summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xCommModule/client.pl4
-rw-r--r--Makefile7
-rw-r--r--cacertupload.pl59
-rw-r--r--includes/account.php20
-rw-r--r--includes/general.php131
-rw-r--r--includes/general_stuff.php4
-rw-r--r--includes/lib/account.php10
-rw-r--r--includes/lib/l10n.php343
-rw-r--r--includes/loggedin.php13
-rw-r--r--includes/wot.inc.php90
-rw-r--r--locale/.gitignore3
-rw-r--r--locale/Makefile183
-rw-r--r--locale/escape_special_chars.php71
-rwxr-xr-xlocale/make.php35
-rw-r--r--pages/account/24.php22
-rw-r--r--pages/account/27.php12
-rw-r--r--pages/account/32.php6
-rw-r--r--pages/account/33.php17
-rw-r--r--pages/account/38.php29
-rw-r--r--pages/account/40.php17
-rw-r--r--pages/account/41.php11
-rw-r--r--pages/account/43.php302
-rw-r--r--pages/index/13.php13
-rw-r--r--pages/wot/14.php6
-rw-r--r--pages/wot/5.php5
-rw-r--r--pages/wot/6.php172
-rw-r--r--pages/wot/9.php9
-rw-r--r--password.dat.sample2
-rw-r--r--scripts/39uk-ate-manchester-email.txt40
-rw-r--r--scripts/39uk-ate-manchester-mail.php.txt108
-rw-r--r--scripts/40de-ate-hamburg-email.txt66
-rw-r--r--scripts/40de-ate-hamburg-mail.php.txt112
-rw-r--r--scripts/41de-ate-jena-email.txt33
-rw-r--r--scripts/41de-ate-jena-mail.php.txt109
-rw-r--r--scripts/42de-ate-leipzig-email.txt39
-rw-r--r--scripts/42de-ate-leipzig-mail.php.txt114
-rw-r--r--scripts/43de-ate-karlsruhe-email.txt103
-rw-r--r--scripts/43de-ate-karlsruhe-mail.php.txt155
-rwxr-xr-xscripts/cron/permissionreview.php102
-rwxr-xr-xscripts/cron/removedead.php (renamed from scripts/removedead.php)7
-rwxr-xr-xscripts/cron/updatesort.php (renamed from scripts/updatesort.php)46
-rwxr-xr-xscripts/cron/warning.php (renamed from scripts/warning.php)2
-rw-r--r--www/advertising.php6
-rw-r--r--www/cap.php60
-rw-r--r--www/capnew.php10
-rw-r--r--www/cats/cats_import.php4
-rw-r--r--www/coapnew.php10
-rw-r--r--www/index.php19
-rw-r--r--www/ttp.php28
-rw-r--r--www/wot.php75
50 files changed, 2274 insertions, 570 deletions
diff --git a/CommModule/client.pl b/CommModule/client.pl
index 323ee27..bf92b27 100755
--- a/CommModule/client.pl
+++ b/CommModule/client.pl
@@ -595,7 +595,7 @@ sub OpenPGPextractExpiryDate ($)
# Sets the locale according to the users preferred language
sub setUsersLanguage($)
{
- my $lang="de_DE";
+ my $lang="en_US";
print "Searching for the language of the user $_[0]\n";
my @a=$dbh->selectrow_array("select language from users where id='".int($_[0])."'");
$lang = $1 if($a[0]=~m/(\w+_[\w.@]+)/);
@@ -887,7 +887,7 @@ sub HandleCerts($$)
my $body = _("Hi")." $user{fname},\n\n";
$body .= sprintf(_("You can collect your certificate for %s by going to the following location:")."\n\n", $row{'email'}.$row{'CN'});
$body .= "https://www.cacert.org/account.php?id=".($server?"15":"6")."&cert=$row{id}\n\n";
- $body .= _("If you have not imported CAcert´s root certificate, please go to:")."\n";
+ $body .= _("If you have not imported CAcert's root certificate, please go to:")."\n";
$body .= "https://www.cacert.org/index.php?id=3\n";
$body .= "Root cert fingerprint = A6:1B:37:5E:39:0D:9C:36:54:EE:BD:20:31:46:1F:6B\n";
$body .= "Root cert fingerprint = 135C EC36 F49C B8E9 3B1A B270 CD80 8846 76CE 8F33\n\n";
diff --git a/Makefile b/Makefile
deleted file mode 100644
index 914d979..0000000
--- a/Makefile
+++ /dev/null
@@ -1,7 +0,0 @@
-all:
- xgettext -s -o messages.po --no-wrap --foreign-user includes/*.php www/*.php pages/account/*.php pages/index/*.php pages/wot/*.php pages/gpg/*.php pages/disputes/*.php pages/help/*.php pages/disputes/*.php scripts/removedead.php
- perl cacertupload.pl
- cd locale; php make.php
-
-other: all
- cat messages.po|sed "s/CHARSET/iso-8859-1/"|sed "s/PACKAGE VERSION/CAcert/"|sed "s/This file is put in the public domain./This file is distributed under the same license as the CAcert package./"|sed "s/# SOME DESCRIPTIVE TITLE.//" > messages.po
diff --git a/cacertupload.pl b/cacertupload.pl
deleted file mode 100644
index 991570b..0000000
--- a/cacertupload.pl
+++ /dev/null
@@ -1,59 +0,0 @@
-#!/usr/bin/perl
-
-#LibreSSL - CAcert web application
-#Copyright (C) 2004-2008 CAcert Inc.
-#
-#This program is free software; you can redistribute it and/or modify
-#it under the terms of the GNU General Public License as published by
-#the Free Software Foundation; version 2 of the License.
-#
-#This program is distributed in the hope that it will be useful,
-#but WITHOUT ANY WARRANTY; without even the implied warranty of
-#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-#GNU General Public License for more details.
-#
-#You should have received a copy of the GNU General Public License
-#along with this program; if not, write to the Free Software
-#Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-
-use LWP::UserAgent;
-$ua = LWP::UserAgent->new(agent => 'Translingo Client 1.0');
-use HTTP::Request::Common qw(POST);
-
-my $translingo_password;
-my $translingo_account;
-
-# Read Account&Password from file
-eval `cat password.dat`;
-
-$ua->cookie_jar({});
-$ua->timeout(10000);
-
-my $req = POST 'http://translingo.cacert.org/login.php',
-[
-];
-# ggf. Referer faken
-$req->referer('http://translingo.cacert.org/');
- $ua->request($req)->as_string;
-
-# 1.Test - Umgebung
-my $req = POST 'http://translingo.cacert.org/login.php',
-[
- username => $translingo_account,
- password => $translingo_password,
- submit => 'Login',
-];
-# ggf. Referer faken
-$req->referer('http://translingo.cacert.org/');
-$ua->request($req)->as_string;
-
-# 2.Test - FileUpload
-my $req = POST 'http://translingo.cacert.org/upload.php',
-Content_Type => 'form-data',
-Content => [
- project => '1',
- fileformat => '1',
- pofile => ["messages.po" => "messages.po", 'Content_Type' => "application/x-gettext"],
-];
-print $ua->request($req)->as_string;
-
diff --git a/includes/account.php b/includes/account.php
index 55c9f7a..72165df 100644
--- a/includes/account.php
+++ b/includes/account.php
@@ -16,6 +16,7 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
require_once("../includes/loggedin.php");
+ require_once("../includes/lib/l10n.php");
loadem("account");
@@ -2288,8 +2289,21 @@
$_SESSION['_config']['errmsg'] = sprintf(_("Wasn't able to match '%s' against any user in the system"), sanitizeHTML($_REQUEST['email']));
} else {
$row = mysql_fetch_assoc($res);
- mysql_query("insert into `org` set `memid`='".intval($row['id'])."', `orgid`='".intval($_SESSION['_config']['orgid'])."',
- `masteracc`='$masteracc', `OU`='$OU', `comments`='$comments'");
+ if ( !is_assurer(intval($row['id'])) )
+ {
+ $id = $oldid;
+ $oldid=0;
+ $_SESSION['_config']['errmsg'] =
+ _("The user is not an Assurer yet");
+ } else {
+ mysql_query(
+ "insert into `org`
+ set `memid`='".intval($row['id'])."',
+ `orgid`='".intval($_SESSION['_config']['orgid'])."',
+ `masteracc`='$masteracc',
+ `OU`='$OU',
+ `comments`='$comments'");
+ }
}
}
@@ -2351,7 +2365,7 @@
{
csrf_check("mainlang");
$lang = mysql_real_escape_string($_REQUEST['lang']);
- foreach($_SESSION['_config']['translations'] as $key => $val)
+ foreach(L10n::$translations as $key => $val)
{
if($key == $lang)
{
diff --git a/includes/general.php b/includes/general.php
index 8481018..9e2b131 100644
--- a/includes/general.php
+++ b/includes/general.php
@@ -39,6 +39,7 @@
require_once($_SESSION['_config']['filepath']."/includes/mysql.php");
require_once($_SESSION['_config']['filepath'].'/includes/lib/account.php');
+ require_once($_SESSION['_config']['filepath'].'/includes/lib/l10n.php');
if(array_key_exists('HTTP_HOST',$_SERVER) &&
$_SERVER['HTTP_HOST'] != $_SESSION['_config']['normalhostname'] &&
@@ -70,122 +71,8 @@
}
}
- $lang = "";
- if(array_key_exists("lang",$_REQUEST))
- $lang=mysql_escape_string(substr(trim($_REQUEST['lang']), 0, 5));
- if($lang != "")
- $_SESSION['_config']['language'] = $lang;
-
- //if($_SESSION['profile']['id'] == 1 && 1 == 2)
- // echo $_SESSION['_config']['language'];
-
- $_SESSION['_config']['translations'] = array(
- "ar_JO" => "العربية",
- "bg_BG" => "Български",
- "cs_CZ" => "Čeština",
- "da_DK" => "Dansk",
- "de_DE" => "Deutsch",
- "el_GR" => "Ελληνικά",
- "en_AU" => "English",
- "eo_EO" => "Esperanto",
- "es_ES" => "Español",
- "fa_IR" => "Farsi",
- "fi_FI" => "Suomi",
- "fr_FR" => "Français",
- "he_IL" => "עברית",
- "hr_HR" => "Hrvatski",
- "hu_HU" => "Magyar",
- "is_IS" => "Íslenska",
- "it_IT" => "Italiano",
- "ja_JP" => "日本語",
- "ka_GE" => "Georgian",
- "nl_NL" => "Nederlands",
- "pl_PL" => "Polski",
- "pt_PT" => "Português",
- "pt_BR" => "Português Brasileiro",
- "ru_RU" => "Русский",
- "ro_RO" => "Română",
- "sv_SE" => "Svenska",
- "tr_TR" => "Türkçe",
- "zh_CN" => "中文(简体)");
-
- $value=array();
-
- if(!(array_key_exists('language',$_SESSION['_config']) && $_SESSION['_config']['language'] != ""))
- {
- $bits = explode(",", strtolower(str_replace(" ", "", mysql_real_escape_string(array_key_exists('HTTP_ACCEPT_LANGUAGE',$_SERVER)?$_SERVER['HTTP_ACCEPT_LANGUAGE']:""))));
- foreach($bits as $lang)
- {
- $b = explode(";", $lang);
- if(count($b)>1 && substr($b[1], 0, 2) == "q=")
- $c = floatval(substr($b[1], 2));
- else
- $c = 1;
- $value["$c"] = trim($b[0]);
- }
-
- krsort($value);
-
- reset($value);
-
- foreach($value as $key => $val)
- {
- $val = substr(escapeshellarg($val), 1, -1);
- $short = substr($val, 0, 2);
- if($val == "en" || $short == "en")
- {
- $_SESSION['_config']['language'] = "en";
- break;
- }
- if(file_exists($_SESSION['_config']['filepath']."/locale/$val/LC_MESSAGES/messages.mo"))
- {
- $_SESSION['_config']['language'] = $val;
- break;
- }
- if(file_exists($_SESSION['_config']['filepath']."/locale/$short/LC_MESSAGES/messages.mo"))
- {
- $_SESSION['_config']['language'] = $short;
- break;
- }
- }
- }
- if(!array_key_exists('_config',$_SESSION) || !array_key_exists('language',$_SESSION['_config']) || strlen($_SESSION['_config']['language']) != 5)
- {
- $lang = array_key_exists('language',$_SESSION['_config'])?$_SESSION['_config']['language']:"";
- $_SESSION['_config']['language'] = "en_AU";
- foreach($_SESSION['_config']['translations'] as $key => $val)
- {
- if(substr($lang, 0, 2) == substr($key, 0, 2))
- {
- $_SESSION['_config']['language'] = $val;
- break;
- }
- }
- }
-
- $_SESSION['_config']['recode'] = "html..latin-1";
- if($_SESSION['_config']['language'] == "zh_CN")
- {
- $_SESSION['_config']['recode'] = "html..gb2312";
- } else if($_SESSION['_config']['language'] == "pl_PL" || $_SESSION['_config']['language'] == "hu_HU") {
- $_SESSION['_config']['recode'] = "html..ISO-8859-2";
- } else if($_SESSION['_config']['language'] == "ja_JP") {
- $_SESSION['_config']['recode'] = "html..SHIFT-JIS";
- } else if($_SESSION['_config']['language'] == "ru_RU") {
- $_SESSION['_config']['recode'] = "html..ISO-8859-5";
- } else if($_SESSION['_config']['language'] == "lt_LT") {
- $_SESSION['_config']['recode'] = "html..ISO-8859-13";
- }
-
- putenv("LANG=".$_SESSION['_config']['language']);
- setlocale(LC_ALL, $_SESSION['_config']['language']);
- $domain = 'messages';
- bindtextdomain($domain, $_SESSION['_config']['filepath']."/locale");
- textdomain($domain);
-
- //if($_SESSION['profile']['id'] == -1)
- // echo $_SESSION['_config']['language']." - ".$_SESSION['_config']['filepath']."/locale";
-
+ L10n::detect_language();
+ L10n::init_gettext();
if(array_key_exists('profile',$_SESSION) && is_array($_SESSION['profile']) && array_key_exists('id',$_SESSION['profile']) && $_SESSION['profile']['id'] > 0)
{
@@ -600,10 +487,6 @@
return(0);
}
- if($points >= 300)
- return(200);
- if($points >= 200)
- return(150);
if($points >= 150)
return(35);
if($points >= 140)
@@ -632,14 +515,6 @@
return(utf8_decode($data));
}
- function screenshot($img)
- {
- if(file_exists("../screenshots/".$_SESSION['_config']['language']."/$img"))
- return("/screenshots/".$_SESSION['_config']['language']."/$img");
- else
- return("/screenshots/en/$img");
- }
-
function signmail($to, $subject, $message, $from, $replyto = "")
{
if($replyto == "")
diff --git a/includes/general_stuff.php b/includes/general_stuff.php
index 80cd8a7..4c1bd30 100644
--- a/includes/general_stuff.php
+++ b/includes/general_stuff.php
@@ -16,6 +16,8 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+require_once($_SESSION['_config']['filepath'].'/includes/lib/l10n.php');
+
if(!function_exists("showheader"))
{
function showbodycontent($title = "CAcert.org", $title2 = "")
@@ -60,7 +62,7 @@ google_color_border = "FFFFFF";
<? include("about_menu.php"); ?>
<div class="relatedLinks">
<h3 class="pointer" onclick="explode('trans')">+ <?=_("Translations")?></h3>
- <ul class="menu" id="trans"><? foreach($_SESSION['_config']['translations'] as $key => $val) { ?><li><a href="<?=$_SERVER['SCRIPT_NAME']?>?id=<?=intval(array_key_exists('id',$_REQUEST)?$_REQUEST['id']:0)?>&amp;lang=<?=$key?>"><?=$val?></a></li><? } ?></ul>
+ <ul class="menu" id="trans"><? foreach(L10n::$translations as $key => $val) { ?><li><a href="<?=$_SERVER['SCRIPT_NAME']?>?id=<?=intval(array_key_exists('id',$_REQUEST)?$_REQUEST['id']:0)?>&amp;lang=<?=$key?>"><?=$val?></a></li><? } ?></ul>
</div>
<? if(array_key_exists('mconn',$_SESSION) && $_SESSION['mconn']) { ?>
<div class="relatedLinks">
diff --git a/includes/lib/account.php b/includes/lib/account.php
index f7a24fa..c7697ce 100644
--- a/includes/lib/account.php
+++ b/includes/lib/account.php
@@ -19,6 +19,8 @@
function fix_assurer_flag($userID)
{
+ // If requirements for assurers are modified see also scripts/cron/updatesort.php
+
// Update Assurer-Flag on users table if 100 points.
// Should the number of points be SUM(points) or SUM(awarded)?
$query = mysql_query('UPDATE `users` AS `u` SET `assurer` = 1 WHERE '.
@@ -29,11 +31,11 @@ function fix_assurer_flag($userID)
'(SELECT SUM(`points`) FROM `notary` AS `n` WHERE `n`.`to` = `u`.`id` '.
'AND (`n`.`expire` > now() OR `n`.`expire` IS NULL)) >= 100');
// Challenge has been passed and non-expired points >= 100
-
+
if (!$query) {
return false;
}
-
+
// Reset flag if requirements are not met
$query = mysql_query('UPDATE `users` AS `u` SET `assurer` = 0 WHERE '.
'`u`.`id` = \''.(int)intval($userID).'\' AND '.
@@ -42,10 +44,10 @@ function fix_assurer_flag($userID)
'AND `cp`.`user_id` = `u`.`id`) OR '.
'(SELECT SUM(`points`) FROM `notary` AS `n` WHERE `n`.`to` = `u`.`id` '.
'AND (`n`.`expire` > now() OR `n`.`expire` IS NULL)) < 100)');
-
+
if (!$query) {
return false;
}
-
+
return true;
} \ No newline at end of file
diff --git a/includes/lib/l10n.php b/includes/lib/l10n.php
new file mode 100644
index 0000000..85b7aff
--- /dev/null
+++ b/includes/lib/l10n.php
@@ -0,0 +1,343 @@
+<?php /*
+ LibreSSL - CAcert web application
+ Copyright (C) 2004-2011 CAcert Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+
+/**
+ * This class provides some functions for language handling
+ */
+class L10n {
+ /**
+ * These are tranlations we currently support.
+ *
+ * If another translation is added, it doesn't suffice to have gettext set
+ * up, you also need to add it here, because it acts as a white list.
+ *
+ * @var array("ISO-language code" => "native name of the language")
+ */
+ public static $translations = array(
+ "ar" => "&#1575;&#1604;&#1593;&#1585;&#1576;&#1610;&#1577;",
+ "bg" => "&#1041;&#1098;&#1083;&#1075;&#1072;&#1088;&#1089;&#1082;&#1080;",
+ "cs" => "&#268;e&scaron;tina",
+ "da" => "Dansk",
+ "de" => "Deutsch",
+ "el" => "&Epsilon;&lambda;&lambda;&eta;&nu;&iota;&kappa;&#940;",
+ "en" => "English",
+ "es" => "Espa&#xf1;ol",
+ "fi" => "Suomi",
+ "fr" => "Fran&#xe7;ais",
+ "hu" => "Magyar",
+ "it" => "Italiano",
+ "ja" => "&#26085;&#26412;&#35486;",
+ "lv" => "Latvie&scaron;u",
+ "nl" => "Nederlands",
+ "pl" => "Polski",
+ "pt" => "Portugu&#xea;s",
+ "pt-br" => "Portugu&#xea;s Brasileiro",
+ "ru" => "&#x420;&#x443;&#x441;&#x441;&#x43a;&#x438;&#x439;",
+ "sv" => "Svenska",
+ "tr" => "T&#xfc;rk&#xe7;e",
+ "zh-cn" => "&#x4e2d;&#x6587;(&#x7b80;&#x4f53;)",
+ "zh-tw" => "&#x4e2d;&#x6587;(&#33274;&#28771;)",
+ );
+
+ /**
+ * setlocale needs a language + region code for whatever reason so here's
+ * the mapping from a translation code to locales with the region that
+ * seemed the most common for this language
+ *
+ * You probably never need this. Use {@link set_translation()} to change the
+ * language instead of manually calling setlocale().
+ *
+ * @var array(string => string)
+ */
+ private static $locales = array(
+ "ar" => "ar_JO",
+ "bg" => "bg_BG",
+ "cs" => "cs_CZ",
+ "da" => "da_DK",
+ "de" => "de_DE",
+ "el" => "el_GR",
+ "en" => "en_US",
+ "es" => "es_ES",
+ "fa" => "fa_IR",
+ "fi" => "fi_FI",
+ "fr" => "fr_FR",
+ "he" => "he_IL",
+ "hr" => "hr_HR",
+ "hu" => "hu_HU",
+ "id" => "id_ID",
+ "is" => "is_IS",
+ "it" => "it_IT",
+ "ja" => "ja_JP",
+ "ka" => "ka_GE",
+ "ko" => "ko_KR",
+ "lv" => "lv_LV",
+ "nb" => "nb_NO",
+ "nl" => "nl_NL",
+ "pl" => "pl_PL",
+ "pt" => "pt_PT",
+ "pt-br" => "pt_BR",
+ "ro" => "ro_RO",
+ "ru" => "ru_RU",
+ "sl" => "sl_SI",
+ "sv" => "sv_SE",
+ "th" => "th_TH",
+ "tr" => "tr_TR",
+ "uk" => "uk_UA",
+ "zh-cn" => "zh_CN",
+ "zh-tw" => "zh_TW",
+ );
+
+ /**
+ * Auto-detects the language that should be used and sets it. Only works for
+ * HTTP, not in a command line script.
+ *
+ * Priority:
+ * <ol>
+ * <li>explicit parameter "lang" passed in HTTP (e.g. via GET)</li>
+ * <li>existing setting in the session (stick to the setting we had before)
+ * </li>
+ * <li>auto-detect via the HTTP Accept-Language header sent by the user
+ * agent</li>
+ * </ol>
+ */
+ public static function detect_language() {
+ if ( (self::get_translation() != "")
+ // already set in the session?
+ &&
+ !(array_key_exists("lang", $_REQUEST) &&
+ trim($_REQUEST["lang"]) != "")
+ // explicit parameter?
+ )
+ {
+ if ( self::set_translation(self::get_translation()) ) {
+ return;
+ }
+ }
+
+
+ $languages = array();
+
+ // parse Accept-Language header
+ if (array_key_exists('HTTP_ACCEPT_LANGUAGE', $_SERVER)) {
+ $bits = explode(",", strtolower(
+ str_replace(" ", "", $_SERVER['HTTP_ACCEPT_LANGUAGE'])
+ ));
+ foreach($bits as $lang)
+ {
+ $b = explode(";", $lang);
+ if(count($b)>1 && substr($b[1], 0, 2) == "q=")
+ $c = floatval(substr($b[1], 2));
+ else
+ $c = 1;
+
+ if ($c != 0)
+ {
+ $languages[trim($b[0])] = $c;
+ }
+ }
+ }
+
+ // check if there is an explicit language given as parameter
+ if(array_key_exists("lang",$_REQUEST) && trim($_REQUEST["lang"]) != "")
+ {
+ // higher priority than those values in the header
+ $languages[strtolower(trim($_REQUEST["lang"]))] = 2.0;
+ }
+
+ arsort($languages, SORT_NUMERIC);
+
+ // this is used to be compatible with browsers like internet
+ // explorer which only provide the language code including the
+ // region not without. Also handles the fallback to English (qvalues
+ // may only have three digits after the .)
+ $fallbacks = array("en" => 0.0005);
+
+ foreach($languages as $lang => $qvalue)
+ {
+ // ignore any non-conforming values (that's why we don't need to
+ // mysql_real_escape() or escapeshellarg(), but take care of
+ // the '*')
+ // spec: ( ( 1*8ALPHA *( "-" 1*8ALPHA ) ) | "*" )
+ if ( preg_match('/^(?:([a-zA-Z]{1,8})(?:-[a-zA-Z]{1,8})*|\*)$/',
+ $lang, $matches) !== 1 ) {
+ continue;
+ }
+ $lang_prefix = $matches[1]; // usually two-letter language code
+ $fallbacks[$lang_prefix] = $qvalue;
+
+ $chosen_translation = "";
+ if ($lang === '*') {
+ // According to the standard '*' matches anything but any
+ // language explicitly specified. So in theory if there
+ // was an explicit mention of "en" with a lower priority
+ // this would be incorrect, but that's too much trouble.
+ $chosen_translation = "en";
+ } else {
+ $lang_length = strlen($lang);
+ foreach (self::$translations as $translation => $ignore)
+ {
+ // May match exactly or on every '-'
+ if ( $translation === $lang ||
+ substr($translation, 0, $lang_length + 1)
+ === $lang.'-'
+ )
+ {
+ $chosen_translation = $translation;
+ break;
+ }
+ }
+ }
+
+ if ($chosen_translation !== "")
+ {
+ if (self::set_translation($chosen_translation)) {
+ return;
+ }
+ }
+ }
+
+ // No translation found yet => try the prefixes
+ arsort($fallbacks, SORT_NUMERIC);
+ foreach ($fallbacks as $lang => $qvalue) {
+ if (self::set_translation($lang)) {
+ return;
+ }
+ }
+
+ // should not get here, as the fallback of "en" is provided and that
+ // should always work => log an error
+ trigger_error("L10n::detect_language(): could not set language",
+ E_USER_WARNING);
+ }
+
+ /**
+ * Get the set translation
+ *
+ * @return string
+ * a translation code or the empty string if not set
+ */
+ public static function get_translation() {
+ if (array_key_exists('language', $_SESSION['_config'])) {
+ return $_SESSION['_config']['language'];
+ } else {
+ return "";
+ }
+ }
+
+ /**
+ * Set the translation to use.
+ *
+ * @param string $translation_code
+ * the translation code as specified in the keys of {@link $translations}
+ *
+ * @return bool
+ * <ul>
+ * <li>true if the translation has been set successfully</li>
+ * <li>false if the $translation_code was not contained in the white
+ * list or could not be set for other reasons (e.g. setlocale()
+ * failed because the locale has not been set up on the system -
+ * details will be logged)</li>
+ * </ul>
+ */
+ public static function set_translation($translation_code) {
+ // check $translation_code against whitelist
+ if ( !array_key_exists($translation_code, self::$translations) ) {
+ // maybe it's a locale as previously used in the system? e.g. en_AU
+ if ( preg_match('/^([a-z][a-z])_([A-Z][A-Z])$/', $translation_code,
+ $matches) !== 1 ) {
+ return false;
+ }
+
+ $lang_code = $matches[1];
+ $region_code = strtolower($matches[2]);
+
+ if ( array_key_exists("${lang_code}-${region_code}",
+ self::$translations) ) {
+ $translation_code = "${lang_code}-${region_code}";
+ } elseif ( array_key_exists($lang_code, self::$translations) ) {
+ $translation_code = $lang_code;
+ } else {
+ return false;
+ }
+ }
+
+ // map translation to locale
+ if ( !array_key_exists($translation_code, self::$locales) ) {
+ // weird. maybe you added a translation but haven't added a
+ // translation to locale mapping in self::locales?
+ trigger_error("L10n::set_translation(): could not map the ".
+ "translation $translation_code to a locale", E_USER_WARNING);
+ return false;
+ }
+ $locale = self::$locales[$translation_code];
+
+ // set up locale
+ if ( !putenv("LANG=$locale") ) {
+ trigger_error("L10n::set_translation(): could not set the ".
+ "environment variable LANG to $locale", E_USER_WARNING);
+ return false;
+ }
+ if ( !setlocale(LC_ALL, $locale) ) {
+ trigger_error("L10n::set_translation(): could not setlocale() ".
+ "LC_ALL to $locale", E_USER_WARNING);
+ return false;
+ }
+
+
+ // only set if we're running in a server not in a script
+ if (isset($_SESSION)) {
+ // save the setting
+ $_SESSION['_config']['language'] = $translation_code;
+
+
+ // Set up the recode settings needed e.g. in PDF creation
+ $_SESSION['_config']['recode'] = "html..latin-1";
+
+ if($translation_code === "zh-cn" || $translation_code === "zh-tw")
+ {
+ $_SESSION['_config']['recode'] = "html..gb2312";
+
+ } else if($translation_code === "pl" || $translation_code === "hu") {
+ $_SESSION['_config']['recode'] = "html..ISO-8859-2";
+
+ } else if($translation_code === "ja") {
+ $_SESSION['_config']['recode'] = "html..SHIFT-JIS";
+
+ } else if($translation_code === "ru") {
+ $_SESSION['_config']['recode'] = "html..ISO-8859-5";
+
+ } else if($translation_code == "lt") { // legacy, keep for reference
+ $_SESSION['_config']['recode'] = "html..ISO-8859-13";
+
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * Sets up the text domain used by gettext
+ *
+ * @param string $domain
+ * the gettext domain that should be used, defaults to "messages"
+ */
+ public static function init_gettext($domain = 'messages') {
+ bindtextdomain($domain, $_SESSION['_config']['filepath'].'/locale');
+ textdomain($domain);
+ }
+} \ No newline at end of file
diff --git a/includes/loggedin.php b/includes/loggedin.php
index bf6b455..5734fad 100644
--- a/includes/loggedin.php
+++ b/includes/loggedin.php
@@ -17,6 +17,7 @@
*/
include_once("../includes/lib/general.php");
+ require_once("../includes/lib/l10n.php");
if($_SERVER['HTTP_HOST'] == $_SESSION['_config']['securehostname'] && $_SESSION['profile']['id'] > 0 && $_SESSION['profile']['loggedin'] != 0)
{
@@ -110,18 +111,12 @@
if($_SESSION['profile']['language'] == "")
{
- $query = "update `users` set `language`='".$_SESSION['_config']['language']."'
+ $query = "update `users` set `language`='".L10n::get_translation()."'
where `id`='".$_SESSION['profile']['id']."'";
mysql_query($query);
} else {
- $_SESSION['_config']['language'] = $_SESSION['profile']['language'];
-
- putenv("LANG=".$_SESSION['_config']['language']);
- setlocale(LC_ALL, $_SESSION['_config']['language']);
-
- $domain = 'messages';
- bindtextdomain("$domain", $_SESSION['_config']['filepath']."/locale");
- textdomain("$domain");
+ L10n::set_translation($_SESSION['profile']['language']);
+ L10n::init_gettext();
}
}
diff --git a/includes/wot.inc.php b/includes/wot.inc.php
index 884b97f..edc442a 100644
--- a/includes/wot.inc.php
+++ b/includes/wot.inc.php
@@ -536,4 +536,94 @@
<p>[ <a href='javascript:history.go(-1)'><?=_("Go Back")?></a> ]</p>
<?
}
+
+// functions for 6.php (assure somebody)
+
+function AssureHead($confirmation,$checkname)
+{
+?>
+<form method="post" action="wot.php">
+ <table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper" width="600">
+ <tr>
+ <td colspan="2" class="title"><?=$confirmation?></td>
+ </tr>
+ <tr>
+ <td class="DataTD" colspan="2" align="left"><?=$checkname?></td>
+ </tr>
+<?
+ }
+
+function AssureTextLine($field1,$field2)
+{
+?>
+ <tr>
+ <td class="DataTD"><?=$field1?>:</td>
+ <td class="DataTD"><?=$field2?></td>
+ </tr>
+<?
+}
+
+function AssureCCABoxLine($type,$text)
+{
+ return;
+ AssureBoxLine($type,$text);
+}
+
+function AssureBoxLine($type,$text,$checked)
+{
?>
+ <tr>
+ <td class="DataTD"><input type="checkbox" name="<?=$type?>" value="1" <?=$checked?"checked":""?>></td>
+ <td class="DataTD"><?=$text?></td>
+ </tr>
+<?
+}
+
+function AssureMethodLine($text,$methods,$remark)
+{
+ if (count($methods) != 1)
+ {
+?>
+ <tr>
+ <td class="DataTD"><?=$text?></td>
+ <td class="DataTD">
+ <select name="method">
+<?
+ foreach($methods as $val) { ?>
+ <option value="<?=$val?>"> <?=$val?></option>
+
+<? } ?>
+ </select>
+ </br><?=$remark?>
+ </td>
+ </tr>
+<?
+ } else {
+?>
+ <input type="hidden" name="<?=$val?>" value="<?=$methods[0]?>">
+<?
+ }
+}
+
+function AssureInboxLine($type,$field,$value,$description)
+{
+?>
+ <tr>
+ <td class="DataTD"><?=$field?>:</td>
+ <td class="DataTD"><input type="text" name="<?=$type?>" value="<?=$value?>"><?=$description?></td>
+ </tr>
+<?
+}
+
+function AssureFoot($oldid,$confirm)
+{?>
+ <tr>
+ <td class="DataTD" colspan="2"><input type="submit" name="process" value="<?=$confirm?>"> <input type="submit" name="cancel" value="<?=_("Cancel")?>"></td>
+ </tr>
+ </table>
+ <input type="hidden" name="pagehash" value="<?=$_SESSION['_config']['wothash']?>">
+ <input type="hidden" name="oldid" value="<?=$oldid?>">
+</form>
+<?
+}
+
diff --git a/locale/.gitignore b/locale/.gitignore
index 94fd7c6..ac93223 100644
--- a/locale/.gitignore
+++ b/locale/.gitignore
@@ -1,5 +1,6 @@
# Language files are imported from translingo
# => Ignore them
-# Use make.php if you need new ones
+# Use make if you need new ones
*.po
+*.pot
*.mo
diff --git a/locale/Makefile b/locale/Makefile
new file mode 100644
index 0000000..1517066
--- /dev/null
+++ b/locale/Makefile
@@ -0,0 +1,183 @@
+#
+# This Makefile will download the translations from our translation server (if
+# they don't exist yet) and compile them. Try target help for more information
+#
+
+################################################################################
+### Download ###
+################################################################################
+
+DOWNLOAD_SERVER := translations.cacert.org
+PO_URL_TEMPLATE := http://$(DOWNLOAD_SERVER)/export/cacert/%/messages.po
+
+# Only use languages that have 10% or more of translated strings
+AUTO_LANGS := \
+en \
+de \
+nl \
+pt_BR \
+fr \
+sv \
+it \
+es \
+hu \
+fi \
+ja \
+bg \
+pt \
+da \
+pl \
+zh_CN \
+ru \
+lv \
+cs \
+zh_TW \
+el \
+tr \
+ar \
+
+LANGS := \
+ar \
+bg \
+cs \
+da \
+de \
+el \
+en \
+es \
+fa \
+fi \
+fr \
+he \
+hr \
+hu \
+id \
+is \
+it \
+ja \
+ka \
+ko \
+lv \
+nb \
+nl \
+pl \
+pt \
+pt_BR \
+ro \
+ru \
+sl \
+sv \
+th \
+tr \
+uk \
+zh_CN \
+zh_TW \
+
+
+PO_FILE_TEMPLATE := %/messages.po
+MO_FILE_TEMPLATE := %/LC_MESSAGES/messages.mo
+
+
+# target: all - Build locales downloading po files
+.PHONY: all
+all: $(AUTO_LANGS)
+
+
+# target: help - Display callable targets
+.PHONY: help
+help:
+ @egrep "^# target:" [Mm]akefile
+
+
+# target: clean - remove the build directories
+RM := rm -rf
+.PHONY: clean
+clean:
+ -$(RM) $(LANGS:%=%/)
+
+
+# target: <lang> - build this particular language
+.PHONY: $(LANGS)
+$(LANGS): %: $(MO_FILE_TEMPLATE)
+
+
+$(LANGS:%=$(MO_FILE_TEMPLATE)): $(MO_FILE_TEMPLATE): $(PO_FILE_TEMPLATE)
+ mkdir -p $(@D)
+#filter obsolete translations
+ grep --invert-match '^#~ ' $< | \
+ msgfmt --check --output-file $@ -
+
+
+.PHONY: $(LANGS:%=$(PO_FILE_TEMPLATE))
+$(LANGS:%=$(PO_FILE_TEMPLATE)):
+ mkdir -p $(@D)
+ wget --output-document - '$(@:$(PO_FILE_TEMPLATE)=$(PO_URL_TEMPLATE))' | \
+ php -f escape_special_chars.php \
+ > $@
+
+
+
+
+################################################################################
+### Upload ###
+################################################################################
+
+UPLOAD_SERVER := $(DOWNLOAD_SERVER)
+SSH_USER := critical
+SSH_OPTIONS :=
+SCP_OPTIONS := $(SSH_OPTIONS)
+
+FILE_OWNER := www-data
+
+POT_UPLOAD_PATH := /var/www/Pootle/po/cacert/templates/messages.pot
+MANAGE_PY := /var/www/Pootle/manage.py
+
+VERSION := Production
+DESCRITPION := LibreSSL - CAcert web application (localisation files)
+COPYRIGHT_YEAR := 2004-$(shell date +\%Y)
+PACKAGE := LibreSSL
+
+GETTEXT_FILE_PATTERN := \
+../CommModule/client.pl \
+../includes/*.php \
+../includes/*/*.php \
+../pages/*/*.php \
+../scripts/*.php \
+../www/*.php \
+../www/*/*.php \
+# ../tverify/*.php \
+# ../tverify/*/*.php \
+
+GETTEXT_FILES := $(wildcard $(GETTEXT_FILE_PATTERN))
+
+# target: template - create the gettext template file, if you want to upload it
+# target: onto the translation server you can directly use the
+# target: target "upload"
+.PHONY: template
+template: messages.pot
+
+# target: template.clean - remove anything that was created during the build of
+# target: the template file
+.PHONY: template.clean
+template.clean:
+ -$(RM) messages.pot
+
+
+# target: upload - upload the template to the translation server
+.PHONY: upload
+upload: messages.pot
+ scp $(SCP_OPTIONS) messages.pot $(SSH_USER)@$(UPLOAD_SERVER):$(POT_UPLOAD_PATH)
+ ssh $(SSH_OPTIONS) $(SSH_USER)@$(UPLOAD_SERVER) "sudo -u $(FILE_OWNER) pootle-update cacert"
+
+# target: upload.clean - remove anything that was created during the upload
+.PHONY: upload.clean
+upload.clean: template.clean
+
+messages.pot: $(GETTEXT_FILES)
+ xgettext --output - --sort-by-file --copyright-holder "CAcert Inc." \
+ --package-name "CAcert" --package-version "$(VERSION)" \
+ --msgid-bugs-address "translations-admin@cacert.org" $^ | \
+ # replace place holders in the lines before the first msgid\
+ sed '1,/^msgid/ { s/SOME DESCRIPTIVE TITLE/$(DESCRITPION)/; s/YEAR/$(COPYRIGHT_YEAR)/; s/PACKAGE/$(PACKAGE)/ }' \
+ > $@
+
diff --git a/locale/escape_special_chars.php b/locale/escape_special_chars.php
new file mode 100644
index 0000000..32de390
--- /dev/null
+++ b/locale/escape_special_chars.php
@@ -0,0 +1,71 @@
+#!/usr/bin/php -q
+<?php
+/*
+LibreSSL - CAcert web application
+Copyright (C) 2004-2012 CAcert Inc.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; version 2 of the License.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+
+/* Convert special characters in UTF-8 encoded PO files to HTML entities */
+
+define('MSGSTR', 'msgstr');
+define('MSGSTR_LEN', strlen(MSGSTR));
+define('MSGID', 'msgid');
+define('MSGID_LEN', strlen(MSGID));
+
+function is_msgstr($line) {
+ if (strlen($line) < MSGSTR_LEN) {
+ return false;
+ }
+
+ return substr_compare($line, MSGSTR, 0, MSGSTR_LEN) === 0;
+}
+
+function is_msgid($line) {
+ if (strlen($line) < MSGID_LEN) {
+ return false;
+ }
+
+ return substr_compare($line, MSGID, 0, MSGID_LEN) === 0;
+}
+
+// Skip the metadata (first msgid/msgstr pair)
+while (!feof(STDIN)) {
+ $line = fgets(STDIN);
+
+ echo $line;
+
+ if (is_msgstr($line)) {
+ break;
+ }
+}
+
+// determines if the current line belongs to a msgid or a msgstr
+$msgstr = false;
+
+while (!feof(STDIN)) {
+ $line = fgets(STDIN);
+
+ if (is_msgstr($line)) {
+ $msgstr = true;
+ } elseif (is_msgid($line)) {
+ $msgstr = false;
+ }
+
+ if ($msgstr) {
+ $line = htmlentities($line, ENT_NOQUOTES, "UTF-8");
+ }
+ echo $line;
+}
diff --git a/locale/make.php b/locale/make.php
deleted file mode 100755
index 859d75e..0000000
--- a/locale/make.php
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/usr/bin/php -q
-<?
- $lang = array( "bg" => "bg_BG", "da" => "da_DK", "de" => "de_DE", "es" => "es_ES",
- "fr" => "fr_FR", "fi" => "fi_FI", "he" => "he_IL", "hr" => "hr_HR",
- "hu" => "hu_HU", "it" => "it_IT", "ja" => "ja_JP", "nl" => "nl_NL",
- "pt" => "pt_PT", "ro" => "ro_RO", "ru" => "ru_RU", "fa" => "fa_IR",
- "sv" => "sv_SE", "tr" => "tr_TR", "zh" => "zh_CN", "ar" => "ar_SY",
- "el" => "el_GR", "tl" => "tl_PH", "pl" => "pl_PL", "cs" => "cs_CZ",
- "ka" => "ka_GE", "is" => "is_IS", "ko" => "ko_KR", "nb" => "nb_NO");
-
- if($argc > 1)
- {
- foreach($argv as $key)
- {
- $val = $lang[$key];
- if($val != "")
- {
- $do = `wget -O $key.po "http://translingo.cacert.org/export2.php?pid=1&editlanguage=$val" 2>&1`;
-echo $do;
- echo `mkdir -p $key/LC_MESSAGES/`;
- $do = `msgfmt -o $key/LC_MESSAGES/messages.mo $key.po 2>&1`;
-echo $do;
- }
- }
- } else {
- foreach($lang as $key => $val)
- {
- $do = `wget -O $key.po "http://translingo.cacert.org/export2.php?pid=1&editlanguage=$val" 2>&1`;
-echo $do;
- echo `mkdir -p $key/LC_MESSAGES/`;
- $do = `msgfmt -o $key/LC_MESSAGES/messages.mo $key.po 2>&1`;
-echo $do;
- }
- }
-?>
diff --git a/pages/account/24.php b/pages/account/24.php
index 19faa9f..7f56023 100644
--- a/pages/account/24.php
+++ b/pages/account/24.php
@@ -15,6 +15,16 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/ ?>
+<?
+ // Reset session variables regarding Org's, present empty form
+ if (array_key_exists('O',$_SESSION['_config'])) $_SESSION['_config']['O'] = "";
+ if (array_key_exists('contact',$_SESSION['_config'])) $_SESSION['_config']['contact'] = "";
+ if (array_key_exists('L',$_SESSION['_config'])) $_SESSION['_config']['L'] = "";
+ if (array_key_exists('ST',$_SESSION['_config'])) $_SESSION['_config']['ST'] = "";
+ if (array_key_exists('C',$_SESSION['_config'])) $_SESSION['_config']['C'] = "";
+ if (array_key_exists('comments',$_SESSION['_config'])) $_SESSION['_config']['comments'] = "";
+
+?>
<form method="post" action="account.php">
<table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper">
<tr>
@@ -22,27 +32,27 @@
</tr>
<tr>
<td class="DataTD"><?=_("Organisation Name")?>:</td>
- <td class="DataTD"><input type="text" name="O" value="<?=array_key_exists('O',$_SESSION['_config'])?$_SESSION['_config']['O']:""?>" maxlength="50"></td>
+ <td class="DataTD"><input type="text" name="O" value="" maxlength="50" size="90"></td>
</tr>
<tr>
<td class="DataTD"><?=_("Contact Email")?>:</td>
- <td class="DataTD"><input type="text" name="contact" value="<?=array_key_exists('contact',$_SESSION['_config'])?$_SESSION['_config']['contact']:""?>"></td>
+ <td class="DataTD"><input type="text" name="contact" value="" size="90"></td>
</tr>
<tr>
<td class="DataTD"><?=_("Town/Suburb")?>:</td>
- <td class="DataTD"><input type="text" name="L" value="<?=array_key_exists('L',$_SESSION['_config'])?$_SESSION['_config']['L']:""?>"></td>
+ <td class="DataTD"><input type="text" name="L" value="" size="90"></td>
</tr>
<tr>
<td class="DataTD"><?=_("State/Province")?>:</td>
- <td class="DataTD"><input type="text" name="ST" value="<?=array_key_exists('ST',$_SESSION['_config'])?$_SESSION['_config']['ST']:""?>"></td>
+ <td class="DataTD"><input type="text" name="ST" value="" size="90"></td>
</tr>
<tr>
<td class="DataTD"><?=_("Country")?>:</td>
- <td class="DataTD"><input type="text" name="C" value="<?=array_key_exists('C',$_SESSION['_config'])?sanitizeHTML($_SESSION['_config']['C']):""?>" size="5">(2 letter <a href="http://www.iso.org/iso/english_country_names_and_code_elements">ISO code</a>)</td>
+ <td class="DataTD"><input type="text" name="C" value="" size="5">(2 letter <a href="http://www.iso.org/iso/english_country_names_and_code_elements">ISO code</a>)</td>
</tr>
<tr>
<td class="DataTD"><?=_("Comments")?>:</td>
- <td class="DataTD"><textarea name="comments" cols="35" rows="5"><?=array_key_exists('comments',$_SESSION['_config'])?$_SESSION['_config']['comments']:""?></textarea></td>
+ <td class="DataTD"><textarea name="comments" cols="60" rows="10"></textarea></td>
</tr>
<tr>
<td class="DataTD" colspan="2"><input type="submit" name="process" value="<?=_("Next")?>"></td>
diff --git a/pages/account/27.php b/pages/account/27.php
index 2cd52a8..9524620 100644
--- a/pages/account/27.php
+++ b/pages/account/27.php
@@ -25,27 +25,27 @@
</tr>
<tr>
<td class="DataTD"><?=_("Organisation Name")?>:</td>
- <td class="DataTD"><input type="text" name="O" value="<?=$row['O']?>"></td>
+ <td class="DataTD"><input type="text" name="O" value="<?=$row['O']?>" size="90"></td>
</tr>
<tr>
<td class="DataTD"><?=_("Contact Email")?>:</td>
- <td class="DataTD"><input type="text" name="contact" value="<?=($row['contact'])?>"></td>
+ <td class="DataTD"><input type="text" name="contact" value="<?=($row['contact'])?>" size="90"></td>
</tr>
<tr>
<td class="DataTD"><?=_("Town/Suburb")?>:</td>
- <td class="DataTD"><input type="text" name="L" value="<?=($row['L'])?>"></td>
+ <td class="DataTD"><input type="text" name="L" value="<?=($row['L'])?>" size="90"></td>
</tr>
<tr>
<td class="DataTD"><?=_("State/Province")?>:</td>
- <td class="DataTD"><input type="text" name="ST" value="<?=($row['ST'])?>"></td>
+ <td class="DataTD"><input type="text" name="ST" value="<?=($row['ST'])?>" size="90"></td>
</tr>
<tr>
<td class="DataTD"><?=_("Country")?>:</td>
- <td class="DataTD"><input type="text" name="C" value="<?=($row['C'])?>"></td>
+ <td class="DataTD"><input type="text" name="C" value="<?=($row['C'])?>" size="5"> (2 letter <a href="http://www.iso.org/iso/english_country_names_and_code_elements">ISO code</a>)</td>
</tr>
<tr>
<td class="DataTD"><?=_("Comments")?>:</td>
- <td class="DataTD"><textarea name="comments" cols=15 rows=5><?=($row['comments'])?></textarea></td>
+ <td class="DataTD"><textarea name="comments" cols=60 rows=10><?=($row['comments'])?></textarea></td>
</tr>
<tr>
<td class="DataTD" colspan="2"><input type="submit" name="process" value="<?=_("Update")?>"></td>
diff --git a/pages/account/32.php b/pages/account/32.php
index 00dc1ea..a05c927 100644
--- a/pages/account/32.php
+++ b/pages/account/32.php
@@ -38,10 +38,10 @@
$user = mysql_fetch_assoc(mysql_query("select * from `users` where `id`='".intval($row['memid'])."'"));
?>
<tr>
- <td class="DataTD"><a href='mailto:<?=$user['email']?>'><?=($user['fname'])?> <?=($user['lname'])?></a></td>
+ <td class="DataTD"><a href='mailto:<?=sanitizeHTML($user['email'])?>'><?=sanitizeHTML($user['fname'])?> <?=sanitizeHTML($user['lname'])?></a></td>
<td class="DataTD"><?=($row['masteracc'])?></a></td>
- <td class="DataTD"><?=($row['OU'])?></a></td>
- <td class="DataTD"><?=($row['comments'])?></a></td>
+ <td class="DataTD"><?=sanitizeHTML($row['OU'])?></a></td>
+ <td class="DataTD"><?=sanitizeHTML($row['comments'])?></a></td>
<? if($row['masteracc'] == 0 || $_SESSION['profile']['orgadmin'] == 1) { ?>
<td class="DataTD"><a href="account.php?id=34&amp;orgid=<?=$row['orgid']?>&amp;memid=<?=$row['memid']?>"><?=_("Delete")?></a></td>
<? } else { ?>
diff --git a/pages/account/33.php b/pages/account/33.php
index 4da8bed..376a8b9 100644
--- a/pages/account/33.php
+++ b/pages/account/33.php
@@ -18,6 +18,13 @@
<?
$query = "select * from `orginfo` where `id`='".intval($_REQUEST['orgid'])."'";
$row = mysql_fetch_assoc(mysql_query($query));
+
+ // Reset session variables regarding OrgAdmin's, present empty form
+ if (array_key_exists('email',$_SESSION['_config'])) $_SESSION['_config']['email']="";
+ if (array_key_exists('OU',$_SESSION['_config'])) $_SESSION['_config']['OU'] = "";
+ if (array_key_exists('masteracc',$_SESSION['_config'])) $_SESSION['_config']['masteracc'] = 0;
+ if (array_key_exists('comments',$_SESSION['_config'])) $_SESSION['_config']['comments'] = "";
+
?>
<form method="post" action="account.php">
<input type="hidden" name="orgid" value="<?=intval($_REQUEST['orgid'])?>">
@@ -27,24 +34,24 @@
</tr>
<tr>
<td class="DataTD"><?=_("Email")?>:</td>
- <td class="DataTD"><input type="text" name="email" value="<?=array_key_exists('email',$_SESSION['_config'])?sanitizeHTML($_SESSION['_config']['email']):""?>"></td>
+ <td class="DataTD"><input type="text" name="email" value=""></td>
</tr>
<tr>
<td class="DataTD"><?=_("Department")?>:</td>
- <td class="DataTD"><input type="text" name="OU" value="<?=array_key_exists('OU',$_SESSION['_config'])?$_SESSION['_config']['OU']:""?>"></td>
+ <td class="DataTD"><input type="text" name="OU" value=""></td>
</tr>
<? if($_SESSION['profile']['orgadmin'] == 1) { ?>
<tr>
<td class="DataTD"><?=_("Master Account")?>:</td>
<td class="DataTD"><select name="masteracc">
- <option value="0">No</option>
- <option value="1"<? if(array_key_exists('masteracc',$_SESSION['_config']) && $_SESSION['_config']['masteracc'] == 1) echo " selected='selected'"; ?>>Yes</option>
+ <option value="0">No</option> // make default option as of SA telco 2011-08-02 on bug 966
+ <option value="1">Yes</option>
</select></td>
</tr>
<? } ?>
<tr>
<td class="DataTD"><?=_("Comments")?>:</td>
- <td class="DataTD"><input type="text" name="comments" value="<?=array_key_exists('comments',$_SESSION['_config'])?$_SESSION['_config']['comments']:""?>"></td>
+ <td class="DataTD"><input type="text" name="comments" size=27 maxlength=20 value=""></td>
</tr>
<tr>
<td class="DataTD" colspan="2"><input type="submit" name="process" value="<?=_("Add")?>"></td>
diff --git a/pages/account/38.php b/pages/account/38.php
index f311bf5..7caddb0 100644
--- a/pages/account/38.php
+++ b/pages/account/38.php
@@ -14,31 +14,6 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-*/ ?>
-<H3><?=_("Donations")?></H3><br>
+*/
-<h4><?=_("If I'd like to donate to CAcert Inc., how can I do it?")?></h4>
-
-<p>
-<?
-printf(_("CAcert Inc. is a non-profit association which is legally able to accept donations. CAcert adheres to %sstrict guidelines%s about how this money can to be used. If you'd like to make a donation, you can do so via"),
- '<a href="//wiki.cacert.org/FAQ/DonationsGuideline">', '</a>');
-?>
-
-<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
-<input type="hidden" name="cmd" value="_s-xclick">
-<input type="image" src="/images/payment2.png" border="0" name="submit" alt="<?=_("CAcert Donation through PayPal")?>">
-<input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIHRwYJKoZIhvcNAQcEoIIHODCCBzQCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwDQYJKoZIhvcNAQEBBQAEgYCA1pOad7SD8OtSdvHxI3CItmi2sb2eq/1UZbQboNkJTwlaTbTZfoWzBuFmimBR/Qz21Z+L7wFa7XxfhwRLC4V/X4uTJVAIDaKsdTXFNx51EMu+LyiP1O+7GxcdNR7njwvndIaHN0HZIdidpG8jFPP/8ZsLaPe2/Dh2S7344wSuUDELMAkGBSsOAwIaBQAwgcQGCSqGSIb3DQEHATAUBggqhkiG9w0DBwQIYn0dsk7tIRmAgaBNejWqE2RRr+Tsb3fVlcbuG98Bq+zaMO5g8n8i3DnBjIoSJNb+ZuSj53oWrh/+HCY4EY1Rg3qHiUSMOS/o9k75UR7C+ez0R9tmZ2eQrdxlqTVuvENRA0W5z6iTJYog5XhMoKScOFUBaIr9zxjETUY2Y1V3X8qRFIe0YWlYRYbePs2p/IDatirUFhOJSff0ancU2GZULRy0PiZHtzbm8Gy/oIIDhzCCA4MwggLsoAMCAQICAQAwDQYJKoZIhvcNAQEFBQAwgY4xCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLUGF5UGFsIEluYy4xEzARBgNVBAsUCmxpdmVfY2VydHMxETAPBgNVBAMUCGxpdmVfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tMB4XDTA0MDIxMzEwMTMxNVoXDTM1MDIxMzEwMTMxNVowgY4xCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLUGF5UGFsIEluYy4xEzARBgNVBAsUCmxpdmVfY2VydHMxETAPBgNVBAMUCGxpdmVfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDBR07d/ETMS1ycjtkpkvjXZe9k+6CieLuLsPumsJ7QC1odNz3sJiCbs2wC0nLE0uLGaEtXynIgRqIddYCHx88pb5HTXv4SZeuv0Rqq4+axW9PLAAATU8w04qqjaSXgbGLP3NmohqM6bV9kZZwZLR/klDaQGo1u9uDb9lr4Yn+rBQIDAQABo4HuMIHrMB0GA1UdDgQWBBSWn3y7xm8XvVk/UtcKG+wQ1mSUazCBuwYDVR0jBIGzMIGwgBSWn3y7xm8XvVk/UtcKG+wQ1mSUa6GBlKSBkTCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb22CAQAwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQCBXzpWmoBa5e9fo6ujionW1hUhPkOBakTr3YCDjbYfvJEiv/2P+IobhOGJr85+XHhN0v4gUkEDI8r2/rNk1m0GA8HKddvTjyGw/XqXa+LSTlDYkqI8OwR8GEYj4efEtcRpRYBxV8KxAW93YDWzFGvruKnnLbDAF6VR5w/cCMn5hzGCAZowggGWAgEBMIGUMIGOMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDU1vdW50YWluIFZpZXcxFDASBgNVBAoTC1BheVBhbCBJbmMuMRMwEQYDVQQLFApsaXZlX2NlcnRzMREwDwYDVQQDFAhsaXZlX2FwaTEcMBoGCSqGSIb3DQEJARYNcmVAcGF5cGFsLmNvbQIBADAJBgUrDgMCGgUAoF0wGAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATAcBgkqhkiG9w0BCQUxDxcNMDcxMTAzMDcxMDI1WjAjBgkqhkiG9w0BCQQxFgQU8tPwGUvNb8eYe8Pfhe9YutgXm/YwDQYJKoZIhvcNAQEBBQAEgYBpwhhgz5ED5qxBosfMaifzIr2anV5ScQqqQbC1hphWBQ4e2PT5+TQWCcQkrTh2UTp3vC81Y8vYZ+fussa+zPBE8DmeFDfzpLJo+TQHZUiKxWUDu6drv3o3mV3VjAkaqIhAdubhEOxj2bbKND3IRT1lfIVVSUipndKzRjukZJK39A==-----END PKCS7-----">
-</form>
-
-<p><?=_("If you are located in Australia, please use bank transfer instead:")?></p>
-
-<pre>
-Account Name: CAcert Inc
-BSB: 032073
-Account No.: 180264
-</pre>
-
-<p><?=_("ANY amount will be appreciated - the more funding CAcert receives, the sooner it can achieve the goals of the community.")?></p>
-
-<p><?=_("Thank you very much for your support, your donations help CAcert to continue to operate.")?></p>
+require_once(dirname(__FILE__)."/../index/13.php");
diff --git a/pages/account/40.php b/pages/account/40.php
index 8391903..fa0c52f 100644
--- a/pages/account/40.php
+++ b/pages/account/40.php
@@ -19,6 +19,15 @@ if(!array_key_exists('secrethash',$_SESSION['_config'])) $_SESSION['_config']['s
?>
<H3><?=_("Contact Us")?></H3>
+<p><? printf(_("To contact us please log out and then use the contact form ".
+ "there or send us an email to %s. We are working to fix this ".
+ "situation so you may contact us while staying logged in again."),
+
+ "<a href='mailto:support@cacert.org'>support@cacert.org</a>"
+ ) ?>
+</p>
+
+<?/*
<p><b><?=_("General Questions")?></b></p>
<p><b><?=_("PLEASE NOTE: Due to the large amounts of support questions, incorrectly directed emails may be over looked, this is a volunteer effort and directing general questions to the right place will help everyone, including yourself as you will get a reply quicker.")?></b></p>
<p><b><?=_("If you are contacting us about advertising, please use the form at the bottom of the website, the first contact form is not the correct place.")?></b></p>
@@ -65,7 +74,12 @@ if(!array_key_exists('secrethash',$_SESSION['_config'])) $_SESSION['_config']['s
</form>
<p><b><?=_("Security Issues")?></b></p>
-<p><?=_("Please use any of the following ways to report security issues: You can use the above contact form for sensitive information. You can email us to support@cacert.org. You can file a bugreport on <a href='https://bugs.cacert.org/'>bugs.cacert.org</a> and mark it as private.")?></p>
+<p><? sprintf(_("Please use any of the following ways to report security ".
+ "issues: You can use the above contact form for sensitive information. ".
+ "You can email us to %s. You can file a bugreport on %s and mark it as ".
+ "private."),
+ "<a href='mailto:support@cacert.org'>support@cacert.org</a>",
+ "<a href='https://bugs.cacert.org/'>bugs.cacert.org</a>")?></p>
<p><b><?=_("Snail Mail")?></b></p>
<p><?=_("Alternatively you can get in contact with us via the following methods:")?></p>
@@ -84,3 +98,4 @@ Australia</p>
document.form2.secrethash2.value = pagehash;
-->
</script>
+*/
diff --git a/pages/account/41.php b/pages/account/41.php
index e44eec9..d2cfc8c 100644
--- a/pages/account/41.php
+++ b/pages/account/41.php
@@ -14,7 +14,11 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-*/ ?>
+*/
+
+require_once($_SESSION['_config']['filepath'].'/includes/lib/l10n.php');
+?>
+
<form method="post" action="account.php">
<table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper" width="400">
<tr>
@@ -24,11 +28,10 @@
<td class="DataTD"><?=_("My prefered language")?>:</td>
<td class="DataTD"><select name="lang">
<?
-echo $_SESSION['_config']['language'];
- foreach($_SESSION['_config']['translations'] as $key => $val)
+ foreach(L10n::$translations as $key => $val)
{
echo "<option value='$key'";
- if($key == $_SESSION['_config']['language'])
+ if($key == L10n::get_translation())
echo " selected";
echo ">$val</option>\n";
}
diff --git a/pages/account/43.php b/pages/account/43.php
index f058770..7bf6d04 100644
--- a/pages/account/43.php
+++ b/pages/account/43.php
@@ -24,10 +24,10 @@ include_once($_SESSION['_config']['filepath']."/includes/notary.inc.php");
$assurance = mysql_escape_string(intval($_REQUEST['assurance']));
$row = 0;
$res = mysql_query("select `to` from `notary` where `id`='$assurance'");
- if ($res) {
+ if ($res) {
$row = mysql_fetch_assoc($res);
}
- mysql_query("delete from `notary` where `id`='$assurance'");
+ mysql_query("delete from `notary` where `id`='$assurance'");
if ($row) {
fix_assurer_flag($row['to']);
}
@@ -485,6 +485,304 @@ include_once($_SESSION['_config']['filepath']."/includes/notary.inc.php");
// End - Debug infos
?>
+<table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper">
+ <tr>
+ <td colspan="6" class="title"><?=_("Certificates")?></td>
+ </tr>
+
+ <tr>
+ <td class="DataTD"><?=_("Cert Type")?>:</td>
+ <td class="DataTD"><?=_("Total")?></td>
+ <td class="DataTD"><?=_("Valid")?></td>
+ <td class="DataTD"><?=_("Expired")?></td>
+ <td class="DataTD"><?=_("Revoked")?></td>
+ <td class="DataTD"><?=_("Latest Expire")?></td>
+ </tr>
+
+ <tr>
+ <td class="DataTD"><?=_("Server")?>:</td>
+ <?
+ $query = "select COUNT(*) as `total`,
+ MAX(`domaincerts`.`expire`) as `maxexpire`
+ from `domains` inner join `domaincerts`
+ on `domains`.`id` = `domaincerts`.`domid`
+ where `domains`.`memid` = '".intval($row['id'])."' ";
+ $dres = mysql_query($query);
+ $drow = mysql_fetch_assoc($dres);
+ $total = $drow['total'];
+
+ $maxexpire = "0000-00-00 00:00:00";
+ if ($drow['maxexpire']) {
+ $maxexpire = $drow['maxexpire'];
+ }
+
+ if($total > 0) {
+ $query = "select COUNT(*) as `valid`
+ from `domains` inner join `domaincerts`
+ on `domains`.`id` = `domaincerts`.`domid`
+ where `domains`.`memid` = '".intval($row['id'])."'
+ and `revoked` = '0000-00-00 00:00:00'
+ and `expire` > NOW()";
+ $dres = mysql_query($query);
+ $drow = mysql_fetch_assoc($dres);
+ $valid = $drow['valid'];
+
+ $query = "select COUNT(*) as `expired`
+ from `domains` inner join `domaincerts`
+ on `domains`.`id` = `domaincerts`.`domid`
+ where `domains`.`memid` = '".intval($row['id'])."'
+ and `expire` <= NOW()";
+ $dres = mysql_query($query);
+ $drow = mysql_fetch_assoc($dres);
+ $expired = $drow['expired'];
+
+ $query = "select COUNT(*) as `revoked`
+ from `domains` inner join `domaincerts`
+ on `domains`.`id` = `domaincerts`.`domid`
+ where `domains`.`memid` = '".intval($row['id'])."'
+ and `revoked` != '0000-00-00 00:00:00'";
+ $dres = mysql_query($query);
+ $drow = mysql_fetch_assoc($dres);
+ $revoked = $drow['revoked'];
+ ?>
+ <td class="DataTD"><?=intval($total)?></td>
+ <td class="DataTD"><?=intval($valid)?></td>
+ <td class="DataTD"><?=intval($expired)?></td>
+ <td class="DataTD"><?=intval($revoked)?></td>
+ <td class="DataTD"><?=($maxexpire != "0000-00-00 00:00:00")?
+ substr($maxexpire, 0, 10) : _("Pending")?></td>
+ <?
+ } else { // $total > 0
+ ?>
+ <td colspan="5" class="DataTD"><?=_("None")?></td>
+ <?
+ } ?>
+ </tr>
+
+ <tr>
+ <td class="DataTD"><?=_("Client")?>:</td>
+ <?
+ $query = "select COUNT(*) as `total`, MAX(`expire`) as `maxexpire`
+ from `emailcerts`
+ where `memid` = '".intval($row['id'])."' ";
+ $dres = mysql_query($query);
+ $drow = mysql_fetch_assoc($dres);
+ $total = $drow['total'];
+
+ $maxexpire = "0000-00-00 00:00:00";
+ if ($drow['maxexpire']) {
+ $maxexpire = $drow['maxexpire'];
+ }
+
+ if($total > 0) {
+ $query = "select COUNT(*) as `valid`
+ from `emailcerts`
+ where `memid` = '".intval($row['id'])."'
+ and `revoked` = '0000-00-00 00:00:00'
+ and `expire` > NOW()";
+ $dres = mysql_query($query);
+ $drow = mysql_fetch_assoc($dres);
+ $valid = $drow['valid'];
+
+ $query = "select COUNT(*) as `expired`
+ from `emailcerts`
+ where `memid` = '".intval($row['id'])."'
+ and `expire` <= NOW()";
+ $dres = mysql_query($query);
+ $drow = mysql_fetch_assoc($dres);
+ $expired = $drow['expired'];
+
+ $query = "select COUNT(*) as `revoked`
+ from `emailcerts`
+ where `memid` = '".intval($row['id'])."'
+ and `revoked` != '0000-00-00 00:00:00'";
+ $dres = mysql_query($query);
+ $drow = mysql_fetch_assoc($dres);
+ $revoked = $drow['revoked'];
+ ?>
+ <td class="DataTD"><?=intval($total)?></td>
+ <td class="DataTD"><?=intval($valid)?></td>
+ <td class="DataTD"><?=intval($expired)?></td>
+ <td class="DataTD"><?=intval($revoked)?></td>
+ <td class="DataTD"><?=($maxexpire != "0000-00-00 00:00:00")?
+ substr($maxexpire, 0, 10) : _("Pending")?></td>
+ <?
+ } else { // $total > 0
+ ?>
+ <td colspan="5" class="DataTD"><?=_("None")?></td>
+ <?
+ } ?>
+ </tr>
+
+ <tr>
+ <td class="DataTD"><?=_("GPG")?>:</td>
+ <?
+ $query = "select COUNT(*) as `total`, MAX(`expire`) as `maxexpire`
+ from `gpg`
+ where `memid` = '".intval($row['id'])."' ";
+ $dres = mysql_query($query);
+ $drow = mysql_fetch_assoc($dres);
+ $total = $drow['total'];
+
+ $maxexpire = "0000-00-00 00:00:00";
+ if ($drow['maxexpire']) {
+ $maxexpire = $drow['maxexpire'];
+ }
+
+ if($total > 0) {
+ $query = "select COUNT(*) as `valid`
+ from `gpg`
+ where `memid` = '".intval($row['id'])."'
+ and `expire` > NOW()";
+ $dres = mysql_query($query);
+ $drow = mysql_fetch_assoc($dres);
+ $valid = $drow['valid'];
+
+ $query = "select COUNT(*) as `expired`
+ from `emailcerts`
+ where `memid` = '".intval($row['id'])."'
+ and `expire` <= NOW()";
+ $dres = mysql_query($query);
+ $drow = mysql_fetch_assoc($dres);
+ $expired = $drow['expired'];
+
+ ?>
+ <td class="DataTD"><?=intval($total)?></td>
+ <td class="DataTD"><?=intval($valid)?></td>
+ <td class="DataTD"><?=intval($expired)?></td>
+ <td class="DataTD"></td>
+ <td class="DataTD"><?=($maxexpire != "0000-00-00 00:00:00")?
+ substr($maxexpire, 0, 10) : _("Pending")?></td>
+ <?
+ } else { // $total > 0
+ ?>
+ <td colspan="5" class="DataTD"><?=_("None")?></td>
+ <?
+ } ?>
+ </tr>
+
+ <tr>
+ <td class="DataTD"><?=_("Org Server")?>:</td>
+ <?
+ $query = "select COUNT(*) as `total`,
+ MAX(`orgcerts`.`expire`) as `maxexpire`
+ from `orgdomaincerts` as `orgcerts` inner join `org`
+ on `orgcerts`.`orgid` = `org`.`orgid`
+ where `org`.`memid` = '".intval($row['id'])."' ";
+ $dres = mysql_query($query);
+ $drow = mysql_fetch_assoc($dres);
+ $total = $drow['total'];
+
+ $maxexpire = "0000-00-00 00:00:00";
+ if ($drow['maxexpire']) {
+ $maxexpire = $drow['maxexpire'];
+ }
+
+ if($total > 0) {
+ $query = "select COUNT(*) as `valid`
+ from `orgdomaincerts` as `orgcerts` inner join `org`
+ on `orgcerts`.`orgid` = `org`.`orgid`
+ where `org`.`memid` = '".intval($row['id'])."'
+ and `orgcerts`.`revoked` = '0000-00-00 00:00:00'
+ and `orgcerts`.`expire` > NOW()";
+ $dres = mysql_query($query);
+ $drow = mysql_fetch_assoc($dres);
+ $valid = $drow['valid'];
+
+ $query = "select COUNT(*) as `expired`
+ from `orgdomaincerts` as `orgcerts` inner join `org`
+ on `orgcerts`.`orgid` = `org`.`orgid`
+ where `org`.`memid` = '".intval($row['id'])."'
+ and `orgcerts`.`expire` <= NOW()";
+ $dres = mysql_query($query);
+ $drow = mysql_fetch_assoc($dres);
+ $expired = $drow['expired'];
+
+ $query = "select COUNT(*) as `revoked`
+ from `orgdomaincerts` as `orgcerts` inner join `org`
+ on `orgcerts`.`orgid` = `org`.`orgid`
+ where `org`.`memid` = '".intval($row['id'])."'
+ and `orgcerts`.`revoked` != '0000-00-00 00:00:00'";
+ $dres = mysql_query($query);
+ $drow = mysql_fetch_assoc($dres);
+ $revoked = $drow['revoked'];
+ ?>
+ <td class="DataTD"><?=intval($total)?></td>
+ <td class="DataTD"><?=intval($valid)?></td>
+ <td class="DataTD"><?=intval($expired)?></td>
+ <td class="DataTD"><?=intval($revoked)?></td>
+ <td class="DataTD"><?=($maxexpire != "0000-00-00 00:00:00")?
+ substr($maxexpire, 0, 10) : _("Pending")?></td>
+ <?
+ } else { // $total > 0
+ ?>
+ <td colspan="5" class="DataTD"><?=_("None")?></td>
+ <?
+ } ?>
+ </tr>
+
+ <tr>
+ <td class="DataTD"><?=_("Org Client")?>:</td>
+ <?
+ $query = "select COUNT(*) as `total`,
+ MAX(`orgcerts`.`expire`) as `maxexpire`
+ from `orgemailcerts` as `orgcerts` inner join `org`
+ on `orgcerts`.`orgid` = `org`.`orgid`
+ where `org`.`memid` = '".intval($row['id'])."' ";
+ $dres = mysql_query($query);
+ $drow = mysql_fetch_assoc($dres);
+ $total = $drow['total'];
+
+ $maxexpire = "0000-00-00 00:00:00";
+ if ($drow['maxexpire']) {
+ $maxexpire = $drow['maxexpire'];
+ }
+
+ if($total > 0) {
+ $query = "select COUNT(*) as `valid`
+ from `orgemailcerts` as `orgcerts` inner join `org`
+ on `orgcerts`.`orgid` = `org`.`orgid`
+ where `org`.`memid` = '".intval($row['id'])."'
+ and `orgcerts`.`revoked` = '0000-00-00 00:00:00'
+ and `orgcerts`.`expire` > NOW()";
+ $dres = mysql_query($query);
+ $drow = mysql_fetch_assoc($dres);
+ $valid = $drow['valid'];
+
+ $query = "select COUNT(*) as `expired`
+ from `orgemailcerts` as `orgcerts` inner join `org`
+ on `orgcerts`.`orgid` = `org`.`orgid`
+ where `org`.`memid` = '".intval($row['id'])."'
+ and `orgcerts`.`expire` <= NOW()";
+ $dres = mysql_query($query);
+ $drow = mysql_fetch_assoc($dres);
+ $expired = $drow['expired'];
+
+ $query = "select COUNT(*) as `revoked`
+ from `orgemailcerts` as `orgcerts` inner join `org`
+ on `orgcerts`.`orgid` = `org`.`orgid`
+ where `org`.`memid` = '".intval($row['id'])."'
+ and `orgcerts`.`revoked` != '0000-00-00 00:00:00'";
+ $dres = mysql_query($query);
+ $drow = mysql_fetch_assoc($dres);
+ $revoked = $drow['revoked'];
+ ?>
+ <td class="DataTD"><?=intval($total)?></td>
+ <td class="DataTD"><?=intval($valid)?></td>
+ <td class="DataTD"><?=intval($expired)?></td>
+ <td class="DataTD"><?=intval($revoked)?></td>
+ <td class="DataTD"><?=($maxexpire != "0000-00-00 00:00:00")?
+ substr($maxexpire, 0, 10) : _("Pending")?></td>
+ <?
+ } else { // $total > 0
+ ?>
+ <td colspan="5" class="DataTD"><?=_("None")?></td>
+ <?
+ } ?>
+ </tr>
+</table>
+<br>
+
<a href="account.php?id=43&amp;userid=<?=$row['id']?>&amp;shownotary=assuredto"><?=_("Show Assurances the user got")?></a>
(<a href="account.php?id=43&amp;userid=<?=$row['id']?>&amp;shownotary=assuredto15"><?=_("New calculation")?></a>)
<br />
diff --git a/pages/index/13.php b/pages/index/13.php
index 68ee5ed..f2ea173 100644
--- a/pages/index/13.php
+++ b/pages/index/13.php
@@ -42,3 +42,16 @@ Account No.: 180264
<p><?=_("ANY amount will be appreciated - the more funding CAcert receives, the sooner it can achieve the goals of the community.")?></p>
<p><?=_("Thank you very much for your support, your donations help CAcert to continue to operate.")?></p>
+
+
+<h3><?=_("Using Our Affiliate Partners")?></h3>
+
+<h4>Booking.com</h4>
+
+<p><?=_("If you do any trips where you need accommodation why not book via booking.com?")?></p>
+
+<p><?php
+ printf(_("For any booking done over %s started from this page CAcert gets a share of the provision. You do not pay more but you will support CAcert."),
+ '<a href="//www.booking.com/index.html?aid=346253">booking.com</a>');
+ ?></p>
+
diff --git a/pages/wot/14.php b/pages/wot/14.php
index 21c5873..a827ee4 100644
--- a/pages/wot/14.php
+++ b/pages/wot/14.php
@@ -20,7 +20,11 @@
<p><?=sprintf(_("If you have a %sSignaturecard%s (also called 'Buergerkarte'), you can digitally sign your assurance request here, and get 50 CAcert points:"),"<a href='http://www.buergerkarte.at/'>","</a>")?><br /></p>
-<p><?=sprintf(_("To get assured with your Signaturecard, you need the Software from <a href='http://www.buergerkarte.at/bku/'>http://www.buergerkarte.at/bku/</a>. To activate your E-Card, please go to <a href='https://www.sozialversicherung.at/signon2-Registrierung/'>https://www.sozialversicherung.at/signon2-Registrierung/</a>."))?></p>
+<p><?=sprintf(_("To get assured with your Signaturecard, you need the ".
+ "Software from %s. To activate your E-Card, please go to %s."),
+ "<a href='http://www.buergerkarte.at/bku/'>http://www.buergerkarte.at/bku/</a>",
+ "<a href='https://www.sozialversicherung.at/signon2-Registrierung/'>https://www.sozialversicherung.at/signon2-Registrierung/</a>"
+ )?></p>
<pre><?=sanitizeHTML($_REQUEST['XMLResponse'])?></pre>
diff --git a/pages/wot/5.php b/pages/wot/5.php
index f717870..c1a6438 100644
--- a/pages/wot/5.php
+++ b/pages/wot/5.php
@@ -16,6 +16,7 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
include_once("../includes/shutdown.php");
+ require_once("../includes/lib/l10n.php");
?>
<?
if(array_key_exists('error',$_SESSION['_config']) && $_SESSION['_config']['error'] != "")
@@ -32,8 +33,8 @@
<select name="reminder-lang">
<?
if($_SESSION['_config']['reminder-lang'] == "")
- $_SESSION['_config']['reminder-lang'] = $_SESSION['profile']['language'];
- foreach($_SESSION['_config']['translations'] as $key => $val)
+ $_SESSION['_config']['reminder-lang'] = L10n::get_translation();
+ foreach(L10n::$translations as $key => $val)
{
echo "<option value='$key'";
if($key == $_SESSION['_config']['reminder-lang'])
diff --git a/pages/wot/6.php b/pages/wot/6.php
index bc37aa2..e648ed4 100644
--- a/pages/wot/6.php
+++ b/pages/wot/6.php
@@ -16,6 +16,11 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/ ?>
<?
+
+function makecap()
+{
+}
+
if(!array_key_exists('notarise',$_SESSION['_config']))
{
echo "Error: No user data found.";
@@ -24,147 +29,38 @@
$row = $_SESSION['_config']['notarise'];
- if(!array_key_exists('pointsalready',$_SESSION['_config'])) $_SESSION['_config']['pointsalready']=0;
-
-
- if($_SESSION['profile']['ttpadmin'] == 1 && $_SESSION['profile']['board'] == 1)
- {
- $methods = array("Face to Face Meeting", "Trusted 3rd Parties", "Thawte Points Transfer", "Administrative Increase", "CT Magazine - Germany");
- } else if($_SESSION['profile']['ttpadmin'] == 1) {
+ if($_SESSION['profile']['ttpadmin'] == 1)
+// $methods = array("Face to Face Meeting", "Trusted 3rd Parties", "TopUP");
+// else
$methods = array("Face to Face Meeting", "Trusted 3rd Parties");
- }
+ else
+ $methods = array("Face to Face Meeting");
- $cap = "/cap.php?";
- $name = $row['fname']." ".$row['mname']." ".$row['lname']." ".$row['suffix'];
- $_SESSION['_config']['wothash'] = md5($name."-".$row['dob']);
- while(strstr($name, " "))
- $name = str_replace(" ", " ", $name);
- $cap .= "name=".urlencode($name);
- $cap .= "&amp;dob=".urlencode($row['dob']);
- $cap .= "&amp;email=".urlencode($row['email']);
- $name = $_SESSION['profile']['fname']." ".$_SESSION['profile']['mname']." ".$_SESSION['profile']['lname']." ".$_SESSION['profile']['suffix'];
- while(strstr($name, " "))
- $name = str_replace(" ", " ", $name);
- $cap .= "&amp;assurer=".urlencode($name);
- $cap .= "&amp;date=now";
- $cap .= "&amp;maxpoints=".maxpoints();
+ $fname = $row['fname'];
+ $mname = $row['mname'];
+ $lname = $row['lname'];
+ $suffix = $row['suffix'];
+ $dob = $row['dob'];
+ $name = $fname." ".$mname." ".$lname." ".$suffix;
+ $_SESSION['_config']['wothash'] = md5($name."-".$dob);
- $maxpoints = maxpoints();
- if($maxpoints > 100)
- $maxpoints = 100;
+ $cap=makecap($fname,$mname,$lname,$suffix,$dob,$row['email'],$_SESSION['profile']['fname'],$_SESSION['profile']['mname'],$_SESSION['profile']['lname'],$_SESSION['profile']['suffix']);
- if(array_key_exists('error',$_SESSION['_config']) && $_SESSION['_config']['error'] != "") { ?><font color="#ff0000" size="+1">ERROR: <?=$_SESSION['_config']['error']?></font><? unset($_SESSION['_config']['error']); } ?>
-<form method="post" action="wot.php">
-<table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper" width="600">
- <tr>
- <td colspan="2" class="title"><?=_("Assurance Confirmation")?></td>
- </tr>
-<? if(array_key_exists('alreadydone',$_SESSION['_config']) && $_SESSION['_config']['alreadydone'] == 1) { ?>
- <tr>
- <td class="DataTD" colspan="2" align="left" style="color: red;"><b><?=_("PLEASE NOTE: You have already assured this person before! If this is unintentional please DO NOT CONTINUE with this assurance.")?></b></td>
- </tr>
-<?
- } if(100 - $_SESSION['_config']['pointsalready'] - $maxpoints < 0) {
- ?>
- <tr>
- <td class="DataTD" colspan="2" align="left" style="color: red;"><b><? printf(_("This person already has %s assurance points. Any points you give this person may be rounded down, or they may not even get any points. If you have less then 150 points you will still receive 2 points for assuring them."), $_SESSION['_config']['pointsalready']); ?></b></td>
- </tr>
-<? }
+ include_once($_SESSION['_config']['filepath']."/includes/wot.inc.php");
- $query = "select `verified` from `users` where `id`='".$row['id']."'";
- $res = mysql_query($query);
- $drow = mysql_fetch_assoc($res);
- //if($_SESSION['_config']['verified'] <= 0)
- if($drow['verified']<=0)
- { ?>
- <tr>
- <td class="DataTD" colspan="2" align="left" style="color: red;"><b><?=_("You are about to assure a person that isn't currently verified. If you continue and they do not verify their account within 48 hours the account could automatically be removed by the system.")?></b></td>
- </tr>
-<? } ?>
- <tr>
- <td class="DataTD" colspan="2" align="left"><? printf(_("Please check the following details match against what you witnessed when you met %s in person. You MUST NOT proceed unless you are sure the details are correct. You may be held responsible by the CAcert Arbitrator for any issues with this Assurance."), $row['fname']); ?></td>
- </tr>
- <tr>
- <td class="DataTD"><?=_("Name")?>:</td>
- <td class="DataTD"><?=$row['fname']?> <?=$row['mname']?> <?=$row['lname']?> <?=$row['suffix']?></td>
- </tr>
- <tr>
- <td class="DataTD"><?=_("Date of Birth")?>:</td>
- <td class="DataTD"><?=$row['dob']?> (<?=_("YYYY-MM-DD")?>)</td>
- </tr>
-<? if($_SESSION['profile']['ttpadmin'] == 1) { ?>
- <tr>
- <td class="DataTD"><?=_("Method")?>:</td>
- <td class="DataTD"><select name="method">
-<? foreach($methods as $val) { ?>
- <option value="<?=$val?>"<? if(array_key_exists('method',$_POST) && $val == $_POST['method']) echo " selected"; ?>><?=$val?></option>
-<? } ?>
- </select>
- </td>
- </tr>
- <tr>
- <td class="DataTD" colspan="2"><?=_("Only tick the next box if the Assurance was face to face.")?></td>
- </tr>
-<? } ?>
- <tr>
- <td class="DataTD"><input type="checkbox" name="certify" value="1"<? if(array_key_exists('certify',$_POST) && $_POST['certify'] == 1) echo " checked"; ?>></td>
- <td class="DataTD"><? printf(_("I certify that %s %s %s has appeared in person"), $row['fname'], $row['mname'], $row['lname']); ?></td>
- </tr>
- <tr>
- <td class="DataTD"><?=_("Location")?>:</td>
- <td class="DataTD"><input type="text" name="location" value="<?=array_key_exists('location',$_SESSION['_config'])?$_SESSION['_config']['location']:""?>"></td>
- </tr>
- <tr>
- <td class="DataTD"><?=_("Date")?>:</td>
- <td class="DataTD"><input type="text" name="date" value="<?=array_key_exists('date',$_SESSION['_config'])?$_SESSION['_config']['date']:""?>"><br><?=_("Only fill this in if you assured the person on a different day")?></td>
- </tr>
-<? if($_SESSION['profile']['board'] == 1 && $_SESSION['_config']['pointsalready'] <= 150) { ?>
- <tr>
- <td class="DataTD" colspan="2"><?=_("Issuing a temporary increase will automatically boost their points to 200 points for a nomindated amount of days, after which the person will be reduced to 150 points regardless of the amount of points they had previously. Regardless of method chosen above it will be recorded in the system as an Administrative Increase and there is a maximum amount of 45 days that points can be issued for.")?></td>
- </tr>
- <tr>
- <td class="DataTD"><nobr><?=_("Temporary Increase")?>:</nobr><br><nobr><?=_("Number of days")?></nobr></td>
- <td class="DataTD"><input type="text" name="expire" value="<?=intval(array_key_exists('expire',$_POST)?$_POST['expire']:0)?>"></td>
- </tr>
- <tr>
- <td class="DataTD"><nobr><?=_("Sponsoring Member")?>:</td>
- <td class="DataTD"><select name="sponsor">
-<?
- $query = "select * from `users` where `board`='1' and `id`!='".intval($_SESSION['profile']['id'])."'";
- $res = mysql_query($query);
- while($row = mysql_fetch_assoc($res))
- {
+ AssureHead(_("Assurance Confirmation"),sprintf(_("Please check the following details match against what you witnessed when you met %s in person. You MUST NOT proceed unless you are sure the details are correct. You may be held responsible by the CAcert Arbitrator for any issues with this Assurance."), $fname));
+ AssureTextLine(_("Name"),$name);
+ AssureTextLine(_("Date of Birth"),$dob." ("._("YYYY-MM-DD").")");
+ AssureBoxLine("certify",sprintf(_("I certify that %s %s %s has appeared in person"), $fname, $mname, $lname),array_key_exists('certify',$_POST) && $_POST['certify'] == 1);
+ AssureInboxLine("location",_("Location"),array_key_exists('location',$_SESSION['_config'])?$_SESSION['_config']['location']:"","");
+ AssureInboxLine("date",_("Date"),array_key_exists('date',$_SESSION['_config'])?$_SESSION['_config']['date']:date("Y-m-d"),"<br/>"._("Please adjust the date if you assured the person on a different day"));
+ AssureMethodLine(_("Method"),$methods,_("Only tick the next box if the Assurance was face to face."));
+ AssureBoxLine("assertion",_("I believe that the assertion of identity I am making is correct, complete and verifiable. I have seen original documentation attesting to this identity. I accept that the CAcert Arbitrator may call upon me to provide evidence in any dispute, and I may be held responsible."),array_key_exists('assertion',$_POST) && $_POST['assertion'] == 1);
+ AssureBoxLine("rules",_("I have read and understood the Assurance Policy and the Assurance Handbook and am making this Assurance subject to and in compliance with the policy and handbook."),array_key_exists('rules',$_POST) && $_POST['rules'] == 1);
+ AssureTextLine(_("Policy"),"<a href=\"/policy/AssurancePolicy.php\" target=\"_blank\">"._("Assurance Policy")."</a> - <a href=\"http://wiki.cacert.org/AssuranceHandbook2\" target=\"_blank\">"._("Assurance Handbook")."</a>");
+ AssureInboxLine("points",_("Points"),"","<br />(Max. ".maxpoints().")");
+ AssureCCABoxLine("CCAAgreed",sprintf(_("Check this box only if %s agreed to the <a href=\"/policy/CAcertCommunityAgreement.php\">CAcert Community Agreement</a>"),$fname));
+ AssureCCABoxLine("CCAAgree",_("Check this box only if YOU agree to the <a href=\"/policy/CAcertCommunityAgreement.php\">CAcert Community Agreement</a>"));
+ AssureTextLine(_("WoT Form"),"<a href=\"".$cap."\" target=\"_blank\">A4 - "._("WoT Form")."</a> <a href=\"".$cap."&amp;format=letter\" target=\"_blank\">US - "._("WoT Form")."</a>");
+ AssureFoot($id,_("I confirm this Assurance"));
?>
- <option value="<?=$row['id']?>"<? if(array_key_exists('sponsor',$_POST) && $row['id'] == $_POST['sponsor']) echo " selected='selected'"; ?>><?=$row['fname']." ".$row['lname']?></option>
-<? } ?>
- </select>
- </td>
- </tr>
-<? } ?>
- <tr>
- <td class="DataTD"><input type="checkbox" name="assertion" value="1"<? if(array_key_exists('assertion',$_POST) && $_POST['assertion'] == 1) echo " checked='checked'"; ?>></td>
- <td class="DataTD"><?=_("I believe that the assertion of identity I am making is correct, complete and verifiable. I have seen original documentation attesting to this identity. I accept that the CAcert Arbitrator may call upon me to provide evidence in any dispute, and I may be held responsible.")?></td>
- </tr>
- <tr>
- <td class="DataTD"><input type="checkbox" name="rules" value="1"<? if(array_key_exists('rules',$_POST) && $_POST['rules'] == 1) echo " checked='checked'"; ?>></td>
- <td class="DataTD"><?=_("I have read and understood the Assurance Policy and the Assurance Handbook and am making this Assurance subject to and in compliance with the policy and handbook.")?></td>
- </tr>
- <tr>
- <td class="DataTD"><?=_("Policy")?>:</td>
- <td class="DataTD"><a href="/policy/AssurancePolicy.php" target="_NEW"><?=_("Assurance Policy")?></a> - <a href="http://wiki.cacert.org/AssuranceHandbook2" target="_NEW"><?=_("Assurance Handbook")?></a></td>
- </tr>
- <tr>
- <td class="DataTD"><?=_("Points")?>:<br><nobr>(Max <?=maxpoints()?>)</nobr></td>
- <td class="DataTD"><input type="text" name="points" value=""></td>
- </tr>
- <tr>
- <td class="DataTD"><?=_("WoT Form")?>:</td>
- <td class="DataTD"><a href="<?=$cap?>" target="_NEW">A4 - <?=_("WoT Form")?></a> <a href="<?=$cap?>&amp;format=letter" target="_NEW">US - <?=_("WoT Form")?></a></td>
- </tr>
- <tr>
- <td class="DataTD" colspan="2"><input type="submit" name="process" value="<?=_("I confirm this Assurance")?>"> <input type="submit" name="cancel" value="<?=_("Cancel")?>"></td>
- </tr>
-</table>
-<input type="hidden" name="pagehash" value="<?=$_SESSION['_config']['wothash']?>">
-<input type="hidden" name="oldid" value="<?=$id?>">
-</form>
diff --git a/pages/wot/9.php b/pages/wot/9.php
index b974c5d..bfa7a98 100644
--- a/pages/wot/9.php
+++ b/pages/wot/9.php
@@ -14,8 +14,11 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-*/ ?>
-<?
+*/
+
+ require_once($_SESSION['_config']['filepath'].'/includes/lib/l10n.php');
+
+
$res = mysql_query("select * from `users` where `id`='".intval($_REQUEST['userid'])."' and `listme`='1'");
if(mysql_num_rows($res) <= 0)
{
@@ -47,7 +50,7 @@
<? if($userlang != "") { ?>
<tr>
<td class="DataTD"><?=_("Language")?>:</td>
- <td class="DataTD" align="left"><? printf(_("%s prefers to be contacted in %s"), $user['fname'], $_SESSION['_config']['translations'][$userlang]) ?></td>
+ <td class="DataTD" align="left"><? printf(_("%s prefers to be contacted in %s"), $user['fname'], L10n::$translations[$userlang]) ?></td>
</tr>
<? } ?>
<?
diff --git a/password.dat.sample b/password.dat.sample
deleted file mode 100644
index f9bbb55..0000000
--- a/password.dat.sample
+++ /dev/null
@@ -1,2 +0,0 @@
-$translingo_password = 'ThePassword';
-$translingo_account = 'TheAccount';
diff --git a/scripts/39uk-ate-manchester-email.txt b/scripts/39uk-ate-manchester-email.txt
new file mode 100644
index 0000000..6c709bf
--- /dev/null
+++ b/scripts/39uk-ate-manchester-email.txt
@@ -0,0 +1,40 @@
+CAcert Assurer Training Event -- Crewe/Manchester, UK
+:::::::::::::::::::::::::::::::::::::::::::::::::::::
+
+Dear Member of the CAcert Community,
+
+Much has happened during recent years. The old way of orally-transmitted procedures has now gone, and our rules have been cast into formal policies. New procedures (e.g. the Assurer Challenge) and obligations (e.g. in the CAcert Community Agreement) have been approved.
+
+The Assurer Training Events bring all this to you, the Assurer, and the Community:
+
+- What is the difference in Thawte notary and CAcert Assurance?
+- What do you have to add onto the CAP form if you assure minors?
+- What are the 2 essential CCA points you have to present an Assuree?
+- Who can access the Member's privacy information?
+
+Answers to these and many other questions typically faced by Assurers are given at the Assurer Training Events (ATEs). Bring your ID for assurances. Especially note that Tverify/Thawte people need to boost up their Assurance Points.
+
+ATE-Manchester takes place at:
+* Saturday, January 14th, 2012
+* The Venue
+* Belong Village
+* Brookhouse Drive
+* Crewe
+* Cheshire CW2 6NA
+* 11:30am - 3pm
+
+The venue is near to and easily accessible from the train station (Crewe is a major rail junction within 3-4 hours of most of the major cities!)
+
+For Registration please reply: 'I will attend ATE-Manchester'
+
+Don't forget your ID!
+
+We are looking forward to hearing from you.
+
+
+- Best regards from the Event Team!
+
+
+PS: Contact: events@cacert.org
+Location, Transportation and other event details at
+[https://wiki.cacert.org/Events/20120114ATE-Manchester]
diff --git a/scripts/39uk-ate-manchester-mail.php.txt b/scripts/39uk-ate-manchester-mail.php.txt
new file mode 100644
index 0000000..5c5d0d9
--- /dev/null
+++ b/scripts/39uk-ate-manchester-mail.php.txt
@@ -0,0 +1,108 @@
+#!/usr/bin/php -q
+<? /*
+ LibreSSL - CAcert web application
+ Copyright (C) 2004-2009 CAcert Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+ include_once("../includes/mysql.php");
+
+ $lines = "";
+ $fp = fopen("39uk-ate-manchester-email.txt", "r");
+ while(!feof($fp))
+ {
+ $line = trim(fgets($fp, 4096));
+ $lines .= wordwrap($line, 75, "\n")."\n";
+ }
+ fclose($fp);
+
+
+// $locid = intval($_REQUEST['location']);
+// $maxdist = intval($_REQUEST['maxdist']);
+// maxdist in [Km] - changed to 350 to include glasgow + london
+ $maxdist = 350;
+
+
+// location location.ID
+// verified: 29.4.09 u.schroeter
+// $locid = 7902857; // Paris
+// $locid = 238568; // Bielefeld
+// $locid = 715191; // Hamburg
+// $locid = 1102495; // London
+// $locid = 520340; // Duesseldorf
+// $locid = 1260319; // Muenchen
+// $locid = 606058; // Frankfurt
+// $locid = 1775784; // Stuttgart
+// $locid = 228950; // Berlin
+// $locid = 606058; // Frankfurt
+// $locid = 599389; // Flensburg
+// $locid = 61065; // Amsterdam, Eemnes
+// $locid = 228950; // Berlin
+// $locid = 2138880; // Baltimore (Baltimore (city)), Maryland, US
+// $locid = 1486658; // Potsdam
+// $locid = 664715; // Goteborg, Vastra Gotaland, Sweden
+// $locid = 2094781; // Mission Hills (Los Angeles), California, US
+// $locid = 423655; // Copenhagen, Kobenhavn*, Denmark
+// $locid = 2257312; // Sydney, New South Wales, Australia
+// $locid = 572764; // Essen, Nordrhein-Westfalen, Germany
+// $locid = 78; // Aachen, Nordrhein-Westfalen, Germany
+// $locid = 266635; // Bonn, Nordrhein-Westfalen, Germany
+// $locid = 2102723; // Washington (District of Columbia, ..., US
+// $locid = 2177566; // New York (Bronx), New York, United States
+// $locid = 1486658; // Potsdam BLIT2011
+// $locid = 2237836; // Blacksburg (Montgomery), Virginia, United States
+
+// ATE Manchester 2012
+ $locid = 1161640; // Manchester, Manchester, United Kingdom
+ $eventname = "ATE-Manchester";
+ $city = "Manchester/Crewe UK";
+
+
+ $query = "select * from `locations` where `id`='$locid'";
+ $loc = mysql_fetch_assoc(mysql_query($query));
+
+ $query = "SELECT ROUND(6378.137 * ACOS(0.9999999*((SIN(PI() * $loc[lat] / 180) * SIN(PI() * `locations`.`lat` / 180)) +
+ (COS(PI() * $loc[lat] / 180 ) * COS(PI() * `locations`.`lat` / 180) *
+ COS(PI() * `locations`.`long` / 180 - PI() * $loc[long] / 180)))), -1) AS `distance`, sum(`points`) as pts, `users`.*
+ FROM `locations`
+ inner join `users` on `users`.`locid` = `locations`.`id`
+ inner join `alerts` on `users`.`id`=`alerts`.`memid`
+ inner join `notary` on `users`.`id`=`notary`.`to`
+ WHERE (`alerts`.`general`=1 OR `alerts`.`country`=1 OR `alerts`.`regional`=1 OR `alerts`.`radius`=1)
+ GROUP BY `users`.`id`
+ HAVING `distance` <= '$maxdist'
+ ORDER BY `distance` ";
+ echo $query;
+
+ // comment next line when starting to send mail not only to me
+ // $query = "select * from `users` where `email` like 'cacerttest%'";
+
+ $res = mysql_query($query);
+ $xrows = mysql_num_rows($res);
+
+ while($row = mysql_fetch_assoc($res))
+ {
+ // uncomment next line to send mails ...
+ sendmail($row['email'], "[CAcert.org] $eventname - $city", $lines, "events@cacert.org", "", "", "CAcert Events Organisation", "returns@cacert.org", 1);
+ }
+ // 1x cc to events.cacert.org
+ sendmail("events@cacert.org", "[CAcert.org] $eventname - $city", $lines, "events@cacert.org", "", "", "CAcert Events Organisation", "returns@cacert.org", 1);
+ // 1x mailing report to events.cacert.org
+ sendmail("events@cacert.org", "[CAcert.org] $eventname - $city Report", "invitation sent to $xrows recipients.", "support@cacert.org", "", "", "CAcert Events Organisation", "returns@cacert.org", 1);
+
+ // 1x mailing report to Arbitrator of case http://wiki.cacert.org/wiki/Arbitrations/a20090525.1
+ sendmail("p.dunkel@cacert.org", "[CAcert.org] $eventname - $city Report", "invitation sent to $xrows recipients.", "support@cacert.org", "", "", "CAcert Events Organisation", "returns@cacert.org", 1);
+ echo "invitation sent to $xrows recipients.\n";
+
+?>
diff --git a/scripts/40de-ate-hamburg-email.txt b/scripts/40de-ate-hamburg-email.txt
new file mode 100644
index 0000000..ddf7c0f
--- /dev/null
+++ b/scripts/40de-ate-hamburg-email.txt
@@ -0,0 +1,66 @@
+CAcert Assurer Training Event Hamburg [Deutsch]
+::::::::::::::::::::::::::::::::::::::::::::::::::
+
+Es hat sich viel getan im letzten Jahr. Eine ganze Reihe von bisher eher "muendlich ueberlieferten" Regeln wurden in Policies gegossen. Neue Prozeduren (z.B. die Assurer Challenge) und Verpflichtungen (z.B. in dem CAcert Community Agreement) wurden beschlossen. Die Assurer Training Events wollen versuchen, die ganzen Informationen unter’s Volk zu bringen:
+
+- Was hast du auf dem CAP Formular hinzuzufuegen, wenn du Minderjaehrige ueberpruefst ?
+- Was sind die 2 wesentlichen Punkte der CCA die du einem Assuree vermitteln koennen sollst ?
+- Unter welchen Umstaenden koennen z.Bsp. niederlaendische Rufnamen akzeptiert werden?
+
+Antworten auf diese und weitere Fragen erhaelst du bei den Assurer Training Events (ATEs).
+
+Die kommende Veranstaltung in deiner Naehe findet statt am:
+
+Dienstag den 14. Februar 2012, 19:00 - 22:00
+
+Attraktor e.V.
+Mexikoring 21
+22297 Hamburg
+
+Das Veranstaltungs-Team freut sich schon auf Eure Teilnahme.
+
+Details zum Veranstaltungsort und Anfahrthinweise findet Ihr im
+Wiki [https://wiki.cacert.org/events/20120214-ATE-Hamburg-3]
+Blog [http://blog.cacert.org/2012/02/547.html]
+
+
+
+Unverbindliche Anmeldung und Registrierung:
+Rueckantwort mit 'Ich moechte teilnehmen: ATE-Hamburg'
+
+Kontakt: events@cacert.org
+
+
+CAcert Assurer Training Event Hamburg [English]
+::::::::::::::::::::::::::::::::::::::::::::::::::
+
+Much has happened during the past 3 years. The old way of
+orally-transmitted procedures has now gone, and our rules have been cast
+into formal policies. New procedures (e.g. the Assurer Challenge) and
+obligations (e.g. in the CAcert Community Agreement) have been approved.
+The Assurer Training Events bring all this to you, the Community:
+
+- What you have to add onto the CAP form if you assure U18 people ?
+- What are the 2 essential topics regarding CCA you have to present an Assuree ?
+- When you can accept i.e. a Dutch "roepnaam" ?
+
+Answers to these and many other questions are given at the Assurer
+Training Events (ATEs).
+
+ATE-Hamburg takes place on:
+Tuesday, Feb 14, 2012, 19:00 - 22:00
+
+Attraktor e.V.
+Mexikoring 21
+22297 Hamburg
+
+The Event-Team is looking forward to hearing from you.
+
+Details on Location and Transportation you will find under
+Wiki [https://wiki.cacert.org/events/20120214-ATE-Hamburg-3]
+Blog [http://blog.cacert.org/2012/02/547.html]
+
+Registration for ATE-Hamburg: please reply
+'I will attend: ATE-Hamburg'
+
+Contact: events@cacert.org
diff --git a/scripts/40de-ate-hamburg-mail.php.txt b/scripts/40de-ate-hamburg-mail.php.txt
new file mode 100644
index 0000000..54ec1b8
--- /dev/null
+++ b/scripts/40de-ate-hamburg-mail.php.txt
@@ -0,0 +1,112 @@
+#!/usr/bin/php -q
+<? /*
+ LibreSSL - CAcert web application
+ Copyright (C) 2004-2009 CAcert Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+ include_once("../includes/mysql.php");
+
+ $lines = "";
+ $fp = fopen("40de-ate-hamburg-email.txt", "r");
+ while(!feof($fp))
+ {
+ $line = trim(fgets($fp, 4096));
+ $lines .= wordwrap($line, 75, "\n")."\n";
+ }
+ fclose($fp);
+
+
+// $locid = intval($_REQUEST['location']);
+// $maxdist = intval($_REQUEST['maxdist']);
+// maxdist in [Km] - changed to 350 to include glasgow + london
+ $maxdist = 200;
+
+
+// location location.ID
+// verified: 29.4.09 u.schroeter
+// $locid = 7902857; // Paris
+// $locid = 238568; // Bielefeld
+// $locid = 715191; // Hamburg
+// $locid = 1102495; // London
+// $locid = 520340; // Duesseldorf
+// $locid = 1260319; // Muenchen
+// $locid = 606058; // Frankfurt
+// $locid = 1775784; // Stuttgart
+// $locid = 228950; // Berlin
+// $locid = 606058; // Frankfurt
+// $locid = 599389; // Flensburg
+// $locid = 61065; // Amsterdam, Eemnes
+// $locid = 228950; // Berlin
+// $locid = 2138880; // Baltimore (Baltimore (city)), Maryland, US
+// $locid = 1486658; // Potsdam
+// $locid = 664715; // Goteborg, Vastra Gotaland, Sweden
+// $locid = 2094781; // Mission Hills (Los Angeles), California, US
+// $locid = 423655; // Copenhagen, Kobenhavn*, Denmark
+// $locid = 2257312; // Sydney, New South Wales, Australia
+// $locid = 572764; // Essen, Nordrhein-Westfalen, Germany
+// $locid = 78; // Aachen, Nordrhein-Westfalen, Germany
+// $locid = 266635; // Bonn, Nordrhein-Westfalen, Germany
+// $locid = 2102723; // Washington (District of Columbia, ..., US
+// $locid = 2177566; // New York (Bronx), New York, United States
+// $locid = 1486658; // Potsdam BLIT2011
+// $locid = 2237836; // Blacksburg (Montgomery), Virginia, United States
+
+// ATE Manchester 2012
+// $locid = 1161640; // Manchester, Manchester, United Kingdom
+// $eventname = "ATE-Manchester";
+// $city = "Manchester/Crewe UK";
+
+// ATE Hamburg, DE, Feb 14 2012
+ $locid = 715191; // Hamburg
+ $eventname = "ATE-Hamburg";
+ $city = "Feb 14, 2012";
+
+ $query = "select * from `locations` where `id`='$locid'";
+ $loc = mysql_fetch_assoc(mysql_query($query));
+
+ $query = "SELECT ROUND(6378.137 * ACOS(0.9999999*((SIN(PI() * $loc[lat] / 180) * SIN(PI() * `locations`.`lat` / 180)) +
+ (COS(PI() * $loc[lat] / 180 ) * COS(PI() * `locations`.`lat` / 180) *
+ COS(PI() * `locations`.`long` / 180 - PI() * $loc[long] / 180)))), -1) AS `distance`, sum(`points`) as pts, `users`.*
+ FROM `locations`
+ inner join `users` on `users`.`locid` = `locations`.`id`
+ inner join `alerts` on `users`.`id`=`alerts`.`memid`
+ inner join `notary` on `users`.`id`=`notary`.`to`
+ WHERE (`alerts`.`general`=1 OR `alerts`.`country`=1 OR `alerts`.`regional`=1 OR `alerts`.`radius`=1)
+ GROUP BY `users`.`id`
+ HAVING `distance` <= '$maxdist'
+ ORDER BY `distance` ";
+ echo $query;
+
+ // comment next line when starting to send mail not only to me
+ // $query = "select * from `users` where `email` like 'cacerttest%'";
+
+ $res = mysql_query($query);
+ $xrows = mysql_num_rows($res);
+
+ while($row = mysql_fetch_assoc($res))
+ {
+ // uncomment next line to send mails ...
+ sendmail($row['email'], "[CAcert.org] $eventname - $city", $lines, "events@cacert.org", "", "", "CAcert Events Organisation", "returns@cacert.org", 1);
+ }
+ // 1x cc to events.cacert.org
+ sendmail("events@cacert.org", "[CAcert.org] $eventname - $city", $lines, "events@cacert.org", "", "", "CAcert Events Organisation", "returns@cacert.org", 1);
+ // 1x mailing report to events.cacert.org
+ sendmail("events@cacert.org", "[CAcert.org] $eventname - $city Report", "invitation sent to $xrows recipients.", "support@cacert.org", "", "", "CAcert Events Organisation", "returns@cacert.org", 1);
+
+ // 1x mailing report to Arbitrator of case http://wiki.cacert.org/wiki/Arbitrations/a20090525.1
+ sendmail("p.dunkel@cacert.org", "[CAcert.org] $eventname - $city Report", "invitation sent to $xrows recipients.", "support@cacert.org", "", "", "CAcert Events Organisation", "returns@cacert.org", 1);
+ echo "invitation sent to $xrows recipients.\n";
+
+?>
diff --git a/scripts/41de-ate-jena-email.txt b/scripts/41de-ate-jena-email.txt
new file mode 100644
index 0000000..f70dc85
--- /dev/null
+++ b/scripts/41de-ate-jena-email.txt
@@ -0,0 +1,33 @@
+CAcert Assurer Training Event Jena [Deutsch]
+::::::::::::::::::::::::::::::::::::::::::::
+
+Es hat sich viel getan im letzten Jahr. Eine ganze Reihe von bisher eher "muendlich ueberlieferten" Regeln wurden in Policies gegossen. Neue Prozeduren (z.B. die Assurer Challenge) und Verpflichtungen (z.B. in dem CAcert Community Agreement) wurden beschlossen. Die Assurer Training Events wollen versuchen, die ganzen Informationen unter’s Volk zu bringen:
+
+- Was hast du auf dem CAP Formular hinzuzufuegen, wenn du Minderjaehrige ueberpruefst ?
+- Warum solltest du dir R/L/O einpraegen ?
+- Wie verhaelst du dich, wenn du ein fremdes Ausweis Dokument das erste mal pruefst ?
+
+Antworten auf diese und weitere Fragen erhaelst du bei den Assurer Training Events (ATEs).
+
+Die kommende Veranstaltung in deiner Naehe findet statt am:
+
+Donnerstag den 29. Maerz 2012, 19:00 - 22:00
+
+Adresse: Am Johannisfriedhof 2, Jena
+Gebaeude: Universitaetsrechenzentrum der Friedrich-Schiller-Universitaet Jena
+OSM: [http://osm.org/go/0MAe9XhNp-]
+Webseite: [http://www.uni-jena.de/URZ.html]
+
+
+Das Veranstaltungs-Team freut sich schon auf Eure Teilnahme.
+
+Details zum Veranstaltungsort und Anfahrthinweise findet Ihr im
+Wiki [https://wiki.cacert.org/Events/2012-03-29ATE-Jena]
+Blog [http://blog.cacert.org/2012/03/550.html]
+
+
+
+Unverbindliche Anmeldung und Registrierung:
+Rueckantwort mit 'Ich moechte teilnehmen: ATE-Jena'
+
+Kontakt: events@cacert.org
diff --git a/scripts/41de-ate-jena-mail.php.txt b/scripts/41de-ate-jena-mail.php.txt
new file mode 100644
index 0000000..5691f63
--- /dev/null
+++ b/scripts/41de-ate-jena-mail.php.txt
@@ -0,0 +1,109 @@
+#!/usr/bin/php -q
+<? /*
+ LibreSSL - CAcert web application
+ Copyright (C) 2004-2009 CAcert Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+ include_once("../includes/mysql.php");
+
+ $lines = "";
+ $fp = fopen("41de-ate-jena-email.txt", "r");
+ while(!feof($fp))
+ {
+ $line = trim(fgets($fp, 4096));
+ $lines .= wordwrap($line, 75, "\n")."\n";
+ }
+ fclose($fp);
+
+
+// $locid = intval($_REQUEST['location']);
+// $maxdist = intval($_REQUEST['maxdist']);
+// maxdist in [Km] - changed to 350 to include glasgow + london
+ $maxdist = 200;
+
+
+// location location.ID
+// verified: 29.4.09 u.schroeter
+// $locid = 7902857; // Paris
+// $locid = 238568; // Bielefeld
+// $locid = 715191; // Hamburg
+// $locid = 1102495; // London
+// $locid = 520340; // Duesseldorf
+// $locid = 1260319; // Muenchen
+// $locid = 606058; // Frankfurt
+// $locid = 1775784; // Stuttgart
+// $locid = 228950; // Berlin
+// $locid = 606058; // Frankfurt
+// $locid = 599389; // Flensburg
+// $locid = 61065; // Amsterdam, Eemnes
+// $locid = 228950; // Berlin
+// $locid = 2138880; // Baltimore (Baltimore (city)), Maryland, US
+// $locid = 1486658; // Potsdam
+// $locid = 664715; // Goteborg, Vastra Gotaland, Sweden
+// $locid = 2094781; // Mission Hills (Los Angeles), California, US
+// $locid = 423655; // Copenhagen, Kobenhavn*, Denmark
+// $locid = 2257312; // Sydney, New South Wales, Australia
+// $locid = 572764; // Essen, Nordrhein-Westfalen, Germany
+// $locid = 78; // Aachen, Nordrhein-Westfalen, Germany
+// $locid = 266635; // Bonn, Nordrhein-Westfalen, Germany
+// $locid = 2102723; // Washington (District of Columbia, ..., US
+// $locid = 2177566; // New York (Bronx), New York, United States
+// $locid = 1486658; // Potsdam BLIT2011
+// $locid = 2237836; // Blacksburg (Montgomery), Virginia, United States
+// $locid = 1161640; // Manchester, Manchester, United Kingdom
+
+// ATE Jena, DE, Mar 29 2012
+ $locid = 803095; // Jena, Thueringen, Germany
+ $eventname = "ATE-Jena";
+ $city = "Mar 29, 2012";
+
+
+ $query = "select * from `locations` where `id`='$locid'";
+ $loc = mysql_fetch_assoc(mysql_query($query));
+
+ $query = "SELECT ROUND(6378.137 * ACOS(0.9999999*((SIN(PI() * $loc[lat] / 180) * SIN(PI() * `locations`.`lat` / 180)) +
+ (COS(PI() * $loc[lat] / 180 ) * COS(PI() * `locations`.`lat` / 180) *
+ COS(PI() * `locations`.`long` / 180 - PI() * $loc[long] / 180)))), -1) AS `distance`, sum(`points`) as pts, `users`.*
+ FROM `locations`
+ inner join `users` on `users`.`locid` = `locations`.`id`
+ inner join `alerts` on `users`.`id`=`alerts`.`memid`
+ inner join `notary` on `users`.`id`=`notary`.`to`
+ WHERE (`alerts`.`general`=1 OR `alerts`.`country`=1 OR `alerts`.`regional`=1 OR `alerts`.`radius`=1)
+ GROUP BY `users`.`id`
+ HAVING `distance` <= '$maxdist'
+ ORDER BY `distance` ";
+ echo $query;
+
+ // comment next line when starting to send mail not only to me
+ // $query = "select * from `users` where `email` like 'cacerttest%'";
+
+ $res = mysql_query($query);
+ $xrows = mysql_num_rows($res);
+
+ while($row = mysql_fetch_assoc($res))
+ {
+ // uncomment next line to send mails ...
+ sendmail($row['email'], "[CAcert.org] $eventname - $city", $lines, "events@cacert.org", "", "", "CAcert Events Organisation", "returns@cacert.org", 1);
+ }
+ // 1x cc to events.cacert.org
+ sendmail("events@cacert.org", "[CAcert.org] $eventname - $city", $lines, "events@cacert.org", "", "", "CAcert Events Organisation", "returns@cacert.org", 1);
+ // 1x mailing report to events.cacert.org
+ sendmail("events@cacert.org", "[CAcert.org] $eventname - $city Report", "invitation sent to $xrows recipients.", "support@cacert.org", "", "", "CAcert Events Organisation", "returns@cacert.org", 1);
+
+ // 1x mailing report to Arbitrator of case http://wiki.cacert.org/wiki/Arbitrations/a20090525.1
+ sendmail("p.dunkel@cacert.org", "[CAcert.org] $eventname - $city Report", "invitation sent to $xrows recipients.", "support@cacert.org", "", "", "CAcert Events Organisation", "returns@cacert.org", 1);
+ echo "invitation sent to $xrows recipients.\n";
+
+?>
diff --git a/scripts/42de-ate-leipzig-email.txt b/scripts/42de-ate-leipzig-email.txt
new file mode 100644
index 0000000..ea08a75
--- /dev/null
+++ b/scripts/42de-ate-leipzig-email.txt
@@ -0,0 +1,39 @@
+CAcert Assurer Training Event Leipzig
+::::::::::::::::::::::::::::::::::::::::::::::::::
+
+Es hat sich viel getan im letzten Jahr. Eine ganze Reihe von bisher eher "muendlich ueberlieferten" Regeln wurden in Policies gegossen. Neue Prozeduren (z.B. die Assurer Challenge) und Verpflichtungen (z.B. in dem CAcert Community Agreement) wurden beschlossen. Die Assurer Training Events wollen versuchen, die ganzen Informationen unter’s Volk zu bringen:
+
+- Was hast du auf dem CAP Formular hinzuzufuegen, wenn du Minderjaehrige ueberpruefst ?
+- Warum solltest du dir R/L/O einpraegen ?
+- Wie verhaelst du dich, wenn du ein fremdes Ausweis Dokument das erste mal pruefst ?
+
+Antworten auf diese und weitere Fragen erhaelst du bei den Assurer Training Events (ATEs).
+
+Die kommende Veranstaltung in deiner Naehe findet statt am:
+
+Dienstag den 10. April 2012, 19:00 - 22:00
+(Dienstag nach Ostern)
+
+Adresse:
+ Universtität Leipzig / Institut fĂ¼r Informatik
+ Johannisgasse 26 / Raum 1-40
+ 04103 Leipzig
+Webseite:
+ [http://www.informatik.uni-leipzig.de/ifi/]
+Lageplan:
+ [http://www.fmi.uni-leipzig.de/cms/service/lageplan.html]
+
+
+
+Das Veranstaltungs-Team freut sich schon auf Eure Teilnahme.
+
+Details zum Veranstaltungsort und Anfahrthinweise findet Ihr im
+Wiki [https://wiki.cacert.org/Events/2012-04-10ATE-Leipzig]
+Blog [http://blog.cacert.org/2012/03/555.html]
+
+
+
+Unverbindliche Anmeldung und Registrierung:
+Rueckantwort mit 'Ich moechte teilnehmen: ATE-Leipzig'
+
+Kontakt: events@cacert.org
diff --git a/scripts/42de-ate-leipzig-mail.php.txt b/scripts/42de-ate-leipzig-mail.php.txt
new file mode 100644
index 0000000..d0c02b7
--- /dev/null
+++ b/scripts/42de-ate-leipzig-mail.php.txt
@@ -0,0 +1,114 @@
+#!/usr/bin/php -q
+<? /*
+ LibreSSL - CAcert web application
+ Copyright (C) 2004-2009 CAcert Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+ include_once("../includes/mysql.php");
+
+ $lines = "";
+ $fp = fopen("42de-ate-leipzig-email.txt", "r");
+ while(!feof($fp))
+ {
+ $line = trim(fgets($fp, 4096));
+ $lines .= wordwrap($line, 75, "\n")."\n";
+ }
+ fclose($fp);
+
+
+// $locid = intval($_REQUEST['location']);
+// $maxdist = intval($_REQUEST['maxdist']);
+// maxdist in [Km] - changed to 350 to include glasgow + london
+ $maxdist = 200;
+
+
+// location location.ID
+// verified: 29.4.09 u.schroeter
+// $locid = 7902857; // Paris
+// $locid = 238568; // Bielefeld
+// $locid = 715191; // Hamburg
+// $locid = 1102495; // London
+// $locid = 520340; // Duesseldorf
+// $locid = 1260319; // Muenchen
+// $locid = 606058; // Frankfurt
+// $locid = 1775784; // Stuttgart
+// $locid = 228950; // Berlin
+// $locid = 606058; // Frankfurt
+// $locid = 599389; // Flensburg
+// $locid = 61065; // Amsterdam, Eemnes
+// $locid = 228950; // Berlin
+// $locid = 2138880; // Baltimore (Baltimore (city)), Maryland, US
+// $locid = 1486658; // Potsdam
+// $locid = 664715; // Goteborg, Vastra Gotaland, Sweden
+// $locid = 2094781; // Mission Hills (Los Angeles), California, US
+// $locid = 423655; // Copenhagen, Kobenhavn*, Denmark
+// $locid = 2257312; // Sydney, New South Wales, Australia
+// $locid = 572764; // Essen, Nordrhein-Westfalen, Germany
+// $locid = 78; // Aachen, Nordrhein-Westfalen, Germany
+// $locid = 266635; // Bonn, Nordrhein-Westfalen, Germany
+// $locid = 2102723; // Washington (District of Columbia, ..., US
+// $locid = 2177566; // New York (Bronx), New York, United States
+// $locid = 1486658; // Potsdam BLIT2011
+// $locid = 2237836; // Blacksburg (Montgomery), Virginia, United States
+// $locid = 1161640; // Manchester, Manchester, United Kingdom
+
+// ATE Jena, DE, Mar 29 2012
+// $locid = 803095; // Jena, Thueringen, Germany
+// $eventname = "ATE-Jena";
+// $city = "Mar 29, 2012";
+
+// ATE Leipzig, DE, Apr 10 2012
+ $locid = 1067965; // Leipzig, Sachsen, Germany
+ $eventname = "ATE-Leipzig";
+ $city = "Apr 10, 2012";
+
+
+ $query = "select * from `locations` where `id`='$locid'";
+ $loc = mysql_fetch_assoc(mysql_query($query));
+
+ $query = "SELECT ROUND(6378.137 * ACOS(0.9999999*((SIN(PI() * $loc[lat] / 180) * SIN(PI() * `locations`.`lat` / 180)) +
+ (COS(PI() * $loc[lat] / 180 ) * COS(PI() * `locations`.`lat` / 180) *
+ COS(PI() * `locations`.`long` / 180 - PI() * $loc[long] / 180)))), -1) AS `distance`, sum(`points`) as pts, `users`.*
+ FROM `locations`
+ inner join `users` on `users`.`locid` = `locations`.`id`
+ inner join `alerts` on `users`.`id`=`alerts`.`memid`
+ inner join `notary` on `users`.`id`=`notary`.`to`
+ WHERE (`alerts`.`general`=1 OR `alerts`.`country`=1 OR `alerts`.`regional`=1 OR `alerts`.`radius`=1)
+ GROUP BY `users`.`id`
+ HAVING `distance` <= '$maxdist'
+ ORDER BY `distance` ";
+ echo $query;
+
+ // comment next line when starting to send mail not only to me
+ // $query = "select * from `users` where `email` like 'cacerttest%'";
+
+ $res = mysql_query($query);
+ $xrows = mysql_num_rows($res);
+
+ while($row = mysql_fetch_assoc($res))
+ {
+ // uncomment next line to send mails ...
+ sendmail($row['email'], "[CAcert.org] $eventname - $city", $lines, "events@cacert.org", "", "", "CAcert Events Organisation", "returns@cacert.org", 1);
+ }
+ // 1x cc to events.cacert.org
+ sendmail("events@cacert.org", "[CAcert.org] $eventname - $city", $lines, "events@cacert.org", "", "", "CAcert Events Organisation", "returns@cacert.org", 1);
+ // 1x mailing report to events.cacert.org
+ sendmail("events@cacert.org", "[CAcert.org] $eventname - $city Report", "invitation sent to $xrows recipients.", "support@cacert.org", "", "", "CAcert Events Organisation", "returns@cacert.org", 1);
+
+ // 1x mailing report to Arbitrator of case http://wiki.cacert.org/wiki/Arbitrations/a20090525.1
+ sendmail("p.dunkel@cacert.org", "[CAcert.org] $eventname - $city Report", "invitation sent to $xrows recipients.", "support@cacert.org", "", "", "CAcert Events Organisation", "returns@cacert.org", 1);
+ echo "invitation sent to $xrows recipients.\n";
+
+?>
diff --git a/scripts/43de-ate-karlsruhe-email.txt b/scripts/43de-ate-karlsruhe-email.txt
new file mode 100644
index 0000000..26af21c
--- /dev/null
+++ b/scripts/43de-ate-karlsruhe-email.txt
@@ -0,0 +1,103 @@
+[Deutsch]
+
+Es hat sich viel getan im letzten Jahr. Eine ganze Reihe von bisher
+eher "muendlich ueberlieferten" Regeln wurden in Policies gegossen.
+Neue Prozeduren (z.B. die Assurer Challenge) und Verpflichtungen (z.B. in dem CAcert Community Agreement) wurden beschlossen. Die Assurer Training Events wollen versuchen, die ganzen Informationen unter’s Volk zu bringen:
+
+- Welcher Satz fehlt auf alten CAP Formularen?
+- Warum soll ich mir R/L/O einpraegen?
+- Wie verhaelst du dich, wenn du ein fremdes Ausweis Dokument das erste mal pruefst?
+
+Antworten auf diese und weitere Fragen erhaelst du bei den Assurer Training Events (ATEs).
+
+Darueberhinaus wird beim ATE der Vorgang der Identitaetsueberpruefung trainiert und auditiert, um die Qualitaet der Assurances in der taeglichen Praxis zu erfassen. Dabei gilt es moegliche Fehler und Fallstricke zu erkennen und aufzudecken. Die Assurer haben also die Moeglichkeit, sich mit den Fehlern auseinanderzusetzen und zu erfahren, wie diese vermieden werden koennen.
+
+As IanG said: The ATE or Assurer Training Event is exceptionally recommended for all Assurers, and include parts which contribute directly to our audit. Come and find out how you can also contribute.
+
+Die kommende Veranstaltung in deiner Naehe findet statt am:
+
+- Dienstag, den 15. Mai 2012
+- in der Zeit von: 19:00 - ca. 22:00 Uhr
+- Raum: New York
+- im FZI Forschungszentrum Informatik
+- Haid-und-Neu-Str. 10-14
+- 76131 Karlsruhe
+
+Details zum Veranstaltungsort und Anfahrthinweise findet Ihr im
+Wiki [http://wiki.cacert.org/Events/2012-05-15ATE-Karlsruhe]
+Blog [http://blog.cacert.org/2012/04/559.html]
+
+Teilnehmer Registrierung mit Rueckantwort:
+ 'Ich moechte am ATE-Karlsruhe teilnehmen'
+
+Das Veranstaltungs-Team freut sich schon auf Eure Teilnahme.
+
+Kontakt: events@cacert.org
+
+
+[French]
+
+Bon nombre de changements ont eu lieu au cours de la derniere annee au sein de CAcert. Beaucoup de regles "orales" ont ete transformees en reglements ("Policies"). De nouvelles procedures (par exemple le Challenge Assureur) et devoirs (par exemple le CAcert Community Agreement) ont ete activees. Les Assurer Training Events essaient de propager ces informations :
+
+- Que manque-t-il sur les "anciens" formulaires CAP ?
+- Pourquoi dois-je me souvenir de R/L/O ?
+- Que faire si une personne vous montre un document d'identite qui vous est inconnu ?
+
+Durant les Assurer Training Events (ATEs) vous recevrez les reponses a ces questions et a plein d'autres.
+
+De plus, les ATE vous permettent de vous entrainer a verifier les identites. Ceci sera audite afin de mesurer la qualite des assurances effectuees dans la routine quotidienne. On essaiera de vous induire en erreur. Vous aurez ainsi la possibilite de voir les problemes et d'apprendre a dejouer les pieges.
+
+Comme IanG l'a dit : il est fortement recommande aux assureurs de participer aux ATE. Le programmme contient des parties qui entrent directement en ligne de compte pour le succes de notre audit. Venez et decouvrez comment contribuer.
+
+Le prochain ATE qui aura lieu pres de chez vous sera :
+- Mardi le 15 mai 2012
+- de 19:00 a environ 22:00
+- Chambre: New York
+- dans le FZI Forschungszentrum Informatik
+- Haid-und-Neu-Str. 10-14
+- 76131 Karlsruhe
+
+NB : les exposes auront lieu en Allemand
+
+Plus de renseignements sur le lieu :
+Wiki [http://wiki.cacert.org/Events/2012-05-15ATE-Karlsruhe]
+Blog [http://blog.cacert.org/2012/04/559.html]
+
+Pour participer, repondez a ce courriel : 'Je viendrais au ATE-Karlsruhe'
+
+Le comite d'organisation se rejouit de votre venue.
+
+Contact: events@cacert.org
+
+[English]
+
+During the last year many changes took place inside CAcert. Many "oral" rules have been put into Policies. New procedures (e.g. Assurer Challenge) and obligations (e.g. CAcert Community Agreement) have been put into live. The Assurer Training Events (ATE) try to spread this information:
+
+- What is missing on the "old" CAP forms?
+- Why should I remember R/L/O?
+- What can you do if an Assuree shows an ID document unknown to you?
+
+These and more questions will be answered during the Assurer Training Events (ATEs)
+
+Furthermore, the ATE trains how to do assurances and audits assurances, to measure the quality of assurances in the daily routine. Here are some possible errors and pitfalls which need to be found. Assurers have the opportunity to see those errors and how to avoid them.
+
+As IanG said: The ATE or Assurer Training Event is exceptionally recommended for all Assurers and includes parts which contribute directly to our audit. Come and find out how you can also contribute.
+
+The next event held in your area will be:
+
+- Tuesday 15th Mai 2012
+- during 19:00 - ca. 22:00
+- Room: New York
+- in the FZI Forschungszentrum Informatik
+- Haid-und-Neu-Str. 10-14
+- 76131 Karlsruhe
+
+Details to the location can be found:
+Wiki [http://wiki.cacert.org/Events/2012-05-15ATE-Karlsruhe]
+Blog [http://blog.cacert.org/2012/04/559.html]
+
+User reply for registration: 'I will attend the ATE-Karlsruhe'
+
+The event team is looking forward for your attendance:
+
+Contact: events@cacert.org
diff --git a/scripts/43de-ate-karlsruhe-mail.php.txt b/scripts/43de-ate-karlsruhe-mail.php.txt
new file mode 100644
index 0000000..afea2f2
--- /dev/null
+++ b/scripts/43de-ate-karlsruhe-mail.php.txt
@@ -0,0 +1,155 @@
+#!/usr/bin/php -q
+<? /*
+ LibreSSL - CAcert web application
+ Copyright (C) 2004-2009 CAcert Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+ include_once("../includes/mysql.php");
+
+ $lines = "";
+ $fp = fopen("43de-ate-karlsruhe-email.txt", "r");
+ while(!feof($fp))
+ {
+ $line = trim(fgets($fp, 4096));
+ $lines .= wordwrap($line, 75, "\n")."\n";
+ }
+ fclose($fp);
+
+
+// $locid = intval($_REQUEST['location']);
+// $maxdist = intval($_REQUEST['maxdist']);
+// maxdist in [Km]
+ $maxdist = 200;
+
+
+// location location.ID
+// verified: 29.4.09 u.schroeter
+// $locid = 7902857; // Paris
+// $locid = 238568; // Bielefeld
+// $locid = 715191; // Hamburg
+// $locid = 1102495; // London
+// $locid = 520340; // Duesseldorf
+// $locid = 1260319; // Muenchen
+// $locid = 606058; // Frankfurt
+// $locid = 1775784; // Stuttgart
+// $locid = 228950; // Berlin
+// $locid = 606058; // Frankfurt
+// $locid = 599389; // Flensburg
+// $locid = 61065; // Amsterdam, Eemnes
+// $locid = 228950; // Berlin
+
+// Software Freedom Day 19. Sept 2009
+// $locid = 715191; // Hamburg
+
+// LISA2009 Baltimore, 1.11.2009
+// $locid = 2138880; // Baltimore (Baltimore (city)), Maryland, United States
+// $city = "Baltimore, MD - Nov. 3rd 2009";
+
+// OpenSourceTreffen-Muenchen, 20.11.2009
+// $locid = 1260319; // Muenchen
+// $city = "Muenchen - 20. Nov 2009";
+
+// BLIT2009, Brandenburger Linux-Infotag, 21.11.2009
+// $locid = 1486658; // Potsdam
+// $eventname = "Brandenburger Linux-Infotag (BLIT2009)";
+// $city = "Potsdam - 21. Nov 2009";
+
+// ATE-Goteborg, 16.12.2009
+// $locid = 664715; // Goteborg, Vastra Gotaland, Sweden
+// $eventname = "ATE-Goteborg";
+// $city = "Goteborg - Dec 16th 2009";
+
+// Assurance Event Mission Hills CA, 15.01.2010
+// $locid = 2094781; // Mission Hills (Los Angeles), California, United States
+// $eventname = "Assurance Event";
+// $city = "Mission Hills CA - Jan 15th 2010";
+
+// Assurance Event OSD Copenhagen DK, 5.03.2010
+// $locid = 423655; // Copenhagen, Kobenhavn*, Denmark
+// $eventname = "Assurance Event OpenSource-Days 2010";
+// $city = "Copenhagen DK - March 5th/6th 2010";
+
+// SCALE 8x Los Angeles, CA, Feb 19-21 2010
+// $locid = 2093625; // Copenhagen, Kobenhavn*, Denmark
+// $eventname = "SCALE 8x 2010";
+// $city = "Los Angeles, CA - February 19-21 2010";
+
+// ATE Sydney, AU, Mar 24 2010
+// $locid = 2257312; // Sydney, New South Wales, Australia
+// $eventname = "ATE-Sydney";
+// $city = "March 24, 2010";
+
+// ATE Essen, DE, Sept 28 2010
+// $locid = 572764; // Essen, Nordrhein-Westfalen, Germany
+// $eventname = "ATE-Essen";
+// $city = "September 28, 2010";
+
+// ATE Aachen, DE, Oct 4th 2010
+// $locid = 78; // Aachen, Nordrhein-Westfalen, Germany
+// $eventname = "ATE-Aachen";
+// $city = "October 4th, 2010";
+
+// ATE Muenchen, DE, Apr 2nd 2011
+// $locid = 1260319; // Muenchen
+// $eventname = "ATE-Muenchen";
+// $city = "2. April, 2011";
+
+// ATE Bonn, DE, Jun 8th 2011
+// $locid = 266635; // Bonn, Nordrhein-Westfalen, Germany
+// $eventname = "ATE-Bonn";
+// $city = "8. Juni, 2011";
+
+// ATE Karlsruhe, DE, May 15th 2012
+ $locid = 873779; // Karlsruhe, Baden-Wuerttemberg, Germany
+ $eventname = "ATE-Karlsruhe";
+ $city = "15. May 2012";
+
+ $query = "select * from `locations` where `id`='$locid'";
+ $loc = mysql_fetch_assoc(mysql_query($query));
+
+ $query = "SELECT ROUND(6378.137 * ACOS(0.9999999*((SIN(PI() * $loc[lat] / 180) * SIN(PI() * `locations`.`lat` / 180)) +
+ (COS(PI() * $loc[lat] / 180 ) * COS(PI() * `locations`.`lat` / 180) *
+ COS(PI() * `locations`.`long` / 180 - PI() * $loc[long] / 180)))), -1) AS `distance`, sum(`points`) as pts, `users`.*
+ FROM `locations`
+ inner join `users` on `users`.`locid` = `locations`.`id`
+ inner join `alerts` on `users`.`id`=`alerts`.`memid`
+ inner join `notary` on `users`.`id`=`notary`.`to`
+ WHERE (`alerts`.`general`=1 OR `alerts`.`country`=1 OR `alerts`.`regional`=1 OR `alerts`.`radius`=1)
+ GROUP BY `users`.`id`
+ HAVING `distance` <= '$maxdist'
+ ORDER BY `distance` ";
+ echo $query;
+
+ // comment next line when starting to send mail not only to me
+ // $query = "select * from `users` where `email` like 'cacerttest%'";
+
+ $res = mysql_query($query);
+ $xrows = mysql_num_rows($res);
+
+ while($row = mysql_fetch_assoc($res))
+ {
+ // uncomment next line to send mails ...
+ sendmail($row['email'], "[CAcert.org] $eventname - $city", $lines, "events@cacert.org", "", "", "CAcert Events Organisation", "returns@cacert.org", 1);
+ }
+ // 1x cc to events.cacert.org
+ sendmail("events@cacert.org", "[CAcert.org] $eventname - $city", $lines, "events@cacert.org", "", "", "CAcert Events Organisation", "returns@cacert.org", 1);
+ // 1x mailing report to events.cacert.org
+ sendmail("events@cacert.org", "[CAcert.org] $eventname - $city Report", "invitation sent to $xrows recipients.", "support@cacert.org", "", "", "CAcert Events Organisation", "returns@cacert.org", 1);
+
+ // 1x mailing report to Arbitrator of case http://wiki.cacert.org/wiki/Arbitrations/a20090525.1
+ sendmail("p.dunkel@cacert.org", "[CAcert.org] $eventname - $city Report", "invitation sent to $xrows recipients.", "support@cacert.org", "", "", "CAcert Events Organisation", "returns@cacert.org", 1);
+ echo "invitation sent to $xrows recipients.\n";
+
+?>
diff --git a/scripts/cron/permissionreview.php b/scripts/cron/permissionreview.php
new file mode 100755
index 0000000..572c1fd
--- /dev/null
+++ b/scripts/cron/permissionreview.php
@@ -0,0 +1,102 @@
+#!/usr/bin/php -q
+<?php
+/*
+LibreSSL - CAcert web application
+Copyright (C) 2004-2012 CAcert Inc.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; version 2 of the License.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+
+require_once(dirname(__FILE__).'/../../includes/mysql.php');
+
+$BOARD_PRIVATE = 'cacert-board-private@lists.cacert.org';
+
+$flags = array(
+ 'admin' => 'Support Engineer',
+ 'orgadmin' => 'Organisation Assurer',
+ 'board' => 'Board Member',
+ 'ttpadmin' => 'Trusted Third Party Admin',
+ 'tverify' => 'Tverify Admin',
+ 'locadmin' => 'Location Admin'
+ );
+
+$adminlist = array();
+
+foreach ($flags as $flag => $description) {
+ $query = "select `fname`, `lname`, `email` from `users` where `$flag` = 1";
+ if(! $res = mysql_query($query) ) {
+ fwrite(STDERR,
+ "MySQL query for flag $flag failed:\n".
+ "\"$query\"\n".
+ mysql_error()
+ );
+
+ continue;
+ }
+
+ $admins = array();
+ $adminlist[$flag] = "";
+
+ while ($row = mysql_fetch_assoc($res)) {
+ $admins[] = $row;
+ $adminlist[$flag] .= "$row[fname] $row[lname] $row[email]\n";
+ }
+
+ foreach ($admins as $admin) {
+ $message = <<<EOF
+Hello $admin[fname],
+
+you get this message, because you are listed as $description on
+CAcert.org. Please review the following list of persons with the same privilege
+and report to the responsible team leader or board
+($BOARD_PRIVATE) if you spot any errors.
+
+$adminlist[$flag]
+
+
+Best Regards,
+CAcert Support
+EOF;
+ sendmail($admin['email'], "Permissions Review", $message, 'support@cacert.org');
+ }
+}
+
+
+
+$message = <<<EOF
+Dear Board Members,
+
+it's time for the permission review again. Here is the list of privileged users
+in the CAcert web application. Please review them and also ask the persons
+responsible for an up-to-date copy of access lists not directly recorded in the
+web application (critical admins, software assessors etc.)
+
+
+EOF;
+
+foreach ($flags as $flag => $description) {
+ $message .= <<<EOF
+List of ${description}s:
+$adminlist[$flag]
+
+EOF;
+}
+
+$message .= <<<EOF
+
+Best Regards,
+CAcert Support
+EOF;
+
+sendmail($BOARD_PRIVATE, "Permissions Review", $message, 'support@cacert.org');
diff --git a/scripts/removedead.php b/scripts/cron/removedead.php
index 7e47c7f..aadda81 100755
--- a/scripts/removedead.php
+++ b/scripts/cron/removedead.php
@@ -17,7 +17,8 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
- include_once("/home/cacert/www/includes/mysql.php");
+ require_once(dirname(__FILE__).'/../../includes/mysql.php');
+ require_once(dirname(__FILE__).'/../../includes/lib/l10n.php');
$query = "select * from `users` where `users`.`verified`=0 and
(UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(`users`.`created`)) >= 172800";
@@ -67,9 +68,7 @@
if($data['language'] != "")
{
- $userlang = $data['language'];
- putenv("LANG=".$userlang);
- setlocale(LC_ALL, $userlang);
+ L10n::set_translation($data['language']);
}
$body = _("You are receiving this email because you had a temporary increase to 200 points. This has since expired and you have been reduced to 150 points.")."\n\n";
diff --git a/scripts/updatesort.php b/scripts/cron/updatesort.php
index 4d36bfc..498eda2 100755
--- a/scripts/updatesort.php
+++ b/scripts/cron/updatesort.php
@@ -16,12 +16,27 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
- include_once("../includes/mysql.php");
+ require_once(dirname(__FILE__).'/../../includes/mysql.php');
- //mysql_query("update users set assurer=0");
- $query = "select notary.`to` as uid from notary group by notary.`to` having sum(points)>=100;";
+ /* Set assurer flag for accounts who miss it
+
+ See also includes/lib/account.php, function fix_assurer_flag($userID)
+
+ We may have some performance problems here, there are 150k assurances and 220k users
+ in the production database. The exists-clause on cats_passed should be a good filter... */
+
+ /* Synchronisation of assurer flag currently deactivated, see https://bugs.cacert.org/view.php?id=1003
+ and https://bugs.cacert.org/view.php?id=1024 */
+/*
+ $query = "select `n`.`to` as `uid` from `notary` as `n`, `users` as `u` ".
+ " where `n`.`to`=`u`.`id` and `u`.`assurer`<>'1' ".
+ " and (`n`.`expire` > now() OR `n`.`expire` IS NULL) ".
+ " and exists(select 1 from `cats_passed` as `cp`, `cats_variant` as `cv` ".
+ " where `cp`.`variant_id`=`cv`.`id` and `cv`.`type_id` = 1 and `cp`.`user_id`=`n`.`to`)".
+ " group by `n`.`to` having sum(`n`.`points`)>=100";
+
$res = mysql_query($query);
while($row = mysql_fetch_assoc($res))
{
@@ -29,7 +44,28 @@
//echo $query."\n";
mysql_query($query);
}
-
+*/
+ /* Remove assurer flag from accounts not eligible.
+
+ Also a bit performance critical, but assurer flag is only set at 5k accounts
+
+ */
+ /* Synchronisation of assurer flag currently deactivated, see https://bugs.cacert.org/view.php?id=1003
+ and https://bugs.cacert.org/view.php?id=1024 */
+/*
+ $query = "select `u`.id as `uid` from `users` as `u` " .
+ " where `u`.`assurer` = '1' ".
+ " and (not exists(select 1 from `cats_passed` as `cp`, `cats_variant` as `cv` ".
+ " where `cp`.`variant_id`=`cv`.`id` and `cv`.`type_id` = 1 and `cp`.`user_id`=`u`.`id`) ".
+ " or (select sum(`n`.`points`) from `notary` as `n` where `n`.`to`=`u`.`id` and (`n`.`expire` > now() OR `n`.`expire` IS NULL)) < 100) ";
+ $res = mysql_query($query);
+ while($row = mysql_fetch_assoc($res))
+ {
+ $query = "update users set `assurer`='0' where `id`='${row['uid']}'";
+ //echo $query."\n";
+ mysql_query($query);
+ }
+*/
mysql_query("update `locations` set `acount`=0");
$query = "SELECT `users`.`locid` AS `locid`, count(*) AS `total` FROM `users`
@@ -72,6 +108,4 @@
}
-
-
?>
diff --git a/scripts/warning.php b/scripts/cron/warning.php
index b578c09..18e89da 100755
--- a/scripts/warning.php
+++ b/scripts/cron/warning.php
@@ -17,7 +17,7 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
- include_once("/home/cacert/www/includes/mysql.php");
+ require_once(dirname(__FILE__).'/../../includes/mysql.php');
$days = array("1" => "3", "15" => "2", "30" => "1", "45" => "0");
diff --git a/www/advertising.php b/www/advertising.php
index e987461..43e4f93 100644
--- a/www/advertising.php
+++ b/www/advertising.php
@@ -47,7 +47,7 @@
if($months < 1 || $months > 12)
{
$id = 1;
- $errmsg .= _("You can only place an advertisement for up to 12 months.<br />");
+ $errmsg .= _("You can only place an advertisement for up to 12 months.")."<br />";
$process="";
$oldid=0;
}
@@ -55,7 +55,7 @@
if(strlen($title) <= 5)
{
$id = 1;
- $errmsg .= _("Link title was too short.<br />");
+ $errmsg .= _("Link title was too short.")."<br />";
$process="";
$oldid=0;
}
@@ -63,7 +63,7 @@
if(strlen($link) <= 10)
{
$id = 1;
- $errmsg .= _("Link URI was too short.<br />");
+ $errmsg .= _("Link URI was too short.")."<br />";
$process="";
$oldid=0;
}
diff --git a/www/cap.php b/www/cap.php
index 6b08d38..73380e1 100644
--- a/www/cap.php
+++ b/www/cap.php
@@ -15,7 +15,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
- if($_SESSION['_config']['language'] != "ja_JP")
+ if($_SESSION['_config']['language'] != "ja")
{
define('FPDF_FONTPATH','/usr/share/fpdf/font/');
require_once('/usr/share/ufpdf/fpdf.php');
@@ -35,7 +35,7 @@
{
$this->Image((array_key_exists('bw',$_REQUEST) && $_REQUEST['bw'])?'images/CAcert-logo-mono-1000.png':'images/CAcert-logo-colour-1000.png',8,8,100);
$this->SetFont('Arial','B',14);
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','',14);
$this->Cell(100);
$this->Cell(40,20,recode($_SESSION['_config']['recode'], _("CAcert Assurance Programme")));
@@ -46,12 +46,12 @@
$this->SetY(36);
$this->SetFont('Arial','I',8);
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','I',8);
$this->Cell(0,0,'CAcert Inc. - P.O. Box 4107 - Denistone East NSW 2112 - Australia - http://www.CAcert.org',0,0,'C');
$this->Ln(3);
$this->SetFont('Arial','',6);
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','',6);
$this->Cell(0,0, recode($_SESSION['_config']['recode'], _("CAcert's Root Certificate fingerprints")).": A6:1B:37:5E:39:0D:9C:36:54:EE:BD:20:31:46:1F:6B "._("and")." 135C EC36 F49C B8E9 3B1A B270 CD80 8846 76CE 8F33",0,0,'C');
$this->SetLineWidth(0.05);
@@ -71,7 +71,7 @@
// Show text blurb at top of page
$this->SetY(45);
$this->SetFont('Arial','',10);
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','',10);
$this->Write(4,sprintf(recode($_SESSION['_config']['recode'], _("To the Assurer: The CAcert Assurance Programme (CAP) aims to verify the identities of Internet users through face-to-face witnessing of government issued identity documents. The Applicant asks you to verify to CAcert.org that you have met them and verified their identity against one or more original, trusted, government photo identity documents. If you have ANY doubts or concerns about the Applicant's identity, DO NOT COMPLETE OR SIGN this form. For more information about the CAcert Assurance Programme, including detailed guides for CAcert Assurers, please visit: %s")), "http://www.CAcert.org"));
$this->Ln(10);
@@ -84,21 +84,21 @@
$this->Rect(11, $top, $this->w - 25, 60, "D"); //50 -> 60
$this->SetXY(11, $top + 5);
$this->SetFont("Arial", "BUI", "20");
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','BUI',20);
$this->Write(0, recode($_SESSION['_config']['recode'], _("Applicant's Statement")));
$this->Rect(13, $top + 10, $this->w - 29, 6, "D");
$this->Line(80, $top + 10, 80, $top + 16);
$this->SetXY(15, $top + 13);
$this->SetFont("Arial", "B", "12");
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','B',12);
$this->Write(0, recode($_SESSION['_config']['recode'], _("Names")).":");
if($name)
{
$this->SetXY(82, $top + 13);
$this->SetFont("Arial", '', "11");
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','',11);
$this->Write(0, $name);
}
@@ -106,18 +106,18 @@
$this->Line(80, $top + 16, 80, $top + 22);
$this->SetXY(15, $top + 19);
$this->SetFont("Arial", "B", "12");
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','B',12);
$this->Write(0, recode($_SESSION['_config']['recode'], _("Date of Birth")).": ");
$this->SetFont("Arial", "", "8");
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','',8);
$this->Write(0, "(".recode($_SESSION['_config']['recode'], _("YYYY-MM-DD")).")");
if($dob)
{
$this->SetXY(82, $top + 19);
$this->SetFont("Arial", "", "11");
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','',11);
$this->Write(0, $dob);
}
@@ -125,26 +125,26 @@
$this->Line(80, $top + 22, 80, $top + 28);
$this->SetXY(15, $top + 25);
$this->SetFont("Arial", "B", "12");
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','B',12);
$this->Write(0, recode($_SESSION['_config']['recode'], _("Email Address")).":");
if($email)
{
$this->SetXY(82, $top + 25);
$this->SetFont("Arial", "", "11");
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','',11);
$this->Write(0, $email);
}
$this->SetXY(13, $top + 32);
$this->SetFont("Arial", "", "9");
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','',9);
$this->MultiCell($this->w - 29, 3, recode($_SESSION['_config']['recode'], _("I hereby confirm that the information stated above is both true and correct, and request the CAcert Assurer (identified below) to verify me according to CAcert Assurance Policy.")));
// new da start
$this->SetXY(13, $top + 42);
$this->SetFont("Arial", "", "9");
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','',9);
$this->MultiCell($this->w - 29, 3, recode($_SESSION['_config']['recode'], _("I agree to the CAcert Community Agreement.")." ( http://www.cacert.org/policy/CAcertCommunityAgreement.php )"));
// new da end
@@ -157,7 +157,7 @@
$this->Write(0, "20___-___-___");
} else {
$this->SetFont("Arial", "U", "10");
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','U',10);
$this->Write(0, str_pad($date, 13, " "));
}
@@ -167,18 +167,18 @@
$this->Rect(11, $top, $this->w - 25, 83, "D"); //63->93
$this->SetXY(11, $top + 5);
$this->SetFont("Arial", "BUI", "20");
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','BUI',20);
$this->Write(0, recode($_SESSION['_config']['recode'], _("CAcert Assurer")));
$this->SetFont("Arial", "", "9");
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','',9);
$this->SetXY(13, $top + 15);
if($assurer)
{
$this->Write(0, recode($_SESSION['_config']['recode'], _("Assurer's Name")).": ");
$this->SetFont("Arial", "", "10");
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','U',10);
// $this->MultiCell($this->w - 70, 2, recode($_SESSION['_config']['recode'], $assurer));
$this->Write(0, str_pad($assurer, 50, " "));
@@ -187,7 +187,7 @@
$this->Write(0, recode($_SESSION['_config']['recode'], _("Assurer's Name")).": ________________________________________________________________");
}
$this->SetFont("Arial", "", "9");
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','',9);
$this->SetXY(13, $top + 22);
$this->MultiCell($this->w - 34, 3, recode($_SESSION['_config']['recode'], _("Photo ID Shown: (ID types, not numbers. eg Drivers license, Passport)")));
@@ -198,12 +198,12 @@
} else {
$this->Write(0, "1. ");
$this->SetFont("Arial", "U", "10");
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','U',10);
$this->Write(0, str_pad($document1, 90, " "));
}
$this->SetFont("Arial", "", "9");
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','',9);
$this->SetXY(13, $top + 35);
if($document2 == "")
@@ -212,12 +212,12 @@
} else {
$this->Write(0, "2. ");
$this->SetFont("Arial", "U", "10");
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','U',10);
$this->Write(0, str_pad($document2, 90, " "));
}
$this->SetFont("Arial", "", "9");
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','',9);
$this->SetXY(13, $top + 45);
$this->Write(0, recode($_SESSION['_config']['recode'], _("Location of Face-to-face Meeting")).": ");
@@ -226,12 +226,12 @@
$this->Write(0, "_____________________________________________");
} else {
$this->SetFont("Arial", "U", "10");
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','U',10);
$this->Write(0, str_pad($location, 70, " "));
}
$this->SetFont("Arial", "", "9");
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','',9);
$this->SetXY(13, $top + 50);
if($maxpoints > 0)
@@ -241,7 +241,7 @@
$this->Write(0, recode($_SESSION['_config']['recode'], _("Points Allocated")).": ______________");
}
$this->SetFont("Arial", "", "9");
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','',9);
$this->SetXY(13, $top + 54);
$this->MultiCell($this->w - 33, 3, recode($_SESSION['_config']['recode'], _("I, the Assurer, hereby confirm that I have verified the Member according to CAcert Assurance Policy.")));
@@ -249,7 +249,7 @@
$this->MultiCell($this->w - 33, 3, recode($_SESSION['_config']['recode'], _("I am a CAcert Community Member, have passed the Assurance Challenge, and have been assured with at least 100 Assurance Points.")));
$this->SetFont("Arial", "", "9");
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','',9);
$this->SetXY(13, $top + 74); //22->67
$this->Write(0, recode($_SESSION['_config']['recode'], _("Assurer's signature")).": __________________________________");
@@ -260,7 +260,7 @@
$this->Write(0, "20___-___-___");
} else {
$this->SetFont("Arial", "U", "10");
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','U',10);
$this->Write(0, str_pad($date, 13, " "));
}
@@ -277,7 +277,7 @@
$maxpoints = 0;
$pdf = new PDF('P', 'mm', $format);
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$pdf->AddSJISFont();
$pdf->Open();
$pdf->AddPage();
diff --git a/www/capnew.php b/www/capnew.php
index 3136993..41a0894 100644
--- a/www/capnew.php
+++ b/www/capnew.php
@@ -17,8 +17,8 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-// $Id: capnew.php,v 1.3 2011-06-10 18:30:41 wytze Exp $
-define('REV', '$Revision: 1.3 $');
+// $Id: capnew.php,v 1.4 2012-01-24 14:26:05 root Exp $
+define('REV', '$Revision: 1.4 $');
/*
** Created from old cap.php 2003, which used the now obsoleted ftpdf package
@@ -168,7 +168,7 @@ define('REV', '$Revision: 1.3 $');
** $_GET['format'] paper format required A0-A6,Letter, Folio, B0-B6 (dflt A4)
** $_GET['watermark'] watermark on the page
** $_GET['orientation'] paper orientation default 'portrait'
-** $_SESSION['_config']['language'] for 'ja_JP' japanese default != ja_JP
+** $_SESSION['_config']['language'] for 'ja' japanese default != ja
** $_SESSION['_config']['recode'] = 'format' recode() uses it: needed ?
** recode() is aliased to php lib function recode_string()
** $_REQUEST['bw'] if exists use black/white, default use colour
@@ -336,7 +336,7 @@ define('DFL_FORMAT', 'html..utf-8');
// Japanese is not supported?
if( array_key_exists('_config', $_SESSION) ) {
if( isset($_SESSION['_config']['language']) ) {
- if($_SESSION['_config']['language'] == 'ja_JP')
+ if($_SESSION['_config']['language'] == 'ja')
define('FONT','SJIS');
else define( 'FONT', 'freesans');
}
@@ -387,7 +387,7 @@ function utf8_is_ascii_ctrl($str) {
// extend TCPF with custom functions
class CAPPDF extends TCPDF {
- // do cap form version numbering automatically '$Revision: 1.3 $'
+ // do cap form version numbering automatically '$Revision: 1.4 $'
/*public*/ function Version() {
strtok(REV, ' ');
return(strtok(' '));
diff --git a/www/cats/cats_import.php b/www/cats/cats_import.php
index 56dd0cf..feb92d4 100644
--- a/www/cats/cats_import.php
+++ b/www/cats/cats_import.php
@@ -31,8 +31,8 @@ function sanitize_string($buffer) {
}
define ('UNDEFINED', 'nd');
-define ('ALLOWED_IP', '213.154.225.228');
-define ('ALLOWED_IP2', '193.238.157.112');
+define ('ALLOWED_IP', '213.154.225.243');
+define ('ALLOWED_IP2', '172.16.2.27');
define ('CONFIG_FILEPATH', '/www/');
$remote_addr = (isset($_SERVER['REMOTE_ADDR']))?$_SERVER['REMOTE_ADDR']:UNDEFINED;
diff --git a/www/coapnew.php b/www/coapnew.php
index c9e4e47..4f69247 100644
--- a/www/coapnew.php
+++ b/www/coapnew.php
@@ -17,8 +17,8 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-// $Id: coapnew.php,v 1.3 2011-06-10 18:30:42 wytze Exp $
-define('REV', '$Revision: 1.3 $');
+// $Id: coapnew.php,v 1.4 2012-01-24 14:26:05 root Exp $
+define('REV', '$Revision: 1.4 $');
/*
** Created from old cap.php 2003, which used the now obsoleted ftpdf package
@@ -179,7 +179,7 @@ define('REV', '$Revision: 1.3 $');
** $_GET['format'] paper format required A0-A6,Letter, Folio, B0-B6 (dflt A4)
** $_GET['watermark'] watermark on the page
** $_GET['orientation'] paper orientation default "landscape" default 2-up (new)
-** $_SESSION['_config']['language'] for "ja_JP" japanese default != ja_JP
+** $_SESSION['_config']['language'] for "ja" japanese default != ja
** $_SESSION['_config']['recode'] = "format" recode() uses it: needed ?
** recode() is aliased to php lib function recode_string()
** $_REQUEST[bw] if exists use black/white, default use colour
@@ -371,7 +371,7 @@ define('DFL_FORMAT', 'html..utf-8');
// Japanese is not supported?
if( array_key_exists('_config', $_SESSION) ) {
if( isset($_SESSION['_config']['language']) ) {
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
define('FONT','SJIS');
else define( 'FONT', 'freesans');
}
@@ -422,7 +422,7 @@ function utf8_is_ascii_ctrl($str) {
// extend TCPF with custom functions
class COAPPDF extends TCPDF {
- // do cap form version numbering automatically "$Revision: 1.3 $"
+ // do cap form version numbering automatically "$Revision: 1.4 $"
/*public*/ function Version() {
strtok(REV, " ");
return(strtok(" "));
diff --git a/www/index.php b/www/index.php
index 5f7fc14..41b6d7a 100644
--- a/www/index.php
+++ b/www/index.php
@@ -14,8 +14,9 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-*/ ?>
-<?
+*/
+
+require_once('../includes/lib/l10n.php');
$id = 0; if(array_key_exists("id",$_REQUEST)) $id=intval($_REQUEST['id']);
$oldid = 0; if(array_key_exists("oldid",$_REQUEST)) $oldid=intval($_REQUEST['oldid']);
@@ -310,18 +311,12 @@
if($_SESSION['profile']['language'] == "")
{
- $query = "update `users` set `language`='".$_SESSION['_config']['language']."'
+ $query = "update `users` set `language`='".L10n::get_translation()."'
where `id`='".$_SESSION['profile']['id']."'";
mysql_query($query);
} else {
- $_SESSION['_config']['language'] = $_SESSION['profile']['language'];
-
- putenv("LANG=".$_SESSION['_config']['language']);
- setlocale(LC_ALL, $_SESSION['_config']['language']);
-
- $domain = 'messages';
- bindtextdomain("$domain", $_SESSION['_config']['filepath']."/locale");
- textdomain("$domain");
+ L10n::set_translation($_SESSION['profile']['language']);
+ L10n::init_gettext();
}
$query = "select sum(`points`) as `total` from `notary` where `to`='".$_SESSION['profile']['id']."' group by `to`";
$res = mysql_query($query);
@@ -551,7 +546,7 @@
mysql_query($query);
$body = _("Thanks for signing up with CAcert.org, below is the link you need to open to verify your account. Once your account is verified you will be able to start issuing certificates till your hearts' content!")."\n\n";
- $body .= "http://".$_SESSION['_config']['normalhostname']."/verify.php?type=email&emailid=$emailid&hash=$hash\n\n"; //."&"."lang=".$_SESSION['_config']['language']."\n\n";
+ $body .= "http://".$_SESSION['_config']['normalhostname']."/verify.php?type=email&emailid=$emailid&hash=$hash\n\n";
$body .= _("Best regards")."\n"._("CAcert.org Support!");
sendmail($_SESSION['signup']['email'], "[CAcert.org] "._("Mail Probe"), $body, "support@cacert.org", "", "", "CAcert Support");
diff --git a/www/ttp.php b/www/ttp.php
index 2240518..6385127 100644
--- a/www/ttp.php
+++ b/www/ttp.php
@@ -15,7 +15,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
- if($_SESSION['_config']['language'] != "ja_JP")
+ if($_SESSION['_config']['language'] != "ja")
{
define('FPDF_FONTPATH','/usr/share/fpdf/font/');
require_once('/usr/share/ufpdf/fpdf.php');
@@ -40,7 +40,7 @@
{
$this->Image($_REQUEST['bw']?'images/CAcert-logo-mono-1000.png':'images/CAcert-logo-colour-1000.png',8,8,100);
$this->SetFont('Arial','B',14);
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','B',14);
$this->Cell(100);
$this->Cell(40,20,recode($_SESSION['_config']['recode'], _("Trusted Third Party")));
@@ -54,12 +54,12 @@
{
$this->SetY(-10);
$this->SetFont('Arial','I',8);
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','I',8);
$this->Cell(0,0,'CAcert Inc. - P.O. Box 4107 - Denistone East NSW 2112 - Australia - http://www.CAcert.org',0,0,'C');
$this->SetY(-7);
$this->SetFont('Arial','',6);
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','',6);
$this->Cell(0,0, recode($_SESSION['_config']['recode'], _("CAcert's Root Certificate fingerprints")).": A6:1B:37:5E:39:0D:9C:36:54:EE:BD:20:31:46:1F:6B "._("and")." 135C EC36 F49C B8E9 3B1A B270 CD80 8846 76CE 8F33",0,0,'C');
}
@@ -72,7 +72,7 @@
// Show text blurb at top of page
$this->SetY(40);
$this->SetFont('Arial','',10);
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','',10);
$this->Write(4, recode($_SESSION['_config']['recode'], _("The CAcert Trusted Third Party (TTP) Programme is designed to assure Internet user identities through personal verification of government issued identity documents.")));
$this->Ln(7);
@@ -100,18 +100,18 @@
$this->Line(120, $top + 6, 120, $top + 36);
$this->SetXY(11, $top + 3);
$this->SetFont("Arial", "BUI", "12");
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','BUI',12);
$this->Write(0, recode($_SESSION['_config']['recode'],_("Person Verifying Applicant's Identity")));
$this->SetXY(11, $top + 9);
$this->SetFont("Arial", "B", "8");
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','B',8);
$this->Write(0, recode($_SESSION['_config']['recode'],_("Names").":"));
$this->SetXY(120, $top + 9);
$this->Write(0, recode($_SESSION['_config']['recode'],_("Office Street Address").":"));
$this->SetFont("Arial", "B", "6");
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','B',6);
$this->SetXY(11, $top + 14);
$this->Write(0, recode($_SESSION['_config']['recode'],_("Profession (Please circle one)")).":");
@@ -122,7 +122,7 @@
$this->SetXY(11, $top + 22);
$this->Write(0, recode($_SESSION['_config']['recode'], "("._("as applicable")."):"));
$this->SetFont("Arial", "B", "8");
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','B',8);
$this->SetXY(11, $top + 27);
$this->Write(0, recode($_SESSION['_config']['recode'],_("Office Phone")).":");
@@ -147,12 +147,12 @@
$this->Line(120, $top + 6, 120, $top + 36);
$this->SetXY(11, $top + 3);
$this->SetFont("Arial", "BUI", "12");
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','BUI',12);
$this->Write(0, recode($_SESSION['_config']['recode'],_("Applicant Information")));
$this->SetXY(11, $top + 9);
$this->SetFont("Arial", "B", "8");
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','B',8);
$this->Write(0, recode($_SESSION['_config']['recode'],_("Full Name (as shown on ID)").":"));
if($name)
@@ -170,11 +170,11 @@
$this->SetXY(11, $top + 21);
$this->Write(0, recode($_SESSION['_config']['recode'],_("Date of Birth")).": ");
$this->SetFont("Arial", "B", "6");
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','B',6);
$this->Write(0, "(".recode($_SESSION['_config']['recode'], _("YYYY-MM-DD")).")");
$this->SetFont("Arial", "B", "8");
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','B',8);
if($dob)
{
@@ -199,7 +199,7 @@
$format = "A4";
$pdf = new PDF('P', 'mm', $format);
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$pdf->AddSJISFont();
$pdf->Open();
$pdf->AddPage();
diff --git a/www/wot.php b/www/wot.php
index fe3b93b..bf5d301 100644
--- a/www/wot.php
+++ b/www/wot.php
@@ -16,6 +16,9 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/ ?>
<?
+require_once("../includes/loggedin.php");
+require_once("../includes/lib/l10n.php");
+
function show_page($target,$message,$error)
{
@@ -83,43 +86,35 @@ function show_page($target,$message,$error)
function send_reminder()
{
$body = "";
- if($_POST['reminder-lang'] != "" && $_POST['reminder-lang'] != "en_AU")
- {
- $userlang = $_POST['reminder-lang'];
- $_SESSION['_config']['reminder-lang'] = $_POST['reminder-lang'];
- putenv("LANG=".$userlang);
- setlocale(LC_ALL, $userlang);
-
- $body .= $_SESSION['_config']['translations'][$userlang].":\n\n";
+ $my_translation = L10n::get_translation();
+
+ $_SESSION['_config']['reminder-lang'] = $_POST['reminder-lang'];
+
+ $reminder_translations[] = $_POST['reminder-lang'];
+ if ( !in_array("en", $reminder_translations, $strict=true) ) {
+ $reminder_translations[] = "en";
+ }
+
+ foreach ($reminder_translations as $translation) {
+ L10n::set_translation($translation);
+
+ $body .= L10n::$translations[$translation].":\n\n";
$body .= sprintf(_("This is a short reminder that you filled out forms to become trusted with CAcert.org, and %s has attempted to issue you points. Please create your account at %s as soon as possible and then notify %s so that the points can be issued."), $_SESSION['profile']['fname']." (".$_SESSION['profile']['email'].")", "http://www.cacert.org", $_SESSION['profile']['fname'])."\n\n";
$body .= _("Best regards")."\n";
- $body .= _("CAcert Support Team");
-
- $body .= "\n\nEnglish:\n\n";
+ $body .= _("CAcert Support Team")."\n\n";
}
-
- $body .= sprintf("This is a short reminder that you filled out forms to become trusted with CAcert.org, and %s has attempted to issue you points. Please create your account at %s as soon as possible and then notify %s so that the points can be issued.", $_SESSION['profile']['fname']." (".$_SESSION['profile']['email'].")", "http://www.cacert.org", $_SESSION['profile']['fname'])."\n\n";
- $body .= "Best regards"."\n";
- $body .= "CAcert Support Team";
-
+
+ L10n::set_translation($reminder_translations[0]); // for the subject
sendmail($_POST['email'], "[CAcert.org] "._("Reminder Notice"), $body, $_SESSION['profile']['email'], "", "", $_SESSION['profile']['fname']);
-
- if($_POST['reminder-lang'] != "" && $_POST['reminder-lang'] != "en_AU")
- {
- $userlang = $_SESSION['profile']['language'];
- putenv("LANG=".$userlang);
- setlocale(LC_ALL, $userlang);
- }
-
+
+ L10n::set_translation($my_translation);
+
$_SESSION['_config']['remindersent'] = 1;
+ $_SESSION['_config']['error'] = _("A reminder notice has been sent.");
}
-
-
- require_once("../includes/loggedin.php");
-
loadem("account");
if(array_key_exists('date',$_POST) && $_POST['date'] != "")
$_SESSION['_config']['date'] = $_POST['date'];
@@ -297,7 +292,7 @@ $iecho= "c";
$query .= ",\n`sponsor`='".intval($_POST['sponsor'])."'";
} else if($_SESSION['profile']['board'] == 1) {
$query .= ",\n`method`='".mysql_escape_string(stripslashes($_POST['method']))."'";
- } else if($_SESSION['profile']['ttpadmin'] == 1 && ($_POST['method'] == 'Trusted 3rd Parties' || $_POST['method'] == 'Trusted third Parties')) {
+ } else if($_SESSION['profile']['ttpadmin'] == 1 && ($_POST['method'] == 'Trusted 3rd Parties' || $_POST['method'] == 'Trusted Third Parties')) {
$query .= ",\n`method`='Trusted Third Parties'";
}
mysql_query($query);
@@ -322,13 +317,9 @@ $iecho= "c";
$_SESSION['profile']['points'] += $addpoints;
}
- if($_SESSION['_config']['notarise']['language'] != "")
- {
- $userlang = $_SESSION['_config']['notarise']['language'];
- putenv("LANG=".$userlang);
- setlocale(LC_ALL, $userlang);
- }
-
+ $my_translation = L10n::get_translation();
+ L10n::set_translation($_SESSION['_config']['notarise']['language']);
+
$body = sprintf(_("You are receiving this email because you have been assured by %s %s (%s)."), $_SESSION['profile']['fname'], $_SESSION['profile']['lname'], $_SESSION['profile']['email'])."\n\n";
if($_POST['points'] != $newpoints)
$body .= sprintf(_("You were issued %s points however the system has rounded this down to %s and you now have %s points in total."), $_POST['points'], $newpoints, ($newpoints + $drow['total']))."\n\n";
@@ -359,8 +350,7 @@ $iecho= "c";
sendmail($_SESSION['_config']['notarise']['email'], "[CAcert.org] "._("You've been Assured."), $body, "support@cacert.org", "", "", "CAcert Website");
- putenv("LANG=".$_SESSION['profile']['language']);
- setlocale(LC_ALL, $_SESSION['profile']['language']);
+ L10n::set_translation($my_translation);
$body = sprintf(_("You are receiving this email because you have assured %s %s (%s)."), $_SESSION['_config']['notarise']['fname'], $_SESSION['_config']['notarise']['lname'], $_SESSION['_config']['notarise']['email'])."\n\n";
if($_POST['points'] != $newpoints)
@@ -454,7 +444,14 @@ $iecho= "c";
{
sendmail($user['email'], "[CAcert.org] ".$_REQUEST['subject'], $_REQUEST['message'],
$_SESSION['profile']['email'], "", "", $_SESSION['profile']['fname']." ".$_SESSION['profile']['lname']);
- show_page("ContactAssurer",_("Your email has been sent to")." ".$user['fname'].".<br />[ <a href='javascript:history.go(-2)'>"._("Go Back")."</a> ]","");
+
+ showheader(_("My CAcert.org Account!"));?>
+ <p>
+ <? printf(_("Your email has been sent to %s."), $user['fname']); ?>
+ </p>
+ <p>[ <a href='javascript:history.go(-2)'><?= _("Go Back") ?></a> ]</p>
+ <?
+ showfooter();
exit;
} else {
show_page(0,"",_("Sorry, I was unable to locate that user."));