summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorMichael Tänzer <neo@nhng.de>2014-04-09 02:12:18 +0200
committerMichael Tänzer <neo@nhng.de>2014-04-09 02:12:18 +0200
commit0331f388f67262e365b7d579cd0d186c7d355ea5 (patch)
treef7527aaf20b26f94187aad07c895d3668369ea4f /scripts
parentb5da37cace08be0217cb05c4b09f07938b5db5ac (diff)
downloadcacert-devel-0331f388f67262e365b7d579cd0d186c7d355ea5.tar.gz
cacert-devel-0331f388f67262e365b7d579cd0d186c7d355ea5.tar.xz
cacert-devel-0331f388f67262e365b7d579cd0d186c7d355ea5.zip
bug 1265: Only English and German will be used
Signed-off-by: Michael Tänzer <neo@nhng.de>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/send_heartbleed.php110
1 files changed, 11 insertions, 99 deletions
diff --git a/scripts/send_heartbleed.php b/scripts/send_heartbleed.php
index f592d8c..1898b56 100644
--- a/scripts/send_heartbleed.php
+++ b/scripts/send_heartbleed.php
@@ -21,89 +21,21 @@ include_once("../includes/mysql.php");
// read texts
-$lines_EN = "";
-if (file_exists("thawte_EN.txt"))
-{
- $fp = fopen("thawte_EN.txt", "r");
- while(!feof($fp))
- {
- $line = trim(fgets($fp, 4096));
- $line = wordwrap($line, 75, "\n")."\n";
- $line = mb_convert_encoding($line, "HTML-ENTITIES", "UTF-8");
- $lines_EN .= $line;
- }
- fclose($fp);
-}
+$lines_EN = <<<EOF
-$lines_DE = "";
-if (file_exists("thawte_DE.txt"))
-{
- $fp = fopen("thawte_DE.txt", "r");
- while(!feof($fp))
- {
- $line = trim(fgets($fp, 4096));
- $line = wordwrap($line, 75, "\n")."\n";
- $line = mb_convert_encoding($line, "HTML-ENTITIES", "UTF-8");
- $lines_DE .= $line;
- }
- fclose($fp);
-}
+EOF;
-$lines_NL = "";
-if (file_exists("thawte_NL.txt"))
-{
- $fp = fopen("thawte_NL.txt", "r");
- while(!feof($fp))
- {
- $line = trim(fgets($fp, 4096));
- $line = wordwrap($line, 75, "\n")."\n";
- $line = mb_convert_encoding($line, "HTML-ENTITIES", "UTF-8");
- $lines_NL .= $line;
- }
- fclose($fp);
-}
+$lines_EN = wordwrap($lines_EN, 75, "\n");
+$lines_EN = mb_convert_encoding($lines_EN, "HTML-ENTITIES", "UTF-8");
-$lines_FR = "";
-if (file_exists("thawte_FR.txt"))
-{
- $fp = fopen("thawte_FR.txt", "r");
- while(!feof($fp))
- {
- $line = trim(fgets($fp, 4096));
- $line = wordwrap($line, 75, "\n")."\n";
- $line = mb_convert_encoding($line, "HTML-ENTITIES", "UTF-8");
- $lines_FR .= $line;
- }
- fclose($fp);
-}
-$lines_ES = "";
-if (file_exists("thawte_ES.txt"))
-{
- $fp = fopen("thawte_ES.txt", "r");
- while(!feof($fp))
- {
- $line = trim(fgets($fp, 4096));
- $line = wordwrap($line, 75, "\n")."\n";
- $line = mb_convert_encoding($line, "HTML-ENTITIES", "UTF-8");
- $lines_ES .= $line;
- }
- fclose($fp);
-}
+$lines_DE = <<<EOF
+
+EOF;
+
+$lines_DE = wordwrap($lines_DE, 75, "\n");
+$lines_DE = mb_convert_encoding($lines_DE, "HTML-ENTITIES", "UTF-8");
-$lines_RU = "";
-if (file_exists("thawte_RU.txt"))
-{
- $fp = fopen("thawte_RU.txt", "r");
- while(!feof($fp))
- {
- $line = trim(fgets($fp, 4096));
- $line = wordwrap($line, 75, "\n")."\n";
- $line = mb_convert_encoding($line, "HTML-ENTITIES", "UTF-8");
- $lines_RU .= $line;
- }
- fclose($fp);
-}
// read last used id
$lastid = 0;
@@ -125,33 +57,13 @@ $res = mysql_query($query);
while($row = mysql_fetch_assoc($res))
{
- $mailtxt = "Hello ${row["fname"]} ${row["lname"]},\n".$lines_EN."\n\n";
+ $mailtxt = "Dear ${row["fname"]} ${row["lname"]},\n".$lines_EN."\n\n";
switch ($row["language"])
{
case "de_DE":
case "de":
$mailtxt .= $lines_DE;
break;
-
- case "nl_NL":
- case "nl":
- $mailtxt .= $lines_NL;
- break;
-
- case "fr_FR":
- case "fr":
- $mailtxt .= $lines_FR;
- break;
-
- case "es_ES":
- case "es":
- $mailtxt .= $lines_ES;
- break;
-
- case "ru_RU":
- case "ru":
- $mailtxt .= $lines_RU;
- break;
}
sendmail($row['email'], "[CAcert.org] Changes at CAcert", $mailtxt, "mailing@cacert.org", "", "", "CAcert", "returns@cacert.org", "");