summaryrefslogtreecommitdiff
path: root/www
diff options
context:
space:
mode:
Diffstat (limited to 'www')
-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.php387
8 files changed, 258 insertions, 266 deletions
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 7fa572f..bf5d301 100644
--- a/www/wot.php
+++ b/www/wot.php
@@ -16,10 +16,106 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/ ?>
<?
- require_once("../includes/loggedin.php");
+require_once("../includes/loggedin.php");
+require_once("../includes/lib/l10n.php");
+
+
+function show_page($target,$message,$error)
+{
+ showheader(_("My CAcert.org Account!"));
+ if ($error != "")
+ $message=_("ERROR").": ".$error;
+ if ($message != "")
+ echo "<p><font color='orange' size='+1'>".$message."</font></p>";
+
+ switch ($target)
+ {
+ case '0':
+ case 'InfoPage': includeit(0, "wot");
+ break;
+ case '1':
+ case 'ListByCity': includeit(1, "wot");
+ break;
+ case '2':
+ case 'BecomeAssurer': includeit(2, "wot");
+ break;
+ case '3':
+ case 'TrustRules': includeit(3, "wot");
+ break;
+ case '4':
+ case 'ShowTTPInfo': includeit(4, "wot");
+ break;
+ case '5';
+ case 'EnterEmail': includeit(5, "wot");
+ break;
+ case '6':
+ case 'VerifyData': includeit(6, "wot");
+ break;
+// case '7':
+// case '???': includeit(7, "wot");
+// break;
+ case '8':
+ case 'EnterMyInfo': includeit(8, "wot");
+ break;
+ case '9':
+ case 'ContactAssurer': includeit(9, "wot");
+ break;
+ case '10':
+ case 'MyPointsOld': includeit(10, "wot");
+ break;
+// case '11':
+// case 'OAInfo': includeit(11, "wot");
+// break;
+ case '12':
+ case 'SearchAssurer': includeit(12, "wot");
+ break;
+ case '13':
+ case 'EnterMyCity': includeit(13, "wot");
+ break;
+// case '14':
+// case 'EnterEmail': includeit(14, "wot");
+// break;
+ case '15':
+ case 'MyPointsNew': includeit(15, "wot");
+ break;
+ }
+
+ showfooter();
+}
+
+function send_reminder()
+{
+ $body = "";
+ $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")."\n\n";
+ }
+
+ L10n::set_translation($reminder_translations[0]); // for the subject
+ sendmail($_POST['email'], "[CAcert.org] "._("Reminder Notice"), $body, $_SESSION['profile']['email'], "", "", $_SESSION['profile']['fname']);
+
+ L10n::set_translation($my_translation);
+
+ $_SESSION['_config']['remindersent'] = 1;
+ $_SESSION['_config']['error'] = _("A reminder notice has been sent.");
+}
+
- loadem("account");
+ loadem("account");
if(array_key_exists('date',$_POST) && $_POST['date'] != "")
$_SESSION['_config']['date'] = $_POST['date'];
@@ -29,244 +125,142 @@
$oldid=array_key_exists('oldid',$_REQUEST)?intval($_REQUEST['oldid']):0;
if($oldid == 12)
- {
$id = $oldid;
- }
if(($id == 5 || $oldid == 5 || $id == 6 || $oldid == 6))
- {
- if (!is_assurer($_SESSION['profile']['id'])) {
- showheader(_("My CAcert.org Account!"));
- echo "<p>".get_assurer_reason($_SESSION['profile']['id'])."</p>";
- showfooter();
- exit;
- }
- }
+ if (!is_assurer($_SESSION['profile']['id']))
+ {
+ show_page ("Exit","",get_assurer_reason($_SESSION['profile']['id']));
+ exit;
+ }
if($oldid == 6 && intval($_SESSION['_config']['notarise']['id']) <= 0)
{
- $oldid=0;
- $id = 5;
+ show_page ("EnterEmail","",_("Something went wrong. Please enter the email address again"));
+ exit;
}
-
if($oldid == 5 && array_key_exists('reminder',$_POST) && $_POST['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";
- $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 .= 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";
-
- 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);
- }
-
- $_SESSION['_config']['remindersent'] = 1;
- $_SESSION['_config']['error'] = _("A reminder notice has been sent.");
-
- $id = $oldid;
- $oldid=0;
+ send_reminder();
+ show_page ("EnterEmail",_("A reminder notice has been sent."),"");
+ exit;
}
if($oldid == 5)
{
- $_SESSION['_config']['noemailfound'] = 0;
$query = "select * from `users` where `email`='".mysql_escape_string(stripslashes($_POST['email']))."' and `deleted`=0";
$res = mysql_query($query);
if(mysql_num_rows($res) != 1)
{
- $id = $oldid;
- $oldid=0;
- $_SESSION['_config']['error'] = _("I'm sorry, there was no email matching what you entered in the system. Please double check your information.");
$_SESSION['_config']['noemailfound'] = 1;
- } else {
+ show_page("EnterEmail","",_("I'm sorry, there was no email matching what you entered in the system. Please double check your information."));
+ exit;
+ } else
+ {
+ $_SESSION['_config']['noemailfound'] = 0;
$_SESSION['_config']['notarise'] = mysql_fetch_assoc($res);
+ if ($_SESSION['_config']['notarise']['verified'] == 0)
+ {
+ show_page("EnterEmail","",_("User is not yet verified. Please try again in 24 hours!"));
+ exit;
+ }
}
}
if($oldid == 5 || $oldid == 6)
{
+ $id=6;
+// $oldid=0;
if(array_key_exists('cancel',$_REQUEST) && $_REQUEST['cancel'] != "")
{
- header("location: wot.php");
+ show_page("EnterEmail","","");
exit;
}
-
if($_SESSION['_config']['notarise']['id'] == $_SESSION['profile']['id'])
{
- $id = 5;
- $oldid=0;
- $_SESSION['_config']['error'] = _("You are never allowed to Assure yourself!");
+ show_page("EnterEmail","",_("You are never allowed to Assure yourself!"));
+ exit;
}
- }
- if($oldid == 5 || $oldid == 6)
- {
$query = "select * from `notary` where `from`='".$_SESSION['profile']['id']."' and
`to`='".$_SESSION['_config']['notarise']['id']."'";
- $_SESSION['_config']['alreadydone'] = 0;
$res = mysql_query($query);
- if(mysql_num_rows($res) > 0 && $_SESSION['profile']['points'] < 200)
- {
- $id = 5;
- $oldid=0;
- $_SESSION['_config']['error'] = _("You are only allowed to Assure someone once!");
- } elseif($oldid == 5) {
- $id = 6;
- }
- if($id == 6 && mysql_num_rows($res) > 0)
- {
- $_SESSION['_config']['alreadydone'] = 1;
- }
- unset($_SESSION['_config']['pointsalready']);
- if($id == 6 && $_SESSION['profile']['points'] >= 100)
- {
- $query = "select sum(`points`) as `total` from `notary` where `to`='".$_SESSION['_config']['notarise']['id']."' group by `to`";
- $res = mysql_query($query);
- $drow = mysql_fetch_assoc($res);
- $_SESSION['_config']['pointsalready'] = $drow['total'];
- }
- unset($_SESSION['_config']['verified']);
- if($id == 6 && $_SESSION['profile']['points'] >= 100)
+ if(mysql_num_rows($res) > 0)
{
- $query = "select `verified` from `users` where `id`='".$_SESSION['_config']['notarise']['id']."'";
- $res = mysql_query($query);
- $drow = mysql_fetch_assoc($res);
- $_SESSION['_config']['verified'] = $drow['verified'];
+ show_page("EnterEmail","",_("You are only allowed to Assure someone once!"));
+ exit;
}
}
if($oldid == 6)
{
- if(!array_key_exists('assertion',$_POST) || $_POST['assertion'] != 1 || !array_key_exists('rules',$_POST) || $_POST['rules'] != 1)
+$iecho= "c";
+ if(!array_key_exists('assertion',$_POST) || $_POST['assertion'] != 1)
+ {
+ show_page("VerifyData","",_("You failed to check all boxes to validate your adherence to the rules and policies of CAcert"));
+ exit;
+ }
+
+/* if(!array_key_exists('rules',$_POST) || $_POST['rules'] != 1)
{
- $id = $oldid;
- $oldid=6;
- $_SESSION['_config']['error'] = _("You failed to check all boxes to validate your adherence to the rules and policies of CAcert");
+ show_page("VerifyData","",_("You failed to check all boxes to validate your adherence to the rules and policies of CAcert"));
+ exit;
}
+*/
if((!array_key_exists('certify',$_POST) || $_POST['certify'] != 1 ) && $_SESSION['profile']['ttpadmin'] != 1)
{
- $id = $oldid;
- $oldid=6;
- $_SESSION['_config']['error'] = _("You failed to check all boxes to validate your adherence to the rules and policies of CAcert");
+ show_page("VerifyData","",_("You failed to check all boxes to validate your adherence to the rules and policies of CAcert"));
+ exit;
}
- }
- if($oldid == 6 && $_SESSION['profile']['ttpadmin'] != 1)
- {
- if($_POST['location'] == "")
+ if($_SESSION['profile']['ttpadmin'] != 1 && $_POST['location'] == "")
{
- $id = $oldid;
- $oldid=0;
- $_SESSION['_config']['error'] = _("You failed to enter a location of your meeting.");
+ show_page("VerifyData","",_("You failed to enter a location of your meeting."));
+ exit;
+ }
+
+ if($_REQUEST['points'] == "")
+ {
+ show_page("VerifyData","",_("You must enter the number of points you wish to allocate to this person."));
+ exit;
}
- }
- if($oldid == 6)
- {
$query = "select * from `users` where `id`='".$_SESSION['_config']['notarise']['id']."'";
$res = mysql_query($query);
$row = mysql_fetch_assoc($res);
$name = $row['fname']." ".$row['mname']." ".$row['lname']." ".$row['suffix'];
if($_SESSION['_config']['wothash'] != md5($name."-".$row['dob']) || $_SESSION['_config']['wothash'] != $_REQUEST['pagehash'])
{
- $id = $oldid;
- $oldid=0;
- $_SESSION['_config']['error'] = _("Race condition discovered, user altered details during assurance procedure. PLEASE MAKE SURE THE NEW DETAILS BELOW MATCH THE ID DOCUMENTS.");
+ show_page("VerifyData","",_("Race condition discovered, user altered details during assurance procedure. PLEASE MAKE SURE THE NEW DETAILS BELOW MATCH THE ID DOCUMENTS."));
+ exit;
}
}
- if($oldid == 6 && $_REQUEST['points'] == "")
- {
- $id = $oldid;
- $oldid=0;
- $_SESSION['_config']['error'] = _("You must enter the number of points you wish to allocate to this person.");
- }
if($oldid == 6)
{
$max = maxpoints();
-
- if (intval($_POST['points']) > $max) {
- $awarded = $newpoints = $max;
- } elseif (intval($_POST['points']) < 0) {
- $awarded = $newpoints = 0;
- } else {
- $awarded = $newpoints = intval($_POST['points']);
- }
+
+ $awarded = $newpoints = intval($_POST['points']);
+ if($newpoints > $max)
+ $newpoints = $awarded = $max;
+ if($newpoints < 0)
+ $newpoints = $awarded = 0;
$query = "select sum(`points`) as `total` from `notary` where `to`='".$_SESSION['_config']['notarise']['id']."' group by `to`";
$res = mysql_query($query);
$drow = mysql_fetch_assoc($res);
- if($_SESSION['profile']['board'] == 1 && intval($_POST['expire']) > 0 && $drow['total'] > 150)
- {
- showheader(_("My CAcert.org Account!"));
- echo "<p>"._("You tried to give a temporary points increase to someone that already has more then 150 points. Can't continue.")."</p>";
- showfooter();
- exit;
- }
-
- if($_SESSION['profile']['board'] == 1 && intval($_POST['expire']) > 0 && intval($_POST['sponsor']) <= 0)
- {
- showheader(_("My CAcert.org Account!"));
- echo "<p>"._("You didn't list a valid sponsor for this action.")."</p>";
- showfooter();
- exit;
- }
-
- if($_SESSION['profile']['board'] == 1 && intval($_POST['expire']) > 0 && intval($_POST['sponsor']) > 0)
- {
- $resc = mysql_query("select * from `users` where `id`='".intval($_POST['sponsor'])."' and `board`='1'");
- $rc = mysql_num_rows($resc);
- $sponsor = mysql_fetch_assoc($resc);
- if($rc <= 0)
- {
- showheader(_("My CAcert.org Account!"));
- echo "<p>"._("You listed an invalid sponsor for this action.")."</p>";
- showfooter();
- exit;
- }
- }
-
- if($_SESSION['profile']['board'] == 1 && intval($_POST['expire']) > 0)
- {
- $_POST['method'] = "Administrative Increase";
- $newpoints = 200 - $drow['total'];
- if(intval($_POST['expire']) > 45)
- $_POST['expire'] = 45;
- if(intval($_POST['expire']) <= 7)
- $_POST['expire'] = 7;
- } else {
- $_POST['expire'] = 0;
- if(($drow['total'] + $newpoints) > 100 && $max < 100)
- $newpoints = 100 - $drow['total'];
- if(($drow['total'] + $newpoints) > $max && $max >= 100)
- $newpoints = $max - $drow['total'];
- if($newpoints < 0)
- $newpoints = 0;
- }
+ $_POST['expire'] = 0;
+ if(($drow['total'] + $newpoints) > 100 && $max < 100)
+ $newpoints = 100 - $drow['total'];
+ if(($drow['total'] + $newpoints) > $max && $max >= 100)
+ $newpoints = $max - $drow['total'];
+ if($newpoints < 0)
+ $newpoints = 0;
+
if(mysql_escape_string(stripslashes($_POST['date'])) == "")
$_POST['date'] = date("Y-m-d H:i:s");
@@ -278,9 +272,8 @@
$res = mysql_query($query);
if(mysql_num_rows($res) > 0)
{
- $id = $oldid;
- $oldid=0;
- $_SESSION['_config']['error'] = _("Identical Assurance attempted, will not continue.");
+ show_page("VerifyEmail","",_("Identical Assurance attempted, will not continue."));
+ exit;
}
}
@@ -299,7 +292,7 @@
$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);
@@ -324,13 +317,9 @@
$_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";
@@ -361,8 +350,7 @@
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)
@@ -443,7 +431,8 @@
{
$oldid=0;
$id = 9;
- $error = _("It looks like you were trying to contact multiple people, this isn't allowed due to data security reasons.");
+ show_page("ContactAssurer","",_("It looks like you were trying to contact multiple people, this isn't allowed due to data security reasons."));
+ exit;
} else {
$body = $_REQUEST['message'];
$subject = $_REQUEST['subject'];
@@ -455,25 +444,33 @@
{
sendmail($user['email'], "[CAcert.org] ".$_REQUEST['subject'], $_REQUEST['message'],
$_SESSION['profile']['email'], "", "", $_SESSION['profile']['fname']." ".$_SESSION['profile']['lname']);
- showheader(_("My CAcert.org Account!"));
- echo "<p>"._("Your email has been sent to")." ".$user['fname'].".</p>";
- echo "<p>[ <a href='javascript:history.go(-2)'>Go Back</a> ]</p>\n";
+
+ 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 {
- showheader(_("My CAcert.org Account!"));
- echo _("Sorry, I was unable to locate that user.");
- showfooter();
+ show_page(0,"",_("Sorry, I was unable to locate that user."));
exit;
}
+
}
- } elseif($oldid == 9) {
+ }
+ if($oldid == 9)
+ {
$oldid=0;
- $error = _("There was an error and I couldn't proceed");
$id = 9;
+ show_page("ContactAssurer","",_("There was an error and I couldn't proceed"));
+ exit;
}
- showheader(_("My CAcert.org Account!"));
- includeit($id, "wot");
- showfooter();
+// showheader(_("My CAcert.org Account!"));
+// echo "ID now = ".$id."/".$oldid.">>".$iecho;
+// includeit($id, "wot");
+// showfooter();
+show_page ($id,"","");
?>