diff options
-rwxr-xr-x | CommModule/server.pl | 4 | ||||
-rw-r--r-- | includes/account.php | 184 | ||||
-rw-r--r-- | includes/account_stuff.php | 1 | ||||
-rw-r--r-- | includes/general.php | 1 | ||||
-rw-r--r-- | includes/mysql.php.sample | 3 | ||||
-rw-r--r-- | includes/notary.inc.php | 70 | ||||
-rw-r--r-- | includes/wot.inc.php | 9 | ||||
-rw-r--r-- | pages/account/10.php | 3 | ||||
-rw-r--r-- | pages/account/41.php | 8 | ||||
-rw-r--r-- | pages/account/43.php | 4 | ||||
-rw-r--r-- | pages/account/57.php | 107 | ||||
-rw-r--r-- | pages/index/0.php | 3 | ||||
-rw-r--r-- | pages/index/3.php | 59 | ||||
-rw-r--r-- | pages/index/4.php | 2 | ||||
-rw-r--r-- | pages/wot/2.php | 25 | ||||
-rw-r--r-- | pages/wot/4.php | 51 | ||||
-rwxr-xr-x | scripts/cron/removedead.php | 4 | ||||
-rwxr-xr-x | scripts/cron/warning.php | 43 | ||||
-rw-r--r-- | www/certs/CAcert_Root_Certificates.msi | bin | 0 -> 1593344 bytes | |||
-rw-r--r-- | www/disputes.php | 16 | ||||
-rw-r--r-- | www/index.php | 3 | ||||
-rw-r--r-- | www/styles/default.css | 6 | ||||
-rw-r--r-- | www/wot.php | 53 |
23 files changed, 480 insertions, 179 deletions
diff --git a/CommModule/server.pl b/CommModule/server.pl index c70bc9a..6084042 100755 --- a/CommModule/server.pl +++ b/CommModule/server.pl @@ -955,10 +955,10 @@ sub analyze($) if($bytes[1] == 0) # NUL Request { SysLog "NUL Request detected.\n"; - if($fields[1]) + if($fields[1] =~ /^\d+\.\d+$/) { open OUT,">timesync.sh"; - print OUT "date -u $fields[1]\n"; + print OUT "date -u '$fields[1]'\n"; print OUT "hwclock --systohc\n"; close OUT; } diff --git a/includes/account.php b/includes/account.php index 052e806..4aed5ed 100644 --- a/includes/account.php +++ b/includes/account.php @@ -10,7 +10,7 @@ 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 @@ -83,7 +83,7 @@ if($checkemail != "OK") { showheader(_("My CAcert.org Account!")); - if (substr($checkemail, 0, 1) == "4") + if (substr($checkemail, 0, 1) == "4") { echo "<p>"._("The mail server responsible for your domain indicated a temporary failure. This may be due to anti-SPAM measures, such as greylisting. Please try again in a few minutes.")."</p>\n"; } else { @@ -152,6 +152,9 @@ { foreach($_REQUEST['delid'] as $id) { + if (0==$delcount) { + echo _('The following email addresses have been removed:')."<br>\n"; + } $id = intval($id); $query = "select * from `email` where `id`='$id' and `memid`='".intval($_SESSION['profile']['id'])."' and `email`!='".$_SESSION['profile']['email']."'"; @@ -160,7 +163,7 @@ { $row = mysql_fetch_assoc($res); echo $row['email']."<br>\n"; - $query = "select `emailcerts`.`id` + $query = "select `emailcerts`.`id` from `emaillink`,`emailcerts` where `emailid`='$id' and `emaillink`.`emailcertsid`=`emailcerts`.`id` and `revoked`=0 and UNIX_TIMESTAMP(`expire`)-UNIX_TIMESTAMP() > 0 @@ -168,7 +171,7 @@ $dres = mysql_query($query); while($drow = mysql_fetch_assoc($dres)) mysql_query("update `emailcerts` set `revoked`='1970-01-01 10:00:01' where `id`='".$drow['id']."'"); - + $query = "update `email` set `deleted`=NOW() where `id`='$id'"; mysql_query($query); $delcount++; @@ -179,10 +182,8 @@ { echo _("You did not select any email accounts for removal."); } - if($delcount > 0) + if(0 == $delcount) { - echo _("The following accounts have been removed:")."<br>\n"; - } else { echo _("You failed to select any accounts to be removed, or you attempted to remove the default account. No action was taken."); } @@ -315,9 +316,9 @@ showfooter(); exit; } - + $query = "insert into emailcerts set - `CN`='$defaultemail', + `CN`='$defaultemail', `keytype`='NS', `memid`='".intval($_SESSION['profile']['id'])."', `created`=FROM_UNIXTIME(UNIX_TIMESTAMP()), @@ -347,7 +348,7 @@ } else if($_REQUEST['keytype'] == "MS" || $_REQUEST['keytype'] == "VI") { if($csr == "") $csr = "-----BEGIN CERTIFICATE REQUEST-----\n".clean_csr($_REQUEST['CSR'])."\n-----END CERTIFICATE REQUEST-----\n"; - + if (($weakKey = checkWeakKeyCSR($csr)) !== "") { $id = 4; @@ -356,7 +357,7 @@ showfooter(); exit; } - + $tmpfname = tempnam("/tmp", "id4CSR"); $fp = fopen($tmpfname, "w"); fputs($fp, $csr); @@ -415,8 +416,8 @@ showfooter(); exit; } - $query = "insert into emailcerts set - `CN`='$defaultemail', + $query = "insert into emailcerts set + `CN`='$defaultemail', `keytype`='".sanitizeHTML($_REQUEST['keytype'])."', `memid`='".$_SESSION['profile']['id']."', `created`=FROM_UNIXTIME(UNIX_TIMESTAMP()), @@ -575,7 +576,7 @@ { showheader(_("My CAcert.org Account!")); //echo "<p>"._("Email Address given was invalid, or a test connection couldn't be made to your server, or the server rejected the email address as invalid")."</p>\n"; - if (substr($checkemail, 0, 1) == "4") + if (substr($checkemail, 0, 1) == "4") { echo "<p>"._("The mail server responsible for your domain indicated a temporary failure. This may be due to anti-SPAM measures, such as greylisting. Please try again in a few minutes.")."</p>\n"; } else { @@ -622,15 +623,16 @@ { $row = mysql_fetch_assoc($res); echo $row['domain']."<br>\n"; - + $dres = mysql_query( - "select distinct `domaincerts`.`id` - from `domaincerts`, `domlink` + "select `domaincerts`.`id` + from `domaincerts` where `domaincerts`.`domid` = '$id' - or ( - `domaincerts`.`id` = `domlink`.`certid` - and `domlink`.`domid` = '$id' - )"); + union distinct + select `domaincerts`.`id` + from `domaincerts`, `domlink` + where `domaincerts`.`id` = `domlink`.`certid` + and `domlink`.`domid` = '$id'"); while($drow = mysql_fetch_assoc($dres)) { mysql_query( @@ -641,7 +643,7 @@ and UNIX_TIMESTAMP(`expire`) - UNIX_TIMESTAMP() > 0"); } - + mysql_query( "update `domains` set `deleted`=NOW() @@ -666,7 +668,7 @@ // In case the CSR is missing the ---BEGIN lines, add them automatically: $CSR = "-----BEGIN CERTIFICATE REQUEST-----\n".$CSR."\n-----END CERTIFICATE REQUEST-----\n"; } - + if (($weakKey = checkWeakKeyCSR($CSR)) !== "") { showheader(_("My CAcert.org Account!")); @@ -674,7 +676,7 @@ showfooter(); exit; } - + $_SESSION['_config']['tmpfname'] = tempnam("/tmp", "id10CSR"); $fp = fopen($_SESSION['_config']['tmpfname'], "w"); fputs($fp, $CSR); @@ -719,7 +721,7 @@ showfooter(); exit; } - + if (($weakKey = checkWeakKeyCSR(file_get_contents( $_SESSION['_config']['tmpfname']))) !== "") { @@ -728,7 +730,7 @@ showfooter(); exit; } - + $id = 11; if($_SESSION['_config']['0.CN'] == "" && $_SESSION['_config']['0.subjectAltName'] == "") { @@ -772,13 +774,13 @@ if(array_key_exists('0',$_SESSION['_config']['rowid']) && $_SESSION['_config']['rowid']['0'] > 0) { - $query = "insert into `domaincerts` set + $query = "insert into `domaincerts` set `CN`='".mysql_real_escape_string($_SESSION['_config']['rows']['0'])."', `domid`='".mysql_real_escape_string($_SESSION['_config']['rowid']['0'])."', `created`=NOW(),`subject`='".mysql_real_escape_string($subject)."', `rootcert`='".mysql_real_escape_string($_SESSION['_config']['rootcert'])."'"; } elseif(array_key_exists('0',$_SESSION['_config']['altid']) && $_SESSION['_config']['altid']['0'] > 0) { - $query = "insert into `domaincerts` set + $query = "insert into `domaincerts` set `CN`='".mysql_real_escape_string($_SESSION['_config']['altrows']['0'])."', `domid`='".mysql_real_escape_string($_SESSION['_config']['altid']['0'])."', `created`=NOW(),`subject`='".mysql_real_escape_string($subject)."', @@ -844,24 +846,24 @@ printf(_("Invalid ID '%s' presented, can't do anything with it.")."<br/>\n", $id); continue; } - + $row = mysql_fetch_assoc($res); - + if (($weakKey = checkWeakKeyX509(file_get_contents( $row['crt_name']))) !== "") { echo $weakKey, "<br/>\n"; continue; } - + mysql_query("update `domaincerts` set `renewed`='1' where `id`='$id'"); - $query = "insert into `domaincerts` set - `domid`='".$row['domid']."', + $query = "insert into `domaincerts` set + `domid`='".$row['domid']."', `CN`='".mysql_real_escape_string($row['CN'])."', `subject`='".mysql_real_escape_string($row['subject'])."',". //`csr_name`='".$row['csr_name']."', // RACE CONDITION "`created`='".$row['created']."', - `modified`=NOW(), + `modified`=NOW(), `rootcert`='".$row['rootcert']."', `type`='".$row['type']."', `pkhash`='".$row['pkhash']."'"; @@ -945,7 +947,7 @@ foreach($_REQUEST['revokeid'] as $id) { $id = intval($id); - $query = "select *,UNIX_TIMESTAMP(`domaincerts`.`revoked`) as `revoke` from `domaincerts`,`domains` + $query = "select *,UNIX_TIMESTAMP(`domaincerts`.`revoked`) as `revoke` from `domaincerts`,`domains` where `domaincerts`.`id`='$id' and `domaincerts`.`domid`=`domains`.`id` and `domains`.`memid`='".$_SESSION['profile']['id']."'"; @@ -976,7 +978,7 @@ foreach($_REQUEST['delid'] as $id) { $id = intval($id); - $query = "select *,UNIX_TIMESTAMP(`domaincerts`.`expire`) as `expired` from `domaincerts`,`domains` + $query = "select *,UNIX_TIMESTAMP(`domaincerts`.`expire`) as `expired` from `domaincerts`,`domains` where `domaincerts`.`id`='$id' and `domaincerts`.`domid`=`domains`.`id` and `domains`.`memid`='".$_SESSION['profile']['id']."'"; @@ -1011,7 +1013,7 @@ foreach($_REQUEST['revokeid'] as $id) { $id = intval($id); - $query = "select *,UNIX_TIMESTAMP(`revoked`) as `revoke` from `emailcerts` + $query = "select *,UNIX_TIMESTAMP(`revoked`) as `revoke` from `emailcerts` where `id`='$id' and `memid`='".$_SESSION['profile']['id']."'"; $res = mysql_query($query); if(mysql_num_rows($res) <= 0) @@ -1019,24 +1021,24 @@ printf(_("Invalid ID '%s' presented, can't do anything with it.")."<br>\n", $id); continue; } - + $row = mysql_fetch_assoc($res); - + if (($weakKey = checkWeakKeyX509(file_get_contents( $row['crt_name']))) !== "") { echo $weakKey, "<br/>\n"; continue; } - + mysql_query("update `emailcerts` set `renewed`='1' where `id`='$id'"); - $query = "insert into emailcerts set - `memid`='".$row['memid']."', + $query = "insert into emailcerts set + `memid`='".$row['memid']."', `CN`='".mysql_real_escape_string($row['CN'])."', `subject`='".mysql_real_escape_string($row['subject'])."', - `keytype`='".$row['keytype']."', - `csr_name`='".$row['csr_name']."', - `created`='".$row['created']."', + `keytype`='".$row['keytype']."', + `csr_name`='".$row['csr_name']."', + `created`='".$row['created']."', `modified`=NOW(), `disablelogin`='".$row['disablelogin']."', `codesign`='".$row['codesign']."', @@ -1084,7 +1086,7 @@ foreach($_REQUEST['revokeid'] as $id) { $id = intval($id); - $query = "select *,UNIX_TIMESTAMP(`revoked`) as `revoke` from `emailcerts` + $query = "select *,UNIX_TIMESTAMP(`revoked`) as `revoke` from `emailcerts` where `id`='$id' and `memid`='".$_SESSION['profile']['id']."'"; $res = mysql_query($query); if(mysql_num_rows($res) <= 0) @@ -1113,7 +1115,7 @@ foreach($_REQUEST['delid'] as $id) { $id = intval($id); - $query = "select *,UNIX_TIMESTAMP(`expire`) as `expired` from `emailcerts` + $query = "select *,UNIX_TIMESTAMP(`expire`) as `expired` from `emailcerts` where `id`='$id' and `memid`='".$_SESSION['profile']['id']."'"; $res = mysql_query($query); if(mysql_num_rows($res) <= 0) @@ -1228,7 +1230,7 @@ $ddres = mysql_query($ddquery); $ddrow = mysql_fetch_assoc($ddres); $_SESSION['profile']['points'] = $ddrow['total']; - + if($_SESSION['profile']['points'] == 0) { $_SESSION['_config']['user']['fname'] = trim(mysql_real_escape_string(stripslashes(strip_tags($_REQUEST['fname'])))); @@ -1280,7 +1282,7 @@ where `id`='".$_SESSION['profile']['id']."'"; mysql_query($query); - //!!!Should be rewritten + //!!!Should be rewritten $_SESSION['_config']['user']['otphash'] = trim(mysql_real_escape_string(stripslashes(strip_tags($_REQUEST['otphash'])))); $_SESSION['_config']['user']['otppin'] = trim(mysql_real_escape_string(stripslashes(strip_tags($_REQUEST['otppin'])))); if($_SESSION['_config']['user']['otphash'] != "" && $_SESSION['_config']['user']['otppin'] != "") @@ -1477,9 +1479,9 @@ showfooter(); exit; } - - $query = "insert into `orgemailcerts` set - `CN`='$defaultemail', + + $query = "insert into `orgemailcerts` set + `CN`='$defaultemail', `keytype`='NS', `orgid`='".$org['orgid']."', `created`=FROM_UNIXTIME(UNIX_TIMESTAMP()), @@ -1508,7 +1510,7 @@ mysql_query("update `orgemailcerts` set `csr_name`='$CSRname' where `id`='$emailid'"); } else if($_REQUEST['keytype'] == "MS" || $_REQUEST['keytype']=="VI") { $csr = "-----BEGIN CERTIFICATE REQUEST-----\n".clean_csr($_REQUEST['CSR'])."-----END CERTIFICATE REQUEST-----\n"; - + if (($weakKey = checkWeakKeyCSR($csr)) !== "") { $id = 17; @@ -1517,7 +1519,7 @@ showfooter(); exit; } - + $tmpfname = tempnam("/tmp", "id17CSR"); $fp = fopen($tmpfname, "w"); fputs($fp, $csr); @@ -1567,8 +1569,8 @@ if($_SESSION['_config']['rootcert'] < 1 || $_SESSION['_config']['rootcert'] > 2) $_SESSION['_config']['rootcert'] = 1; - $query = "insert into `orgemailcerts` set - `CN`='$defaultemail', + $query = "insert into `orgemailcerts` set + `CN`='$defaultemail', `keytype`='" . sanitizeHTML($_REQUEST['keytype']) . "', `orgid`='".$org['orgid']."', `created`=FROM_UNIXTIME(UNIX_TIMESTAMP()), @@ -1624,29 +1626,29 @@ printf(_("Invalid ID '%s' presented, can't do anything with it.")."<br>\n", $id); continue; } - + $row = mysql_fetch_assoc($res); - + if (($weakKey = checkWeakKeyX509(file_get_contents( $row['crt_name']))) !== "") { echo $weakKey, "<br/>\n"; continue; } - + mysql_query("update `orgemailcerts` set `renewed`='1' where `id`='$id'"); if($row['revoke'] > 0) { printf(_("It would seem '%s' has already been revoked. I'll skip this for now.")."<br>\n", $row['CN']); continue; } - $query = "insert into `orgemailcerts` set - `orgid`='".$row['orgid']."', + $query = "insert into `orgemailcerts` set + `orgid`='".$row['orgid']."', `CN`='".$row['CN']."', `subject`='".$row['subject']."', - `keytype`='".$row['keytype']."', - `csr_name`='".$row['csr_name']."', - `created`='".$row['created']."', + `keytype`='".$row['keytype']."', + `csr_name`='".$row['csr_name']."', + `created`='".$row['created']."', `modified`=NOW(), `codesign`='".$row['codesign']."', `rootcert`='".$row['rootcert']."'"; @@ -1744,7 +1746,7 @@ if($process != "" && $oldid == 20) { $CSR = clean_csr($_REQUEST['CSR']); - + if (($weakKey = checkWeakKeyCSR($CSR)) !== "") { $id = 20; @@ -1753,7 +1755,7 @@ showfooter(); exit; } - + $_SESSION['_config']['tmpfname'] = tempnam("/tmp", "id20CSR"); $fp = fopen($_SESSION['_config']['tmpfname'], "w"); fputs($fp, $CSR); @@ -1803,7 +1805,7 @@ if($process != "" && $oldid == 21) { $id = 21; - + if(!file_exists($_SESSION['_config']['tmpfname'])) { showheader(_("My CAcert.org Account!")); @@ -1811,7 +1813,7 @@ showfooter(); exit; } - + if (($weakKey = checkWeakKeyCSR(file_get_contents( $_SESSION['_config']['tmpfname']))) !== "") { @@ -1860,7 +1862,7 @@ if(is_array($_SESSION['_config']['rows'])) foreach($_SESSION['_config']['rows'] as $row) $csrsubject .= "/commonName=$row"; - $SAN=""; + $SAN=""; if(is_array($_SESSION['_config']['altrows'])) foreach($_SESSION['_config']['altrows'] as $subalt) { @@ -1879,7 +1881,7 @@ if($_SESSION['_config']['rowid']['0'] > 0) { - $query = "insert into `orgdomaincerts` set + $query = "insert into `orgdomaincerts` set `CN`='".$_SESSION['_config']['rows']['0']."', `orgid`='".$org['id']."', `created`=NOW(), @@ -1887,7 +1889,7 @@ `rootcert`='".$_SESSION['_config']['rootcert']."', `type`='$type'"; } else { - $query = "insert into `orgdomaincerts` set + $query = "insert into `orgdomaincerts` set `CN`='".$_SESSION['_config']['altrows']['0']."', `orgid`='".$org['id']."', `created`=NOW(), @@ -1945,29 +1947,29 @@ printf(_("Invalid ID '%s' presented, can't do anything with it.")."<br>\n", $id); continue; } - + $row = mysql_fetch_assoc($res); - + if (($weakKey = checkWeakKeyX509(file_get_contents( $row['crt_name']))) !== "") { echo $weakKey, "<br/>\n"; continue; } - + mysql_query("update `orgdomaincerts` set `renewed`='1' where `id`='$id'"); if($row['revoke'] > 0) { printf(_("It would seem '%s' has already been revoked. I'll skip this for now.")."<br>\n", $row['CN']); continue; } - $query = "insert into `orgdomaincerts` set - `orgid`='".$row['orgid']."', + $query = "insert into `orgdomaincerts` set + `orgid`='".$row['orgid']."', `CN`='".$row['CN']."', - `csr_name`='".$row['csr_name']."', + `csr_name`='".$row['csr_name']."', `created`='".$row['created']."', - `modified`=NOW(), - `subject`='".$row['subject']."', + `modified`=NOW(), + `subject`='".$row['subject']."', `type`='".$row['type']."', `rootcert`='".$row['rootcert']."'"; mysql_query($query); @@ -2181,7 +2183,7 @@ if(($oldid == 29 || $oldid == 30) && $process != "") // _("Cancel") is handled in front of account.php { - $query = "select `orgdomaincerts`.`id` as `id` from `orgdomlink`, `orgdomaincerts`, `orgdomains` where + $query = "select `orgdomaincerts`.`id` as `id` from `orgdomlink`, `orgdomaincerts`, `orgdomains` where `orgdomlink`.`orgdomid`=`orgdomains`.`id` and `orgdomaincerts`.`id`=`orgdomlink`.`orgcertid` and `orgdomains`.`id`='".intval($domid)."'"; @@ -2189,7 +2191,7 @@ while($row = mysql_fetch_assoc($res)) mysql_query("update `orgdomaincerts` set `revoked`='1970-01-01 10:00:01' where `id`='".$row['id']."'"); - $query = "select `orgemailcerts`.`id` as `id` from `orgemailcerts`, `orgemaillink`, `orgdomains` where + $query = "select `orgemailcerts`.`id` as `id` from `orgemailcerts`, `orgemaillink`, `orgdomains` where `orgemaillink`.`domid`=`orgdomains`.`id` and `orgemailcerts`.`id`=`orgemaillink`.`emailcertsid` and `orgdomains`.`id`='".intval($domid)."'"; @@ -2233,7 +2235,7 @@ $dres = mysql_query($query); while($drow = mysql_fetch_assoc($dres)) { - $query = "select `orgdomaincerts`.`id` as `id` from `orgdomlink`, `orgdomaincerts`, `orgdomains` where + $query = "select `orgdomaincerts`.`id` as `id` from `orgdomlink`, `orgdomaincerts`, `orgdomains` where `orgdomlink`.`orgdomid`=`orgdomains`.`id` and `orgdomaincerts`.`id`=`orgdomlink`.`orgcertid` and `orgdomains`.`id`='".intval($drow['id'])."'"; @@ -2245,7 +2247,7 @@ mysql_query("delete from `orgdomlink` where `domid`='".intval($row['id'])."'"); } - $query = "select `orgemailcerts`.`id` as `id` from `orgemailcerts`, `orgemaillink`, `orgdomains` where + $query = "select `orgemailcerts`.`id` as `id` from `orgemailcerts`, `orgemaillink`, `orgdomains` where `orgemaillink`.`domid`=`orgdomains`.`id` and `orgemailcerts`.`id`=`orgemaillink`.`emailcertsid` and `orgdomains`.`id`='".intval($drow['id'])."'"; @@ -2325,8 +2327,8 @@ $row = mysql_fetch_assoc($res); if ( !is_assurer(intval($row['id'])) ) { - $id = $oldid;
- $oldid=0;
+ $id = $oldid; + $oldid=0; $_SESSION['_config']['errmsg'] = _("The user is not an Assurer yet"); } else { @@ -2460,7 +2462,7 @@ exit; } - if($oldid == 54 || ($id == 53 && array_key_exists('action',$_REQUEST) && $_REQUEST['action'] != "") || + if($oldid == 54 || ($id == 53 && array_key_exists('action',$_REQUEST) && $_REQUEST['action'] != "") || ($id == 54 && array_key_exists('action',$_REQUEST) && $_REQUEST['action'] != "" && $_REQUEST['action'] != "aliases" && $_REQUEST['action'] != "edit" && $_REQUEST['action'] != "add")) { @@ -2677,7 +2679,7 @@ showfooter(); exit; } - + if (($weakKey = checkWeakKeyCSR($CSR)) !== "") { showheader(_("My CAcert.org Account!")); @@ -2686,7 +2688,7 @@ exit; } - $query = "insert into `domaincerts` set + $query = "insert into `domaincerts` set `CN`='".$_SESSION['_config']['0.CN']."', `domid`='".$_SESSION['_config']['row']['id']."', `created`=NOW()"; @@ -2750,7 +2752,7 @@ if($id == 43 && array_key_exists('locked',$_REQUEST) && $_REQUEST['locked'] > 0) { - csrf_check('admactlock'); + csrf_check('admactlock'); $memid = $_REQUEST['userid'] = intval($_REQUEST['locked']); $query = "select * from `users` where `id`='$memid'"; $row = mysql_fetch_assoc(mysql_query($query)); @@ -2975,7 +2977,7 @@ while($row = mysql_fetch_assoc($res)) $body .= $row['comment']."\n"; $body .= "\n"; - + $body .= _("Best regards")."\n"; $body .= _("CAcert Support Team"); sendmail($user['email'], "[CAcert.org] Thawte Notary Points Transfer", $body, "website-form@cacert.org", "support@cacert.org", "", "CAcert Tverify"); @@ -2996,7 +2998,7 @@ $body .= "\n"; $body .= _("You are welcome to try submitting another request at any time in the future, please make sure you take the reviewer comments into consideration or you risk having your application rejected again.")."\n\n"; - + $body .= _("Best regards")."\n"; $body .= _("CAcert Support Team"); sendmail($user['email'], "[CAcert.org] Thawte Notary Points Transfer", $body, "website-form@cacert.org", "support@cacert.org", "", "CAcert Tverify"); diff --git a/includes/account_stuff.php b/includes/account_stuff.php index 148a0ac..b9544e0 100644 --- a/includes/account_stuff.php +++ b/includes/account_stuff.php @@ -262,6 +262,7 @@ function hideall() { <ul class="menu" id="advertising"><li><a href="advertising.php?id=1"><?=_("New Ad")?></a></li><li><a href="advertising.php?id=0"><?=_("View Ads")?></a></li></ul> </div> <? } ?> + <? include("about_menu.php"); ?> </div> <div id="content"> <div class="story"> diff --git a/includes/general.php b/includes/general.php index d762586..bcbe38d 100644 --- a/includes/general.php +++ b/includes/general.php @@ -797,4 +797,5 @@ return $res; } + ?> diff --git a/includes/mysql.php.sample b/includes/mysql.php.sample index eb86401..10185fc 100644 --- a/includes/mysql.php.sample +++ b/includes/mysql.php.sample @@ -64,7 +64,8 @@ fputs($smtp, "DATA\r\n"); $InputBuffer = fgets($smtp, 1024); fputs($smtp, "X-Mailer: CAcert.org Website\r\n"); - fputs($smtp, "X-OriginatingIP: ".$_SERVER["REMOTE_ADDR"]."\r\n"); + if (array_key_exists("REMOTE_ADDR", $_SERVER)) + fputs($smtp, "X-OriginatingIP: ".$_SERVER["REMOTE_ADDR"]."\r\n"); fputs($smtp, "Sender: $errorsto\r\n"); fputs($smtp, "Errors-To: $errorsto\r\n"); if($replyto != "") diff --git a/includes/notary.inc.php b/includes/notary.inc.php index 7382fc3..d6f86a8 100644 --- a/includes/notary.inc.php +++ b/includes/notary.inc.php @@ -602,4 +602,74 @@ <p>[ <a href='javascript:history.go(-1)'><?=_("Go Back")?></a> ]</p> <? } + + //functions to do with recording user agreements + function write_user_agreement($memid, $document, $method, $comment, $active=1, $secmemid=0){ + // write a new record to the table user_agreement + $query="insert into `user_agreements` set `memid`=".$memid.", `secmemid`=".$secmemid. + ",`document`='".$document."',`date`=NOW(), `active`=".$active.",`method`='".$method."',`comment`='".$comment."'" ; + $res = mysql_query($query); + } + + function get_user_agreement_status($memid, $type="CCA"){ + //returns 0 - no user agreement, 1- at least one entry + $query="SELECT u.`document` FROM `user_agreements` u + WHERE u.`document` = '".$type."' AND (u.`memid`=".$memid." or u.`secmemid`=".$memid.")" ; + $res = mysql_query($query); + if(mysql_num_rows($res) <=0){ + return 0; + }else{ + return 1; + } + } + + function get_first_user_agreement($memid, $active=1, $type="CCA"){ + //returns an array (`document`,`date`,`method`, `comment`,`active`) + if($active==1){ + $filter="u.`memid`=".$memid; + }else{ + $filter="u.`secmemid`=".$memid; + } + $query="SELECT u.`document`, u.`date`, u.`method`, u.`comment`, u.`active` FROM `user_agreements` u + WHERE u.`document` = '".$type."' AND ".$filter." + ORDER BY u.`date` Limit 1;"; + $res = mysql_query($query); + if(mysql_num_rows($res) >0){ + $row = mysql_fetch_assoc($res); + $rec['document']= $row['document']; + $rec['date']= $row['date']; + $rec['method']= $row['method']; + $rec['comment']= $row['comment']; + $rec['active']= $row['active']; + }else{ + $rec=array(); + } + return $rec; + } + + function get_last_user_agreement($memid, $type="CCA"){ + //returns an array (`document`,`date`,`method`, `comment`,`active`) + $query="(SELECT u.`document`, u.`date`, u.`method`, u.`comment`, 1 as `active` FROM user_agreements u WHERE u.`document` = '".$type."' AND (u.`memid`=".$memid." ) order by `date` desc limit 1) + union + (SELECT u.`document`, u.`date`, u.`method`, u.`comment`, 0 as `active` FROM user_agreements u WHERE u.`document` = '".$type."' AND ( u.`secmemid`=".$memid.")) order by `date` desc limit 1" ; + $res = mysql_query($query); + if(mysql_num_rows($res) >0){ + $row = mysql_fetch_assoc($res); + $rec['document']= $row['document']; + $rec['date']= $row['date']; + $rec['method']= $row['method']; + $rec['comment']= $row['comment']; + $rec['active']= $row['active']; + }else{ + $rec=array(); + } + return $rec; +} + + function delete_user_agreement($memid, $type="CCA"){ + //deletes all entries to an user for the given type of user agreements + mysql_query("delete from `user_agreements` where `memid`='".$memid."'"); + mysql_query("delete from `user_agreements` where `secmemid`='".$memid."'"); + } + ?> diff --git a/includes/wot.inc.php b/includes/wot.inc.php index 6b3bcc8..9471bee 100644 --- a/includes/wot.inc.php +++ b/includes/wot.inc.php @@ -40,6 +40,15 @@ return intval($row['list']); } + + function get_number_of_ttpassurances ($userid) + { + $res = query_init ("SELECT count(*) AS `list` FROM `notary` + WHERE (`method`='Trusted Third Parties' or `method`='TTP-Assisted') AND `to`='".intval($userid)."' "); + $row = query_getnextrow($res); + + return intval($row['list']); + } function get_number_of_assurees ($userid) { diff --git a/pages/account/10.php b/pages/account/10.php index 704a05c..a394695 100644 --- a/pages/account/10.php +++ b/pages/account/10.php @@ -26,7 +26,8 @@ <p><?=_("If the Subscriber's name and/or domain name registration change the subscriber will immediately inform CAcert Inc. who shall revoke the digital certificate. When the Digital Certificate expires or is revoked the company will permanently remove the certificate from the server on which it is installed and will not use it for any purpose thereafter. The person responsible for key management and security is fully authorized to install and utilize the certificate to represent this organization's electronic presence.")?></p> -<p><b>*** <?=_("Please Note. All information on your certificate will be removed except the CommonName and SubjectAltName field, this is because it's an automated service and cannot automatically verify other details on your certificates are valid or not. If you are a valid organisation and would like more details to appear on certificates, you will need to have at least 50 assurance points and you need to send us a copy of your document of incorporation. Then we can add those details to your certificates. Contact us for more information on our organisational services.")?> ***</b></p> +<p><b>*** <?=_("Please note: All information on your certificate will be removed except the CommonName and SubjectAltName field, this is because it's an automated service and cannot automatically verify other details on your certificates are valid or not.")?> ***</b></p> +<p><?=_("If you are a valid organisation and would like the organisation name in the certificates you can apply for an organisation assurance. Contact us via support@cacert.org for more information.")?></p> <form method="post" action="account.php"> <? if($_SESSION['profile']['points'] >= 50) { ?> diff --git a/pages/account/41.php b/pages/account/41.php index 4ea9b10..d61d8db 100644 --- a/pages/account/41.php +++ b/pages/account/41.php @@ -73,8 +73,12 @@ require_once($_SESSION['_config']['filepath'].'/includes/lib/l10n.php'); $res = mysql_query($query); while($row = mysql_fetch_assoc($res)) { - echo "<option value='".sanitizeHTML($row['locale'])."'"; - echo ">".$row['country']." - ".$row['lang']."</option>\n"; + printf("<option value=\"%s\">[%s] %s (%s)</option>\n", + sanitizeHTML($row['locale']), + sanitizeHTML($row['locale']), + $row['lang'], + $row['country'] + ); } ?> </select> diff --git a/pages/account/43.php b/pages/account/43.php index 7935cea..11fe593 100644 --- a/pages/account/43.php +++ b/pages/account/43.php @@ -173,6 +173,10 @@ include_once($_SESSION['_config']['filepath']."/includes/notary.inc.php"); <input type="submit" value="Go"></form></nobr></td> </tr> <tr> + <td class="DataTD"><?=_("CCA accepted")?>:</td> + <td class="DataTD"><a href="account.php?id=57&userid=<?=intval($row['id'])?>"><?=intval(get_user_agreement_status($row['id'])) ? _("Yes") : _("No") ?></a></td> + </tr> + <tr> <td class="DataTD"><?=_("Trainings")?>:</td> <td class="DataTD"><a href="account.php?id=55&userid=<?=intval($row['id'])?>">show</a></td> </tr> diff --git a/pages/account/57.php b/pages/account/57.php new file mode 100644 index 0000000..76eee27 --- /dev/null +++ b/pages/account/57.php @@ -0,0 +1,107 @@ +<? /* + 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 +*/ ?> +<? + include_once($_SESSION['_config']['filepath'].'/includes/notary.inc.php'); + + if ($_SESSION['profile']['admin'] != 1 || !array_key_exists('userid',$_REQUEST) || intval($_REQUEST['userid']) < 1) { + + echo _('You do not have access to this page'); + + } else { + $user_id = intval($_REQUEST['userid']); + $query = "select * from `users` where `id`='$user_id' and `users`.`deleted`=0"; + $res = mysql_query($query); + if(mysql_num_rows($res) <= 0) + { + echo _("I'm sorry, the user you were looking for seems to have disappeared! Bad things are a foot!"); + } else { + $row = mysql_fetch_assoc($res); +?> +<table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper"> + <tr> + <td colspan="5" class="title"><?=_('CCA agreement of').' '.sanitizeHTML($row['fname']).' '.sanitizeHTML($row['mname']).' '.sanitizeHTML($row['lname'])?></td> + </tr> +</table> + + +<br> +<table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper"> + <tr> + <td class="DataTD"><b><?=_('CCA type')?></b></td> + <td class="DataTD"><b><?=_('Date')?></b></td> + <td class="DataTD"><b><?=_('Method')?></b></td> + <td class="DataTD"><b><?=_('Type')?></b></td> + </tr> +<? + $data=get_first_user_agreement($user_id,1); + if (!isset($data['active'])){ + $type=''; + }else{ + $type=_('active'); + } +?> + <tr> + <td class="DataTD"><?=_('First active CCA')?></td> + <td class="DataTD"><?=$data['date']?></td> + <td class="DataTD"><?=$data['method']?></td> + <td class="DataTD"><?=$type?></td> + </tr> +<? + $data=get_first_user_agreement($user_id,0); + if (!isset($data['active'])){ + $type=""; + }else{ + $type=_('passive'); + } +?> + <tr> + <td class="DataTD"><?=_('First passive CCA')?></td> + <td class="DataTD"><?=$data['date']?></td> + <td class="DataTD"><?=$data['method']?></td> + <td class="DataTD"><?=$type?></td> + </tr> +<? + $data=get_last_user_agreement($user_id); + if (!isset($data['active'])){ + $type=""; + }elseif($data['active']==1){ + $type=_('active'); + }else{ + $type=_('passive'); + } +?> + <tr> + <td class="DataTD"><?=_('Last CCA')?></td> + <td class="DataTD"><?=$data['date']?></td> + <td class="DataTD"><?=$data['method']?></td> + <td class="DataTD"><?=$type?></td> + </tr> +</table> +<br> +<table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper"> + <tr> +<? + if ($_SESSION['profile']['admin'] == 1 && array_key_exists('userid',$_REQUEST) && intval($_REQUEST['userid']) > 0) { +?> + <tr><td colspan="3" class="DataTD"><a href="account.php?id=43&userid=<?=$user_id ?>">back</a></td></tr> +<? } +?> </table> +<? + } +} +?> diff --git a/pages/index/0.php b/pages/index/0.php index 81ab2b1..e7356c7 100644 --- a/pages/index/0.php +++ b/pages/index/0.php @@ -118,8 +118,7 @@ <p><?=_("If you are located in Australia, use bank transfer instead.")?></p> <p><?=_("CAcert bank account details:")?></p> - -<ul> +<ul class="no_indent"> <li>Account Name: CAcert Inc</li> <li>SWIFT: WPACAU2S</li> <li>BSB: 032073</li> diff --git a/pages/index/3.php b/pages/index/3.php index c2cb391..a107c29 100644 --- a/pages/index/3.php +++ b/pages/index/3.php @@ -18,38 +18,45 @@ <p><?=sprintf(_("You are bound by the %s Root Distribution Licence %s for any re-distributions of CAcert's roots."),"<a href='/policy/RootDistributionLicense.php'>","</a>")?></p> -<p> -Class 1 <?=_("PKI Key")?><br> -<a href="index.php?id=17"><?=_("Click here if you want to import the root certificate into Microsoft Internet Explorer 5.x/6.x")?></a><br> -<a href="certs/root.crt"><?=_("Root Certificate (PEM Format)")?></a><br> -<a href="certs/root.der"><?=_("Root Certificate (DER Format)")?></a><br> -<a href="certs/root.txt"><?=_("Root Certificate (Text Format)")?></a><br> -<a href="<?=$_SERVER['HTTPS']?"https":"http"?>://crl.cacert.org/revoke.crl">CRL</a><br> -<?=_("Fingerprint")?> SHA1: 13:5C:EC:36:F4:9C:B8:E9:3B:1A:B2:70:CD:80:88:46:76:CE:8F:33<br/> -<?=_("Fingerprint")?> MD5: A6:1B:37:5E:39:0D:9C:36:54:EE:BD:20:31:46:1F:6B<br/> -</p> +<h3><?=_("Windows Installer") ?></h3> +<ul class="no_indent"> + <li><? printf(_("%s Windows installer package %s for browsers that use the Windows certificate store %s (for example Internet Explorer, Chrome on Windows and Safari on Windows)"), '<a href="certs/CAcert_Root_Certificates.msi">', '</a>', '<br/>')?></li> + <li><?=_("SHA1 Hash:") ?> 2db1957db31aa0d778d1a65ea146760ee1e67611</li> + <li><?=_("SHA256 Hash:") ?> 88883f2e3117bae6f43922fbaef8501b94efe4143c12116244ca5d0c23bcbb16</li> +</ul> -<p> -Class 3 <?=_("PKI Key")?><br> -<a href="certs/class3.crt"><?=_("Intermediate Certificate (PEM Format)")?></a><br/> -<a href="certs/class3.der"><?=_("Intermediate Certificate (DER Format)")?></a><br/> -<a href="certs/class3.txt"><?=_("Intermediate Certificate (Text Format)")?></a><br/> -<a href="<?=$_SERVER['HTTPS']?"https":"http"?>://crl.cacert.org/class3-revoke.crl">CRL</a><br/> +<h3><?=_("Class 1 PKI Key")?></h3> +<ul class="no_indent"> + <li><a href="certs/root.crt"><?=_("Root Certificate (PEM Format)")?></a></li> + <li><a href="certs/root.der"><?=_("Root Certificate (DER Format)")?></a></li> + <li><a href="certs/root.txt"><?=_("Root Certificate (Text Format)")?></a></li> + <li><a href="<?=$_SERVER['HTTPS']?"https":"http"?>://crl.cacert.org/revoke.crl">CRL</a></li> + <li><?=_("SHA1 Fingerprint:")?> 13:5C:EC:36:F4:9C:B8:E9:3B:1A:B2:70:CD:80:88:46:76:CE:8F:33</li> + <li><?=_("MD5 Fingerprint:")?> A6:1B:37:5E:39:0D:9C:36:54:EE:BD:20:31:46:1F:6B</li> +</ul> + +<h3><?=_("Class 3 PKI Key")?></h3> +<ul class="no_indent"> + <li><a href="certs/class3.crt"><?=_("Intermediate Certificate (PEM Format)")?></a></li> + <li><a href="certs/class3.der"><?=_("Intermediate Certificate (DER Format)")?></a></li> + <li><a href="certs/class3.txt"><?=_("Intermediate Certificate (Text Format)")?></a></li> + <li><a href="<?=$_SERVER['HTTPS']?"https":"http"?>://crl.cacert.org/class3-revoke.crl">CRL</a></li> <?php /* class3 subroot fingerprint updated: 2011-05-23 class3 Re-sign project https://wiki.cacert.org/Roots/Class3ResignProcedure/Migration */ ?> -<?=_("Fingerprint")?> SHA1: AD:7C:3F:64:FC:44:39:FE:F4:E9:0B:E8:F4:7C:6C:FA:8A:AD:FD:CE<br/> -<?=_("Fingerprint")?> MD5: F7:25:12:82:4E:67:B5:D0:8D:92:B7:7C:0B:86:7A:42<br/> -</p> + <li><?=_("SHA1 Fingerprint:")?> AD:7C:3F:64:FC:44:39:FE:F4:E9:0B:E8:F4:7C:6C:FA:8A:AD:FD:CE</li> + <li><?=_("MD5 Fingerprint:")?> F7:25:12:82:4E:67:B5:D0:8D:92:B7:7C:0B:86:7A:42</li> +</ul> -<p> -<?=_("GPG Key")?><br> -<a href="certs/cacert.asc"><?=_("CAcert's GPG Key")?></a><br> -</p> +<h3><?=_("GPG Key")?></h3> +<ul class="no_indent"> + <li><a href="certs/cacert.asc"><?=_("CAcert's GPG Key")?></a></li> + <li><?=_("GPG Key ID:")?> 0x65D0FD58</li> + <li><?=_("Fingerprint:")?> A31D 4F81 EF4E BD07 B456 FA04 D2BB 0D01 65D0 FD58</li> +</ul> -<p> -<?=_("PKI finger/thumb print signed by the CAcert GPG Key")?><br> +<h4><?=_("PKI fingerprint signed by the CAcert GPG Key")?></h4> <pre> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 @@ -82,8 +89,8 @@ TG1yj+lkktROGGyn0hJ5SbM= =tXoj -----END PGP SIGNATURE----- </pre> -</p> +<h3><?=_("History")?></h3> <p> <? printf(_('An overview over all CA certificates ever issued can be found in '. '%sthe wiki%s.'), diff --git a/pages/index/4.php b/pages/index/4.php index 9eb90af..384ea56 100644 --- a/pages/index/4.php +++ b/pages/index/4.php @@ -25,7 +25,7 @@ ?> <? if($_SESSION['_config']['hostname'] == $_SESSION['_config']['securehostname']) { ?> -<p><?=_("Warning! You've attempted to log into the system with a client certificate, but the login failed due to the certificate being expired, revoked, disabled for certificate login, or simply not valid for this site. You can login using your Email/Pass Phrase to get a new certificate, by clicking on 'Normal Login' to the right of your screen.")?></p> +<p><?=sprintf(_("Warning! You've attempted to log into the system with a client certificate, but the login failed due to the certificate being expired, revoked, disabled for certificate login, or simply not valid for this site. You can login using your email/pass phrase to get a new certificate, by clicking on %sPassword Login%s on the right side of this page."),"<a href='https://".$_SESSION['_config']['normalhostname']."/index.php?id=4'>", "</a>")?></p> <? } else { ?> <style> .box2 {width:100%;text-align:center;} diff --git a/pages/wot/2.php b/pages/wot/2.php index a75bc57..eda77bb 100644 --- a/pages/wot/2.php +++ b/pages/wot/2.php @@ -15,22 +15,19 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ ?> -<span style="background-color: #FF8080; font-size: 150%"> -Note that the <strong>TTP</strong> programme is effectively <strong>Frozen</strong><br> -Until a subsidiary policy under AP is written, it is against AP rules.<br> -</span> - <br> -<h3><?=_("To become an Assurer")?></h3> -<p><?=_("There are several ways to become a CAcert Assurer, the most common of which is face to face meetings with existing assurers, who check your ID documents (you need to show 2 government issued photo ID where possible otherwise you won't be allocated as many points!).")?></p> +<h3><?=_('To become an Assurer')?></h3> -<p><?=_("You can also become a CAcert Assurer by seeking out a public notary, justice of the peace, accountant, lawyer or bank manager. You will need to download and print out a copy of the TTP.pdf and fill in your sections. You will need to produce a photo copy of your ID, which the person assuring you will inspect against the originals. Once they are satisfied the documents appear to be genuine they need to sign the back of the photo copies, and fill in their sections of the TTP document. Once you have had your ID verified by 2 different people, pop the copies + forms in an envelope and post them to:")?></p> +<p><?=_('To become a CAcert Assurer you need to fulfill the following requirements:')?></p> +<ol> + <li><?=_('You have to reach 100 Assurance points')?></li> + <li><?=_('You have to pass the CATS test')?></li> +</ol> -<p>CAcert Inc.<br> -P.O. Box 4107<br> -Denistone East NSW 2112<br> -Australia</p> +<p><?=_('To reach 100 Assurance Points you have to meet with assurers who assure you under the CAcert Assurance Programme according to Assurance Policy. During the face to face meeting you need to show at least one governmental issued photo ID.')?></p> + +<p><?=sprintf(_('The 2nd requirement in becoming assurer is to pass the CAcert Assurer Challenge, which can be started at %s. For more information explore the wiki regarding the %s.'),'<a href="https://cats.cacert.org">https://cats.cacert.org</a>','<a href="//wiki.cacert.org/AssurerChallenge">Assurer Challenge</a>')?><p> + +<p><?=sprintf(_('In case you cannot meet an Assurer (eg there are not many assurer in your area) you can be assured under the alternate %sTTP-assisted-assurance programme%s. Read the pages %s for the basic way how the TTP-assisted-assurance programme works for you and %s whether the TTP programme affects the country where you are located.'),'<a href="/wot.php?id=4">', '</a>','<a href="//wiki.cacert.org/TTP/TTPuser">TTPuser</a>','<a href="//wiki.cacert.org/TTP/TTPAL">TTPAL</a>')?> </p> -<p><?=_("Upon receiving your documents you will be notified, and points will be added to your account.")?></p> -<p><?=_("Once you have received at least 100 Assurance Points you will have to pass a test called Assurer Challenge, which can be started at").' <a href="https://cats.cacert.org/">https://cats.cacert.org/</a>!'?></p> diff --git a/pages/wot/4.php b/pages/wot/4.php index 04997ba..befdfe4 100644 --- a/pages/wot/4.php +++ b/pages/wot/4.php @@ -14,7 +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(dirname(__FILE__).'/../../includes/wot.inc.php'); +?> <h3><?=_("Trusted Third Parties")?></h3> @@ -32,4 +34,49 @@ <p><?=sprintf(_("If you are interested in the TTP programme, read the pages %s for the basic way how the TTP programme works for you, and %s whether the TTP programme affects the country where you are located."),"<a href='//wiki.cacert.org/TTP/TTPuser'>https://wiki.cacert.org/TTP/TTPuser</a>","<a href='//wiki.cacert.org/TTP/TTPAL'>https://wiki.cacert.org/TTP/TTPAL</a>")?> </p> -<p><?=sprintf(_("If you want to take part in the TTP programme, send an email to %s with your name, the main email address of your CAcert account and the country that you want to see the TTP. CAcert will then send you the needed forms and guide you through the process."),"<a href='mailto:support@cacert.org'>support@cacert.org</a>")?></p> +<? +// test for points <100 +if ($_SESSION['profile']['points']<100){ + // test for TTP assurances + if (get_number_of_ttpassurances(intval($_SESSION['profile']['id']))<2){?> + <p><?=_("If you want to ask for TTP assurances fill out the missing data and send the request to support@cacert.org to start the process. CAcert will then inform you about the next steps.")?></p> + <form method="post" action="wot.php"> + <table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper"> + <tr> + <td class="DataTD"><?=_("Country where you want to visit the TTP")?></td> + <td class="DataTD"><select size="1" name="country"> + <option>Australia</option> + <option>Puerto Rico</option> + <option>USA</option> + </select></td> + </tr> + <tr> + <td class="DataTD"><?=_("I want to take part in the TTP Topup programme")?></td> + <td class="DataTD"><input type="checkbox" name="ttptopup" value="1"></td> + </tr> + <tr> + <td colspan="2" > + <input type="hidden" name="oldid" value="<?=intval($id)?>"> + <input type="submit" name="ttp" value="<?=_("I need a TTP assurance")?>"> + </td> + </tr> + </table> + </form> +<? //" + } else { + /* As soon as the TPP TOPUP Programme is established this routine should be used + <p><?=_("As you have already got 2 TTP assurances you can only take part in the TTP TOPUP programme. If you want to ask for the TTP TOPUP programme use the submit button to send the request to support@cacert.org to start the process. CAcert will then inform you about the next steps.")?></p> + <form method="post" action="wot.php"> + <input type="hidden" name="oldid" value="<?=intval($id)?>"> + <input type="submit" name="ttptopup" value="<?=_("I need a TTP TOPUP")?>"> + </form> +*/ +?> + <p><?=_("We are working to develop the TTP TOPUP process to be able to fill the gap of the missing 30 assurance points to 100 assurance points. Meanwhile you have to close this gap with face to face assurances from CAcert Assurers. Think not only travelling to populated countries, but as well to assurers visiting your country or area.")?></p> +<? + } +} else { +?> + <p><?=_("You reached the maximum points that can be granted by the TTP programme and therefore you cannot take part in the TTP programme any more.")?></p> +<? +} diff --git a/scripts/cron/removedead.php b/scripts/cron/removedead.php index aadda81..2257dc8 100755 --- a/scripts/cron/removedead.php +++ b/scripts/cron/removedead.php @@ -19,7 +19,8 @@ require_once(dirname(__FILE__).'/../../includes/mysql.php'); require_once(dirname(__FILE__).'/../../includes/lib/l10n.php'); - + require_once(dirname(__FILE__).'/../../includes/notary.inc.php'); + $query = "select * from `users` where `users`.`verified`=0 and (UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(`users`.`created`)) >= 172800"; $res = mysql_query($query); @@ -27,6 +28,7 @@ { mysql_query("delete from `email` where `memid`='".$row['id']."'"); mysql_query("delete from `users` where `id`='".$row['id']."'"); + delete_user_agreement($row['id']); } $query = "delete from `domains` where `hash`!='' and diff --git a/scripts/cron/warning.php b/scripts/cron/warning.php index 5cf7c31..0c97ba2 100755 --- a/scripts/cron/warning.php +++ b/scripts/cron/warning.php @@ -72,32 +72,37 @@ echo $row['fname']." ".$row['lname']." <".$row['email']."> (memid: ".$row['memid foreach($days as $day => $warning) { - $query = - "SELECT DISTINCT `domaincerts`.`id`, + $select_clause = + "`domaincerts`.`id`, `users`.`fname`, `users`.`lname`, `users`.`email`, `domains`.`memid`, `domaincerts`.`subject`, `domaincerts`.`crt_name`, `domaincerts`.`CN`, `domaincerts`.`serial`, - (UNIX_TIMESTAMP(`domaincerts`.`expire`) - - UNIX_TIMESTAMP(NOW())) / 86400 AS `daysleft` - - FROM `users`, `domaincerts`, `domlink`, `domains` - WHERE UNIX_TIMESTAMP(`domaincerts`.`expire`) - + (UNIX_TIMESTAMP(`domaincerts`.`expire`) - + UNIX_TIMESTAMP(NOW())) / 86400 AS `daysleft`"; + $where_clause = + "UNIX_TIMESTAMP(`domaincerts`.`expire`) - UNIX_TIMESTAMP(NOW()) > -7 * 86400 - AND UNIX_TIMESTAMP(`domaincerts`.`expire`) - + AND UNIX_TIMESTAMP(`domaincerts`.`expire`) - UNIX_TIMESTAMP(NOW()) < $day * 86400 - AND `domaincerts`.`renewed` = 0 - AND `domaincerts`.`warning` <= '$warning' - AND `domaincerts`.`revoked` = 0 - AND ( - `domaincerts`.`domid` = `domains`.`id` - OR ( - `domaincerts`.`id` = `domlink`.`certid` - AND `domlink`.`domid` = `domains`.`id` - ) - ) - AND `domains`.`memid` = `users`.`id`"; + AND `domaincerts`.`renewed` = 0 + AND `domaincerts`.`warning` <= '$warning' + AND `domaincerts`.`revoked` = 0 + AND `domains`.`memid` = `users`.`id`"; + $query = + "SELECT $select_clause + FROM `users`, `domaincerts`, `domains` + WHERE $where_clause + AND `domaincerts`.`domid` = `domains`.`id` + UNION DISTINCT + SELECT $select_clause + FROM `users`, + `domaincerts` LEFT JOIN `domlink` ON + (`domaincerts`.`id` = `domlink`.`certid`), + `domains` + WHERE $where_clause + AND `domlink`.`domid` = `domains`.`id`"; $res = mysql_query($query); while($row = mysql_fetch_assoc($res)) { diff --git a/www/certs/CAcert_Root_Certificates.msi b/www/certs/CAcert_Root_Certificates.msi Binary files differnew file mode 100644 index 0000000..f60567e --- /dev/null +++ b/www/certs/CAcert_Root_Certificates.msi diff --git a/www/disputes.php b/www/disputes.php index 5b78c1e..f195ed5 100644 --- a/www/disputes.php +++ b/www/disputes.php @@ -264,7 +264,7 @@ echo _("You aren't allowed to dispute your own email addresses. Can't continue."); showfooter(); exit; - } + } $res = mysql_query("select * from `users` where `id`='$oldmemid'"); $user = mysql_fetch_assoc($res); @@ -319,12 +319,20 @@ } unset($oldid); $query = "select * from `domains` where `domain`='$domain' and `deleted`=0"; - $email = ""; if(array_key_exists('email',$_REQUEST)) $email=trim(mysql_real_escape_string($_REQUEST['email'])); $res = mysql_query($query); if(mysql_num_rows($res) <= 0) { + $query = "select 1 from `orgdomains` where `domain`='$domain'"; + $res = mysql_query($query); + if(mysql_num_rows($res) > 0) + { + showheader(_("Domain Dispute")); + printf(_("The domain '%s' is included in an organisation account. Please send a mail to %s to dispute this domain."), sanitizeHTML($domain),'<a href="mailto:support@cacert.org">support@cacert.org</a>'); + showfooter(); + exit; + } showheader(_("Domain Dispute")); - printf(_("The domain '%s' doesn't exist in the system. Can't continue."), sanitizeHTML($email)); + printf(_("The domain '%s' doesn't exist in the system. Can't continue."), sanitizeHTML($domain)); showfooter(); exit; } @@ -336,7 +344,7 @@ echo _("You aren't allowed to dispute your own domains. Can't continue."); showfooter(); exit; - } + } $domainid = $row['id']; $_SESSION['_config']['domainid'] = $domainid; diff --git a/www/index.php b/www/index.php index 35d22d7..c7cc03e 100644 --- a/www/index.php +++ b/www/index.php @@ -18,6 +18,7 @@ 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']); $process = ""; if(array_key_exists("process",$_REQUEST)) $process=$_REQUEST['process']; @@ -544,6 +545,8 @@ require_once('../includes/lib/l10n.php'); `regional`='".$_SESSION['signup']['regional']."', `radius`='".$_SESSION['signup']['radius']."'"; mysql_query($query); + include_once("../includes/notary.inc.php"); + write_user_agreement($memid, "CCA", "account creation", "", 1); $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"; diff --git a/www/styles/default.css b/www/styles/default.css index c97e429..f2b3c95 100644 --- a/www/styles/default.css +++ b/www/styles/default.css @@ -86,11 +86,9 @@ padding-left: 5px; border-left: 0px; } -ul { +ul.no_indent { list-style: none; -margin: 0px 0px 0px 15px; -padding-left: 5px; -border-left: 1px dotted #000; +padding: 0px; } /***********************************************/ diff --git a/www/wot.php b/www/wot.php index 9e41891..ed4f0cd 100644 --- a/www/wot.php +++ b/www/wot.php @@ -115,6 +115,7 @@ function send_reminder() + loadem("account"); if(array_key_exists('date',$_POST) && $_POST['date'] != "") $_SESSION['_config']['date'] = $_POST['date']; @@ -126,6 +127,40 @@ function send_reminder() if($oldid == 12) $id = $oldid; + + if($oldid == 4) + { + if ($_POST['ttp']!='') { + //This mail does not need to be translated + $body = "Hi TTP adminstrators,\n\n"; + $body .= "User ".$_SESSION['profile']['fname']." ". + $_SESSION['profile']['lname']." with email address '". + $_SESSION['profile']['email']."' is requesting a TTP assurances for ". + mysql_escape_string(stripslashes($_POST['country'])).".\n\n"; + if ($_POST['ttptopup']=='1') { + $body .= "The user is also requesting TTP TOPUP.\n\n"; + }else{ + $body .= "The user is NOT requesting TTP TOPUP.\n\n"; + } + $body .= "The user received ".intval($_SESSION['profile']['points'])." assurance points up to today.\n\n"; + $body .= "Please start the TTP assurance process."; + sendmail("support@cacert.org", "[CAcert.org] TTP request.", $body, "support@cacert.org", "", "", "CAcert Website"); + + //This mail needs to be translated + $body =_("You are receiving this email because you asked for TTP assurance.")."\n\n"; + if ($_POST['ttptopup']=='1') { + $body .=_("You are requesting TTP TOPUP.")."\n\n"; + }else{ + $body .=_("You are NOT requesting TTP TOPUP.")."\n\n"; + } + $body .= _("Best regards")."\n"; + $body .= _("CAcert Support Team"); + + sendmail($_SESSION['profile']['email'], "[CAcert.org] "._("You requested TTP assurances"), $body, "support@cacert.org", "", "", "CAcert Support"); + + } + + } if(($id == 5 || $oldid == 5 || $id == 6 || $oldid == 6)) if (!is_assurer($_SESSION['profile']['id'])) @@ -228,7 +263,7 @@ $iecho= "c"; exit; } - if($_REQUEST['points'] == "") + if($_REQUEST['points'] == "" || !is_numeric($_REQUEST['points'])) { show_page("VerifyData","",_("You must enter the number of points you wish to allocate to this person.")); exit; @@ -305,6 +340,11 @@ $iecho= "c"; } mysql_query($query); fix_assurer_flag($_SESSION['_config']['notarise']['id']); + include_once("../includes/notary.inc.php"); +/*to be activated after CCA accept option is implemented in form + write_user_agreement($_SESSION['profile']['id'], "CCA", "assurance", "Assuring", 1, $_SESSION['_config']['notarise']['id']);}*/ +/* to be activated after the CCA recording is announced + write_user_agreement($_SESSION['_config']['notarise']['id'], "CCA", "assurance", "Being assured", 0, $_SESSION['profile']['id']); */ if($_SESSION['profile']['points'] < 150) { @@ -321,6 +361,7 @@ $iecho= "c"; `method`='Administrative Increase', `when`=NOW()"; mysql_query($query); + // No need to fix_assurer_flag here, this should only happen for assurers... $_SESSION['profile']['points'] += $addpoints; } @@ -341,14 +382,8 @@ $iecho= "c"; if(($drow['total'] + $newpoints) >= 100 && $newpoints > 0) { - $body .= _("You have at least 100 Assurance Points. If you want ". - "to become an assurer try the Assurer Challenge"). - " ( https://cats.cacert.org ).\n\n"; - $body .= _("To make it easier for others in your area to find ". - "you, it's helpful to list yourself as an assurer (this ". - "is voluntary), as well as a physical location where you ". - "live or work the most. You can flag your account to be ". - "listed, and add a comment to the display by going to:")."\n"; + $body .= _("You have at least 100 Assurance Points, if you want to become an assurer try the Assurer Challenge")." ( https://cats.cacert.org )\n\n"; + $body .= _("To make it easier for others in your area to find you, it's helpful to list yourself as an assurer (this is voluntary), as well as a physical location where you live or work the most. You can flag your account to be listed, and add a comment to the display by going to:")."\n"; $body .= "https://www.cacert.org/wot.php?id=8\n\n"; $body .= _("You can list your location by going to:")."\n"; $body .= "https://www.cacert.org/wot.php?id=13\n\n"; |