diff options
42 files changed, 2656 insertions, 1681 deletions
diff --git a/includes/account.php b/includes/account.php index ff9da77..f28cf49 100644 --- a/includes/account.php +++ b/includes/account.php @@ -18,6 +18,7 @@ require_once("../includes/loggedin.php"); require_once("../includes/lib/l10n.php"); require_once("../includes/lib/check_weak_key.php"); + require_once("../includes/notary.inc.php"); loadem("account"); @@ -70,9 +71,7 @@ } $oldid=0; $_REQUEST['email'] = trim(mysql_real_escape_string(stripslashes($_REQUEST['newemail']))); - $query = "select * from `email` where `email`='".$_REQUEST['email']."' and `deleted`=0"; - $res = mysql_query($query); - if(mysql_num_rows($res) > 0) + if(check_email_exists($_REQUEST['email'])==true) { showheader(_("My CAcert.org Account!")); printf(_("The email address '%s' is already in a different account. Can't continue."), sanitizeHTML($_REQUEST['email'])); @@ -150,10 +149,12 @@ $delcount = 0; if(array_key_exists('delid',$_REQUEST) && is_array($_REQUEST['delid'])) { + $deltitle=false; foreach($_REQUEST['delid'] as $id) { - if (0==$delcount) { + if (!$deltitle) { echo _('The following email addresses have been removed:')."<br>\n"; + $deltitle=true; } $id = intval($id); $query = "select * from `email` where `id`='$id' and `memid`='".intval($_SESSION['profile']['id'])."' and @@ -163,17 +164,7 @@ { $row = mysql_fetch_assoc($res); echo $row['email']."<br>\n"; - $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 - group by `emailcerts`.`id`"; - $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); + account_email_delete($row['id']); $delcount++; } } @@ -184,7 +175,7 @@ } if(0 == $delcount) { - echo _("You failed to select any accounts to be removed, or you attempted to remove the default account. No action was taken."); + echo _("You did not select any accounts to be removed, or you attempted to remove the default account. No action was taken."); } showfooter(); @@ -193,6 +184,14 @@ if($process != "" && $oldid == 3) { + if(!array_key_exists('CCA',$_REQUEST)) + { + showheader(_("My CAcert.org Account!")); + echo _("You did not accept the CAcert Community Agreement (CCA), hit the back button and try again."); + showfooter(); + exit; + } + if(!(array_key_exists('addid',$_REQUEST) && is_array($_REQUEST['addid'])) && $_REQUEST['SSO'] != '1') { showheader(_("My CAcert.org Account!")); @@ -322,6 +321,8 @@ exit; } + write_user_agreement(intval($_SESSION['profile']['id']), "CCA", "certificate creation", "", 1); + $query = "insert into emailcerts set `CN`='$defaultemail', `keytype`='NS', @@ -630,32 +631,9 @@ { $row = mysql_fetch_assoc($res); echo $row['domain']."<br>\n"; - - $dres = mysql_query( - "select `domaincerts`.`id` - from `domaincerts` - where `domaincerts`.`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( - "update `domaincerts` - set `revoked`='1970-01-01 10:00:01' - where `id` = '".$drow['id']."' - and `revoked` = 0 - and UNIX_TIMESTAMP(`expire`) - - UNIX_TIMESTAMP() > 0"); - } - - mysql_query( - "update `domains` - set `deleted`=NOW() - where `id` = '$id'"); + account_domain_delete($row['id']); } + } } else @@ -669,6 +647,14 @@ if($process != "" && $oldid == 10) { + if(!array_key_exists('CCA',$_REQUEST)) + { + showheader(_("My CAcert.org Account!")); + echo _("You did not accept the CAcert Community Agreement (CCA), hit the back button and try again."); + showfooter(); + exit; + } + $CSR = clean_csr($_REQUEST['CSR']); if(strpos($CSR,"---BEGIN")===FALSE) { @@ -785,6 +771,8 @@ if($_SESSION['_config']['rootcert'] < 1 || $_SESSION['_config']['rootcert'] > 2) $_SESSION['_config']['rootcert'] = 1; + write_user_agreement(intval($_SESSION['profile']['id']), "CCA", "certificate creation", "", 1); + if(array_key_exists('0',$_SESSION['_config']['rowid']) && $_SESSION['_config']['rowid']['0'] > 0) { $query = "insert into `domaincerts` set @@ -1206,17 +1194,17 @@ $description= trim(mysql_real_escape_string(stripslashes($_REQUEST['description']))); }else{ $description= ""; - } + } - if(trim($_REQUEST['disablelogin']) == "1"){ - $disablelogin = 1; - }else{ - $disablelogin = 0; - } + if(trim($_REQUEST['disablelogin']) == "1"){ + $disablelogin = 1; + }else{ + $disablelogin = 0; + } - mysql_query("update `emailcerts` set `disablelogin`='$disablelogin', `description`='$description' where `id`='".$_REQUEST['certid']."' and `memid`='".$_SESSION['profile']['id']."'"); + mysql_query("update `emailcerts` set `disablelogin`='$disablelogin', `description`='$description' where `id`='".$_REQUEST['certid']."' and `memid`='".$_SESSION['profile']['id']."'"); + } - } if($oldid == 13 && $process != "") { csrf_check("perschange"); @@ -2733,6 +2721,13 @@ mysql_query($query); } + if($oldid == 43 && $_REQUEST['action'] == 'revokecert') + { + $userid = intval($_REQUEST['userid']); + revoke_all_private_cert($userid); + $id=43; + } + if($oldid == 48 && $_REQUEST['domain'] == "") { $id = $oldid; @@ -3029,23 +3024,39 @@ if($oldid == 50 && $process != "") { $_REQUEST['userid'] = intval($_REQUEST['userid']); - $res = mysql_query("select * from `users` where `id`='".intval($_REQUEST['userid'])."'"); - if(mysql_num_rows($res) > 0) - { - $query = "update `domaincerts`,`domains` SET `domaincerts`.`revoked`='1970-01-01 10:00:01' - WHERE `domaincerts`.`domid` = `domains`.`id` AND `domains`.`memid`='".intval($_REQUEST['userid'])."'"; - mysql_query($query); - $query = "update `domains` SET `deleted`=NOW() WHERE `domains`.`memid`='".intval($_REQUEST['userid'])."'"; - mysql_query($query); - $query = "update `emailcerts` SET `revoked`='1970-01-01 10:00:01' WHERE `memid`='".intval($_REQUEST['userid'])."'"; - mysql_query($query); - $query = "update `email` SET `deleted`=NOW() WHERE `memid`='".intval($_REQUEST['userid'])."'"; - mysql_query($query); - $query = "delete from `org` WHERE `memid`='".intval($_REQUEST['userid'])."'"; - mysql_query($query); - $query = "update `users` SET `deleted`=NOW() WHERE `id`='".intval($_REQUEST['userid'])."'"; - mysql_query($query); + if (trim($_REQUEST['arbitrationno'])==""){ + showheader(_("My CAcert.org Account!")); + echo _("You did not enter an arbitration number entry."); + showfooter(); + exit; + } + if ( 1 !== preg_match('/^[a-z]\d{8}\.\d+\.\d+$/i',trim($_REQUEST['arbitrationno'])) ) { + showheader(_("My CAcert.org Account!")); + printf(_("'%s' is not a valid arbitration number entry."), sanitizeHTML(trim($_REQUEST['arbitrationno']))); + showfooter(); + exit; + } + if (check_email_exists(trim($_REQUEST['arbitrationno']).'@cacert.org')) { + showheader(_("My CAcert.org Account!")); + printf(_("The email address '%s' is already in a different account. Can't continue."), sanitizeHTML($_REQUEST['arbitrationno'].'@cacert.org')); + showfooter(); + exit; + } + if (check_client_cert_running($_REQUEST['userid'],1) || + check_server_cert_running($_REQUEST['userid'],1) || + check_gpg_cert_running($_REQUEST['userid'],1)) { + showheader(_("My CAcert.org Account!")); + printf(_("The CCA retention time for at least one certificate is not over. Can't continue.")); + showfooter(); + exit; + } + if (check_is_orgadmin($_REQUEST['userid'],1)) { + showheader(_("My CAcert.org Account!")); + printf(_("The user is listed as Organisation Administrator. Can't continue.")); + showfooter(); + exit; } + account_delete($_REQUEST['userid'], trim($_REQUEST['arbitrationno']), $_SESSION['profile']['id']); } if(($id == 51 || $id == 52 || $oldid == 52) && $_SESSION['profile']['tverify'] <= 0) diff --git a/includes/account_stuff.php b/includes/account_stuff.php index b9544e0..dbebf6a 100644 --- a/includes/account_stuff.php +++ b/includes/account_stuff.php @@ -172,7 +172,7 @@ function hideall() { </div> <div class="relatedLinks"> <h3 class="pointer" onclick="explode('mydetails')">+ <?=_("My Details")?></h3> - <ul class="menu" id="mydetails"><li><a href="account.php?id=13"><?=_("Edit")?></a></li><li><a href="account.php?id=14"><?=_("Change Password")?></a></li><li><a href="account.php?id=41"><?=_("Default Language")?></a></li><li><a href="wot.php?id=8"><?=_("My Listing")?></a></li><li><a href="wot.php?id=13"><?=_("My Location")?></a></li><li><a href="account.php?id=36"><?=_("My Alert Settings")?></a></li><li><a href="wot.php?id=10"><?=_("My Points")?></a></li><? + <ul class="menu" id="mydetails"><li><a href="account.php?id=13"><?=_("View/Edit")?></a></li><li><a href="account.php?id=14"><?=_("Change Password")?></a></li><li><a href="account.php?id=41"><?=_("Default Language")?></a></li><li><a href="wot.php?id=8"><?=_("My Listing")?></a></li><li><a href="wot.php?id=13"><?=_("My Location")?></a></li><li><a href="account.php?id=36"><?=_("My Alert Settings")?></a></li><li><a href="wot.php?id=10"><?=_("My Points")?></a></li><? if($_SESSION['profile']['id'] == 1 || $_SESSION['profile']['id'] == 5897) echo "<li><a href='sqldump.php'>SQL Dump</a></li>"; ?></ul> @@ -281,7 +281,7 @@ function hideall() { <div id="siteInfo"><a href="//wiki.cacert.org/FAQ/AboutUs"><?=_("About Us")?></a> | <a href="account.php?id=38"><?=_("Donations")?></a> | <a href="http://wiki.cacert.org/wiki/CAcertIncorporated"><?=_("Association Membership")?></a> | <a href="/policy/PrivacyPolicy.html"><?=_("Privacy Policy")?></a> | <a href="account.php?id=40"><?=_("Contact Us")?></a> | ©2002-<?=date("Y")?> <?=_("by CAcert")?></div> -</div> -</body> +</div> +</body> </html><? } diff --git a/includes/keygen.php b/includes/keygen.php index 09ec7f9..2713a81 100644 --- a/includes/keygen.php +++ b/includes/keygen.php @@ -75,7 +75,7 @@ if (array_key_exists('HTTP_USER_AGENT',$_SERVER) && strstr($_SERVER['HTTP_USER_A <p style="color:red"><?php printf(_('Please note that RSA key sizes smaller than %d bit '. 'will not be accepted by CAcert.'), - 1024)?> + 2048)?> </p> </fieldset> diff --git a/includes/lib/check_weak_key.php b/includes/lib/check_weak_key.php index ca13ba2..217b885 100644 --- a/includes/lib/check_weak_key.php +++ b/includes/lib/check_weak_key.php @@ -137,7 +137,7 @@ function checkWeakKeyText($text) $keysize = intval($keysize[1]); } - if ($keysize < 1024) + if ($keysize < 2048) { return sprintf(_("The keys that you use are very small ". "and therefore insecure. Please generate stronger ". @@ -145,11 +145,6 @@ function checkWeakKeyText($text) "found in %sthe wiki%s"), "<a href='//wiki.cacert.org/WeakKeys#SmallKey'>", "</a>"); - } elseif ($keysize < 2048) { - // not critical but log so we have some statistics about - // affected users - trigger_error("checkWeakKeyText(): Certificate for small ". - "key (< 2048 bit) requested", E_USER_NOTICE); } diff --git a/includes/notary.inc.php b/includes/notary.inc.php index d6f86a8..1f0ec92 100644 --- a/includes/notary.inc.php +++ b/includes/notary.inc.php @@ -41,6 +41,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) { $res = query_init ("SELECT count(*) AS `list` FROM `notary` @@ -106,7 +115,7 @@ function calc_experience ($row,&$points,&$experience,&$sum_experience,&$revoked) { - $apoints = max($row['points'],$row['awarded']); + $apoints = max($row['points'], $row['awarded']); $points += $apoints; $experience = " "; $revoked = false; # to be coded later (after DB-upgrade) @@ -192,15 +201,15 @@ ?> <table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper"> - <tr> - <td class="title"><?=_("Assurer Ranking")?></td> - </tr> - <tr> - <td class="DataTD"><?=sprintf(_("You have made %s assurances which ranks you as the #%s top assurer."), intval($num_of_assurances), intval($rank_of_assurer) )?></td> - </tr> - <tr> - <td class="DataTD"><?=sprintf(_("You have received %s assurances which ranks you as the #%s top assuree."), intval($num_of_assurees), intval($rank_of_assuree) )?></td> - </tr> + <tr> + <td class="title"><?=_("Assurer Ranking")?></td> + </tr> + <tr> + <td class="DataTD"><?=sprintf(_("You have made %s assurances which ranks you as the #%s top assurer."), intval($num_of_assurances), intval($rank_of_assurer) )?></td> + </tr> + <tr> + <td class="DataTD"><?=sprintf(_("You have received %s assurances which ranks you as the #%s top assuree."), intval($num_of_assurees), intval($rank_of_assuree) )?></td> + </tr> </table> <br/> <? @@ -210,65 +219,68 @@ { ?> <table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper"> - <tr> + <tr> <? if ($support == "1") { ?> - <td colspan="10" class="title"><?=$title?></td> + <td colspan="10" class="title"><?=$title?></td> <? } else { ?> - <td colspan="7" class="title"><?=$title?></td> -<? } + <td colspan="7" class="title"><?=$title?></td> +<? + } ?> - </tr> - <tr> - <td class="DataTD"><strong><?=_("ID")?></strong></td> - <td class="DataTD"><strong><?=_("Date")?></strong></td> + </tr> + <tr> + <td class="DataTD"><strong><?=_("ID")?></strong></td> + <td class="DataTD"><strong><?=_("Date")?></strong></td> <? if ($support == "1") { ?> - <td class="DataTD"><strong><?=_("When")?></strong></td> - <td class="DataTD"><strong><?=_("Email")?></strong></td> -<? } ?> - <td class="DataTD"><strong><?=_("Who")?></strong></td> - <td class="DataTD"><strong><?=_("Points")?></strong></td> - <td class="DataTD"><strong><?=_("Location")?></strong></td> - <td class="DataTD"><strong><?=_("Method")?></strong></td> - <td class="DataTD"><strong><?=_("Experience Points")?></strong></td> + <td class="DataTD"><strong><?=_("When")?></strong></td> + <td class="DataTD"><strong><?=_("Email")?></strong></td> +<? + } +?> + <td class="DataTD"><strong><?=_("Who")?></strong></td> + <td class="DataTD"><strong><?=_("Points")?></strong></td> + <td class="DataTD"><strong><?=_("Location")?></strong></td> + <td class="DataTD"><strong><?=_("Method")?></strong></td> + <td class="DataTD"><strong><?=_("Experience Points")?></strong></td> <? if ($support == "1") { ?> - <td class="DataTD"><strong><?=_("Revoke")?></strong></td> + <td class="DataTD"><strong><?=_("Revoke")?></strong></td> <? } ?> - </tr> + </tr> <? } function output_assurances_footer($points_txt,$points,$experience_txt,$sumexperience,$support) { ?> - <tr> - <td class="DataTD" colspan="5"><strong><?=$points_txt?>:</strong></td> - <td class="DataTD"><?=$points?></td> - <td class="DataTD"> </td> - <td class="DataTD"><strong><?=$experience_txt?>:</strong></td> - <td class="DataTD"><?=$sumexperience?></td> + <tr> + <td<?=($support == "1")?' colspan="5"':' colspan="3"'?> class="DataTD"><strong><?=$points_txt?>:</strong></td> + <td class="DataTD"><?=$points?></td> + <td class="DataTD"> </td> + <td class="DataTD"><strong><?=$experience_txt?>:</strong></td> + <td class="DataTD"><?=$sumexperience?></td> <? if ($support == "1") { ?> - <td class="DataTD"> </td> + <td class="DataTD"> </td> <? } ?> - </tr> + </tr> </table> <br/> <? @@ -277,52 +289,54 @@ function output_assurances_row($assuranceid,$date,$when,$email,$name,$awarded,$points,$location,$method,$experience,$userid,$support,$revoked) { - $tdstyle=""; - $emopen=""; - $emclose=""; + $tdstyle=""; + $emopen=""; + $emclose=""; - if ($awarded == $points) - { - if ($awarded == "0") + if ($awarded == $points) { - if ($when < "2006-09-01") + if ($awarded == "0") { - $tdstyle="style='background-color: #ffff80'"; - $emopen="<em>"; - $emclose="</em>"; + if ($when < "2006-09-01") + { + $tdstyle="style='background-color: #ffff80'"; + $emopen="<em>"; + $emclose="</em>"; + } } } - } ?> - <tr> - <td class="DataTD" <?=$tdstyle?>><?=$emopen?><?=$assuranceid?><?=$emclose?></td> - <td class="DataTD" <?=$tdstyle?>><?=$emopen?><?=$date?><?=$emclose?></td> + <tr> + <td class="DataTD" <?=$tdstyle?>><?=$emopen?><?=$assuranceid?><?=$emclose?></td> + <td class="DataTD" <?=$tdstyle?>><?=$emopen?><?=$date?><?=$emclose?></td> <? - if ($support == "1") - { + if ($support == "1") + { ?> <td class="DataTD" <?=$tdstyle?>><?=$emopen?><?=$when?><?=$emclose?></td> <td class="DataTD" <?=$tdstyle?>><?=$emopen?><?=$email?><?=$emclose?></td> -<? } +<? + } ?> - <td class="DataTD" <?=$tdstyle?>><?=$emopen?><?=$name?><?=$emclose?></td> - <td class="DataTD" <?=$tdstyle?>><?=$emopen?><?=$awarded?><?=$emclose?></td> - <td class="DataTD" <?=$tdstyle?>><?=$emopen?><?=$location?><?=$emclose?></td> - <td class="DataTD" <?=$tdstyle?>><?=$emopen?><?=$method?><?=$emclose?></td> - <td class="DataTD" <?=$tdstyle?>><?=$emopen?><?=$experience?><?=$emclose?></td> + <td class="DataTD" <?=$tdstyle?>><?=$emopen?><?=$name?><?=$emclose?></td> + <td class="DataTD" <?=$tdstyle?>><?=$emopen?><?=$awarded?><?=$emclose?></td> + <td class="DataTD" <?=$tdstyle?>><?=$emopen?><?=$location?><?=$emclose?></td> + <td class="DataTD" <?=$tdstyle?>><?=$emopen?><?=$method?><?=$emclose?></td> + <td class="DataTD" <?=$tdstyle?>><?=$emopen?><?=$experience?><?=$emclose?></td> <? - if ($support == "1") - { - if ($revoked == true) + if ($support == "1") { + if ($revoked == true) + { ?> - <td class="DataTD" <?=$tdstyle?>> </td> -<? } else { + <td class="DataTD" <?=$tdstyle?>> </td> +<? + } else { ?> - <td class="DataTD" <?=$tdstyle?>><?=$emopen?><a href="account.php?id=43&userid=<?=intval($userid)?>&assurance=<?=intval($assuranceid)?>&csrf=<?=make_csrf('admdelassurance')?>" onclick="return confirm('<?=sprintf(_("Are you sure you want to revoke the assurance with ID "%s"?"),$assuranceid)?>');"><?=_("Revoke")?></a><?=$emclose?></td> + <td class="DataTD" <?=$tdstyle?>><?=$emopen?><a href="account.php?id=43&userid=<?=intval($userid)?>&assurance=<?=intval($assuranceid)?>&csrf=<?=make_csrf('admdelassurance')?>" onclick="return confirm('<?=sprintf(_("Are you sure you want to revoke the assurance with ID "%s"?"),$assuranceid)?>');"><?=_("Revoke")?></a><?=$emclose?></td> <? + } } - } ?> </tr> <? @@ -332,14 +346,14 @@ { ?> <table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper"> - <tr> - <td colspan="4" class="title"><?=_("Summary of your Points")?></td> - </tr> - <tr> - <td class="DataTD"><strong><?=_("Description")?></strong></td> - <td class="DataTD"><strong><?=_("Points")?></strong></td> - <td class="DataTD"><strong><?=_("Countable Points")?></strong></td> - <td class="DataTD"><strong><?=_("Remark")?></strong></td> + <tr> + <td colspan="4" class="title"><?=_("Summary of your Points")?></td> + </tr> + <tr> + <td class="DataTD"><strong><?=_("Description")?></strong></td> + <td class="DataTD"><strong><?=_("Points")?></strong></td> + <td class="DataTD"><strong><?=_("Countable Points")?></strong></td> + <td class="DataTD"><strong><?=_("Remark")?></strong></td> </tr> <? } @@ -355,12 +369,12 @@ function output_summary_row($title,$points,$points_countable,$remark) { ?> - <tr> - <td class="DataTD"><strong><?=$title?></strong></td> - <td class="DataTD"><?=$points?></td> - <td class="DataTD"><?=$points_countable?></td> - <td class="DataTD"><?=$remark?></td> - </tr> + <tr> + <td class="DataTD"><strong><?=$title?></strong></td> + <td class="DataTD"><?=$points?></td> + <td class="DataTD"><?=$points_countable?></td> + <td class="DataTD"><?=$remark?></td> + </tr> <? } @@ -430,6 +444,8 @@ break; case 'Unknown': // to be revoked in the future? limit to max 50 pts? case 'Trusted Third Parties': // to be revoked in the future? limit to max 35 pts? + case 'TTP-Assisted': // TTP assurances, limit to 35 + case 'TOPUP': // TOPUP to be delevoped in the future, limit to 30 case '': // to be revoked in the future? limit to max 50 pts? case 'Face to Face Meeting': // normal assurances, limit to 35/50 pts in the future? break; @@ -575,14 +591,14 @@ return $issue_points; } - function output_given_assurances($userid,$support) + function output_given_assurances($userid,$support=0) { output_assurances_header(_("Assurance Points You Issued"),$support); output_given_assurances_content($userid,$points,$sum_experience,$support); output_assurances_footer(_("Total Points Issued"),$points,_("Total Experience Points"),$sum_experience,$support); } - function output_received_assurances($userid,$support) + function output_received_assurances($userid,$support=0) { output_assurances_header(_("Your Assurance Points"),$support); output_received_assurances_content($userid,$points,$sum_experience,$support); @@ -602,18 +618,30 @@ <p>[ <a href='javascript:history.go(-1)'><?=_("Go Back")?></a> ]</p> <? } - + //functions to do with recording user agreements + /** + * write_user_agreement() + * writes a new record to the table user_agreement + * + * @param mixed $memid + * @param mixed $document + * @param mixed $method + * @param mixed $comment + * @param integer $active + * @param integer $secmemid + * @return + */ 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."'" ; + $query="insert into `user_agreements` set `memid`=".intval($memid).", `secmemid`=".intval($secmemid). + ",`document`='".mysql_real_escape_string($document)."',`date`=NOW(), `active`=".intval($active).",`method`='".mysql_real_escape_string($method)."',`comment`='".mysql_real_escape_string($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 + $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){ @@ -650,8 +678,8 @@ 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" ; + 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); @@ -664,7 +692,7 @@ $rec=array(); } return $rec; -} + } function delete_user_agreement($memid, $type="CCA"){ //deletes all entries to an user for the given type of user agreements @@ -672,4 +700,413 @@ mysql_query("delete from `user_agreements` where `secmemid`='".$memid."'"); } + // functions for 6.php (assure somebody) + + function AssureHead($confirmation,$checkname) + { +?> +<form method="post" action="wot.php"> +<table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper" width="600"> + <tr> + <td colspan="2" class="title"><?=$confirmation?></td> + </tr> + <tr> + <td class="DataTD" colspan="2" align="left"><?=$checkname?></td> + </tr> +<? + } + + function AssureTextLine($field1,$field2) + { +?> + <tr> + <td class="DataTD"><?=$field1.(empty($field1)?'':':')?></td> + <td class="DataTD"><?=$field2?></td> + </tr> +<? + } + + function AssureBoxLine($type,$text,$checked) + { +?> + <tr> + <td class="DataTD"><input type="checkbox" name="<?=$type?>" value="1" <?=$checked?"checked":""?>></td> + <td class="DataTD"><?=$text?></td> + </tr> +<? + } + + function AssureMethodLine($text,$methods,$remark) + { + if (count($methods) != 1) { +?> + <tr> + <td class="DataTD"><?=$text.(empty($text)?'':':')?></td> + <td class="DataTD"> + <select name="method"> +<? + foreach($methods as $val) { +?> + <option value="<?=$val?>"><?=$val?></option> +<? + } +?> + </select> + <br /> + <?=$remark?> + </td> + </tr> +<? + } else { +?> + <input type="hidden" name="<?=$val?>" value="<?=$methods[0]?>" /> +<? + } + } + + function AssureInboxLine($type,$field,$value,$description) + { +?> + <tr> + <td class="DataTD"><?=$field.(empty($field)?'':':')?></td> + <td class="DataTD"><input type="text" name="<?=$type?>" value="<?=$value?>"><?=$description?></td> + </tr> +<? + } + + function AssureFoot($oldid,$confirm) + { ?> + <tr> + <td class="DataTD" colspan="2"> + <input type="submit" name="process" value="<?=$confirm?>" /> + <input type="submit" name="cancel" value="<?=_("Cancel")?>" /> + </td> + </tr> +</table> +<input type="hidden" name="pagehash" value="<?=$_SESSION['_config']['wothash']?>" /> +<input type="hidden" name="oldid" value="<?=$oldid?>" /> +</form> +<? + } + + function account_email_delete($mailid){ + //deletes an email entry from an acount + //revolkes all certifcates for that email address + //called from www/account.php if($process != "" && $oldid == 2) + //called from www/diputes.php if($type == "reallyemail") / if($action == "accept") + //called from account_delete + $mailid = intval($mailid); + revoke_all_client_cert($mailid); + $query = "update `email` set `deleted`=NOW() where `id`='$mailid'"; + mysql_query($query); + } + + function account_domain_delete($domainid){ + //deletes an domain entry from an acount + //revolkes all certifcates for that domain address + //called from www/account.php if($process != "" && $oldid == 9) + //called from www/diputes.php if($type == "reallydomain") / if($action == "accept") + //called from account_delete + $domainid = intval($domainid); + revoke_all_server_cert($domainid); + mysql_query( + "update `domains` + set `deleted`=NOW() + where `id` = '$domainid'"); + } + + function account_delete($id, $arbno, $adminid){ + //deletes an account following the deleted account routnie V3 + // called from www/account.php if($oldid == 50 && $process != "") + //change password + $id = intval($id); + $arbno = mysql_real_escape_string($arbno); + $adminid = intval($adminid); + $pool = 'abcdefghijklmnopqrstuvwxyz'; + $pool .= '0123456789!()§'; + $pool .= 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; + srand ((double)microtime()*1000000); + $password=""; + for($index = 0; $index < 30; $index++) + { + $password .= substr($pool,(rand()%(strlen ($pool))), 1); + } + mysql_query("update `users` set `password`=sha1('".$password."') where `id`='".$id."'"); + + //create new mail for arbitration number + $query = "insert into `email` set `email`='".$arbno."@cacert.org',`memid`='".$id."',`created`=NOW(),`modified`=NOW(), `attempts`=-1"; + mysql_query($query); + $emailid = mysql_insert_id(); + + //set new mail as default + $query = "update `users` set `email`='".$arbno."@cacert.org' where `id`='".$id."'"; + mysql_query($query); + + //delete all other email address + $query = "select `id` from `email` where `memid`='".$id."' and `id`!='".$emailid."'" ; + $res=mysql_query($query); + while($row = mysql_fetch_assoc($res)){ + account_email_delete($row['id']); + } + + //delete all domains + $query = "select `id` from `domains` where `memid`='".$id."'"; + $res=mysql_query($query); + while($row = mysql_fetch_assoc($res)){ + account_domain_delete($row['id']); + } + + //clear alert settings + mysql_query( + "update `alerts` set + `general`='0', + `country`='0', + `regional`='0', + `radius`='0' + where `memid`='$id'"); + + //set default location + $query = "update `users` set `locid`='2256755', `regid`='243', `ccid`='12' where `id`='".$id."'"; + mysql_query($query); + + //clear listings + $query = "update `users` set `listme`=' ',`contactinfo`=' ' where `id`='".$id."'"; + mysql_query($query); + + //set lanuage to default + //set default language + mysql_query("update `users` set `language`='en_AU' where `id`='".$id."'"); + //delete secondary langugaes + mysql_query("delete from `addlang` where `userid`='".$id."'"); + + //change secret questions + for($i=1;$i<=5;$i++){ + $q=""; + $a=""; + for($index = 0; $index < 30; $index++) + { + $q .= substr($pool,(rand()%(strlen ($pool))), 1); + $a .= substr($pool,(rand()%(strlen ($pool))), 1); + } + $query = "update `users` set `Q$i`='$q', `A$i`='$a' where `id`='".$id."'"; + mysql_query($query); + } + + //change personal information to arbitration number and DOB=1900-01-01 + $query = "select `fname`,`mname`,`lname`,`suffix`,`dob` from `users` where `id`='$userid'"; + $details = mysql_fetch_assoc(mysql_query($query)); + $query = "insert into `adminlog` set `when`=NOW(),`old-lname`='${details['lname']}',`old-dob`='${details['dob']}', + `new-lname`='$arbno',`new-dob`='1900-01-01',`uid`='$id',`adminid`='".$adminid."'"; + mysql_query($query); + $query = "update `users` set `fname`='".$arbno."', + `mname`='".$arbno."', + `lname`='".$arbno."', + `suffix`='".$arbno."', + `dob`='1900-01-01' + where `id`='".$id."'"; + mysql_query($query); + + //clear all admin and board flags + mysql_query( + "update `users` set + `assurer`='0', + `assurer_blocked`='0', + `codesign`='0', + `orgadmin`='0', + `ttpadmin`='0', + `locadmin`='0', + `admin`='0', + `adadmin`='0', + `tverify`='0', + `board`='0' + where `id`='$id'"); + + //block account + mysql_query("update `users` set `locked`='1' where `id`='$id'"); //, `deleted`=Now() + } + + + function check_email_exists($email){ + // called from includes/account.php if($process != "" && $oldid == 1) + // called from includes/account.php if($oldid == 50 && $process != "") + $email = mysql_real_escape_string($email); + $query = "select 1 from `email` where `email`='$email' and `deleted`=0"; + $res = mysql_query($query); + return mysql_num_rows($res) > 0; + } + + function check_gpg_cert_running($uid,$cca=0){ + //if $cca =0 if just expired, =1 if CCA retention +3 month should be obeyed + // called from includes/account.php if($oldid == 50 && $process != "") + $uid = intval($uid); + if (0==$cca) { + $query = "select 1 from `gpg` where `memid`='$uid' and `expire`>NOW()"; + }else{ + $query = "select 1 from `gpg` where `memid`='$uid' and `expire`>(NOW()-90*86400)"; + } + $res = mysql_query($query); + return mysql_num_rows($res) > 0; + } + + function check_client_cert_running($uid,$cca=0){ + //if $cca =0 if just expired, =1 if CCA retention +3 month should be obeyed + // called from includes/account.php if($oldid == 50 && $process != "") + $uid = intval($uid); + if (0==$cca) { + $query1 = "select 1 from `emailcerts` where `memid`='$uid' and `expire`>NOW() and `revoked`<`created`"; + $query2 = "select 1 from `emailcerts` where `memid`='$uid' and `revoked`>NOW()"; + }else{ + $query1 = "select 1 from `emailcerts` where `memid`='$uid' and `expire`>(NOW()-90*86400) and `revoked`<`created`"; + $query2 = "select 1 from `emailcerts` where `memid`='$uid' and `revoked`>(NOW()-90*86400)"; + } + $res = mysql_query($query1); + $r1 = mysql_num_rows($res)>0; + $res = mysql_query($query2); + $r2 = mysql_num_rows($res)>0; + return !!($r1 || $r2); + } + + function check_server_cert_running($uid,$cca=0){ + //if $cca =0 if just expired, =1 if CCA retention +3 month should be obeyed + // called from includes/account.php if($oldid == 50 && $process != "") + $uid = intval($uid); + if (0==$cca) { + $query1 = " + select 1 from `domaincerts` join `domains` + on `domaincerts`.`domid` = `domains`.`id` + where `domains`.`memid` = '$uid' + and `domaincerts`.`expire` > NOW() + and `domaincerts`.`revoked` < `domaincerts`.`created`"; + $query2 = " + select 1 from `domaincerts` join `domains` + on `domaincerts`.`domid` = `domains`.`id` + where `domains`.`memid` = '$uid' + and `revoked`>NOW()"; + }else{ + $query1 = " + select 1 from `domaincerts` join `domains` + on `domaincerts`.`domid` = `domains`.`id` + where `domains`.`memid` = '$uid' + and `expire`>(NOW()-90*86400) + and `revoked`<`created`"; + $query2 = " + select 1 from `domaincerts` join `domains` + on `domaincerts`.`domid` = `domains`.`id` + where `domains`.`memid` = '$uid' + and `revoked`>(NOW()-90*86400)"; + } + $res = mysql_query($query1); + $r1 = mysql_num_rows($res)>0; + $res = mysql_query($query2); + $r2 = mysql_num_rows($res)>0; + return !!($r1 || $r2); + } + + function check_is_orgadmin($uid){ + // called from includes/account.php if($oldid == 50 && $process != "") + $uid = intval($uid); + $query = "select 1 from `org` where `memid`='$uid' and `deleted`=0"; + $res = mysql_query($query); + return mysql_num_rows($res) > 0; + } + + + // revokation of certificates + function revoke_all_client_cert($mailid){ + //revokes all client certificates for an email address + $mailid = intval($mailid); + $query = "select `emailcerts`.`id` + from `emaillink`,`emailcerts` where + `emaillink`.`emailid`='$mailid' and `emaillink`.`emailcertsid`=`emailcerts`.`id` and `emailcerts`.`revoked`=0 + group by `emailcerts`.`id`"; + $dres = mysql_query($query); + while($drow = mysql_fetch_assoc($dres)){ + mysql_query("update `emailcerts` set `revoked`='1970-01-01 10:00:01', `disablelogin`=1 where `id`='".$drow['id']."'"); + } + } + + function revoke_all_server_cert($domainid){ + //revokes all server certs for an domain + $domainid = intval($domainid); + $query = + "select `domaincerts`.`id` + from `domaincerts` + where `domaincerts`.`domid` = '$domainid' + union distinct + select `domaincerts`.`id` + from `domaincerts`, `domlink` + where `domaincerts`.`id` = `domlink`.`certid` + and `domlink`.`domid` = '$domainid'"; + $dres = mysql_query($query); + while($drow = mysql_fetch_assoc($dres)) + { + mysql_query( + "update `domaincerts` + set `revoked`='1970-01-01 10:00:01' + where `id` = '".$drow['id']."' + and `revoked` = 0"); + } + } + + function revoke_all_private_cert($uid){ + //revokes all certificates linked to a personal accounts + //gpg revokation needs to be added to a later point + $uid=intval($uid); + $query = "select `id` from `email` where `memid`='".$uid."'"; + $res=mysql_query($query); + while($row = mysql_fetch_assoc($res)){ + revoke_all_client_cert($row['id']); + } + + + $query = "select `id` from `domains` where `memid`='".$uid."'"; + $res=mysql_query($query); + while($row = mysql_fetch_assoc($res)){ + revoke_all_server_cert($row['id']); + } + } + + /** + * check_date_format() + * checks if the date is entered in the right date format YYYY-MM-DD and + * if the date is after the 1st January of the given year + * + * @param mixed $date + * @param integer $year + * @return + */ + function check_date_format($date, $year=2000){ + if (!strpos($date,'-')) { + return FALSE; + } + $arr=explode('-',$date); + + if ((count($arr)!=3)) { + return FALSE; + } + if (intval($arr[0])<=$year) { + return FALSE; + } + if (intval($arr[1])>12 or intval($arr[1])<=0) { + return FALSE; + } + if (intval($arr[2])>31 or intval($arr[2])<=0) { + return FALSE; + } + + return checkdate( intval($arr[1]), intval($arr[2]), intval($arr[0])); + + } + + /** + * check_date_difference() + * returns false if the date is larger then today + time diffrence + * + * @param mixed $date + * @param integer $diff + * @return + */ + function check_date_difference($date, $diff=1){ + return (strtotime($date)<=time()+$diff*86400); + } diff --git a/includes/wot.inc.php b/includes/wot.inc.php deleted file mode 100644 index 9471bee..0000000 --- a/includes/wot.inc.php +++ /dev/null @@ -1,640 +0,0 @@ -<? /* - LibreSSL - CAcert web application - Copyright (C) 2004-2011 CAcert Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 of the License. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -*/ - - function query_init ($query) - { - return mysql_query($query); - } - - function query_getnextrow ($res) - { - $row1 = mysql_fetch_assoc($res); - return $row1; - } - - function query_get_number_of_rows ($resultset) - { - return intval(mysql_num_rows($resultset)); - } - - function get_number_of_assurances ($userid) - { - $res = query_init ("SELECT count(*) AS `list` FROM `notary` - WHERE `method` = 'Face to Face Meeting' AND `from`='".intval($userid)."' "); - $row = query_getnextrow($res); - - 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) - { - $res = query_init ("SELECT count(*) AS `list` FROM `notary` - WHERE `method` = 'Face to Face Meeting' AND `to`='".intval($userid)."' "); - $row = query_getnextrow($res); - - return intval($row['list']); - } - - function get_top_assurer_position ($no_of_assurances) - { - $res = query_init ("SELECT count(*) AS `list` FROM `notary` - WHERE `method` = 'Face to Face Meeting' - GROUP BY `from` HAVING count(*) > '".intval($no_of_assurances)."'"); - return intval(query_get_number_of_rows($res)+1); - } - - function get_top_assuree_position ($no_of_assurees) - { - $res = query_init ("SELECT count(*) AS `list` FROM `notary` - WHERE `method` = 'Face to Face Meeting' - GROUP BY `to` HAVING count(*) > '".intval($no_of_assurees)."'"); - return intval(query_get_number_of_rows($res)+1); - } - - function get_given_assurances ($userid) - { - $res = query_init ("select * from `notary` where `from`='".intval($userid)."' and `from` != `to` order by `id` asc"); - return $res; - } - - function get_received_assurances ($userid) - { - $res = query_init ("select * from `notary` where `to`='".intval($userid)."' and `from` != `to` order by `id` asc "); - return $res; - } - - function get_given_assurances_summary ($userid) - { - $res = query_init ("select count(*) as number,points,awarded,method from notary where `from`='".intval($userid)."' group by points,awarded,method"); - return $res; - } - - function get_received_assurances_summary ($userid) - { - $res = query_init ("select count(*) as number,points,awarded,method from notary where `to`='".intval($userid)."' group by points,awarded,method"); - return $res; - } - - function get_user ($userid) - { - $res = query_init ("select * from `users` where `id`='".intval($userid)."'"); - return mysql_fetch_assoc($res); - } - - function get_cats_state ($userid) - { - - $res = query_init ("select * from `cats_passed` inner join `cats_variant` on `cats_passed`.`variant_id` = `cats_variant`.`id` and `cats_variant`.`type_id` = 1 - WHERE `cats_passed`.`user_id` = '".intval($userid)."'"); - return mysql_num_rows($res); - } - - function calc_experience ($row,&$points,&$experience,&$sum_experience) - { - $apoints = max($row['points'], $row['awarded']); - - $points += $apoints; - - $experience = " "; - if ($row['method'] == "Face to Face Meeting") - { - $sum_experience = $sum_experience +2; - $experience = "2"; - } - return $apoints; - } - - function calc_assurances ($row,&$points,&$experience,&$sumexperience,&$awarded) - { - $awarded = calc_points($row); - - if ($awarded > 100) - { - $experience = $awarded - 100; // needs to be fixed in the future (limit 50 pts and/or no experience if pts > 100) - $awarded = 100; - } - else - $experience = 0; - - switch ($row['method']) - { - case 'Thawte Points Transfer': - case 'CT Magazine - Germany': - case 'Temporary Increase': // Current usage of 'Temporary Increase' may break audit aspects, needs to be reimplemented - $awarded=sprintf("<strong style='color: red'>%s</strong>",_("Revoked")); - $experience=0; - break; - default: - $points += $awarded; - } - $sumexperience = $sumexperience + $experience; - } - - - function show_user_link ($name,$userid) - { - $name = trim($name); - if($name == "") - { - if ($userid == 0) - $name = _("System"); - else - $name = _("Deleted account"); - } - else - $name = "<a href='wot.php?id=9&userid=".intval($userid)."'>$name</a>"; - return $name; - } - - function get_assurer_ranking($userid,&$num_of_assurances,&$rank_of_assurer) - { - $num_of_assurances = get_number_of_assurances (intval($userid)); - $rank_of_assurer = get_top_assurer_position($num_of_assurances); - } - - function get_assuree_ranking($userid,&$num_of_assurees,&$rank_of_assuree) - { - $num_of_assurees = get_number_of_assurees (intval($userid)); - $rank_of_assuree = get_top_assuree_position($num_of_assurees); - } - - -// ************* html table definitions ****************** - - function output_ranking($userid) - { - get_assurer_ranking($userid,$num_of_assurances,$rank_of_assurer); - get_assuree_ranking($userid,$num_of_assurees,$rank_of_assuree); - -?> -<table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper"> - <tr> - <td class="title"><?=_("Assurer Ranking")?></td> - </tr> - <tr> - <td class="DataTD"><?=sprintf(_("You have made %s assurances which ranks you as the #%s top assurer."), intval($num_of_assurances), intval($rank_of_assurer) )?></td> - </tr> - <tr> - <td class="DataTD"><?=sprintf(_("You have received %s assurances which ranks you as the #%s top assuree."), intval($num_of_assurees), intval($rank_of_assuree) )?></td> - </tr> -</table> -<br/> -<? - } - - function output_assurances_header($title) - { -?> -<table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper"> - <tr> - <td colspan="7" class="title"><?=$title?></td> - </tr> - <tr> - <td class="DataTD"><strong><?=_("ID")?></strong></td> - <td class="DataTD"><strong><?=_("Date")?></strong></td> - <td class="DataTD"><strong><?=_("Who")?></strong></td> - <td class="DataTD"><strong><?=_("Points")?></strong></td> - <td class="DataTD"><strong><?=_("Location")?></strong></td> - <td class="DataTD"><strong><?=_("Method")?></strong></td> - <td class="DataTD"><strong><?=_("Experience Points")?></strong></td> - </tr> -<? - } - - function output_assurances_footer($points_txt,$points,$experience_txt,$sumexperience) - { -?> - <tr> - <td class="DataTD" colspan="3"><strong><?=$points_txt?>:</strong></td> - <td class="DataTD"><?=$points?></td> - <td class="DataTD"> </td> - <td class="DataTD"><strong><?=$experience_txt?>:</strong></td> - <td class="DataTD"><?=$sumexperience?></td> - </tr> -</table> -<br/> -<? - } - - function output_assurances_row($assuranceid,$date,$when,$name,$awarded,$points,$location,$method,$experience) - { - - $tdstyle=""; - $emopen=""; - $emclose=""; - - if ($awarded == $points) - { - if ($awarded == "0") - { - if ($when < "2006-09-01") - { - $tdstyle="style='background-color: #ffff80'"; - $emopen="<em>"; - $emclose="</em>"; - } - } - } - -?> - <tr> - <td class="DataTD" <?=$tdstyle?>><?=$emopen?><?=$assuranceid?><?=$emclose?></td> - <td class="DataTD" <?=$tdstyle?>><?=$emopen?><?=$date?><?=$emclose?></td> - <td class="DataTD" <?=$tdstyle?>><?=$emopen?><?=$name?><?=$emclose?></td> - <td class="DataTD" <?=$tdstyle?>><?=$emopen?><?=$awarded?><?=$emclose?></td> - <td class="DataTD" <?=$tdstyle?>><?=$emopen?><?=$location?><?=$emclose?></td> - <td class="DataTD" <?=$tdstyle?>><?=$emopen?><?=$method?><?=$emclose?></td> - <td class="DataTD" <?=$tdstyle?>><?=$emopen?><?=$experience?><?=$emclose?></td> - </tr> -<? - } - - function output_summary_header() - { -?> -<table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper"> - <tr> - <td colspan="4" class="title"><?=_("Summary of your Points")?></td> - </tr> - <tr> - <td class="DataTD"><strong><?=_("Description")?></strong></td> - <td class="DataTD"><strong><?=_("Points")?></strong></td> - <td class="DataTD"><strong><?=_("Countable Points")?></strong></td> - <td class="DataTD"><strong><?=_("Remark")?></strong></td> - </tr> -<? - } - - function output_summary_footer() - { -?> -</table> -<br/> -<? - } - - function output_summary_row($title,$points,$points_countable,$remark) - { -?> - <tr> - <td class="DataTD"><strong><?=$title?></strong></td> - <td class="DataTD"><?=$points?></td> - <td class="DataTD"><?=$points_countable?></td> - <td class="DataTD"><?=$remark?></td> - </tr> -<? - } - - -// ************* output given assurances ****************** - - function output_given_assurances_content($userid,&$points,&$sum_experience) - { - $points = 0; - $sumexperience = 0; - $res = get_given_assurances(intval($userid)); - while($row = mysql_fetch_assoc($res)) - { - $fromuser = get_user (intval($row['to'])); - $apoints = calc_experience ($row,$points,$experience,$sum_experience); - $name = show_user_link ($fromuser['fname']." ".$fromuser['lname'],intval($row['to'])); - output_assurances_row (intval($row['id']),$row['date'],$row['when'],$name,$apoints,intval($row['points']),$row['location'],$row['method']==""?"":_(sprintf("%s", $row['method'])),$experience); - } - } - -// ************* output received assurances ****************** - - function output_received_assurances_content($userid,&$points,&$sum_experience) - { - $points = 0; - $sumexperience = 0; - $res = get_received_assurances(intval($userid)); - while($row = mysql_fetch_assoc($res)) - { - $fromuser = get_user (intval($row['from'])); - calc_assurances ($row,$points,$experience,$sum_experience,$awarded); - $name = show_user_link ($fromuser['fname']." ".$fromuser['lname'],intval($row['from'])); - output_assurances_row (intval($row['id']),$row['date'],$row['when'],$name,$awarded,intval($row['points']),$row['location'],$row['method']==""?"":_(sprintf("%s", $row['method'])),$experience); - } - } - -// ************* output summary table ****************** - - function check_date_limit ($userid,$age) - { - $dob = date("Y-m-d", mktime(0,0,0,date("m"),date("d"),date("Y")-$age)); - $res = query_init ("select id from `users` where `id`='".$userid."' and `dob` < '$dob'"); - return intval(query_get_number_of_rows($res)); - } - - function calc_points($row) - { - $awarded = intval($row['awarded']); - if ($awarded == "") - $awarded = 0; - if (intval($row['points']) < $awarded) - $points = $awarded; // if 'sum of added points' > 100, awarded shows correct value - else - $points = intval($row['points']); // on very old assurances, awarded is '0' instead of correct value - switch ($row['method']) - { - case 'Thawte Points Transfer': // revoke all Thawte-points (as per arbitration) - case 'CT Magazine - Germany': // revoke c't (only one test-entry) - case 'Temporary Increase': // revoke 'temporary increase' (Current usage breaks audit aspects, needs to be reimplemented) - $points = 0; - break; - case 'Administrative Increase': // ignore AI with 2 points or less (historical for experiance points, now other calculation) - if ($points <= 2) // maybe limit to 35/50 pts in the future? - $points = 0; - break; - case 'Unknown': // to be revoked in the future? limit to max 50 pts? - case 'Trusted Third Parties': // to be revoked in the future? limit to max 35 pts? - case 'TTP-Assisted': // TTP assurances, limit to 35 - case 'TOPUP': // TOPUP to be delevoped in the future, limit to 30 - case '': // to be revoked in the future? limit to max 50 pts? - case 'Face to Face Meeting': // normal assurances, limit to 35/50 pts in the future? - break; - default: // should never happen ... ;-) - $points = 0; - } - if ($points < 0) // ignore negative points (bug needs to be fixed) - $points = 0; - return $points; - } - - function max_points($userid) - { - return output_summary_content ($userid,0); - } - - function output_summary_content($userid,$display_output) - { - $sum_points = 0; - $sum_experience = 0; - $sum_experience_other = 0; - $max_points = 100; - $max_experience = 50; - - $experience_limit_reached_txt = _("Limit reached"); - - if (check_date_limit($userid,18) != 1) - { - $max_experience = 10; - $experience_limit_reached_txt = _("Limit given by PoJAM reached"); - } - if (check_date_limit($userid,14) != 1) - { - $max_experience = 0; - $experience_limit_reached_txt = _("Limit given by PoJAM reached"); - } - - $res = get_received_assurances_summary($userid); - while($row = mysql_fetch_assoc($res)) - { - $points = calc_points ($row); - - if ($points > $max_points) // limit to 100 points, above is experience (needs to be fixed) - { - $sum_experience_other = $sum_experience_other+($points-$max_points)*intval($row['number']); - $points = $max_points; - } - $sum_points += $points*intval($row['number']); - } - - $res = get_given_assurances_summary($userid); - while($row = mysql_fetch_assoc($res)) - { - switch ($row['method']) - { - case 'Face to Face Meeting': // count Face to Face only - $sum_experience += 2*intval($row['number']); - break; - } - - } - - if ($sum_points > $max_points) - { - $sum_points_countable = $max_points; - $remark_points = _("Limit reached"); - } - else - { - $sum_points_countable = $sum_points; - $remark_points = " "; - } - if ($sum_experience > $max_experience) - { - $sum_experience_countable = $max_experience; - $remark_experience = $experience_limit_reached_txt; - } - else - { - $sum_experience_countable = $sum_experience; - $remark_experience = " "; - } - - if ($sum_experience_countable + $sum_experience_other > $max_experience) - { - $sum_experience_other_countable = $max_experience-$sum_experience_countable; - $remark_experience_other = $experience_limit_reached_txt; - } - else - { - $sum_experience_other_countable = $sum_experience_other; - $remark_experience_other = " "; - } - - if ($sum_points_countable < $max_points) - { - if ($sum_experience_countable != 0) - $remark_experience = _("Points on hold due to less assurance points"); - $sum_experience_countable = 0; - if ($sum_experience_other_countable != 0) - $remark_experience_other = _("Points on hold due to less assurance points"); - $sum_experience_other_countable = 0; - } - - $issue_points = 0; - $cats_test_passed = get_cats_state ($userid); - if ($cats_test_passed == 0) - { - $issue_points_txt = "<strong style='color: red'>"._("You have to pass the CAcert Assurer Challenge (CATS-Test) to be an Assurer")."</strong>"; - if ($sum_points_countable < $max_points) - { - $issue_points_txt = "<strong style='color: red'>"; - $issue_points_txt .= sprintf(_("You need %s assurance points and the passed CATS-Test to be an Assurer"), intval($max_points)); - $issue_points_txt .= "</strong>"; - } - } - else - { - $experience_total = $sum_experience_countable+$sum_experience_other_countable; - $issue_points_txt = ""; - if ($sum_points_countable == $max_points) - $issue_points = 10; - if ($experience_total >= 10) - $issue_points = 15; - if ($experience_total >= 20) - $issue_points = 20; - if ($experience_total >= 30) - $issue_points = 25; - if ($experience_total >= 40) - $issue_points = 30; - if ($experience_total >= 50) - $issue_points = 35; - if ($issue_points != 0) - $issue_points_txt = sprintf(_("You may issue up to %s points"),$issue_points); - } - if ($display_output) - { - output_summary_row (_("Assurance Points you received"),$sum_points,$sum_points_countable,$remark_points); - output_summary_row (_("Total Experience Points by Assurance"),$sum_experience,$sum_experience_countable,$remark_experience); - output_summary_row (_("Total Experience Points (other ways)"),$sum_experience_other,$sum_experience_other_countable,$remark_experience_other); - output_summary_row (_("Total Points")," ",$sum_points_countable + $sum_experience_countable + $sum_experience_other_countable,$issue_points_txt); - } - return $issue_points; - } - - function output_given_assurances($userid) - { - output_assurances_header(_("Assurance Points You Issued")); - output_given_assurances_content($userid,$points,$sum_experience); - output_assurances_footer(_("Total Points Issued"),$points,_("Total Experience Points"),$sum_experience); - } - - function output_received_assurances($userid) - { - output_assurances_header(_("Your Assurance Points")); - output_received_assurances_content($userid,$points,$sum_experience); - output_assurances_footer(_("Total Assurance Points"),$points,_("Total Experience Points"),$sum_experience); - } - - function output_summary($userid) - { - output_summary_header(); - output_summary_content($userid,1); - output_summary_footer(); - } - - function output_end_of_page() - { -?> - <p>[ <a href='javascript:history.go(-1)'><?=_("Go Back")?></a> ]</p> -<? - } - -// functions for 6.php (assure somebody) - -function AssureHead($confirmation,$checkname) -{ -?> -<form method="post" action="wot.php"> - <table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper" width="600"> - <tr> - <td colspan="2" class="title"><?=$confirmation?></td> - </tr> - <tr> - <td class="DataTD" colspan="2" align="left"><?=$checkname?></td> - </tr> -<? - } - -function AssureTextLine($field1,$field2) -{ -?> - <tr> - <td class="DataTD"><?=$field1?>:</td> - <td class="DataTD"><?=$field2?></td> - </tr> -<? -} - -function AssureCCABoxLine($type,$text) -{ - return; - AssureBoxLine($type,$text); -} - -function AssureBoxLine($type,$text,$checked) -{ -?> - <tr> - <td class="DataTD"><input type="checkbox" name="<?=$type?>" value="1" <?=$checked?"checked":""?>></td> - <td class="DataTD"><?=$text?></td> - </tr> -<? -} - -function AssureMethodLine($text,$methods,$remark) -{ - if (count($methods) != 1) - { -?> - <tr> - <td class="DataTD"><?=$text?></td> - <td class="DataTD"> - <select name="method"> -<? - foreach($methods as $val) { ?> - <option value="<?=$val?>"> <?=$val?></option> - -<? } ?> - </select> - </br><?=$remark?> - </td> - </tr> -<? - } else { -?> - <input type="hidden" name="<?=$val?>" value="<?=$methods[0]?>"> -<? - } -} - -function AssureInboxLine($type,$field,$value,$description) -{ -?> - <tr> - <td class="DataTD"><?=$field?>:</td> - <td class="DataTD"><input type="text" name="<?=$type?>" value="<?=$value?>"><?=$description?></td> - </tr> -<? -} - -function AssureFoot($oldid,$confirm) -{?> - <tr> - <td class="DataTD" colspan="2"><input type="submit" name="process" value="<?=$confirm?>"> <input type="submit" name="cancel" value="<?=_("Cancel")?>"></td> - </tr> - </table> - <input type="hidden" name="pagehash" value="<?=$_SESSION['_config']['wothash']?>"> - <input type="hidden" name="oldid" value="<?=$oldid?>"> -</form> -<? -} - diff --git a/pages/account/10.php b/pages/account/10.php index f83e0d8..8908400 100644 --- a/pages/account/10.php +++ b/pages/account/10.php @@ -17,7 +17,7 @@ */ include_once("../includes/shutdown.php"); ?> -<h3><?=_("CAcert Certficate Acceptable Use Policy")?></h3> +<h3><?=_("CAcert Certificate Acceptable Use Policy")?></h3> <p><?=_("Once you decide to subscribe for an SSL Server Certificate you will need to complete this agreement. Please read it carefully. Your Certificate Request can only be processed with your acceptance and understanding of this agreement.")?></p> <p><?=_("I hereby represent that I am fully authorized by the owner of the information contained in the CSR sent to CAcert Inc. to apply for an Digital Certificate for secure and authenticated electronic transactions. I understand that a digital certificate serves to identify the Subscriber for the purposes of electronic communication and that the management of the private keys associated with such certificates is the responsibility of the subscriber's technical staff and/or contractors.")?></p> @@ -35,10 +35,12 @@ <input type="radio" name="rootcert" value="2" checked/> <?=_("Sign by class 3 root certificate")?><br /> <p><?=_("Please note: The class 3 root certificate needs to be setup in your webserver as a chained certificate, while slightly more complicated to setup, this root certificate is more likely to be trusted by more people.")?></p> <? } ?> -<p><?=_("Optional comment, only used in the certifictate overview")?><br> +<p><?=_("Optional comment, only used in the certificate overview")?><br> <input type="text" name="description" maxlength="80" size=80/></p> <p><?=_("Paste your CSR(Certificate Signing Request) below...")?></p> -<textarea name="CSR" cols="80" rows="15"></textarea><br> -<input type="submit" name="process" value="<?=_("Submit")?>"/> -<input type="hidden" name="oldid" value="<?=$id?>"/> +<textarea name="CSR" cols="80" rows="15"></textarea><br /> +<p><input type="checkbox" name="CCA" /> <strong><?=sprintf(_("I accept the CAcert Community Agreement (%s)."),"<a href='/policy/CAcertCommunityAgreement.html'>CCA</a>")?></strong><br /> + <?=_("Please Note: You need to accept the CCA to proceed.")?></p> +<input type="submit" name="process" value="<?=_("Submit")?>" /> +<input type="hidden" name="oldid" value="<?=$id?>" /> </form> diff --git a/pages/account/12.php b/pages/account/12.php index 6d85cdc..9058a07 100644 --- a/pages/account/12.php +++ b/pages/account/12.php @@ -19,7 +19,7 @@ <form method="post" action="account.php"> <table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper"> <tr> - <td colspan="8" class="title"><?=_("Domain Certificates")?> - <a href="account.php?id=12&viewall=<?=!$viewall?>"><?=_("View all certificates")?></a></td> + <td colspan="8" class="title"><?=_("Domain Certificates")?> - <a href="account.php?id=12&viewall=<?=!$viewall?>"><?=$viewall?_("Hide old certificates"):_("View all certificates")?></a></td> </tr> <tr> <td class="DataTD"><?=_("Renew/Revoke/Delete")?></td> @@ -86,6 +86,11 @@ <? } ?> <tr> <td class="DataTD" colspan="8"> + <a href="account.php?id=12&viewall=<?=!$viewall?>"><b><?=$viewall?_("Hide old certificates"):_("View all certificates")?></b></a> + </td> + </tr> + <tr> + <td class="DataTD" colspan="8"> <?=_('* Comment is NOT included in the certificate as it is intended for your personal reference only. To change the comment tick the checkbox and hit "Change Settings".')?> </td> </tr> diff --git a/pages/account/13.php b/pages/account/13.php index c2b7cc5..1c1cfc6 100644 --- a/pages/account/13.php +++ b/pages/account/13.php @@ -16,30 +16,33 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ ?> <? - $query = "select * from `users` where `id`='".intval($_SESSION['profile']['id'])."' and `users`.`deleted`=0"; - $res = mysql_query($query); - $user = mysql_fetch_assoc($res); + $query = "select * from `users` where `id`='".intval($_SESSION['profile']['id'])."' and `users`.`deleted`=0"; + $res = mysql_query($query); + $user = mysql_fetch_assoc($res); - $year = intval(substr($user['dob'], 0, 4)); - $month = intval(substr($user['dob'], 5, 2)); - $day = intval(substr($user['dob'], 8, 2)); + $year = intval(substr($user['dob'], 0, 4)); + $month = intval(substr($user['dob'], 5, 2)); + $day = intval(substr($user['dob'], 8, 2)); + $showdetails = array_key_exists('showdetails', $_REQUEST) && !!intval($_REQUEST['showdetails']); + if($showdetails){ + $body = sprintf(_("Hi %s,"),$user['fname'])."\n\n"; + $body .= _("You receive this automatic mail since you yourself or someone ". + "else looked up your secret questions and answers for a forgotten ". + "password.\n\n". + "If it was you who looked up or changed that data, or clicked ". + "through the menu in your account, everything is in best order ". + "and you can ignore this mail.\n\n". + "But if you received this mail without a recognisable reason, ". + "there is a danger that an unauthorised person accessed your ". + "account, and you should promptly change your password and your ". + "secret questions and answers.")."\n\n"; - $body = sprintf(_("Hi %s,"),$user['fname'])."\n\n"; - $body .= _("You receive this automatic mail since you yourself or someone ". - "else looked up your secret questions and answers for a forgotten ". - "password.\n\n". - "If it was you who looked up or changed that data, or clicked ". - "through the menu in your account, everything is in best order ". - "and you can ignore this mail.\n\n". - "But if you received this mail without a recognisable reason, ". - "there is a danger that an unauthorised person accessed your ". - "account, and you should promptly change your password and your ". - "secret questions and answers.")."\n\n"; + $body .= _("Best regards")."\n"._("CAcert Support"); - $body .= _("Best regards")."\n"._("CAcert Support"); - - sendmail($user['email'], "[CAcert.org] "._("Email Notification"), $body, "support@cacert.org", "", "", "CAcert Support"); + sendmail($user['email'], "[CAcert.org] "._("Email Notification"), $body, "support@cacert.org", "", "", "CAcert Support"); + } ?> + <form method="post" action="account.php"> <table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper" width="400"> <tr> @@ -70,24 +73,24 @@ (<?=_("dd/mm/yyyy")?>)</td> <td class="DataTD"><nobr><select name="day"> <? - for($i = 1; $i <= 31; $i++) - { - echo "<option"; - if($day == $i) - echo " selected='selected'"; - echo ">$i</option>"; - } + for($i = 1; $i <= 31; $i++) + { + echo "<option"; + if($day == $i) + echo " selected='selected'"; + echo ">$i</option>"; + } ?> </select> <select name="month"> <? - for($i = 1; $i <= 12; $i++) - { - echo "<option value='$i'"; - if($month == $i) - echo " selected='selected'"; - echo ">".ucwords(recode("utf-8..html", strftime("%B", mktime(0,0,0,$i,1,date("Y")))))."</option>"; - } + for($i = 1; $i <= 12; $i++) + { + echo "<option value='$i'"; + if($month == $i) + echo " selected='selected'"; + echo ">".ucwords(recode("utf-8..html", strftime("%B", mktime(0,0,0,$i,1,date("Y")))))."</option>"; + } ?> </select> <input type="text" name="year" value="<?=$year?>" size="4"></nobr> @@ -115,18 +118,22 @@ </tr> <tr> <td class="DataTD"><?=_("Date of Birth")?><br> - (<?=_("dd/mm/yyyy")?>)</td> + (<?=_("dd/mm/yyyy")?>)</td> <td class="DataTD"><?=$day?> <?=ucwords(recode("utf-8..html", strftime("%B", mktime(0,0,0,$month,1,1))))?> <?=$year?></td> </tr> <? } ?> <tr> + <td colspan="2" class="title"><a href="account.php?id=13&showdetails=<?=!$showdetails?>"><?=_("View secret question & answers and OTP phrases")?></a></td> + </tr> + <? if($showdetails){ ?> + <tr> <td class="DataTD"><?=_("OTP Hash")?><br> - (<?=_("Not displayed")?>)</td> + (<?=_("Not displayed")?>)</td> <td class="DataTD"><input type="text" name="otphash"></td> </tr> <tr> <td class="DataTD"><?=_("OTP PIN")?><br> - (<?=_("Not displayed")?>)</td> + (<?=_("Not displayed")?>)</td> <td class="DataTD"><input type="text" name="otppin"></td> </tr> <tr> @@ -153,6 +160,7 @@ <td class="DataTD"><input type="text" name="A5" value="<?=sanitizeHTML($user['A5'])?>"></td> </tr> <tr> + <? } ?> <td class="DataTD" colspan="2"><input type="submit" name="process" value="<?=_("Update")?>"></td> </tr> </table> diff --git a/pages/account/16.php b/pages/account/16.php index 6f055d7..564463e 100644 --- a/pages/account/16.php +++ b/pages/account/16.php @@ -58,7 +58,7 @@ <? } ?> <tr> <td class="DataTD" colspan="2" align="left"> - <?=_("Optional comment, only used in the certifictate overview")?><br /> + <?=_("Optional comment, only used in the certificate overview")?><br /> <input type="text" name="description" maxlength="80" size=80 /> </td> </tr> diff --git a/pages/account/20.php b/pages/account/20.php index 0187013..ee16dd4 100644 --- a/pages/account/20.php +++ b/pages/account/20.php @@ -17,7 +17,7 @@ */ include_once("../includes/shutdown.php"); ?> -<h3><?=_("CAcert Certficate Acceptable Use Policy")?></h3> +<h3><?=_("CAcert Certificate Acceptable Use Policy")?></h3> <p><?=_("Once you decide to subscribe for an SSL Server Certificate you will need to complete this agreement. Please read it carefully. Your Certificate Request can only be processed with your acceptance and understanding of this agreement.")?></p> <p><?=_("I hereby represent that I am fully authorized by the owner of the information contained in the CSR sent to CAcert Inc. to apply for an Digital Certificate for secure and authenticated electronic transactions. I understand that a digital certificate serves to identify the Subscriber for the purposes of electronic communication and that the management of the private keys associated with such certificates is the responsibility of the subscriber's technical staff and/or contractors.")?></p> @@ -29,7 +29,7 @@ <form method="post" action="account.php"> <input type="radio" name="rootcert" value="1" /> <?=_("Sign by class 1 root certificate")?><br /> <input type="radio" name="rootcert" value="2" checked /> <?=_("Sign by class 3 root certificate")?><br /> -<p> <?=_("Optional comment, only used in the certifictate overview")?><br /> +<p> <?=_("Optional comment, only used in the certificate overview")?><br /> <input type="text" name="description" maxlength="80" size=80 /></p> <p><?=_("Please note: The class 3 root certificate needs to be setup in your webserver as a chained certificate, while slightly more complicated to setup, this root certificate is more likely to be trusted by more people.")?></p> <p><?=_("Paste your CSR below...")?></p> diff --git a/pages/account/3.php b/pages/account/3.php index c2165c2..7e34300 100644 --- a/pages/account/3.php +++ b/pages/account/3.php @@ -24,7 +24,7 @@ <p><?=_("CAcert Inc.'s public certification services are governed by a CPS as amended from time to time which is incorporated into this Agreement by reference. The Subscriber will use the SSL Server Certificate in accordance with CAcert Inc.'s CPS and supporting documentation published at")?> <a href="http://www.cacert.org/cps.php">http://www.cacert.org/cps.php</a></p> -<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 andwill 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><?=_("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> <form method="post" action="account.php"> <table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper"> @@ -70,30 +70,37 @@ if($_SESSION['profile']['points'] >= 50) <? } ?> <? if($_SESSION['profile']['points'] >= 100 && $_SESSION['profile']['codesign'] > 0) { ?> <tr> + <td class="DataTD"> + <input type="checkbox" name="codesign" value="1" /> + </td> <td class="DataTD" align="left"> - <input type="checkbox" name="codesign" value="1" /> <?=_("Code Signing")?></td> - <td class="DataTD" align="left"> + <?=_("Code Signing")?><br /> <?=_("Please Note: By ticking this box you will automatically have your name included in any certificates.")?> </td> </tr> <? } ?> <tr> - <td class="DataTD" colspan="2" align="left"> - <input type="checkbox" name="login" value="1" checked="checked" /> <?=_("Enable certificate login with this certificate")?><br /> + <td class="DataTD"> + <input type="checkbox" name="login" value="1" checked="checked" /> + </td> + <td class="DataTD"> <?=_("Enable certificate login with this certificate")?><br /> <?=_("By allowing certificate login, this certificate can be used to login into this account at https://secure.cacert.org/ .")?><br/> </td> </tr> <tr> <td class="DataTD" colspan="2" align="left"> - <?=_("Optional comment, only used in the certifictate overview max. 100 characters")?><br /> + <?=_("Optional comment, only used in the certificate overview")?><br /> <input type="text" name="description" maxlength="100" size="100" /> </td> </tr> <tr name="expertoff" style="display:none"> - <td class="DataTD" colspan="2" align="left"> - <input type="checkbox" name="expertbox" onchange="showExpert(this.checked)"/><?=_("Show advanced options")?> + <td class="DataTD"> + <input type="checkbox" name="expertbox" onchange="showExpert(this.checked)" /> + </td> + <td class="DataTD"> + <?=_("Show advanced options")?> </td> </tr> @@ -114,6 +121,15 @@ if($_SESSION['profile']['points'] >= 50) <td class="DataTD" colspan="2"><textarea name="optionalCSR" cols="80" rows="5"></textarea></td> </tr> <tr> + <td class="DataTD"> + <input type="checkbox" name="CCA" /> + </td> + <td class="DataTD" align="left"> + <strong><?=sprintf(_("I accept the CAcert Community Agreement (%s)."),"<a href='/policy/CAcertCommunityAgreement.html'>CCA</a>")?></strong><br /> + <?=_("Please Note: You need to accept the CCA to proceed.")?> + </td> + </tr> + <tr> <td class="DataTD" colspan="2"><input type="submit" name="process" value="<?=_("Next")?>" /></td> </tr> </table> diff --git a/pages/account/43.php b/pages/account/43.php index 234e01a..53b24d3 100644 --- a/pages/account/43.php +++ b/pages/account/43.php @@ -100,8 +100,8 @@ include_once($_SESSION['_config']['filepath']."/includes/notary.inc.php"); if(intval($_REQUEST['userid']) > 0) { - $id = intval($_REQUEST['userid']); - $query = "select * from `users` where `id`='$id' and `users`.`deleted`=0"; + $userid = intval($_REQUEST['userid']); + $query = "select * from `users` where `users`.`id`='$userid' and `users`.`deleted`=0"; $res = mysql_query($query); if(mysql_num_rows($res) <= 0) { @@ -135,7 +135,7 @@ include_once($_SESSION['_config']['filepath']."/includes/notary.inc.php"); <td class="DataTD"><?=_("Last Name")?>:</td> <td class="DataTD"> <input type="hidden" name="oldid" value="43"> <input type="hidden" name="action" value="updatedob"> - <input type="hidden" name="userid" value="<?=intval($id)?>"> + <input type="hidden" name="userid" value="<?=intval($userid)?>"> <input type="text" name="lname" value="<?=sanitizeHTML($row['lname'])?>"></td> </tr> <tr> @@ -504,7 +504,7 @@ include_once($_SESSION['_config']['filepath']."/includes/notary.inc.php"); <td class="DataTD"><?=_("Revoked")?></td> <td class="DataTD"><?=_("Latest Expire")?></td> </tr> - +<!-- server certificates --> <tr> <td class="DataTD"><?=_("Server")?>:</td> <? @@ -564,7 +564,7 @@ include_once($_SESSION['_config']['filepath']."/includes/notary.inc.php"); <? } ?> </tr> - +<!-- client certificates --> <tr> <td class="DataTD"><?=_("Client")?>:</td> <? @@ -619,7 +619,7 @@ include_once($_SESSION['_config']['filepath']."/includes/notary.inc.php"); <? } ?> </tr> - +<!-- gpg certificates --> <tr> <td class="DataTD"><?=_("GPG")?>:</td> <? @@ -645,9 +645,9 @@ include_once($_SESSION['_config']['filepath']."/includes/notary.inc.php"); $valid = $drow['valid']; $query = "select COUNT(*) as `expired` - from `emailcerts` - where `memid` = '".intval($row['id'])."' - and `expire` <= NOW()"; + from `gpg` + where `memid` = '".intval($row['id'])."' + and `expire` <= NOW()"; $dres = mysql_query($query); $drow = mysql_fetch_assoc($dres); $expired = $drow['expired']; @@ -666,7 +666,7 @@ include_once($_SESSION['_config']['filepath']."/includes/notary.inc.php"); <? } ?> </tr> - +<!-- org server certificates --> <tr> <td class="DataTD"><a href="account.php?id=58&userid=<?=intval($row['id'])?>"><?=_("Org Server")?></a>:</td> <? @@ -726,7 +726,7 @@ include_once($_SESSION['_config']['filepath']."/includes/notary.inc.php"); <? } ?> </tr> - +<!-- org client certificates --> <tr> <td class="DataTD"><?=_("Org Client")?>:</td> <? @@ -786,9 +786,20 @@ include_once($_SESSION['_config']['filepath']."/includes/notary.inc.php"); <? } ?> </tr> + <tr> + <td colspan="6" class="title"> + <form method="post" action="account.php" onSubmit="if(!confirm('<?=_("Are you sure you want to revoke all private certificates?")?>')) return false;"> + <input type="hidden" name="action" value="revokecert"> + <input type="hidden" name="oldid" value="43"> + <input type="hidden" name="userid" value="<?=intval($userid)?>"> + <input type="submit" value="<?=_('revoke certificates')?>"> + </form> + </td> + </tr> </table> <br> + <a href="account.php?id=43&userid=<?=$row['id']?>&shownotary=assuredto"><?=_("Show Assurances the user got")?></a> (<a href="account.php?id=43&userid=<?=$row['id']?>&shownotary=assuredto15"><?=_("New calculation")?></a>) <br /> @@ -837,7 +848,7 @@ function showassuredto() </tr> <? } ?> <tr> - <td class="DataTD" colspan="2"><b><?=_("Total Points")?>:</b></td> + <td class="DataTD" colspan="4"><b><?=_("Total Points")?>:</b></td> <td class="DataTD"><?=$points?></td> <td class="DataTD" colspan="3"> </td> </tr> @@ -883,7 +894,7 @@ function showassuredby() </tr> <? } ?> <tr> - <td class="DataTD" colspan="2"><b><?=_("Total Points")?>:</b></td> + <td class="DataTD" colspan="4"><b><?=_("Total Points")?>:</b></td> <td class="DataTD"><?=$points?></td> <td class="DataTD" colspan="3"> </td> </tr> diff --git a/pages/account/5.php b/pages/account/5.php index 9607850..44763e2 100644 --- a/pages/account/5.php +++ b/pages/account/5.php @@ -19,7 +19,7 @@ <form method="post" action="account.php"> <table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper"> <tr> - <td colspan="10" class="title"><?=_("Client Certificates")?> - <a href="account.php?id=5&viewall=<?=!$viewall?>"><?=_("View all certificates")?></a></td> + <td colspan="10" class="title"><?=_("Client Certificates")?> - <a href="account.php?id=5&viewall=<?=!$viewall?>"><?=$viewall?_("Hide old certificates"):_("View all certificates")?></a></td> </tr> <tr> <td class="DataTD"><?=_("Renew/Revoke/Delete")?></td> diff --git a/pages/account/50.php b/pages/account/50.php index 1604156..a4c2413 100644 --- a/pages/account/50.php +++ b/pages/account/50.php @@ -19,13 +19,17 @@ <form method="post" action="account.php"> <table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper"> <tr> - <td colspan="2" class="title"><?=_("Change Password")?></td> + <td colspan="2" class="title"><?=_("Delete Account")?></td> </tr> <tr> <td class="DataTD"><?=_("Email")?>:</td> <td class="DataTD"><b><?=sanitizeHTML($_REQUEST['email'])?></b></td> </tr> <tr> + <td class="DataTD"><?=_("New Username from arbitration number + sequence number a20xxyyzz.a.b")?>:</td> + <td class="DataTD"><input type="text" name="arbitrationno"></td> + </tr> + <tr> <td class="DataTD" colspan="2"><?=_("Are you sure you want to delete this user, while not actually deleting the account it will completely disable it and revoke any/all certificates currently issued.")?></td> </tr> <tr> diff --git a/pages/account/6.php b/pages/account/6.php index ae72730..0054b7a 100644 --- a/pages/account/6.php +++ b/pages/account/6.php @@ -14,12 +14,15 @@ 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 -*/ ?> -<? - $certid = 0; if(array_key_exists('cert',$_REQUEST)) $certid=intval($_REQUEST['cert']); +*/ + +// Get certificate information +$certid = 0; +if(array_key_exists('cert',$_REQUEST)) { + $certid = intval($_REQUEST['cert']); +} -// $query = "select * from `emailcerts` where `id`='$certid' and `memid`='".intval($_SESSION['profile']['id'])."'"; - $query = "select UNIX_TIMESTAMP(`emailcerts`.`created`) as `created`, +$query = "select UNIX_TIMESTAMP(`emailcerts`.`created`) as `created`, UNIX_TIMESTAMP(`emailcerts`.`expire`) - UNIX_TIMESTAMP() as `timeleft`, UNIX_TIMESTAMP(`emailcerts`.`expire`) as `expired`, `emailcerts`.`expire` as `expires`, @@ -32,123 +35,90 @@ `emailcerts`.`crt_name`, `emailcerts`.`keytype`, `emailcerts`.`description` - from `emailcerts` - where `emailcerts`.`id`='$certid' and `emailcerts`.`memid`='".intval($_SESSION['profile']['id'])."'"; + from `emailcerts` + where `emailcerts`.`id`='$certid' and + `emailcerts`.`memid`='".intval($_SESSION['profile']['id'])."'"; + +$res = mysql_query($query); +if(mysql_num_rows($res) <= 0) { + showheader(_("My CAcert.org Account!")); + echo _("No such certificate attached to your account."); + showfooter(); + exit; +} +$row = mysql_fetch_assoc($res); - $res = mysql_query($query); - if(mysql_num_rows($res) <= 0) - { - showheader(_("My CAcert.org Account!")); - echo _("No such certificate attached to your account."); - showfooter(); - exit; +if (array_key_exists('format', $_REQUEST)) { + // Which output format? + if ($_REQUEST['format'] === 'der') { + $outform = '-outform DER'; + $extension = 'cer'; + } else { + $outform = '-outform PEM'; + $extension = 'crt'; } - $row = mysql_fetch_assoc($res); $crtname=escapeshellarg($row['crt_name']); - $cert = `/usr/bin/openssl x509 -in $crtname`; - - if($row['keytype'] == "NS") - { - if(array_key_exists('install',$_REQUEST) && $_REQUEST['install'] == 1) - { - header("Content-Type: application/x-x509-user-cert"); - header("Content-Length: ".strlen($cert)); - $fname=sanitizeFilename($row['CN']); - if($fname=="") $fname="certificate"; - header('Content-Disposition: inline; filename="'.$fname.'.crt"'); - echo $cert; - exit; - } else { - showheader(_("My CAcert.org Account!")); - echo "<h3>"._("Installing your certificate")."</h3>\n"; - echo "<p>"._("You are about to install a certificate, if you are using mozilla/netscape based browsers you will not be informed that the certificate was installed successfully, you can go into the options dialog box, security and manage certificates to view if it was installed correctly however.")."</p>\n"; - echo "<p><a href='account.php?id=6&cert=$certid&install=1'>"._("Click here")."</a> "._("to install your certificate.")."</p>\n"; - showfooter(); - exit; - } - } else { - showheader(_("My CAcert.org Account!")); -?> -<h3><?=_("Installing your certificate")?></h3> + $cert = `/usr/bin/openssl x509 -in $crtname $outform`; -<p><?=_("Hit the 'Install your Certificate' button below to install the certificate into MS IE 5.x and above.")?> + header("Content-Type: application/pkix-cert"); + header("Content-Length: ".strlen($cert)); -<OBJECT classid="clsid:127698e4-e730-4e5c-a2b1-21490a70c8a1" codebase="/xenroll.cab#Version=5,131,3659,0" id="cec"> -<?=_("You must enable ActiveX for this to work.")?> -</OBJECT> -<FORM > -<INPUT TYPE=BUTTON NAME="CertInst" VALUE="<?=_("Install Your Certificate")?>"> -</FORM> + $fname = sanitizeFilename($row['CN']); + if ($fname=="") $fname="certificate"; + header("Content-Disposition: attachment; filename=\"${fname}.${extension}\""); -</P> + echo $cert; + exit; -<SCRIPT LANGUAGE=VBS> - Sub CertInst_OnClick - certchain = _ -<? - $lines = explode("\n", $cert); - if(is_array($lines)) - foreach($lines as $line) - { - $line = trim($line); - if($line != "-----END CERTIFICATE-----") - echo "\"$line\" & _\n"; - else { - echo "\"$line\"\n"; - break; - } +} elseif (array_key_exists('install', $_REQUEST)) { + if (array_key_exists('HTTP_USER_AGENT',$_SERVER) && + strstr($_SERVER['HTTP_USER_AGENT'], "MSIE")) { + + // Handle IE + //TODO + + } else { + // All other browsers + $crtname=escapeshellarg($row['crt_name']); + $cert = `/usr/bin/openssl x509 -in $crtname -outform DER`; + + header("Content-Type: application/x-x509-user-cert"); + header("Content-Length: ".strlen($cert)); + + $fname = sanitizeFilename($row['CN']); + if ($fname=="") $fname="certificate"; + header("Content-Disposition: inline; filename=\"${fname}.cer\""); + + echo $cert; + exit; } -?> - On Error Resume Next - - Dim obj - Set obj=CreateObject("X509Enrollment.CX509Enrollment") - If IsObject(obj) Then - obj.Initialize(1) - obj.InstallResponse 0,certchain,0,"" - if err.number<>0 then - msgbox err.Description - else - msgbox "<?=_("Certificate installed successfully. Please don't forget to backup now")?>" - end if - else - - - - - cec.DeleteRequestCert = FALSE - err.clear - - cec.WriteCertToCSP = TRUE - cec.acceptPKCS7(certchain) - if err.number <> 0 Then - cec.WriteCertToCSP = FALSE - end if - err.clear - cec.acceptPKCS7(certchain) - if err.number <> 0 then - errorMsg = "<?=_("Certificate installation failed!")?>" & chr(13) & chr(10) & _ - "(Error code " & err.number & ")" - msgRes = MsgBox(errorMsg, 0, "<?=_("Certificate Installation Error")?>") - else - okMsg = "<?=_("Personal Certificate Installed.")?>" & chr(13) & chr(10) & _ - "See Tools->Internet Options->Content->Certificates" - msgRes = MsgBox(okMsg, 0, "<?=_("Certificate Installation Complete!")?>") - end if - End If - End Sub -</SCRIPT> - -<p><?=_("Your certificate:")?></p> -<pre><?=$cert?></pre> +} else { + showheader(_("My CAcert.org Account!"), _("Install your certificate")); + echo '<ul class="no_indent">'; + echo "<li><a href='account.php?id=$id&cert=$certid&install'>". + _("Install the certificate into your browser"). + "</a></li>\n"; + + echo "<li><a href='account.php?id=$id&cert=$certid&format=pem'>". + _("Download the certificate in PEM format")."</a></li>\n"; + + echo "<li><a href='account.php?id=$id&cert=$certid&format=der'>". + _("Download the certificate in DER format")."</a></li>\n"; + echo '</ul>'; + + // Allow to directly copy and paste the cert in PEM format + $crtname=escapeshellarg($row['crt_name']); + $cert = `/usr/bin/openssl x509 -in $crtname -outform PEM`; + echo "<pre>$cert</pre>"; + ?> <form method="post" action="account.php"> <table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper"> <tr> - <td colspan="2" class="title"><?=_("Information about the certificte")?></td> + <td colspan="2" class="title"><?=_("Information about the certificate")?></td> </tr> <? if($row['timeleft'] > 0) @@ -213,4 +183,4 @@ <? showfooter(); exit; -}
\ No newline at end of file +} diff --git a/pages/gpg/0.php b/pages/gpg/0.php index 7c7a37b..a11c4bf 100644 --- a/pages/gpg/0.php +++ b/pages/gpg/0.php @@ -19,9 +19,11 @@ ?> <p><?=_("Paste your own public OpenPGP key below. It should not contain a picture. CAcert will sign your key after submission.")?></p> <form method="post" action="gpg.php"> -<p><?=_("Optional comment, only used in the certifictate overview")?><br /> +<p><?=_("Optional comment, only used in the certificate overview")?><br /> <input type="text" name="description" maxlength="80" size=80 /></p> <textarea name="CSR" cols="80" rows="15"><?=array_key_exists('CSR',$_POST)?strip_tags($_POST['CSR']):""?></textarea><br /> +<p><input type="checkbox" name="CCA" /> <strong><?=sprintf(_("I accept the CAcert Community Agreement (%s)."),"<a href='/policy/CAcertCommunityAgreement.html'>CCA</a>")?></strong><br /> + <?=_("Please Note: You need to accept the CCA to proceed.")?></p> <input type="submit" name="process" value="<?=_("Submit")?>" /> <input type="hidden" name="oldid" value="<?=$id?>" /> </form> diff --git a/pages/index/0.php b/pages/index/0.php index e7356c7..b1359f6 100644 --- a/pages/index/0.php +++ b/pages/index/0.php @@ -29,61 +29,52 @@ <div class="newsbox"> <? -/* - $query = "select *, UNIX_TIMESTAMP(`when`) as `TS` from news order by `when` desc limit 5"; - $res = mysql_query($query); - while($row = mysql_fetch_assoc($res)) - { - echo "<p><b>".date("Y-m-d", $row['TS'])."</b> - ".$row['short']."</p>\n"; - if($row['story'] != "") - echo "<p>[ <a href='news.php?id=".$row['id']."'>"._("Full Story")."</a> ]</p>\n"; - } - if(mysql_num_rows(mysql_query("select * from `news`")) > 2) - echo "<p>[ <a href='news.php'>"._("More News Items")."</a> ]</p>"; -*/ - $rss = ""; - $open = $items = 0; - $fp = @fopen("/www/pages/index/feed.rss", "r"); - if($fp) - { - echo '<p id="lnews">'._('Latest News').'</p>'; - - - while(!feof($fp)) - $rss .= trim(fgets($fp, 4096)); - fclose($fp); - $rss = str_replace("><", ">\n<", $rss); - $lines = explode("\n", $rss); - foreach($lines as $line) - { - $line = trim($line); - - if($line != "<item>" && $open == 0) - continue; - - if($line == "<item>" && $open == 0) - { - $open = 1; - continue; - } - - if($line == "</item>" && $open == 1) - { - $items++; - if($items >= 3) - break; - $open == 0; - continue; - } - if(substr($line, 0, 7) == "<title>") - echo "<h3>".str_replace("&#", "&#", recode_string("UTF8..html", str_replace("&", "", trim(substr($line, 7, -8)))))."</h3>\n"; - if(substr($line, 0, 13) == "<description>") - echo "<p>".str_replace("&#", "&#", recode_string("UTF8..html", str_replace("&", "", trim(substr($line, 13, -14)))))."</p>\n"; - if(substr($line, 0, 6) == "<link>") - echo "<p>[ <a href='".trim(substr($line, 6, -7))."'>"._("Full Story")."</a> ]</p>\n"; + printf("<p id='lnews'>%s</p>\n\n",_('Latest News')); + + $xml = "/www/pages/index/feed.rss"; // FIXME: use relative path to allow operation with different document root + $dom = new DOMDocument(); + $dom->preserveWhiteSpace = false; + $dom->Load($xml); + + $xpath = new DOMXPath($dom); //Create an XPath query + + $query = "//channel/item"; + $items = $xpath->query($query); + + $count = 0; + foreach($items as $id => $item) { + $query = "./title"; + $nodeList = $xpath->query($query, $item); + $title = recode_string("UTF8..html" , $nodeList->item(0)->nodeValue); + + $query = "./link"; + $nodeList = $xpath->query($query, $item); + $link = htmlspecialchars($nodeList->item(0)->nodeValue); + + $query = "./description"; + $nodeList = $xpath->query($query, $item); + $description = $nodeList->item(0)->nodeValue; + // The description may contain HTML entities => convert them + $description = html_entity_decode($description, ENT_COMPAT | ENT_HTML401, 'UTF-8'); + // Description may contain HTML markup and unicode characters => encode them + // If we didn't decode and then encode again, (i.e. take the content + // as it is in the RSS feed) we might inject harmful markup + $description = recode_string("UTF8..html", $description); + + printf("<h3><a href=\"%s\">%s</a></h3>\n", $link, $title); + printf("<p>%s</p>\n", nl2br($description)); + + $title = ''; + $description = ''; + $link = ''; + + $count++; + if ($count >= 3) { + break; } } ?> + [ <a href="http://blog.CAcert.org/"><?=_('More News Items')?></a> ] </div> <hr/> @@ -127,4 +118,3 @@ <br /><br /> <?=_("If you want to participate in CAcert.org, have a look")?> <a href="http://wiki.cacert.org/wiki/HelpingCAcert"><?=_("here")?></a> <?=_("and")?> <a href="http://wiki.cacert.org/wiki/SystemTasks"><?=_("here")?></a>. - diff --git a/pages/index/21.php b/pages/index/21.php index 0521f67..f07bbb8 100644 --- a/pages/index/21.php +++ b/pages/index/21.php @@ -14,34 +14,36 @@ 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 -*/ ?> -<? /* -page called from the following pages +*/ + +/* +page called from the following pages a. https://wiki.cacert.org/Price [^] b. https://wiki.cacert.org/CacertMembership/DE [^] c. https://wiki.cacert.org/CacertMembership [^] d. https://wiki.cacert.org/CAcertInc [^] - e. https://wiki.cacert.org/Brain/CAcertInc [^] - */ ?> + e. https://wiki.cacert.org/Brain/CAcertInc [^] +*/ ?> + <h3><?=_("For CAcert Association Members")?></h3> -<b><?=_("Have you paid your CAcert Association membership fees for the year?")?></b> -<p><?=_("If not then select this PayPal button to establish annual payment of your US$10 membership fee.")?></p> -<form action="https://www.paypal.com/cgi-bin/webscr" method="post"> +<p><b><?=_("Have you paid your CAcert Association membership fees for the year?")?></b></p> + +<p><?=_("If not then select this PayPal button to establish annual payment of your 10 EUR membership fee.")?></p> +<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top"> <input type="hidden" name="cmd" value="_s-xclick"> -<input type="image" src="/images/payment2.png" border="0" name="submit" alt="Make payments with PayPal"> -<input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIHiAYJKoZIhvcNAQcEoIIHeTCCB3UCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwDQYJKoZIhvcNAQEBBQAEgYAVW/F7PUYp3SMSCdOj1L4lNmZk8TPLmyFBXiYe/dP6bdcsvvx0A58mLC/3j961TCs95gXWqYx5vDD9znDEii5An7weRqtaxFa9B+UplKT2kcQJpi45zsGKzhwtHF/g0aJQdLmzrDYNnWd16UvhuasUIV501LaZB3ykq5j2eDJV/DELMAkGBSsOAwIaBQAwggEEBgkqhkiG9w0BBwEwFAYIKoZIhvcNAwcECJHKnDgLaYrEgIHgjYPDm0r2cH9hexIMEuCuiO9eOIsYxpzC50y9+ZWltUA9Eqp8avPT3ExC4qaw6FS8eo4+UWweESWXpAk3QrNTXgeV+Zf/4RjUEurpkRECinPUCtTgJvs6XLaPU50hAAaV9QmknT4DICcmB7djry0tB1FbLOmnqMyOTpT2pKDuL7r6hgEIAnCyASBtO5E8YJWFgSneQ53PbtT+YuAcVwIOD83wFRDAjlwYhs50VD6ugK07SXxC5I8RFV65PZS/qIiEEBCv7yiXi/U9DK4QG+3ojuxkP6ZjwshGb/99uK1NZCqgggOHMIIDgzCCAuygAwIBAgIBADANBgkqhkiG9w0BAQUFADCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20wHhcNMDQwMjEzMTAxMzE1WhcNMzUwMjEzMTAxMzE1WjCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMFHTt38RMxLXJyO2SmS+Ndl72T7oKJ4u4uw+6awntALWh03PewmIJuzbALScsTS4sZoS1fKciBGoh11gIfHzylvkdNe/hJl66/RGqrj5rFb08sAABNTzDTiqqNpJeBsYs/c2aiGozptX2RlnBktH+SUNpAajW724Nv2Wvhif6sFAgMBAAGjge4wgeswHQYDVR0OBBYEFJaffLvGbxe9WT9S1wob7BDWZJRrMIG7BgNVHSMEgbMwgbCAFJaffLvGbxe9WT9S1wob7BDWZJRroYGUpIGRMIGOMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDU1vdW50YWluIFZpZXcxFDASBgNVBAoTC1BheVBhbCBJbmMuMRMwEQYDVQQLFApsaXZlX2NlcnRzMREwDwYDVQQDFAhsaXZlX2FwaTEcMBoGCSqGSIb3DQEJARYNcmVAcGF5cGFsLmNvbYIBADAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUAA4GBAIFfOlaagFrl71+jq6OKidbWFSE+Q4FqROvdgIONth+8kSK//Y/4ihuE4Ymvzn5ceE3S/iBSQQMjyvb+s2TWbQYDwcp129OPIbD9epdr4tJOUNiSojw7BHwYRiPh58S1xGlFgHFXwrEBb3dgNbMUa+u4qectsMAXpVHnD9wIyfmHMYIBmjCCAZYCAQEwgZQwgY4xCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLUGF5UGFsIEluYy4xEzARBgNVBAsUCmxpdmVfY2VydHMxETAPBgNVBAMUCGxpdmVfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tAgEAMAkGBSsOAwIaBQCgXTAYBgkqhkiG9w0BCQMxCwYJKoZIhvcNAQcBMBwGCSqGSIb3DQEJBTEPFw0wNzExMDMwNzA2NDdaMCMGCSqGSIb3DQEJBDEWBBQQVDeJMeMteu3fuP5xIdpSiYrfLDANBgkqhkiG9w0BAQEFAASBgHIt5M/R6uPXFU0bVQJWcoO++ETE4nPbp+Nz+o7bclXsxIQL+yG5C5vQdpgNeCLuq42sPv+QUuVoMxio6hecCgHewwqAxkrUUr+teGOFSEqpfXBhjWfkUvZLvOy1ix6pSpjLnUu4bbJxaA5eM0gZQDZCJ8nh0HxPScdi5BhVuPSk-----END PKCS7----- -"> +<input type="hidden" name="hosted_button_id" value="AMCDNMBBDXGA2"> +<input type="image" src="/images/btn_subscribeCC_LG.gif" border="0" name="submit" alt="Subscription payment for membership fee"> </form> -<p><?=_("To do a single US$10 Membership-Fee Payment, please use this button:")?></p> -<form action="https://www.paypal.com/cgi-bin/webscr" method="post"> +<p><?=_("To do a single 10 EUR membership fee payment, please use this button:")?></p> +<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top"> <input type="hidden" name="cmd" value="_s-xclick"> -<input type="hidden" name="hosted_button_id" value="586280"> -<input type="image" src="/images/btn_paynowCC_LG.gif" border="0" name="submit" alt=""> -</form> +<input type="hidden" name="hosted_button_id" value="8F4WL72WX857J"> +<input type="image" src="/images/btn_paynowCC_LG.gif" border="0" name="submit" alt="Single payment for membership fee"> +</form> -<p><?=_("If you are located in Australia, you can use bank transfer instead and pay the equivalent of US$10 in AU$.")?></p> +<p><?=_("If you are located in Australia, you can use bank transfer instead and pay the equivalent of 10 EUR in AUD.")?></p> <p><?=_("Please also include your name in the transaction so we know who it came from and send an email to secretary at cacert dot org with the details:")?></p> @@ -49,6 +51,5 @@ page called from the following pages <li>Account Name: CAcert Inc</li> <li>SWIFT: WPACAU2S</li> <li>BSB: 032073</li> -<li>Account No.: 180264</li> +<li>Account No: 180264</li> </ul> -<br/><br/> diff --git a/pages/wot/15.php b/pages/wot/15.php index 8579588..cca2702 100644 --- a/pages/wot/15.php +++ b/pages/wot/15.php @@ -16,7 +16,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ - include_once($_SESSION['_config']['filepath']."/includes/wot.inc.php"); + require_once($_SESSION['_config']['filepath']."/includes/notary.inc.php"); $userid = intval($_SESSION['profile']['id']); diff --git a/pages/wot/4.php b/pages/wot/4.php index befdfe4..628e6a5 100644 --- a/pages/wot/4.php +++ b/pages/wot/4.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 */ -require_once(dirname(__FILE__).'/../../includes/wot.inc.php'); +require_once(dirname(__FILE__).'/../../includes/notary.inc.php'); ?> <h3><?=_("Trusted Third Parties")?></h3> diff --git a/pages/wot/6.php b/pages/wot/6.php index 28c1875..ef8cac7 100644 --- a/pages/wot/6.php +++ b/pages/wot/6.php @@ -32,28 +32,54 @@ else $methods = array("Face to Face Meeting"); + $mnames = array( + '01' => _('January'), + '02' => _('February'), + '03' => _('March'), + '04' => _('April'), + '05' => _('May'), + '06' => _('June'), + '07' => _('July'), + '08' => _('August'), + '09' => _('September'), + '10' => _('October'), + '11' => _('November'), + '12' => _('December') + ); + $fname = $row['fname']; $mname = $row['mname']; $lname = $row['lname']; $suffix = $row['suffix']; $dob = $row['dob']; + + $dob_date = explode('-', $dob, 3); + $dob_print = sprintf( + '<tt class="accountdetail">%s-%s-%s</tt> (%d %s %d)', + $dob_date[0], $dob_date[1], $dob_date[2], + intval($dob_date[2], 10), $mnames[$dob_date[1]], intval($dob_date[0], 10) + ); + $name = $fname." ".$mname." ".$lname." ".$suffix; $_SESSION['_config']['wothash'] = md5($name."-".$dob); - include_once($_SESSION['_config']['filepath']."/includes/wot.inc.php"); + require_once($_SESSION['_config']['filepath']."/includes/notary.inc.php"); - AssureHead(_("Assurance Confirmation"),sprintf(_("Please check the following details match against what you witnessed when you met %s in person. You MUST NOT proceed unless you are sure the details are correct. You may be held responsible by the CAcert Arbitrator for any issues with this Assurance."), $fname)); - AssureTextLine(_("Name"),$name); - AssureTextLine(_("Date of Birth"),$dob." ("._("YYYY-MM-DD").")"); - AssureBoxLine("certify",sprintf(_("I certify that %s %s %s has appeared in person"), $fname, $mname, $lname),array_key_exists('certify',$_POST) && $_POST['certify'] == 1); + AssureHead(_("Assurance Confirmation"),sprintf(_("Please check the following details match against what you witnessed when you met %s %s %s %s in person. You MUST NOT proceed unless you are sure the details are correct. You may be held responsible by the CAcert Arbitrator for any issues with this Assurance."), $fname, $mname, $lname, $suffix)); + AssureTextLine(_("Name"), sprintf( + "<tt><span class=\"accountdetail name\"><span class=\"accountdetail fname\">%s</span> <span class=\"accountdetail mname\">%s</span> <span class=\"accountdetail lname\">%s</span> <span class=\"accountdetail suffix\">%s</span></span></tt>", + $fname, $mname, $lname, $suffix + )); + AssureTextLine(_("Date of Birth"),$dob_print); + AssureMethodLine(_("Method"),$methods,''); + AssureBoxLine("certify",sprintf(_("I certify that %s %s %s %s has appeared in person."), $fname, $mname, $lname, $suffix),array_key_exists('certify',$_POST) && $_POST['certify'] == 1); + AssureBoxLine("CCAAgreed",sprintf(_("I verify that %s %s %s %s has accepted the CAcert Community Agreement."), $fname, $mname, $lname, $suffix),array_key_exists('CCAAgreed',$_POST) && $_POST['CCAAgreed'] == 1); AssureInboxLine("location",_("Location"),array_key_exists('location',$_SESSION['_config'])?$_SESSION['_config']['location']:"",""); - AssureInboxLine("date",_("Date"),array_key_exists('date',$_SESSION['_config'])?$_SESSION['_config']['date']:date("Y-m-d"),"<br/>"._("Please adjust the date if you assured the person on a different day")); - AssureMethodLine(_("Method"),$methods,_("Only tick the next box if the Assurance was face to face.")); + AssureInboxLine("date",_("Date"),array_key_exists('date',$_SESSION['_config'])?$_SESSION['_config']['date']:date("Y-m-d"),"<br/>"._("The date when the assurance took place. Please adjust the date if you assured the person on a different day (YYYY-MM-DD).")); + AssureTextLine("",_("Only tick the next box if the Assurance was face to face.")); AssureBoxLine("assertion",_("I believe that the assertion of identity I am making is correct, complete and verifiable. I have seen original documentation attesting to this identity. I accept that the CAcert Arbitrator may call upon me to provide evidence in any dispute, and I may be held responsible."),array_key_exists('assertion',$_POST) && $_POST['assertion'] == 1); - AssureBoxLine("rules",_("I have read and understood the Assurance Policy and the Assurance Handbook and am making this Assurance subject to and in compliance with the policy and handbook."),array_key_exists('rules',$_POST) && $_POST['rules'] == 1); - AssureTextLine(_("Policy"),"<a href=\"/policy/AssurancePolicy.php\" target=\"_blank\">"._("Assurance Policy")."</a> - <a href=\"http://wiki.cacert.org/AssuranceHandbook2\" target=\"_blank\">"._("Assurance Handbook")."</a>"); + AssureBoxLine("rules",_("I have read and understood the CAcert Community Agreement (CCA), Assurance Policy and the Assurance Handbook. I am making this Assurance subject to and in compliance with the CCA, Assurance policy and handbook."),array_key_exists('rules',$_POST) && $_POST['rules'] == 1); + AssureTextLine(_("Policy"),"<a href=\"/policy/CAcert Community Agreement.php\" target=\"_blank\">"._("CAcert Community Agreement")."</a> -<a href=\"/policy/AssurancePolicy.php\" target=\"_blank\">"._("Assurance Policy")."</a> - <a href=\"http://wiki.cacert.org/AssuranceHandbook2\" target=\"_blank\">"._("Assurance Handbook")."</a>"); AssureInboxLine("points",_("Points"),"","<br />(Max. ".maxpoints().")"); - AssureCCABoxLine("CCAAgreed",sprintf(_("Check this box only if %s agreed to the <a href=\"/policy/CAcertCommunityAgreement.php\">CAcert Community Agreement</a>"),$fname)); - AssureCCABoxLine("CCAAgree",_("Check this box only if YOU agree to the <a href=\"/policy/CAcertCommunityAgreement.php\">CAcert Community Agreement</a>")); AssureFoot($id,_("I confirm this Assurance")); ?> diff --git a/scripts/49de-lt2013-berlin-email.txt b/scripts/49de-lt2013-berlin-email.txt new file mode 100644 index 0000000..3759160 --- /dev/null +++ b/scripts/49de-lt2013-berlin-email.txt @@ -0,0 +1,17 @@ +Hallo CAcert-Mitglieder und Assurer, + +Der diesjaehrige LinuxTag auf der Messe Berlin findet von Mittwoch, 22. Mai bis Samstag, 25. Mai statt und steht unter dem Motto "Open minds create effective solutions!" + +Effektive Loesungen finden bei CAcert besonders gut dann statt, wenn ein reger Informationsaustausch stattfindet. Dafuer steht CAcert mit einem Stand auf der Messe am Stand 140 in Halle 7.1a. Wir freuen uns dabei nicht nur auf Besucher, sondern wir sind auch in hohem Masse auf die Mithilfe der Community angewiesen. Wir freuen uns deshalb besonders, auch Dich am Stand als Standbetreuer, Assurer und Netzwerker begruessen zu koennen. Bei dieser Gelegenheit koennen wir uns auch gerne ueber die aktuellen Entwicklungen bei CAcert unterhalten. + +Weitere Details stehen in unserem Wiki unter +[https://wiki.cacert.org/Events/LinuxTag2013] + +Fuer Assurer, die als Standbetreuer mithelfen moechten bitte +Rueckantwort bitte an events@cacert.org + 'Ich moechte beim Linuxtag mithelfen' +Dafuer koennen wir auch kostenlose Eintrittskarten zur Verfuegung stellen, rechtzeitige Absprache ist dafuer natuerlich Voraussetzung. + +Vielen Dank fuer eure Unterstuetzung! + +Kontakt: events@cacert.org diff --git a/scripts/49de-lt2013-berlin-mail.php.txt b/scripts/49de-lt2013-berlin-mail.php.txt new file mode 100644 index 0000000..a5bef69 --- /dev/null +++ b/scripts/49de-lt2013-berlin-mail.php.txt @@ -0,0 +1,119 @@ +#!/usr/bin/php -q +<? /* + LibreSSL - CAcert web application + Copyright (C) 2004-2009 CAcert Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ + include_once("../includes/mysql.php"); + + $lines = ""; + $fp = fopen("49de-lt2013-berlin-email.txt", "r"); + while(!feof($fp)) + { + $line = trim(fgets($fp, 4096)); + $lines .= wordwrap($line, 75, "\n")."\n"; + } + fclose($fp); + + +// $locid = intval($_REQUEST['location']); +// $maxdist = intval($_REQUEST['maxdist']); +// maxdist in [Km] + $maxdist = 50; + + +// location location.ID +// verified: 29.4.09 u.schroeter +// $locid = 7902857; // Paris +// $locid = 238568; // Bielefeld +// $locid = 715191; // Hamburg +// $locid = 1102495; // London +// $locid = 606058; // Frankfurt +// $locid = 1775784; // Stuttgart +// $locid = 228950; // Berlin +// $locid = 606058; // Frankfurt +// $locid = 599389; // Flensburg +// $locid = 61065; // Amsterdam, Eemnes +// $locid = 228950; // Berlin +// $locid = 2138880; // Baltimore (Baltimore (city)), Maryland, United States +// $locid = 1486658; // Potsdam +// $locid = 664715; // Goteborg, Vastra Gotaland, Sweden +// $locid = 2094781; // Mission Hills (Los Angeles), California, United States +// $locid = 423655; // Copenhagen, Kobenhavn*, Denmark +// $locid = 2093625; // Los Angeles, CA ??? +// $locid = 2094326 // Los Angeles (Los Angeles), California, United States +// $locid = 2257312; // Sydney, New South Wales, Australia +// $locid = 572764; // Essen, Nordrhein-Westfalen, Germany +// $locid = 78; // Aachen, Nordrhein-Westfalen, Germany +// $locid = 1260319; // Muenchen +// $locid = 266635; // Bonn, Nordrhein-Westfalen, Germany +// $locid = 873779; // Karlsruhe, Baden-Wuerttemberg, Germany +// $locid = 520340; // Dusseldorf, Nordrhein-Westfalen, Germany +// $locid = 2262656; // Melbourne, Victoria, Australia +// $locid = 2185076; // Raleigh (Wake), North Carolina, United States + +// CAcert Assurance and Keysigning event at FUDcon, Lawrence, KS, Jan 19th 2013 +// $locid = 2126955; // Lawrence (Douglas), Kansas, United States +// $eventname = "CAcert Assurance and Keysigning at FUDcon Lawrence, KS"; +// $city = "January 19th 2013"; + +// ATE-Kiel 2013-02-11 +// $locid = 919560; // Kiel, Schleswig-Holstein, Germany +// $eventname = "ATE-Kiel"; +// $city = "11. Februar 2013"; + +// Linuxtag, Berlin, May 22-25, 2013, + $locid = 228950; // Berlin + $eventname = "Linuxtag Berlin"; + $city = "22.-25. Mai, 2013"; + + + $query = "select * from `locations` where `id`='$locid'"; + $loc = mysql_fetch_assoc(mysql_query($query)); + + $query = "SELECT ROUND(6378.137 * ACOS(0.9999999*((SIN(PI() * $loc[lat] / 180) * SIN(PI() * `locations`.`lat` / 180)) + + (COS(PI() * $loc[lat] / 180 ) * COS(PI() * `locations`.`lat` / 180) * + COS(PI() * `locations`.`long` / 180 - PI() * $loc[long] / 180)))), -1) AS `distance`, sum(`points`) as pts, `users`.* + FROM `locations` + inner join `users` on `users`.`locid` = `locations`.`id` + inner join `alerts` on `users`.`id`=`alerts`.`memid` + inner join `notary` on `users`.`id`=`notary`.`to` + WHERE (`alerts`.`general`=1 OR `alerts`.`country`=1 OR `alerts`.`regional`=1 OR `alerts`.`radius`=1) + GROUP BY `users`.`id` + HAVING `distance` <= '$maxdist' + ORDER BY `distance` "; + echo $query; + + // comment next line when starting to send mail not only to me + // $query = "select * from `users` where `email` like 'cacerttest%'"; + + $res = mysql_query($query); + $xrows = mysql_num_rows($res); + + while($row = mysql_fetch_assoc($res)) + { + // uncomment next line to send mails ... + sendmail($row['email'], "[CAcert.org] $eventname - $city", $lines, "events@cacert.org", "", "", "CAcert Events Organisation", "returns@cacert.org", 1); + } + // 1x cc to events.cacert.org + sendmail("events@cacert.org", "[CAcert.org] $eventname - $city", $lines, "events@cacert.org", "", "", "CAcert Events Organisation", "returns@cacert.org", 1); + // 1x mailing report to events.cacert.org + sendmail("events@cacert.org", "[CAcert.org] $eventname - $city Report", "invitation sent to $xrows recipients.", "support@cacert.org", "", "", "CAcert Events Organisation", "returns@cacert.org", 1); + + // 1x mailing report to Arbitrator of case http://wiki.cacert.org/wiki/Arbitrations/a20090525.1 + sendmail("p.dunkel@cacert.org", "[CAcert.org] $eventname - $city Report", "invitation sent to $xrows recipients.", "support@cacert.org", "", "", "CAcert Events Organisation", "returns@cacert.org", 1); + echo "invitation sent to $xrows recipients.\n"; + +?> diff --git a/scripts/50de-ate-luebeck-email.txt b/scripts/50de-ate-luebeck-email.txt new file mode 100644 index 0000000..5bbfb70 --- /dev/null +++ b/scripts/50de-ate-luebeck-email.txt @@ -0,0 +1,91 @@ +[Deutsch] + +Es hat sich viel getan im letzten Jahr. Eine ganze Reihe von bisher +eher "muendlich ueberlieferten" Regeln wurden in Policies gegossen. +Neue Prozeduren (z.B. die Assurer Challenge) und Verpflichtungen (z.B. +in dem CAcert Community Agreement) wurden beschlossen. Die Assurer +Training Events wollen versuchen, die ganzen Informationen unter's +Volk zu bringen: + +- Welcher Satz fehlt auf alten CAP Formularen? +- Warum soll ich mir R/L/O einpraegen? +- Wie verhaelst du dich, + wenn du ein fremdes Ausweisdokument das ersteMal pruefst? + +Antworten auf diese und weitere Fragen erhaelst du bei den +Assurer Training Events (ATEs). + +Darueberhinaus wird beim ATE der Vorgang der Identitaetsueberpruefung +trainiert und auditiert, um die Qualitaet der Assurances in der +taeglichen Praxis zu erfassen. Dabei gilt es moegliche Fehler und +Fallstricke zu erkennen und aufzudecken. Die Assurer haben also die +Moeglichkeit, sich mit den Fehlern auseinanderzusetzen und zu erfahren, +wie diese vermieden werden koennen. + +Wie IanG sagte: The ATE or Assurer Training Event is exceptionally +recommended for all Assurers, and include parts which contribute +directly to our audit. Come and find out how you can also contribute. + +Die kommende Veranstaltung in deiner Naehe findet statt am: + +- Freitag, den 7. Juni 2013 +- in der Zeit von: 19:00 - ca. 22:00 Uhr +- Jugendzentrum Burgtor +- Grosse Burgstrasse 2 +- 23539 Luebeck + + +Details zum Veranstaltungsort und Anfahrthinweise findet Ihr im +Wiki [http://wiki.cacert.org/events/2013-06-07ATE-Luebeck] +Blog [http://blog.cacert.org/2013/05/595.html] + +Teilnehmer Registrierung mit Rueckantwort: + 'Ich moechte am ATE-Luebeck teilnehmen' + +Das Veranstaltungs-Team freut sich schon auf Eure Teilnahme. + +Kontakt: events@cacert.org + + + +[English] + +During the last year many changes took place inside CAcert. Many "oral" +rules have been put into Policies. New procedures +(e.g. Assurer Challenge) and obligations +(e.g. CAcert Community Agreement) have been put into live. +The Assurer Training Events (ATE) try to spread this information: + +- What is missing on the "old" CAP forms? +- Why should I remember R/L/O? +- What can you do if an Assuree shows an ID document unknown to you? + +These and more questions will be answered during the +Assurer Training Events (ATEs) + +Furthermore, the ATE trains how to do assurances and audits assurances, +to measure the quality of assurances in the daily routine. Here are some +possible errors and pitfalls which need to be found. Assurers have the +opportunity to see those errors and how to avoid them. + +As IanG said: The ATE or Assurer Training Event is exceptionally +recommended for all Assurers and includes parts which contribute +directly to our audit. Come and find out how you can also contribute. + +The next event held in your area will be: + +- Friday 07. June 2013 +- during 19:00 - ca. 22:00 +- Jugendzentrum Burgtor +- Grosse Burgstrasse 2 +- 23539 Luebeck + +Details to the location can be found: +Wiki [http://wiki.cacert.org/events/2013-06-07ATE-Luebeck] +Blog [http://blog.cacert.org/2013/05/595.html] + +User reply for registration: 'I will attend the ATE-Luebeck' + +The event team is looking forward for your attendance: + +Contact: events@cacert.org diff --git a/scripts/50de-ate-luebeck-mail.php.txt b/scripts/50de-ate-luebeck-mail.php.txt new file mode 100644 index 0000000..41721c5 --- /dev/null +++ b/scripts/50de-ate-luebeck-mail.php.txt @@ -0,0 +1,123 @@ +#!/usr/bin/php -q +<? /* + LibreSSL - CAcert web application + Copyright (C) 2004-2013 CAcert Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ + include_once("../includes/mysql.php"); + + $lines = ""; + $fp = fopen("50de-ate-luebeck-email.txt", "r"); + while(!feof($fp)) + { + $line = trim(fgets($fp, 4096)); + $lines .= wordwrap($line, 75, "\n")."\n"; + } + fclose($fp); + + +// $locid = intval($_REQUEST['location']); +// $maxdist = intval($_REQUEST['maxdist']); +// maxdist in [Km] + $maxdist = 200; + + +// location location.ID +// verified: 29.4.09 u.schroeter +// $locid = 7902857; // Paris +// $locid = 238568; // Bielefeld +// $locid = 715191; // Hamburg +// $locid = 1102495; // London +// $locid = 606058; // Frankfurt +// $locid = 1775784; // Stuttgart +// $locid = 228950; // Berlin +// $locid = 606058; // Frankfurt +// $locid = 599389; // Flensburg +// $locid = 61065; // Amsterdam, Eemnes +// $locid = 228950; // Berlin +// $locid = 2138880; // Baltimore (Baltimore (city)), Maryland, United States +// $locid = 1486658; // Potsdam +// $locid = 664715; // Goteborg, Vastra Gotaland, Sweden +// $locid = 2094781; // Mission Hills (Los Angeles), California, United States +// $locid = 423655; // Copenhagen, Kobenhavn*, Denmark +// $locid = 2093625; // Los Angeles, CA ??? +// $locid = 2094326 // Los Angeles (Los Angeles), California, United States +// $locid = 2257312; // Sydney, New South Wales, Australia +// $locid = 572764; // Essen, Nordrhein-Westfalen, Germany +// $locid = 78; // Aachen, Nordrhein-Westfalen, Germany +// $locid = 1260319; // Muenchen +// $locid = 266635; // Bonn, Nordrhein-Westfalen, Germany +// $locid = 873779; // Karlsruhe, Baden-Wuerttemberg, Germany +// $locid = 520340; // Dusseldorf, Nordrhein-Westfalen, Germany +// $locid = 2262656; // Melbourne, Victoria, Australia +// $locid = 2185076; // Raleigh (Wake), North Carolina, United States + +// CAcert Assurance and Keysigning event at FUDcon, Lawrence, KS, Jan 19th 2013 +// $locid = 2126955; // Lawrence (Douglas), Kansas, United States +// $eventname = "CAcert Assurance and Keysigning at FUDcon Lawrence, KS"; +// $city = "January 19th 2013"; + +// ATE-Kiel 2013-02-11 +// $locid = 919560; // Kiel, Schleswig-Holstein, Germany +// $eventname = "ATE-Kiel"; +// $city = "11. Februar 2013"; + +// Linuxtag, Berlin, May 22-25, 2013, +// $locid = 228950; // Berlin +// $eventname = "Linuxtag Berlin"; +// $city = "22.-25. Mai, 2013"; + + $locid = 1117395; // Lubeck Hansestadt, Schleswig-Holstein, Germany + $eventname = "ATE-Luebeck"; + $city = "07. Juni 2013"; + + + $query = "select * from `locations` where `id`='$locid'"; + $loc = mysql_fetch_assoc(mysql_query($query)); + + $query = "SELECT ROUND(6378.137 * ACOS(0.9999999*((SIN(PI() * $loc[lat] / 180) * SIN(PI() * `locations`.`lat` / 180)) + + (COS(PI() * $loc[lat] / 180 ) * COS(PI() * `locations`.`lat` / 180) * + COS(PI() * `locations`.`long` / 180 - PI() * $loc[long] / 180)))), -1) AS `distance`, sum(`points`) as pts, `users`.* + FROM `locations` + inner join `users` on `users`.`locid` = `locations`.`id` + inner join `alerts` on `users`.`id`=`alerts`.`memid` + inner join `notary` on `users`.`id`=`notary`.`to` + WHERE (`alerts`.`general`=1 OR `alerts`.`country`=1 OR `alerts`.`regional`=1 OR `alerts`.`radius`=1) + GROUP BY `users`.`id` + HAVING `distance` <= '$maxdist' + ORDER BY `distance` "; + echo $query; + + // comment next line when starting to send mail not only to me + // $query = "select * from `users` where `email` like 'cacerttest%'"; + + $res = mysql_query($query); + $xrows = mysql_num_rows($res); + + while($row = mysql_fetch_assoc($res)) + { + // uncomment next line to send mails ... + sendmail($row['email'], "[CAcert.org] $eventname - $city", $lines, "events@cacert.org", "", "", "CAcert Events Organisation", "returns@cacert.org", 1); + } + // 1x cc to events.cacert.org + sendmail("events@cacert.org", "[CAcert.org] $eventname - $city", $lines, "events@cacert.org", "", "", "CAcert Events Organisation", "returns@cacert.org", 1); + // 1x mailing report to events.cacert.org + sendmail("events@cacert.org", "[CAcert.org] $eventname - $city Report", "invitation sent to $xrows recipients.", "support@cacert.org", "", "", "CAcert Events Organisation", "returns@cacert.org", 1); + + // 1x mailing report to Arbitrator of case http://wiki.cacert.org/wiki/Arbitrations/a20090525.1 + sendmail("p.dunkel@cacert.org", "[CAcert.org] $eventname - $city Report", "invitation sent to $xrows recipients.", "support@cacert.org", "", "", "CAcert Events Organisation", "returns@cacert.org", 1); + echo "invitation sent to $xrows recipients.\n"; + +?> diff --git a/scripts/51at-ate-graz-email.txt b/scripts/51at-ate-graz-email.txt new file mode 100644 index 0000000..0d77dfe --- /dev/null +++ b/scripts/51at-ate-graz-email.txt @@ -0,0 +1,91 @@ +[Deutsch]
+
+Es hat sich viel getan im letzten Jahr. Eine ganze Reihe von bisher
+eher "muendlich ueberlieferten" Regeln wurden in Policies gegossen.
+Neue Prozeduren (z.B. die Assurer Challenge) und Verpflichtungen (z.B.
+in dem CAcert Community Agreement) wurden beschlossen. Die Assurer
+Training Events wollen versuchen, die ganzen Informationen unter's
+Volk zu bringen:
+
+- Welcher Satz fehlt auf alten CAP Formularen?
+- Warum soll ich mir R/L/O einpraegen?
+- Wie verhaelst du dich,
+ wenn du ein fremdes Ausweisdokument das ersteMal pruefst?
+
+Antworten auf diese und weitere Fragen erhaelst du bei den
+Assurer Training Events (ATEs).
+
+Darueberhinaus wird beim ATE der Vorgang der Identitaetsueberpruefung
+trainiert und auditiert, um die Qualitaet der Assurances in der
+taeglichen Praxis zu erfassen. Dabei gilt es moegliche Fehler und
+Fallstricke zu erkennen und aufzudecken. Die Assurer haben also die
+Moeglichkeit, sich mit den Fehlern auseinanderzusetzen und zu erfahren,
+wie diese vermieden werden koennen.
+
+Wie IanG sagte: The ATE or Assurer Training Event is exceptionally
+recommended for all Assurers, and include parts which contribute
+directly to our audit. Come and find out how you can also contribute.
+
+Die kommende Veranstaltung in deiner Naehe findet statt am:
+
+- Freitag, den 16. August 2013
+- in der Zeit von: 19:00 - ca. 22:00 Uhr
+- Realraum Graz
+- Jakomistraße 16
+- 8010 Graz
+
+
+Details zum Veranstaltungsort und Anfahrthinweise findet Ihr im
+Wiki [http://wiki.cacert.org/Events/2013-08-16ATE-Graz]
+Blog [http://blog.cacert.org/2013/07/ate-graz-at-2013-08-16/]
+
+Teilnehmer Registrierung mit Rueckantwort:
+ 'Ich moechte am ATE-Graz teilnehmen'
+
+Das Veranstaltungs-Team freut sich schon auf Eure Teilnahme.
+
+Kontakt: events@cacert.org
+
+
+
+[English]
+
+During the last year many changes took place inside CAcert. Many "oral"
+rules have been put into Policies. New procedures
+(e.g. Assurer Challenge) and obligations
+(e.g. CAcert Community Agreement) have been put into live.
+The Assurer Training Events (ATE) try to spread this information:
+
+- What is missing on the "old" CAP forms?
+- Why should I remember R/L/O?
+- What can you do if an Assuree shows an ID document unknown to you?
+
+These and more questions will be answered during the
+Assurer Training Events (ATEs)
+
+Furthermore, the ATE trains how to do assurances and audits assurances,
+to measure the quality of assurances in the daily routine. Here are some
+possible errors and pitfalls which need to be found. Assurers have the
+opportunity to see those errors and how to avoid them.
+
+As IanG said: The ATE or Assurer Training Event is exceptionally
+recommended for all Assurers and includes parts which contribute
+directly to our audit. Come and find out how you can also contribute.
+
+The next event held in your area will be:
+
+- Friday 16. August 2013
+- during 19:00 - ca. 22:00
+- Realraum Graz
+- Jakomistraße 16
+- 8010 Graz
+
+Details to the location can be found:
+Wiki [http://wiki.cacert.org/Events/2013-08-16ATE-Graz]
+Blog [http://blog.cacert.org/2013/07/ate-graz-at-2013-08-16/]
+
+User reply for registration: 'I will attend the ATE-Graz'
+
+The event team is looking forward for your attendance:
+
+Contact: events@cacert.org
diff --git a/scripts/51at-ate-graz-mail.php.txt b/scripts/51at-ate-graz-mail.php.txt new file mode 100644 index 0000000..56dd4ff --- /dev/null +++ b/scripts/51at-ate-graz-mail.php.txt @@ -0,0 +1,126 @@ +#!/usr/bin/php -q
+<? /*
+ LibreSSL - CAcert web application
+ Copyright (C) 2004-2013 CAcert Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+ include_once("../includes/mysql.php");
+
+ $lines = "";
+ $fp = fopen("51at-ate-graz-email.txt", "r");
+ while(!feof($fp))
+ {
+ $line = trim(fgets($fp, 4096));
+ $lines .= wordwrap($line, 75, "\n")."\n";
+ }
+ fclose($fp);
+
+
+// $locid = intval($_REQUEST['location']);
+// $maxdist = intval($_REQUEST['maxdist']);
+// maxdist in [Km]
+ $maxdist = 200;
+
+
+// location location.ID
+// verified: 29.4.09 u.schroeter
+// $locid = 7902857; // Paris
+// $locid = 238568; // Bielefeld
+// $locid = 715191; // Hamburg
+// $locid = 1102495; // London
+// $locid = 606058; // Frankfurt
+// $locid = 1775784; // Stuttgart
+// $locid = 228950; // Berlin
+// $locid = 606058; // Frankfurt
+// $locid = 599389; // Flensburg
+// $locid = 61065; // Amsterdam, Eemnes
+// $locid = 228950; // Berlin
+// $locid = 2138880; // Baltimore (Baltimore (city)), Maryland, United States
+// $locid = 1486658; // Potsdam
+// $locid = 664715; // Goteborg, Vastra Gotaland, Sweden
+// $locid = 2094781; // Mission Hills (Los Angeles), California, United States
+// $locid = 423655; // Copenhagen, Kobenhavn*, Denmark
+// $locid = 2093625; // Los Angeles, CA ???
+// $locid = 2094326 // Los Angeles (Los Angeles), California, United States
+// $locid = 2257312; // Sydney, New South Wales, Australia
+// $locid = 572764; // Essen, Nordrhein-Westfalen, Germany
+// $locid = 78; // Aachen, Nordrhein-Westfalen, Germany
+// $locid = 1260319; // Muenchen
+// $locid = 266635; // Bonn, Nordrhein-Westfalen, Germany
+// $locid = 873779; // Karlsruhe, Baden-Wuerttemberg, Germany
+// $locid = 520340; // Dusseldorf, Nordrhein-Westfalen, Germany
+// $locid = 2262656; // Melbourne, Victoria, Australia
+// $locid = 2185076; // Raleigh (Wake), North Carolina, United States
+
+// CAcert Assurance and Keysigning event at FUDcon, Lawrence, KS, Jan 19th 2013
+// $locid = 2126955; // Lawrence (Douglas), Kansas, United States
+// $eventname = "CAcert Assurance and Keysigning at FUDcon Lawrence, KS";
+// $city = "January 19th 2013";
+
+// ATE-Kiel 2013-02-11
+// $locid = 919560; // Kiel, Schleswig-Holstein, Germany
+// $eventname = "ATE-Kiel";
+// $city = "11. Februar 2013";
+
+// Linuxtag, Berlin, May 22-25, 2013,
+// $locid = 228950; // Berlin
+// $eventname = "Linuxtag Berlin";
+// $city = "22.-25. Mai, 2013";
+
+// $locid = 1117395; // Lubeck Hansestadt, Schleswig-Holstein, Germany
+// $eventname = "ATE-Luebeck";
+// $city = "07. Juni 2013";
+
+ $locid = 675661; // Graz, Steiermark, Austria
+ $eventname = "ATE-Graz";
+ $city = "16. August 2013";
+
+ $query = "select * from `locations` where `id`='$locid'";
+ $loc = mysql_fetch_assoc(mysql_query($query));
+
+ $query = "SELECT ROUND(6378.137 * ACOS(0.9999999*((SIN(PI() * $loc[lat] / 180) * SIN(PI() * `locations`.`lat` / 180)) +
+ (COS(PI() * $loc[lat] / 180 ) * COS(PI() * `locations`.`lat` / 180) *
+ COS(PI() * `locations`.`long` / 180 - PI() * $loc[long] / 180)))), -1) AS `distance`, sum(`points`) as pts, `users`.*
+ FROM `locations`
+ inner join `users` on `users`.`locid` = `locations`.`id`
+ inner join `alerts` on `users`.`id`=`alerts`.`memid`
+ inner join `notary` on `users`.`id`=`notary`.`to`
+ WHERE (`alerts`.`general`=1 OR `alerts`.`country`=1 OR `alerts`.`regional`=1 OR `alerts`.`radius`=1)
+ GROUP BY `users`.`id`
+ HAVING `distance` <= '$maxdist'
+ ORDER BY `distance` ";
+ echo $query;
+
+ // comment next line when starting to send mail not only to me
+ // $query = "select * from `users` where `email` like 'cacerttest%'";
+
+ $res = mysql_query($query);
+ $xrows = mysql_num_rows($res);
+
+ while($row = mysql_fetch_assoc($res))
+ {
+ // uncomment next line to send mails ...
+ sendmail($row['email'], "[CAcert.org] $eventname - $city", $lines, "events@cacert.org", "", "", "CAcert Events Organisation", "returns@cacert.org", 1);
+ }
+ // 1x cc to events.cacert.org
+ sendmail("events@cacert.org", "[CAcert.org] $eventname - $city", $lines, "events@cacert.org", "", "", "CAcert Events Organisation", "returns@cacert.org", 1);
+ // 1x mailing report to events.cacert.org
+ sendmail("events@cacert.org", "[CAcert.org] $eventname - $city Report", "invitation sent to $xrows recipients.", "support@cacert.org", "", "", "CAcert Events Organisation", "returns@cacert.org", 1);
+
+ // 1x mailing report to Arbitrator of case http://wiki.cacert.org/wiki/Arbitrations/a20090525.1
+ sendmail("p.dunkel@cacert.org", "[CAcert.org] $eventname - $city Report", "invitation sent to $xrows recipients.", "support@cacert.org", "", "", "CAcert Events Organisation", "returns@cacert.org", 1);
+ echo "invitation sent to $xrows recipients.\n";
+
+?>
diff --git a/scripts/52at-ate-wien-email.txt b/scripts/52at-ate-wien-email.txt new file mode 100644 index 0000000..bb4ce4c --- /dev/null +++ b/scripts/52at-ate-wien-email.txt @@ -0,0 +1,91 @@ +[Deutsch] + +Es hat sich viel getan im letzten Jahr. Eine ganze Reihe von bisher +eher "muendlich ueberlieferten" Regeln wurden in Policies gegossen. +Neue Prozeduren (z.B. die Assurer Challenge) und Verpflichtungen (z.B. +in dem CAcert Community Agreement) wurden beschlossen. Die Assurer +Training Events wollen versuchen, die ganzen Informationen unter's +Volk zu bringen: + +- Welcher Satz fehlt auf alten CAP Formularen? +- Warum soll ich mir R/L/O einpraegen? +- Wie verhaelst du dich, + wenn du ein fremdes Ausweisdokument das erste Mal pruefst? + +Antworten auf diese und weitere Fragen erhaelst du bei den +Assurer Training Events (ATEs). + +Darueberhinaus wird beim ATE der Vorgang der Identitaetsueberpruefung +trainiert und auditiert, um die Qualitaet der Assurances in der +taeglichen Praxis zu erfassen. Dabei gilt es moegliche Fehler und +Fallstricke zu erkennen und aufzudecken. Die Assurer haben also die +Moeglichkeit, sich mit den Fehlern auseinanderzusetzen und zu erfahren, +wie diese vermieden werden koennen. + +Wie IanG sagte: The ATE or Assurer Training Event is exceptionally +recommended for all Assurers, and include parts which contribute +directly to our audit. Come and find out how you can also contribute. + +Die kommende Veranstaltung in deiner Naehe findet statt am: + +- Dienstag, den 15. Oktober 2013 +- in der Zeit von: 18:00 - ca. 22:00 Uhr +- Wirtschaftskammer Oesterreich, Raum B3 1 Besprechungsraum +- Wiedner Hauptstraße 63 +- 1045 Wien + + +Details zum Veranstaltungsort und Anfahrthinweise findet Ihr im +Wiki [https://wiki.cacert.org/Events/2013-10-15ATE-Wien] +Blog [http://blog.cacert.org/2013/09/ate-wien-at-2013-10-15/] + +Teilnehmer Registrierung mit Rueckantwort: + 'Ich moechte am ATE-Graz teilnehmen' + +Das Veranstaltungs-Team freut sich schon auf Eure Teilnahme. + +Kontakt: events@cacert.org + + + +[English] + +During the last year many changes took place inside CAcert. Many "oral" +rules have been put into Policies. New procedures +(e.g. Assurer Challenge) and obligations +(e.g. CAcert Community Agreement) have been put into live. +The Assurer Training Events (ATE) try to spread this information: + +- What is missing on the "old" CAP forms? +- Why should I remember R/L/O? +- What can you do if an Assuree shows an ID document unknown to you? + +These and more questions will be answered during the +Assurer Training Events (ATEs) + +Furthermore, the ATE trains how to do assurances and audits assurances, +to measure the quality of assurances in the daily routine. Here are some +possible errors and pitfalls which need to be found. Assurers have the +opportunity to see those errors and how to avoid them. + +As IanG said: The ATE or Assurer Training Event is exceptionally +recommended for all Assurers and includes parts which contribute +directly to our audit. Come and find out how you can also contribute. + +The next event held in your area will be: + +- Friday, October 15th 2013 +- during: 18:00 - ca. 22:00 +- Austrian Chamber of Commerce, Meetingroom B3 1 +- Wiedner Hauptstraße 63 +- 1045 Vienna + +Details to the location can be found: +Wiki [https://wiki.cacert.org/Events/2013-10-15ATE-Wien] +Blog [http://blog.cacert.org/2013/09/ate-wien-at-2013-10-15/] + +User reply for registration: 'I will attend the ATE-Graz' + +The event team is looking forward for your attendance: + +Contact: events@cacert.org diff --git a/scripts/52at-ate-wien-mail.php.txt b/scripts/52at-ate-wien-mail.php.txt new file mode 100644 index 0000000..109bb81 --- /dev/null +++ b/scripts/52at-ate-wien-mail.php.txt @@ -0,0 +1,130 @@ +#!/usr/bin/php -q +<? /* + LibreSSL - CAcert web application + Copyright (C) 2004-2013 CAcert Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ + include_once("../includes/mysql.php"); + + $lines = ""; + $fp = fopen("52at-ate-wien-email.txt", "r"); + while(!feof($fp)) + { + $line = trim(fgets($fp, 4096)); + $lines .= wordwrap($line, 75, "\n")."\n"; + } + fclose($fp); + + +// $locid = intval($_REQUEST['location']); +// $maxdist = intval($_REQUEST['maxdist']); +// maxdist in [Km] + $maxdist = 200; + + +// location location.ID +// verified: 29.4.09 u.schroeter +// $locid = 7902857; // Paris +// $locid = 238568; // Bielefeld +// $locid = 715191; // Hamburg +// $locid = 1102495; // London +// $locid = 606058; // Frankfurt +// $locid = 1775784; // Stuttgart +// $locid = 228950; // Berlin +// $locid = 606058; // Frankfurt +// $locid = 599389; // Flensburg +// $locid = 61065; // Amsterdam, Eemnes +// $locid = 228950; // Berlin +// $locid = 2138880; // Baltimore (Baltimore (city)), Maryland, United States +// $locid = 1486658; // Potsdam +// $locid = 664715; // Goteborg, Vastra Gotaland, Sweden +// $locid = 2094781; // Mission Hills (Los Angeles), California, United States +// $locid = 423655; // Copenhagen, Kobenhavn*, Denmark +// $locid = 2093625; // Los Angeles, CA ??? +// $locid = 2094326 // Los Angeles (Los Angeles), California, United States +// $locid = 2257312; // Sydney, New South Wales, Australia +// $locid = 572764; // Essen, Nordrhein-Westfalen, Germany +// $locid = 78; // Aachen, Nordrhein-Westfalen, Germany +// $locid = 1260319; // Muenchen +// $locid = 266635; // Bonn, Nordrhein-Westfalen, Germany +// $locid = 873779; // Karlsruhe, Baden-Wuerttemberg, Germany +// $locid = 520340; // Dusseldorf, Nordrhein-Westfalen, Germany +// $locid = 2262656; // Melbourne, Victoria, Australia +// $locid = 2185076; // Raleigh (Wake), North Carolina, United States + +// CAcert Assurance and Keysigning event at FUDcon, Lawrence, KS, Jan 19th 2013 +// $locid = 2126955; // Lawrence (Douglas), Kansas, United States +// $eventname = "CAcert Assurance and Keysigning at FUDcon Lawrence, KS"; +// $city = "January 19th 2013"; + +// ATE-Kiel 2013-02-11 +// $locid = 919560; // Kiel, Schleswig-Holstein, Germany +// $eventname = "ATE-Kiel"; +// $city = "11. Februar 2013"; + +// Linuxtag, Berlin, May 22-25, 2013, +// $locid = 228950; // Berlin +// $eventname = "Linuxtag Berlin"; +// $city = "22.-25. Mai, 2013"; + +// $locid = 1117395; // Lubeck Hansestadt, Schleswig-Holstein, Germany +// $eventname = "ATE-Luebeck"; +// $city = "07. Juni 2013"; + +// $locid = 675661; // Graz, Steiermark, Austria +// $eventname = "ATE-Graz"; +// $city = "16. August 2013"; + + $locid = 1992733; // Wien, Wien, Austria + $eventname = "ATE-Wien"; + $city = "15. Oktober 2013"; + + $query = "select * from `locations` where `id`='$locid'"; + $loc = mysql_fetch_assoc(mysql_query($query)); + + $query = "SELECT ROUND(6378.137 * ACOS(0.9999999*((SIN(PI() * $loc[lat] / 180) * SIN(PI() * `locations`.`lat` / 180)) + + (COS(PI() * $loc[lat] / 180 ) * COS(PI() * `locations`.`lat` / 180) * + COS(PI() * `locations`.`long` / 180 - PI() * $loc[long] / 180)))), -1) AS `distance`, sum(`points`) as pts, `users`.* + FROM `locations` + inner join `users` on `users`.`locid` = `locations`.`id` + inner join `alerts` on `users`.`id`=`alerts`.`memid` + inner join `notary` on `users`.`id`=`notary`.`to` + WHERE (`alerts`.`general`=1 OR `alerts`.`country`=1 OR `alerts`.`regional`=1 OR `alerts`.`radius`=1) + GROUP BY `users`.`id` + HAVING `distance` <= '$maxdist' + ORDER BY `distance` "; + echo $query; + + // comment next line when starting to send mail not only to me + // $query = "select * from `users` where `email` like 'cacerttest%'"; + + $res = mysql_query($query); + $xrows = mysql_num_rows($res); + + while($row = mysql_fetch_assoc($res)) + { + // uncomment next line to send mails ... + sendmail($row['email'], "[CAcert.org] $eventname - $city", $lines, "events@cacert.org", "", "", "CAcert Events Organisation", "returns@cacert.org", 1); + } + // 1x cc to events.cacert.org + sendmail("events@cacert.org", "[CAcert.org] $eventname - $city", $lines, "events@cacert.org", "", "", "CAcert Events Organisation", "returns@cacert.org", 1); + // 1x mailing report to events.cacert.org + sendmail("events@cacert.org", "[CAcert.org] $eventname - $city Report", "invitation sent to $xrows recipients.", "support@cacert.org", "", "", "CAcert Events Organisation", "returns@cacert.org", 1); + + // 1x mailing report to Arbitrator of case http://wiki.cacert.org/wiki/Arbitrations/a20090525.1 + sendmail("p.dunkel@cacert.org", "[CAcert.org] $eventname - $city Report", "invitation sent to $xrows recipients.", "support@cacert.org", "", "", "CAcert Events Organisation", "returns@cacert.org", 1); + echo "invitation sent to $xrows recipients.\n"; + +?> diff --git a/scripts/cron/permissionreview.php b/scripts/cron/permissionreview.php index 0f2fc2e..ca95f18 100755 --- a/scripts/cron/permissionreview.php +++ b/scripts/cron/permissionreview.php @@ -27,7 +27,7 @@ $ORGANISATION_ASSURANCE_OFFICER = 'oao@cacert.org'; //defines to whom to send the lists $flags = array( - 'admin' => array( + 'admin=1' => array( 'name' => 'Support Engineer', 'own' => false, //Don't send twice 'board' => true, @@ -35,8 +35,8 @@ $flags = array( 'ao' => false, 'oao' => false ), - - 'orgadmin' => array( + + 'orgadmin=1' => array( 'name' => 'Organisation Assurer', 'own' => true, 'board' => true, @@ -44,8 +44,8 @@ $flags = array( 'ao' => true, 'oao' => true ), - - 'board' => array( + + 'board=1' => array( 'name' => 'Board Member', 'own' => false, 'board' => true, @@ -53,8 +53,8 @@ $flags = array( 'ao' => true, 'oao' => false ), - - 'ttpadmin' => array( + + 'ttpadmin=1' => array( 'name' => 'Trusted Third Party Admin', 'own' => true, 'board' => true, @@ -62,8 +62,17 @@ $flags = array( 'ao' => true, 'oao' => true ), - - 'tverify' => array( + + 'ttpadmin=2' => array( + 'name' => 'Trusted Third Party TOPUP Admin', + 'own' => true, + 'board' => true, + 'support' => true, + 'ao' => true, + 'oao' => true + ), + + 'tverify=1' => array( 'name' => 'Tverify Admin', 'own' => false, 'board' => true, @@ -71,8 +80,8 @@ $flags = array( 'ao' => true, 'oao' => false ), - - 'locadmin' => array( + + 'locadmin=1' => array( 'name' => 'Location Admin', 'own' => false, 'board' => true, @@ -80,30 +89,51 @@ $flags = array( 'ao' => false, 'oao' => false ), + + 'adadmin=1' => array( + 'name' => 'submit status for Advertising Admin', + 'own' => false, + 'board' => true, + 'support' => true, + 'ao' => false, + 'oao' => false + ), + + 'adadmin=2' => array( + 'name' => 'approve status for Advertising Admin', + 'own' => false, + 'board' => true, + 'support' => true, + 'ao' => false, + 'oao' => false + ), + + ); // Build up list of various admins $adminlist = array(); foreach ($flags as $flag => $flag_properties) { - $query = "select `fname`, `lname`, `email` from `users` where `$flag` = 1"; + $flagname = explode('=', $flag, 2 ); + $query = "select `fname`, `lname`, `email` from `users` where `$flagname[0]` = '$flagname[1]'"; if(! $res = mysql_query($query) ) { fwrite(STDERR, "MySQL query for flag $flag failed:\n". "\"$query\"\n". mysql_error() ); - + continue; } - + $adminlist[$flag] = array(); - + while ($row = mysql_fetch_assoc($res)) { $adminlist[$flag][] = $row; } - - + + // Send mail to admins of this group if 'own' is set if ($flag_properties['own']) { foreach ($adminlist[$flag] as $admin) { @@ -117,19 +147,20 @@ and report to the responsible team leader or board EOF; - + foreach ($adminlist[$flag] as $colleague) { $message .= "$colleague[fname] $colleague[lname] $colleague[email]\n"; } - + $message .= <<<EOF Best Regards, CAcert Support EOF; - + sendmail($admin['email'], "Permissions Review", $message, 'support@cacert.org'); + echo "Sent $flag_properties[name] mail to $admin[email]\n"; } } } @@ -152,7 +183,7 @@ foreach ($flags as $flag => $flag_properties) { foreach ($adminlist[$flag] as $colleague) { $message .= "$colleague[fname] $colleague[lname] $colleague[email]\n"; } - + $message .= "\n\n"; } } @@ -163,12 +194,13 @@ Best Regards, CAcert Support EOF; -foreach ($adminlist['admin'] as $support_engineer) { +foreach ($adminlist['admin=1'] as $support_engineer) { sendmail( $support_engineer['email'], "Permissions Review", $message, 'support@cacert.org'); + echo "Sent Support Engineer mail to $support_engineer[email]\n"; } @@ -188,14 +220,14 @@ foreach (array( Dear $values[description], it's time for the permission review again. Here is the list of privileged users -in the CAcert web application. Please review them and also ask the persons +in the CAcert web application. Please review them and also ask the persons responsible for an up-to-date copy of access lists not directly recorded in the -web application (critical admins, software assessors etc.) +web application (critical admins, software assessors etc.) EOF; - + foreach ($flags as $flag => $flag_properties) { if ($flag_properties[$key]) { $message .= "List of $flag_properties[name]s:\n\n"; @@ -205,13 +237,14 @@ EOF; $message .= "\n\n"; } } - + $message .= <<<EOF Best Regards, CAcert Support EOF; - + sendmail($values['email'], "Permissions Review", $message, 'support@cacert.org'); + echo "Sent $values[description] mail to $values[email]\n"; } diff --git a/scripts/cron/refresh_stats.php b/scripts/cron/refresh_stats.php new file mode 100755 index 0000000..2a3d2b5 --- /dev/null +++ b/scripts/cron/refresh_stats.php @@ -0,0 +1,307 @@ +#!/usr/bin/php -q +<?php +/* +LibreSSL - CAcert web application +Copyright (C) 2004-2012 CAcert Inc. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; version 2 of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +require_once(dirname(__FILE__).'/../../includes/mysql.php'); + +/** + * Wrapper around mysql_query() to provide some error handling. Prints an error + * message and dies if query fails + * + * @param string $sql + * the SQL statement to execute + * @return resource|boolean + * the MySQL result set + */ +function sql_query($sql) { + $res = mysql_query($sql); + if (!$res) { + fwrite(STDERR, "MySQL query failed:\n\"$sql\"\n".mysql_error()); + die(1); + } + + return $res; +} + +function tc($sql) { + $row = mysql_fetch_assoc(sql_query($sql)); + return(intval($row['count'])); +} + +/** +* writes new data to cache, create cache or update existing cache, set current +* time stamp +* @return boolean +*/ +function updateCache($stats) { + $timestamp = time(); + $sql = "insert into `statscache` (`timestamp`, `cache`) values + ('$timestamp', '".mysql_real_escape_string(serialize($stats))."')"; + sql_query($sql); + + // Make sure the new statistic was inserted successfully + $res = sql_query( + "select 1 from `statscache` where `timestamp` = '$timestamp'"); + if (mysql_num_rows($res) !== 1) { + fwrite(STDERR, "Error on inserting the new statistic"); + return false; + } + + sql_query("delete from `statscache` where `timestamp` != '$timestamp'"); + return true; +} + +/** +* get statistics data from live tables, takes a long time so please try to use the +* cache +* @return array +*/ +function getDataFromLive() { + echo "Calculating current statistics\n"; + + $stats = array(); + $stats['verified_users'] = number_format(tc( + "select count(*) as `count` from `users` + where `verified` = 1 + and `deleted` = 0 + and `locked` = 0")); + + $stats['verified_emails'] = number_format(tc( + "select count(*) as `count` from `email` + where `hash` = '' and `deleted` = 0")); + + $stats['verified_domains'] = number_format(tc( + "select count(*) as `count` from `domains` + where `hash` = '' and `deleted` = 0")); + + $certs = tc("select count(*) as `count` from `domaincerts` + where `expire` != 0"); + $certs += tc("select count(*) as `count` from `emailcerts` + where `expire` != 0"); + $certs += tc("select count(*) as `count` from `gpg` + where `expire` != 0"); + $certs += tc("select count(*) as `count` from `orgdomaincerts` + where `expire` != 0"); + $certs += tc("select count(*) as `count` from `orgemailcerts` + where `expire` != 0"); + $stats['verified_certificates'] = number_format($certs); + + $certs = tc("select count(*) as `count` from `domaincerts` + where `revoked` = 0 and `expire` > NOW()"); + $certs += tc("select count(*) as `count` from `emailcerts` + where `revoked` = 0 and `expire` > NOW()"); + $certs += tc("select count(*) as `count` from `gpg` + where `expire` > NOW()"); + $certs += tc("select count(*) as `count` from `orgdomaincerts` + where `revoked` = 0 and `expire` > NOW()"); + $certs += tc("select count(*) as `count` from `orgemailcerts` + where `revoked` = 0 and `expire` > NOW()"); + $stats['valid_certificates'] = number_format($certs); + + $stats['assurances_made'] = number_format(tc( + "select count(*) as `count` from `notary` + where `method` = '' or `method` = 'Face to Face Meeting'")); + + $stats['users_1to49'] = number_format(tc( + "select count(*) as `count` from ( + select 1 from `notary` + where `deleted` = 0 + group by `to` + having sum(`points`) > 0 and sum(`points`) < 50 + ) as `low_points`")); + + $stats['users_50to99'] = number_format(tc( + "select count(*) as `count` from ( + select 1 from `notary` + where `deleted` = 0 + group by `to` + having sum(`points`) >= 50 and sum(`points`) < 100 + ) as `high_points`")); + + $stats['assurer_candidates'] = number_format(tc( + "select count(*) as `count` from `users` + where ( + select sum(`points`) from `notary` + where `to`=`users`.`id` + and `deleted` = 0 + ) >= 100 + and not exists( + select 1 from `cats_passed` as `cp`, `cats_variant` as `cv` + where `cp`.`user_id`=`users`.`id` + and `cp`.`variant_id`=`cv`.`id` + and `cv`.`type_id`=1 + )" + )); + + $stats['aussurers_with_test'] = number_format(tc( + "select count(*) as `count` from `users` + where ( + select sum(`points`) from `notary` + where `to`=`users`.`id` + and `deleted` = 0 + ) >= 100 + and exists( + select 1 from `cats_passed` as `cp`, `cats_variant` as `cv` + where `cp`.`user_id`=`users`.`id` + and `cp`.`variant_id`=`cv`.`id` + and `cv`.`type_id`=1 + )" + )); + + $stats['points_issued'] = number_format(tc( + "select sum(greatest(`points`, `awarded`)) as `count` from `notary` + where `deleted` = 0 + and `method` = 'Face to Face Meeting'")); + + $totalusers=0; + $totassurers=0; + $totalcerts=0; + for($i = 0; $i < 12; $i++) { + $first_ts = mktime(0, 0, 0, date("m") - $i, 1, date("Y")); + $next_month_ts = mktime(0, 0, 0, date("m") - $i + 1, 1, date("Y")); + $first = date("Y-m-d", $first_ts); + $next_month = date("Y-m-d", $next_month_ts); + + echo "Calculating statistics for month $first\n"; + + $totalusers += $users = tc( + "select count(*) as `count` from `users` + where `created` >= '$first' and `created` < '$next_month' + and `verified` = 1 + and `deleted` = 0 + and `locked` = 0"); + + $totassurers += $assurers = tc( + "select count(*) as `count` from ( + select 1 from `notary` + where `when` >= '$first' and `when` < '$next_month' + and `method`!='Administrative Increase' + and `deleted` = 0 + group by `to` having sum(`points`) >= 100 + ) as `assurer_candidates`"); + + $certs = tc( + "select count(*) as `count` from `domaincerts` + where `created` >= '$first' and `created` < '$next_month' + and `expire` != 0"); + $certs += tc( + "select count(*) as `count` from `emailcerts` + where `created` >= '$first' and `created` < '$next_month' + and `expire` != 0"); + $certs += tc( + "select count(*) as `count` from `gpg` + where `issued` >= '$first' and `issued` < '$next_month' + and `expire` != 0"); + $certs += tc( + "select count(*) as `count` from `orgdomaincerts` + where `created` >= '$first' and `created` < '$next_month' + and `expire` != 0"); + $certs += tc( + "select count(*) as `count` from `orgemailcerts` + where `created` >= '$first' and `created` < '$next_month' + and `expire` != 0"); + $totalcerts += $certs; + + $tmp_arr = array(); + $tmp_arr['date'] = date("Y-m", $first_ts); + $tmp_arr['new_users'] = number_format($users); + $tmp_arr['new_assurers'] = number_format($assurers); + $tmp_arr['new_certificates'] = number_format($certs); + + $stats['growth_last_12m'][] = $tmp_arr; + } + $stats['growth_last_12m_total'] = array( + 'new_users' => number_format($totalusers), + 'new_assurers' => number_format($totassurers), + 'new_certificates' => number_format($totalcerts), + ); + + $totalcerts = 0; + $totalusers = 0; + $totassurers = 0; + for($i = date("Y"); $i >= 2002; $i--) { + $first_ts = mktime(0, 0, 0, 1, 1, $i); + $next_year_ts = mktime(0, 0, 0, 1, 1, $i + 1); + $first = date("Y-m-d", $first_ts); + $next_year = date("Y-m-d", $next_year_ts); + + echo "Calculating statistics for year $i\n"; + + $totalusers += $users = tc( + "select count(*) as `count` from `users` + where `created` >= '$first' and `created` < '$next_year' + and `verified` = 1 + and `deleted` = 0 + and `locked` = 0"); + + $totassurers += $assurers = tc( + "select count(*) as `count` from ( + select 1 from `notary` + where `when` >= '$first' and `when` < '$next_year' + and `method`!='Administrative Increase' + and `deleted` = 0 + group by `to` having sum(`points`) >= 100 + ) as `assurer_candidates`"); + + $certs = tc( + "select count(*) as `count` from `domaincerts` + where `created` >= '$first' and `created` < '$next_year' + and `expire` != 0"); + $certs += tc( + "select count(*) as `count` from `emailcerts` + where `created` >= '$first' and `created` < '$next_year' + and `expire` != 0"); + $certs += tc( + "select count(*) as `count` from `gpg` + where `issued` >= '$first' and `issued` < '$next_year' + and `expire` != 0"); + $certs += tc( + "select count(*) as `count` from `orgdomaincerts` + where `created` >= '$first' and `created` < '$next_year' + and `expire` != 0"); + $certs += tc( + "select count(*) as `count` from `orgemailcerts` + where `created` >= '$first' and `created` < '$next_year' + and `expire` != 0"); + $totalcerts += $certs; + + $tmp_arr = array(); + $tmp_arr['date'] = $i; + $tmp_arr['new_users'] = number_format($users); + $tmp_arr['new_assurers'] = number_format($assurers); + $tmp_arr['new_certificates'] = number_format($certs); + + $stats['growth_last_years'][] = $tmp_arr; + } + $stats['growth_last_years_total'] = array( + 'new_users' => number_format($totalusers), + 'new_assurers' => number_format($totassurers), + 'new_certificates' => number_format($totalcerts), + ); + + return $stats; +} + + +$stats = getDataFromLive(); +if (! updateCache($stats) ) { + fwrite(STDERR, + "An error occured. The statistics were not successfully updated!"); + die(1); +} diff --git a/scripts/mail-weak-keys.php b/scripts/mail-weak-keys.php index 95c0e4f..c85aec8 100644 --- a/scripts/mail-weak-keys.php +++ b/scripts/mail-weak-keys.php @@ -18,7 +18,7 @@ You received this email because a certificate issued to you is vulnerable: Server Certificate, Serial $cert_serial, expiring $cert_expire, CN $cert_CN To rectify the problem CAcert will revoke all vulnerable certificates (including yours) on $action_date. -CAcert will no longer accept vulnerable certificate requests for signing. In future all Certficate +CAcert will no longer accept vulnerable certificate requests for signing. In future all Certificate Signing Requests must be backed by private keys with a key length at least 2048 bits and no other known vulnerabilities. You should submit a new Certificate Signing Request of acceptable strength as soon as possible @@ -51,13 +51,13 @@ Client Certificate, Serial $cert_serial, expiring $cert_expire, CN $cert_CN To rectify the problem CAcert will revoke all vulnerable certificates (including yours) on $action_date. CAcert will no longer accept vulnerable certificate requests for signing. In future all -client certficates must be backed by private keys with a key length at least 1024 bits +client certificates must be backed by private keys with a key length at least 1024 bits and no other known vulnerabilities. This means that you should replace your current certificate with a new one of acceptable strength. If you use Firefox or Chrome, select 'Keysize: High Grade' before 'Create Certificate Request'. If you use Internet Explorer, select 'Microsoft Strong Cryptographic Provider'. If you select an -option that generates a weak key (eg 'Microsoft Base Cryptographic Provider v1.0') your certficate +option that generates a weak key (eg 'Microsoft Base Cryptographic Provider v1.0') your certificate request will be rejected. Kind regards @@ -83,7 +83,7 @@ You received this email because a certificate issued to you is vulnerable: Organisation Server Certificate, Serial $cert_serial, expiring $cert_expire, CN $cert_CN To rectify the problem CAcert will revoke all vulnerable certificates (including yours) on $action_date. -CAcert will no longer accept vulnerable certificate requests for signing. In future all Certficate +CAcert will no longer accept vulnerable certificate requests for signing. In future all Certificate Signing Requests must be backed by private keys with a key length at least 2048 bits and no other known vulnerabilities. You should submit a new Certificate Signing Request of acceptable strength as soon as possible @@ -116,13 +116,13 @@ Organisation Client Certificate, Serial $cert_serial, expiring $cert_expire, CN To rectify the problem CAcert will revoke all vulnerable certificates (including yours) on $action_date. CAcert will no longer accept vulnerable certificate requests for signing. In future all -client certficates must be backed by private keys with a key length at least 1024 bits +client certificates must be backed by private keys with a key length at least 1024 bits and no other known vulnerabilities. This means that you should replace your current certificate with a new one of acceptable strength. If you use Firefox or Chrome, select 'Keysize: High Grade' before 'Create Certificate Request'. If you use Internet Explorer, select 'Microsoft Strong Cryptographic Provider'. If you select an -option that generates a weak key (eg 'Microsoft Base Cryptographic Provider v1.0') your certficate +option that generates a weak key (eg 'Microsoft Base Cryptographic Provider v1.0') your certificate request will be rejected. Kind regards diff --git a/stamp/style.css b/stamp/style.css index 79d3c35..c00a4c7 100644 --- a/stamp/style.css +++ b/stamp/style.css @@ -6,94 +6,95 @@ /***********************************************/ /* HTML tag styles */ /***********************************************/ -body{ +body { font-family: Arial,sans-serif; color: #333333; - line-height: 1.166; + line-height: 1.166; margin: 0px; padding: 0px; - background: #cccccc; + background: #cccccc; /* url("/siteimages/bg_grad.jpg") fixed; */ } + /******* hyperlink and anchor tag styles *******/ -a:link, a:visited{ +a:link, a:visited { color: #005FA9; text-decoration: none; } -a:hover{ +a:hover { text-decoration: underline; } /************** header tag styles **************/ -h1{ - font: bold 120% Arial,sans-serif; - color: #334d55; - margin: 0px; - padding: 0px; +h1 { + font: bold 120% Arial,sans-serif; + color: #334d55; + margin: 0px; + padding: 0px; } -h2{ - font: bold 114% Arial,sans-serif; - color: #006699; - margin: 0px; - padding: 0px; +h2 { + font: bold 114% Arial,sans-serif; + color: #006699; + margin: 0px; + padding: 0px; } -h3{ - font: bold 100% Arial,sans-serif; - color: #334d55; - margin: 0px; - padding: 0px; - cursor: pointer; -/* cursor: hand; */ +h3 { + font: bold 100% Arial,sans-serif; + color: #334d55; + margin: 0px; + padding: 0px; + cursor: pointer; + /* cursor: hand; */ } -h4{ - font: bold 100% Arial,sans-serif; - color: #333333; - margin: 0px; - padding: 0px; +h4 { + font: bold 100% Arial,sans-serif; + color: #333333; + margin: 0px; + padding: 0px; } -h5{ - font: 100% Arial,sans-serif; - color: #334d55; - margin: 0px; - padding: 0px; +h5 { + font: 100% Arial,sans-serif; + color: #334d55; + margin: 0px; + padding: 0px; } /*************** list tag styles ***************/ ul.menu { -list-style: none; -margin :0px 0px 0px 15px; -padding-left: 5px; -border-left: 1px dotted #000; + list-style: none; + margin :0px 0px 0px 15px; + padding-left: 5px; + border-left: 1px dotted #000; } ul.top { -list-style: none; -margin: 0px 0px 0px 15px; -padding-left: 5px; -border-left: 0px; + list-style: none; + margin: 0px 0px 0px 15px; + padding-left: 5px; + border-left: 0px; } ul { -list-style: none; -margin: 0px 0px 0px 15px; -padding-left: 5px; -border-left: 1px dotted #000; + list-style: none; + margin: 0px 0px 0px 15px; + padding-left: 5px; + border-left: 1px dotted #000; } /***********************************************/ /* Layout Divs */ /***********************************************/ -#pagecell1{ +#pagecell1 { position:absolute; top: 2%; left: 2%; diff --git a/www/disputes.php b/www/disputes.php index 4944d8c..34a447a 100644 --- a/www/disputes.php +++ b/www/disputes.php @@ -17,6 +17,7 @@ */ ?> <? require_once("../includes/loggedin.php"); + require_once("../includes/notary.inc.php"); loadem("account"); @@ -58,24 +59,13 @@ { $row = mysql_fetch_assoc($res); echo $row['email']."<br>\n"; - $query = "select `emailcerts`.`id` - from `emaillink`,`emailcerts` where - `emailid`='$emailid' and `emaillink`.`emailcertsid`=`emailcerts`.`id` and - `revoked`=0 and UNIX_TIMESTAMP(`expire`)-UNIX_TIMESTAMP() > 0 - group by `emailcerts`.`id`"; - $dres = mysql_query($query); - while($drow = mysql_fetch_assoc($dres)) - mysql_query("update `emailcerts` set `revoked`='1970-01-01 10:00:01' where `id`='".intval($drow['id'])."'"); - - $do = `../scripts/runclient`; - $query = "update `email` set `deleted`=NOW() where `id`='".intval($emailid)."'"; - mysql_query($query); + account_email_delete($row['id']); } mysql_query("update `disputeemail` set hash='',action='accept' where `id`='$emailid'"); - $rc = mysql_num_rows(mysql_query("select * from `domains` where `memid`='$oldmemid' and `deleted`=0")); - $rc = mysql_num_rows(mysql_query("select * from `email` where `memid`='$oldmemid' and `deleted`=0 and `id`!='$emailid'")); - $res = mysql_query("select * from `users` where `id`='$oldmemid'"); - $user = mysql_fetch_assoc($res); + $rc = mysql_num_rows(mysql_query("select * from `domains` where `memid`='$oldmemid' and `deleted`=0")); + $rc2 = mysql_num_rows(mysql_query("select * from `email` where `memid`='$oldmemid' and `deleted`=0 and `id`!='$emailid'")); + $res = mysql_query("select * from `users` where `id`='$oldmemid'"); + $user = mysql_fetch_assoc($res); if($rc == 0 && $rc2 == 0 && $_SESSION['_config']['email'] == $user['email']) { mysql_query("update `users` set `deleted`=NOW() where `id`='$oldmemid'"); @@ -160,17 +150,13 @@ showheader(_("Domain Dispute")); echo "<p>"._("You have opted to accept this dispute and the request will now remove this domain from the existing account, and revoke any current certificates.")."</p>"; echo "<p>"._("The following accounts have been removed:")."<br>\n"; + //new account_domain_delete($domainid, $memberID) $query = "select * from `domains` where `id`='$domainid' and deleted=0"; $res = mysql_query($query); if(mysql_num_rows($res) > 0) { - echo $_SESSION['_config']['domain']."<br>\n"; - mysql_query("update `domains` set `deleted`=NOW() where `id`='$domainid'"); - $query = "select * from `domlink` where `domid`='$domainid'"; - $res = mysql_query($query); - while($row = mysql_fetch_assoc($res)) - mysql_query("update `domaincerts` set `revoked`='1970-01-01 10:00:01' where `id`='".$row['certid']."' and `revoked`=0 and UNIX_TIMESTAMP(`expire`)-UNIX_TIMESTAMP() > 0"); - $do = `../scripts/runserver`; + echo $_SESSION['_config']['domain']."<br>\n"; + account_domain_delete($domainid); } mysql_query("update `disputedomain` set hash='',action='accept' where `id`='$domainid'"); showfooter(); diff --git a/www/gpg.php b/www/gpg.php index 317072c..829bbcf 100644 --- a/www/gpg.php +++ b/www/gpg.php @@ -17,6 +17,8 @@ */ ?> <? require_once("../includes/loggedin.php"); + require_once("../includes/lib/general.php"); + require_once('../includes/notary.inc.php'); $id = 0; if(array_key_exists('id',$_REQUEST)) $id=intval($_REQUEST['id']); $oldid = $_REQUEST['oldid'] = array_key_exists('oldid',$_REQUEST) ? intval($_REQUEST['oldid']) : 0; @@ -82,17 +84,44 @@ function verifyEmail($email) $state=0; if($oldid == "0" && $CSR != "") { - $debugkey = $gpgkey = clean_gpgcsr($CSR); + if(!array_key_exists('CCA',$_REQUEST)) + { + showheader(_("My CAcert.org Account!")); + echo _("You did not accept the CAcert Community Agreement (CCA), hit the back button and try again."); + showfooter(); + exit; + } - $tnam = tempnam('/tmp/', '__gpg'); - $fp = fopen($tnam, 'w'); - fwrite($fp, $gpgkey); - fclose($fp); - $debugpg = $gpg = trim(`gpg --with-colons --homedir /tmp 2>&1 < $tnam`); - unlink($tnam); + $err = runCommand('mktemp --directory /tmp/cacert_gpg.XXXXXXXXXX', + "", + $tmpdir); + if (!$tmpdir) + { + $err = true; + } + + if (!$err) + { + $err = runCommand("gpg --with-colons --homedir $tmpdir 2>&1", + clean_gpgcsr($CSR), + $gpg); + + `rm -r $tmpdir`; + } + + if ($err) + { + showheader(_("Welcome to CAcert.org")); + + echo "<p style='color:#ff0000'>"._("There was an error parsing your key.")."</p>"; + unset($_REQUEST['process']); + $id = $oldid; + unset($oldid); + exit(); + } $lines = ""; - $gpgarr = explode("\n", $gpg); + $gpgarr = explode("\n", trim($gpg)); foreach($gpgarr as $line) { #echo "Line[]: $line <br/>\n"; @@ -260,7 +289,6 @@ function verifyEmail($email) unset($_REQUEST['process']); $id = $oldid; unset($oldid); - $do = `echo "$debugkey\n--\n$debugpg\n--" >> /www/tmp/gpg.debug`; exit(); } elseif($nerr) @@ -274,6 +302,8 @@ function verifyEmail($email) if($oldid == "0" && $CSR != "") { + write_user_agreement(intval($_SESSION['profile']['id']), "CCA", "certificate creation", "", 1); + //set variable for comment if(trim($_REQUEST['description']) == ""){ $description= ""; @@ -289,10 +319,10 @@ function verifyEmail($email) `keyid`='".mysql_real_escape_string($keyid)."', `description`='".mysql_real_escape_string($description)."'"; mysql_query($query); - $id = mysql_insert_id(); + $insert_id = mysql_insert_id(); - $cwd = '/tmp/gpgspace'.$id; + $cwd = '/tmp/gpgspace'.$insert_id; mkdir($cwd,0755); $fp = fopen("$cwd/gpg.csr", "w"); @@ -303,7 +333,8 @@ function verifyEmail($email) system("gpg --homedir $cwd --import $cwd/gpg.csr"); - $debugpg = $gpg = trim(`gpg --homedir $cwd --with-colons --fixed-list-mode --list-keys $keyid 2>&1`); + $cmd_keyid = escapeshellarg($keyid); + $gpg = trim(`gpg --homedir $cwd --with-colons --fixed-list-mode --list-keys $cmd_keyid 2>&1`); $lines = ""; $gpgarr = explode("\n", $gpg); foreach($gpgarr as $line) @@ -403,7 +434,8 @@ function verifyEmail($email) //echo "Keyid: $keyid\n"; - $process = proc_open("/usr/bin/gpg --homedir $cwd --no-tty --command-fd 0 --status-fd 1 --logger-fd 2 --edit-key $keyid", $descriptorspec, $pipes); + $cmd_keyid = escapeshellarg($keyid); + $process = proc_open("/usr/bin/gpg --homedir $cwd --no-tty --command-fd 0 --status-fd 1 --logger-fd 2 --edit-key $cmd_keyid", $descriptorspec, $pipes); //echo "Process: $process\n"; //fputs($stderr,"Process: $process\n"); @@ -485,15 +517,16 @@ function verifyEmail($email) } - $csrname=generatecertpath("csr","gpg",$id); - $do=`gpg --homedir $cwd --batch --export-options export-minimal --export $keyid >$csrname`; + $csrname=generatecertpath("csr","gpg",$insert_id); + $cmd_keyid = escapeshellarg($keyid); + $do=`gpg --homedir $cwd --batch --export-options export-minimal --export $cmd_keyid >$csrname`; - mysql_query("update `gpg` set `csr`='$csrname' where `id`='$id'"); - waitForResult('gpg', $id); + mysql_query("update `gpg` set `csr`='$csrname' where `id`='$insert_id'"); + waitForResult('gpg', $insert_id); showheader(_("Welcome to CAcert.org")); echo $resulttable; - $query = "select * from `gpg` where `id`='$id' and `crt`!=''"; + $query = "select * from `gpg` where `id`='$insert_id' and `crt`!=''"; $res = mysql_query($query); if(mysql_num_rows($res) <= 0) { @@ -501,7 +534,7 @@ function verifyEmail($email) echo _("If this is a re-occuring problem, please send a copy of the key you are trying to signed to support@cacert.org. Thank you."); } else { echo "<pre>"; - readfile(generatecertpath("crt","gpg",$id)); + readfile(generatecertpath("crt","gpg",$insert_id)); echo "</pre>"; } diff --git a/www/images/btn_paynowCC_LG.gif b/www/images/btn_paynowCC_LG.gif Binary files differindex f2edb8f..99fda23 100644 --- a/www/images/btn_paynowCC_LG.gif +++ b/www/images/btn_paynowCC_LG.gif diff --git a/www/images/btn_subscribeCC_LG.gif b/www/images/btn_subscribeCC_LG.gif Binary files differnew file mode 100644 index 0000000..a5cd278 --- /dev/null +++ b/www/images/btn_subscribeCC_LG.gif diff --git a/www/sqldump.php b/www/sqldump.php index 9476f6f..f30b4d0 100644 --- a/www/sqldump.php +++ b/www/sqldump.php @@ -15,24 +15,24 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ - header("content-type: text/plain"); + header("content-type: text/plain"); ?> # CAcert SQL Dump -# version 0.0.2 +# version 0.0.3 # # Generation Time: <?=date('r')?> # # Database: `cacert` # <? - $tables = mysql_list_tables('cacert'); - while(list($table_name) = mysql_fetch_array($tables)) - { - echo "# --------------------------------------------------------\n\n"; - echo "#\n# Table structure for table `$table_name`\n#\n\n"; + $tables = mysql_query("SHOW TABLES"); + while(list($table_name) = mysql_fetch_array($tables)) + { + echo "# --------------------------------------------------------\n\n"; + echo "#\n# Table structure for table `$table_name`\n#\n\n"; - echo "DROP TABLE IF EXISTS `$table_name`;\n"; - $create = mysql_fetch_assoc(mysql_query("SHOW CREATE TABLE `cacert`.`$table_name`")); - echo $create['Create Table'].";\n\n"; - } + echo "DROP TABLE IF EXISTS `$table_name`;\n"; + $create = mysql_fetch_assoc(mysql_query("SHOW CREATE TABLE `$table_name`")); + echo $create['Create Table'].";\n\n"; + } ?> diff --git a/www/stats.php b/www/stats.php index 93f693e..1599e17 100644 --- a/www/stats.php +++ b/www/stats.php @@ -1,268 +1,160 @@ -<? /*
- 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
-*/
- define('MAX_CACHE_TTL', 36000);
-
- loadem("index");
- showheader(_("Welcome to CAcert.org"));
-
- function tc($sql)
- {
- $row = mysql_fetch_assoc($sql);
- return($row['count']);
- }
-
- /**
- * writes new data to cache, create cache or update existing cache, set current
- * time stamp
- * @return boolean
- */
- function updateCache($stats) {
- $sql = 'insert into statscache (timestamp, cache) values ("' . time() . '", ' .
- '"' . mysql_real_escape_string(serialize($stats)) . '")';
- mysql_query($sql);
- }
-
- /**
- * get statistics data from current cache, return result of getDataFromLive if no cache file exists
- * @return array
- */
- function getData() {
- $sql = 'select * from statscache order by timestamp desc limit 1';
- $res = mysql_query($sql);
- if ($res && mysql_numrows($res) > 0) {
- $ar = mysql_fetch_assoc($res);
- $stats = unserialize($ar['cache']);
- $stats['timestamp'] = $ar['timestamp'];
- if ($ar['timestamp'] + MAX_CACHE_TTL < time())
- {
- $stats=getDataFromLive();
- updateCache($stats);
- }
- return $stats;
- }
- $stats=getDataFromLive();
- updateCache($stats);
- return $stats;
- }
-
- /**
- * get statistics data from live tables, takes a long time so please try to use the
- * cache
- * @return array
- */
- function getDataFromLive() {
- $stats = array();
- $stats['verified_users'] = number_format(tc(mysql_query("select count(`id`) as `count` from `users` where `verified`=1")));
- $stats['verified_emails'] = number_format(tc(mysql_query("select count(`id`) as `count` from `email` where `hash`='' and `deleted`=0")));
- $stats['verified_domains'] = number_format(tc(mysql_query("select count(`id`) as `count` from `domains` where `hash`='' and `deleted`=0")));
- $certs = tc(mysql_query("select count(`id`) as `count` from `domaincerts`"));
- $certs += tc(mysql_query("select count(`id`) as `count` from `emailcerts`"));
- $certs += tc(mysql_query("select count(`id`) as `count` from `gpg`"));
- $certs += tc(mysql_query("select count(`id`) as `count` from `orgdomaincerts`"));
- $certs += tc(mysql_query("select count(`id`) as `count` from `orgemailcerts`"));
- $stats['verified_certificates'] = number_format($certs);
- $certs = tc(mysql_query("select count(`id`) as `count` from `domaincerts` where `revoked`=0 and `expire`>NOW()"));
- $certs += tc(mysql_query("select count(`id`) as `count` from `emailcerts` where `revoked`=0 and `expire`>NOW()"));
- $certs += tc(mysql_query("select count(`id`) as `count` from `gpg` where `expire`<=NOW()"));
- $certs += tc(mysql_query("select count(`id`) as `count` from `orgdomaincerts` where `revoked`=0 and `expire`>NOW()"));
- $certs += tc(mysql_query("select count(`id`) as `count` from `orgemailcerts` where `revoked`=0 and `expire`>NOW()"));
- $stats['valid_certificates'] = number_format($certs);
- $stats['assurances_made'] = number_format(tc(mysql_query("select count(`id`) as `count` from `notary`")));
- $stats['users_1to49'] = number_format(mysql_num_rows(mysql_query("select `to` from `notary` group by `to` having sum(`points`) > 0 and sum(`points`) < 50")));
- $stats['users_50to99'] = number_format(mysql_num_rows(mysql_query("select `to` from `notary` group by `to` having sum(`points`) >= 50 and sum(`points`) < 100")));
- $stats['assurer_candidates'] = number_format(tc(mysql_query("select count(*) as `count` from `users` where ".
- "not exists(select 1 from `cats_passed` as `cp`, `cats_variant` as `cv` where `cp`.`user_id`=`users`.`id` and `cp`.`variant_id`=`cv`.`id` and `cv`.`type_id`=1) and ".
- "(select sum(`points`) from `notary` where `to`=`users`.`id`) >= 100")));
- $stats['aussurers_with_test'] = number_format(tc(mysql_query("select count(*) as `count` from `users` where ".
- "exists(select 1 from `cats_passed` as `cp`, `cats_variant` as `cv` where `cp`.`user_id`=`users`.`id` and `cp`.`variant_id`=`cv`.`id` and `cv`.`type_id`=1) and ".
- "(select sum(`points`) from `notary` where `to`=`users`.`id`) >= 100")));
- $stats['points_issued'] = number_format(tc(mysql_query("select sum(`points`) as `count` from `notary`")));
-
- $totalusers=0;
- $totassurers=0;
- $totalcerts=0;
- for($i = 0; $i < 12; $i++) {
- $tmp_arr = array();
- $tmp_arr['date'] = date("Y-m", mktime(0,0,0,date("m") - $i,1,date("Y")));
- $date = date("Y-m", mktime(0,0,0,date("m") - $i,1,date("Y")));
- $totalusers += $users = tc(mysql_query("select count(`id`) as `count` from `users` where `created` like '$date%' and `verified`=1"));
- $totassurers += $assurers = mysql_num_rows(mysql_query("select `to` from `notary` where `when` like '$date%' and `method`!='Administrative Increase' group by `to` having sum(`points`) >= 100"));
- $certs = tc(mysql_query("select count(`id`) as `count` from `domaincerts` where `created` like '$date%'"));
- $certs += tc(mysql_query("select count(`id`) as `count` from `emailcerts` where `created` like '$date%'"));
- $certs += tc(mysql_query("select count(`id`) as `count` from `gpg` where `issued` like '$date%'"));
- $certs += tc(mysql_query("select count(`id`) as `count` from `orgdomaincerts` where `created` like '$date%'"));
- $certs += tc(mysql_query("select count(`id`) as `count` from `orgemailcerts` where `created` like '$date%'"));
- $totalcerts += $certs;
-
- $tmp_arr['new_users'] = number_format($users);
- $tmp_arr['new_assurers'] = number_format($assurers);
- $tmp_arr['new_certificates'] = number_format($certs);
-
- $stats['growth_last_12m'][] = $tmp_arr;
- }
- $stats['growth_last_12m_total'] = array('new_users' => number_format($totalusers),
- 'new_assurers' => number_format($totassurers),
- 'new_certificates' => number_format($totalcerts));
-
- $totalcerts = 0;
- $totalusers = 0;
- $totassurers = 0;
- for($i = date("Y"); $i >= 2002; $i--) {
- $tmp_arr = array();
- $tmp_arr['date'] = $i;
- $totalusers += $users = tc(mysql_query("select count(`id`) as `count` from `users` where `created` like '$i%' and `verified`=1"));
- $totassurers += $assurers = mysql_num_rows(mysql_query("select `to` from `notary` where `when` like '$i%' and `method`!='Administrative Increase' group by `to` having sum(`points`) >= 100"));
- $certs = tc(mysql_query("select count(`id`) as `count` from `domaincerts` where `created` like '$i%'"));
- $certs += tc(mysql_query("select count(`id`) as `count` from `emailcerts` where `created` like '$i%'"));
- $certs += tc(mysql_query("select count(`id`) as `count` from `gpg` where `issued` like '$i%'"));
- $certs += tc(mysql_query("select count(`id`) as `count` from `orgdomaincerts` where `created` like '$i%'"));
- $certs += tc(mysql_query("select count(`id`) as `count` from `orgemailcerts` where `created` like '$i%'"));
- $totalcerts += $certs;
-
- $tmp_arr['new_users'] = number_format($users);
- $tmp_arr['new_assurers'] = number_format($assurers);
- $tmp_arr['new_certificates'] = number_format($certs);
-
- $stats['growth_last_years'][] = $tmp_arr;
- }
- $stats['growth_last_years_total'] = array('new_users' => number_format($totalusers),
- 'new_assurers' => number_format($totassurers),
- 'new_certificates' => number_format($totalcerts));
-
- return $stats;
- }
-
- $stats = getData();
-?>
-<h1>CAcert.org <?=_("Statistics")?></h1>
-
-<table align="center" border="0" cellspacing="0" cellpadding="0" class="wrapper">
- <tr>
- <td colspan="2" class="title">CAcert.org <?=_("Statistics")?></td>
- </tr>
- <tr>
- <td class="DataTD"><?=_("Verified Users")?>:</td>
- <td class="DataTD"><?=$stats['verified_users'];?></td>
- </tr>
- <tr>
- <td class="DataTD"><?=_("Verified Emails")?>:</td>
- <td class="DataTD"><?=$stats['verified_emails'];?></td>
- </tr>
- <tr>
- <td class="DataTD"><?=_("Verified Domains")?>:</td>
- <td class="DataTD"><?=$stats['verified_domains'];?></td>
- </tr>
- <tr>
- <td class="DataTD"><?=_("Certificates Issued")?>:</td>
- <td class="DataTD"><?=$stats['verified_certificates'];?></td>
- </tr>
- <tr>
- <td class="DataTD"><?=_("Valid Certificates")?>:</td>
- <td class="DataTD"><?=$stats['valid_certificates'];?></td>
- </tr>
- <tr>
- <td class="DataTD"><?=_("Assurances Made")?>:</td>
- <td class="DataTD"><?=$stats['assurances_made'];?></td>
- </tr>
- <tr>
- <td class="DataTD"><?=_("Users with 1-49 Points")?>:</td>
- <td class="DataTD"><?=$stats['users_1to49'];?></td>
- </tr>
- <tr>
- <td class="DataTD"><?=_("Users with 50-99 Points")?>:</td>
- <td class="DataTD"><?=$stats['users_50to99'];?></td>
- </tr>
- <tr>
- <td class="DataTD"><?=_("Assurer Candidates")?>:</td>
- <td class="DataTD"><?=$stats['assurer_candidates'];?></td>
- </tr>
- <tr>
- <td class="DataTD"><?=_("Assurers with test")?>:</td>
- <td class="DataTD"><?=$stats['aussurers_with_test'];?></td>
- </tr>
- <tr>
- <td class="DataTD"><?=_("Points Issued")?>:</td>
- <td class="DataTD"><?=$stats['points_issued'];?></td>
- </tr>
-</table>
-<br>
-<table align="center" border="0" cellspacing="0" cellpadding="0" class="wrapper">
- <tr>
- <td colspan="4" class="title">CAcert.org <?=_("Growth in the last 12 months")?></td>
- </tr>
- <tr>
- <td class="DataTD"><b><?=_("Date")?></b>
- <td class="DataTD"><b><?=_("New Users")?></b>
- <td class="DataTD"><b><?=_("New Assurers")?></b>
- <td class="DataTD"><b><?=_("New Certificates")?></b>
- </tr>
-<?
- for($i = 0; $i < 12; $i++) {
-?>
- <tr>
- <td class="DataTD"><?=$stats['growth_last_12m'][$i]['date'];?></td>
- <td class="DataTD"><?=$stats['growth_last_12m'][$i]['new_users'];?></td>
- <td class="DataTD"><?=$stats['growth_last_12m'][$i]['new_assurers'];?></td>
- <td class="DataTD"><?=$stats['growth_last_12m'][$i]['new_certificates'];?></td>
- </tr>
-<? } ?>
- <tr>
- <td class="DataTD">N/A</td>
- <td class="DataTD"><?=$stats['growth_last_12m_total']['new_users'];?></td>
- <td class="DataTD"><?=$stats['growth_last_12m_total']['new_assurers'];?></td>
- <td class="DataTD"><?=$stats['growth_last_12m_total']['new_certificates'];?></td>
- </tr>
-</table>
-<br>
-<table align="center" border="0" cellspacing="0" cellpadding="0" class="wrapper">
- <tr>
- <td colspan="4" class="title">CAcert.org <?=_("Growth by year")?></td>
- </tr>
- <tr>
- <td class="DataTD"><b><?=_("Date")?></b>
- <td class="DataTD"><b><?=_("New Users")?></b>
- <td class="DataTD"><b><?=_("New Assurers")?></b>
- <td class="DataTD"><b><?=_("New Certificates")?></b>
- </tr>
-<?
- for($i = 0; $i < count($stats['growth_last_years']); $i++) {
-?>
- <tr>
- <td class="DataTD"><?=$stats['growth_last_years'][$i]['date'];?></td>
- <td class="DataTD"><?=$stats['growth_last_years'][$i]['new_users'];?></td>
- <td class="DataTD"><?=$stats['growth_last_years'][$i]['new_assurers'];?></td>
- <td class="DataTD"><?=$stats['growth_last_years'][$i]['new_certificates'];?></td>
- </tr>
-<? } ?>
- <tr>
- <td class="DataTD">N/A</td>
- <td class="DataTD"><?=$stats['growth_last_years_total']['new_users'];?></td>
- <td class="DataTD"><?=$stats['growth_last_years_total']['new_assurers'];?></td>
- <td class="DataTD"><?=$stats['growth_last_years_total']['new_certificates'];?></td>
- </tr>
-</table>
-<br>
-<?php
- if (isset($stats['timestamp'])) {
-?>
-<div style="text-align: center;font-size: small;"><?=_("Statistical data from cache, created at ") . date('Y-m-d H:i:s', $stats['timestamp']);?></div>
-<?php
- }
-?>
-<? showfooter(); ?>
-
+<? /* + 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 +*/ + + loadem("index"); + showheader(_("Welcome to CAcert.org")); + + /** + * get statistics data from current cache, return result of getDataFromLive if no cache file exists + * @return array + */ + function getData() { + $sql = 'select * from `statscache` order by `timestamp` desc limit 1'; + $res = mysql_query($sql); + if ($res && mysql_numrows($res) > 0) { + $ar = mysql_fetch_assoc($res); + $stats = unserialize($ar['cache']); + $stats['timestamp'] = $ar['timestamp']; + return $stats; + } + + return null; + } + + $stats = getData(); + if ($stats === null) { + echo '<p>', _("Error while retrieving the statistics!"), '</p>'; + showfooter(); + die(); + } +?> +<h1>CAcert.org <?=_("Statistics")?></h1> + +<table align="center" border="0" cellspacing="0" cellpadding="0" class="wrapper"> + <tr> + <td colspan="2" class="title">CAcert.org <?=_("Statistics")?></td> + </tr> + <tr> + <td class="DataTD"><?=_("Verified Users")?>:</td> + <td class="DataTD"><?=$stats['verified_users'];?></td> + </tr> + <tr> + <td class="DataTD"><?=_("Verified Emails")?>:</td> + <td class="DataTD"><?=$stats['verified_emails'];?></td> + </tr> + <tr> + <td class="DataTD"><?=_("Verified Domains")?>:</td> + <td class="DataTD"><?=$stats['verified_domains'];?></td> + </tr> + <tr> + <td class="DataTD"><?=_("Certificates Issued")?>:</td> + <td class="DataTD"><?=$stats['verified_certificates'];?></td> + </tr> + <tr> + <td class="DataTD"><?=_("Valid Certificates")?>:</td> + <td class="DataTD"><?=$stats['valid_certificates'];?></td> + </tr> + <tr> + <td class="DataTD"><?=_("Assurances Made")?>:</td> + <td class="DataTD"><?=$stats['assurances_made'];?></td> + </tr> + <tr> + <td class="DataTD"><?=_("Users with 1-49 Points")?>:</td> + <td class="DataTD"><?=$stats['users_1to49'];?></td> + </tr> + <tr> + <td class="DataTD"><?=_("Users with 50-99 Points")?>:</td> + <td class="DataTD"><?=$stats['users_50to99'];?></td> + </tr> + <tr> + <td class="DataTD"><?=_("Assurer Candidates")?>:</td> + <td class="DataTD"><?=$stats['assurer_candidates'];?></td> + </tr> + <tr> + <td class="DataTD"><?=_("Assurers with test")?>:</td> + <td class="DataTD"><?=$stats['aussurers_with_test'];?></td> + </tr> + <tr> + <td class="DataTD"><?=_("Points Issued")?>:</td> + <td class="DataTD"><?=$stats['points_issued'];?></td> + </tr> +</table> +<br> +<table align="center" border="0" cellspacing="0" cellpadding="0" class="wrapper"> + <tr> + <td colspan="4" class="title">CAcert.org <?=_("Growth in the last 12 months")?></td> + </tr> + <tr> + <td class="DataTD"><b><?=_("Date")?></b> + <td class="DataTD"><b><?=_("New Users")?></b> + <td class="DataTD"><b><?=_("New Assurers")?></b> + <td class="DataTD"><b><?=_("New Certificates")?></b> + </tr> +<? + for($i = 0; $i < 12; $i++) { +?> + <tr> + <td class="DataTD"><?=$stats['growth_last_12m'][$i]['date'];?></td> + <td class="DataTD"><?=$stats['growth_last_12m'][$i]['new_users'];?></td> + <td class="DataTD"><?=$stats['growth_last_12m'][$i]['new_assurers'];?></td> + <td class="DataTD"><?=$stats['growth_last_12m'][$i]['new_certificates'];?></td> + </tr> +<? } ?> + <tr> + <td class="DataTD"><?=_("Total")?></td> + <td class="DataTD"><?=$stats['growth_last_12m_total']['new_users'];?></td> + <td class="DataTD"><?=$stats['growth_last_12m_total']['new_assurers'];?></td> + <td class="DataTD"><?=$stats['growth_last_12m_total']['new_certificates'];?></td> + </tr> +</table> +<br> +<table align="center" border="0" cellspacing="0" cellpadding="0" class="wrapper"> + <tr> + <td colspan="4" class="title">CAcert.org <?=_("Growth by year")?></td> + </tr> + <tr> + <td class="DataTD"><b><?=_("Date")?></b> + <td class="DataTD"><b><?=_("New Users")?></b> + <td class="DataTD"><b><?=_("New Assurers")?></b> + <td class="DataTD"><b><?=_("New Certificates")?></b> + </tr> +<? + for($i = 0; $i < count($stats['growth_last_years']); $i++) { +?> + <tr> + <td class="DataTD"><?=$stats['growth_last_years'][$i]['date'];?></td> + <td class="DataTD"><?=$stats['growth_last_years'][$i]['new_users'];?></td> + <td class="DataTD"><?=$stats['growth_last_years'][$i]['new_assurers'];?></td> + <td class="DataTD"><?=$stats['growth_last_years'][$i]['new_certificates'];?></td> + </tr> +<? } ?> + <tr> + <td class="DataTD"><?=_("Total")?></td> + <td class="DataTD"><?=$stats['growth_last_years_total']['new_users'];?></td> + <td class="DataTD"><?=$stats['growth_last_years_total']['new_assurers'];?></td> + <td class="DataTD"><?=$stats['growth_last_years_total']['new_certificates'];?></td> + </tr> +</table> +<br> + +<div style="text-align: center;font-size: small;"><? + printf(_("Last updated: %s"), date('Y-m-d H:i:s', $stats['timestamp']));?> +</div> + +<? showfooter(); ?> + diff --git a/www/styles/default.css b/www/styles/default.css index f2b3c95..4d4db6a 100644 --- a/www/styles/default.css +++ b/www/styles/default.css @@ -6,20 +6,22 @@ /***********************************************/ /* HTML tag styles */ /***********************************************/ -body{ + +body { font-family: Arial,sans-serif; color: #333333; - line-height: 1.166; + line-height: 1.166; margin: 0px; padding: 0px; - background: #cccccc; -/* url("/siteimages/bg_grad.jpg") fixed; */ + background: #cccccc; +/* url("/siteimages/bg_grad.jpg") fixed; */ } + /******* hyperlink and anchor tag styles *******/ a:link, a:visited { - color: #005FA9; + color: #005fa9; text-decoration: none; } @@ -27,85 +29,87 @@ a:hover { text-decoration: underline; } + /************** header tag styles **************/ -h1{ - font: bold 120% Arial,sans-serif; - color: #334d55; - margin: 0px; - padding: 0px; +h1 { + font: bold 120% Arial ,sans-serif; + color: #334d55; + margin: 0px; + padding: 0px; } -h2{ - font: bold 114% Arial,sans-serif; - color: #006699; - margin: 0px; - padding: 0px; +h2 { + font: bold 114% Arial ,sans-serif; + color: #006699; + margin: 0px; + padding: 0px; } -h3{ - font: bold 100% Arial,sans-serif; - color: #334d55; - margin: 0px; - padding: 0px; +h3 { + font: bold 100% Arial ,sans-serif; + color: #334d55; + margin: 0px; + padding: 0px; } -h3.pointer{ - cursor: pointer; - /* cursor: hand; */ +h3.pointer { + cursor: pointer; + /* cursor: hand; */ } -h4{ - font: bold 100% Arial,sans-serif; - color: #333333; - margin: 0px; - padding: 0px; +h4 { + font: bold 100% Arial ,sans-serif; + color: #333333; + margin: 0px; + padding: 0px; } -h5{ - font: 100% Arial,sans-serif; - color: #334d55; - margin: 0px; - padding: 0px; +h5 { + font: 100% Arial ,sans-serif; + color: #334d55; + margin: 0px; + padding: 0px; } /*************** list tag styles ***************/ ul.menu { -list-style: none; -margin :0px 0px 0px 15px; -padding-left: 5px; -border-left: 1px dotted #000; + list-style: none; + margin: 0px 0px 0px 15px; + padding-left: 5px; + border-left: 1px dotted #000; } ul.top { -list-style: none; -margin: 0px 0px 0px 15px; -padding-left: 5px; -border-left: 0px; + list-style: none; + margin: 0px 0px 0px 15px; + padding-left: 5px; + border-left: 0px; } ul.no_indent { -list-style: none; -padding: 0px; + list-style: none; + padding: 0px; } + /***********************************************/ /* Layout Divs */ /***********************************************/ -#pagecell1{ - position:absolute; + +#pagecell1 { + position: absolute; top: 2%; left: 2%; right: 2%; width: 96%; background-color: #ffffff; - } #tl { - position:absolute; + position: absolute; top: -1px; left: -1px; margin: 0px; @@ -114,7 +118,7 @@ padding: 0px; } #tr { - position:absolute; + position: absolute; top: -1px; right: -1px; margin: 0px; @@ -122,43 +126,43 @@ padding: 0px; z-index: 100; } -#masthead{ +#masthead { position: absolute; top: 0px; left: 2%; right: 2%; - width:95.6%; - + width: 95.6%; } -#pageNav{ +#pageNav { float: right; - width:178px; + width: 178px; padding: 0px; background-color: #F5f7f7; border-left: 1px solid #cccccc; font: small Verdana,sans-serif; } -#content{ +#content { padding: 0px 10px 0px 0px; - margin:0px 178px 0px 0px; + margin: 0px 178px 0px 0px; } /***********************************************/ /* Component Divs */ /***********************************************/ -#siteName{ +#siteName { margin: 0px; padding: 16px 0px 8px 0px; color: #ffffff; font-weight: normal; } + /************** utility styles *****************/ -#utility{ +#utility { font: 75% Verdana,sans-serif; position: absolute; top: 16px; @@ -166,7 +170,7 @@ padding: 0px; color: #919999; } -#utility a{ +#utility a { color: #ffffff; } @@ -174,46 +178,48 @@ padding: 0px; text-decoration: underline; } + /************** pageName styles ****************/ -#pageName{ +#pageName { padding: 0px 0px 14px 10px; margin: 0px; - border-bottom:1px solid #ccd2d2; + border-bottom: 1px solid #ccd2d2; z-index: 2; } -#pageName h2{ +#pageName h2 { font: bold 175% Arial,sans-serif; color: #000000; - margin:0px; + margin: 0px; padding: 0px; } + /* #pageLogo { - position: absolute; - top: 8px; - left: 10px; - z-index: 5; + position: absolute; + top: 8px; + left: 10px; + z-index: 5; } */ + /************* globalNav styles ****************/ -#globalNav{ -position: relative; -width: 100%; -min-width: 640px; -height: 32px; -color: #cccccc; -padding: 0px; -margin: 0px; -background-image: url("siteimages/glbnav_background.gif"); +#globalNav { + position: relative; + width: 100%; + min-width: 640px; + height: 32px; + color: #cccccc; + padding: 0px; + margin: 0px; + background-image: url("siteimages/glbnav_background.gif"); } -#globalNav img{ - margin-bottom: -4px; - +#globalNav img { + margin-bottom: -4px; } #gnl { @@ -228,7 +234,7 @@ background-image: url("siteimages/glbnav_background.gif"); right:0px; } -#globalLink{ +#globalLink { position: absolute; top: 6px; height: 22px; @@ -241,24 +247,27 @@ background-image: url("siteimages/glbnav_background.gif"); a.glink, a.glink:visited { - font-size: small; - color: #000000; + font-size: small; + color: #000000; font-weight: bold; margin: 0px; padding: 2px 5px 4px 5px; - border-right: 1px solid #8FB8BC; + border-right: 1px solid #8fb8bc; } a.glink:hover { - background-image: url("siteimages/glblnav_selected.gif"); + background-image: url("siteimages/glblnav_selected.gif"); text-decoration: none; } -.skipLinks {display: none;} +.skipLinks { + display: none; +} + /************ subglobalNav styles **************/ -.subglobalNav{ +.subglobalNav { position: absolute; top: 84px; left: 0px; @@ -279,13 +288,15 @@ a.glink:hover { color: #cccccc; } + /*************** search styles *****************/ /* #listshow { z-order: 101; } */ -#search{ + +#search { position: absolute; top: 125px; right: 0px; @@ -300,46 +311,46 @@ a.glink:hover { font-size: 11px; } -#search1{ +#search1 { position: absolute; top: 85px; right: 300px; } -#search2{ +#search2 { position: absolute; top: 100px; right: 300px; } -#search3{ +#search3 { position: absolute; top: 85px; right: 240px; } -#search4{ +#search4 { position: absolute; top: 100px; right: 226px; } -#googlead{ +#googlead { position: absolute; top: 5px; right: 0px; z-index: -10; } -#search input{ - font-size: 70%; - margin: 0px 0px 0px 10px; +#search input { + font-size: 70%; + margin: 0px 0px 0px 10px; } - + #search a:link, #search a:visited { font-size: 80%; font-weight: bold; - + } #search a:hover { @@ -349,40 +360,42 @@ a.glink:hover { /************* breadCrumb styles ***************/ -#breadCrumb{ +#breadCrumb { padding: 5px 0px 5px 10px; font: small Verdana,sans-serif; - color: #AAAAAA; + color: #aaaaaa; } -#breadCrumb a{ - color: #AAAAAA; +#breadCrumb a { + color: #aaaaaa; } #breadCrumb a:hover { - color: #005FA9; + color: #005fa9; text-decoration: underline; } /************** feature styles *****************/ -.feature{ +.feature { padding: 0px 0px 10px 10px; font-size: 80%; min-height: 200px; height: 200px; } -.feature {height: auto;} +.feature { + height: auto; +} -.feature h3{ +.feature h3 { font: bold 175% Arial,sans-serif; color: #000000; padding: 30px 0px 5px 0px; } -.feature img{ +.feature img { float: left; padding: 0px 10px 0px 0px; } @@ -396,7 +409,7 @@ a.glink:hover { min-height: 450px; } -.story h3{ +.story h3 { font: bold 125% Arial,sans-serif; color: #000000; } @@ -405,10 +418,10 @@ a.glink:hover { padding: 0px 0px 10px 0px; } -.story a.capsule{ +.story a.capsule { font: bold 1em Arial,sans-serif; color: #005FA9; - display:block; + display: block; padding-bottom: 5px; } @@ -416,14 +429,14 @@ a.glink:hover { text-decoration: underline; } -td.storyLeft{ +td.storyLeft { padding-right: 12px; } /************** siteInfo styles ****************/ -#siteInfo{ +#siteInfo { clear: both; border-top: 1px solid #cccccc; font-size: small; @@ -431,15 +444,15 @@ td.storyLeft{ padding: 10px 10px 10px 10px; } + /************ sectionLinks styles **************/ -#sectionLinks{ +#sectionLinks { margin: 0px; padding: 0px; - } -#sectionLinks h3{ +#sectionLinks h3 { padding: 10px 0px 2px 10px; border-bottom: 1px solid #cccccc; } @@ -448,7 +461,7 @@ td.storyLeft{ display: block; border-top: 1px solid #ffffff; border-bottom: 1px solid #cccccc; - background-image: url("siteimages/bg_nav.jpg"); + background-image: url("siteimages/bg_nav.jpg"); font-weight: bold; padding: 3px 0px 3px 10px; color: #21536A; @@ -465,83 +478,84 @@ td.storyLeft{ /************* relatedLinks styles **************/ -.relatedLinks{ +.relatedLinks { margin: 0px; padding: 0px 0px 10px 10px; border-bottom: 1px solid #cccccc; } -.relatedLinks h3{ +.relatedLinks h3 { padding: 10px 0px 2px 0px; } -.relatedLinks a{ - display: block; +.relatedLinks a { + display: block; } /**************** advert styles *****************/ -#advert{ +#advert { padding: 10px; } -#advert img{ +#advert img { display: block; } + /********************* end **********************/ .DataTD input, .DataTD textarea { - FONT-SIZE: 92%; + font-size: 92%; } .DataTD select, .DataTD option { - FONT-SIZE: 92%; + font-size: 92%; } .DataTD { - background-color: #E2E2E2; + background-color: #e2e2e2; border-style: inset; border-width: 1px; - FONT-SIZE: 8pt; - COLOR: #000000; - FONT-FAMILY: Arial, Tahoma, Verdana, Helvetica, sans-serif; + font-size: 8pt; + color: #000000; + font-family: Arial, Tahoma, Verdana, Helvetica, sans-serif; background: #ffffff; padding: 1px 5px 1px 5px; - border: 1px #CFCFCF solid; - border-left: 1px #CFCFCF dotted; - border-right: 1px #CFCFCF dotted; + border: 1px #cfcfcf solid; + border-left: 1px #cfcfcf dotted; + border-right: 1px #cfcfcf dotted; } .DataTDGrey { background-color: #EFEDED; border-style: inset; border-width: 1px; - FONT-SIZE: 8pt; - COLOR: #000000; - FONT-FAMILY: Arial, Tahoma, Verdana, Helvetica, sans-serif; + font-size: 8pt; + color: #000000; + font-family: Arial, Tahoma, Verdana, Helvetica, sans-serif; padding: 1px 5px 1px 5px; border: 1px #CFCFCF solid; - border-left: 1px #CFCFCF dotted; - border-right: 1px #CFCFCF dotted; + border-left: 1px #cfcfcf dotted; + border-right: 1px #cfcfcf dotted; } .DataTDNotDotted { - background-color: #E2E2E2; + background-color: #e2e2e2; border-style: inset; border-width: 1px; - FONT-SIZE: 8pt; - COLOR: #000000; - FONT-FAMILY: Arial, Tahoma, Verdana, Helvetica, sans-serif; + font-size: 8pt; + color: #000000; + font-family: Arial, Tahoma, Verdana, Helvetica, sans-serif; background: #ffffff; padding: 1px 5px 1px 5px; border: 1px #CFCFCF solid; - border-left: 1px #CFCFCF solid; - border-right: 1px #CFCFCF solid; + border-left: 1px #cfcfcf solid; + border-right: 1px #cfcfcf solid; } .wrapper { @@ -552,104 +566,142 @@ td.storyLeft{ } td.greytxt { - color: #CCCCCC; + color: #cccccc; font-size: smaller; text-align: right; vertical-align: bottom; } .title { - background: #E2E2E2; - font-weight:BOLD; + background: #e2e2e2; + font-weight: bold; padding: 1px 5px 1px 5px; - border: 1px solid #CFCFCF; - border-bottom: 3px double #CFCFCF; + border: 1px solid #cfcfcf; + border-bottom: 3px double #cfcfcf; border-top: 1px solid #656565; text-align: center; } .errmsg { - font-weight: BOLD; + font-weight: bold; color: #FF0000; } -.ac_menu -{ - border:1px solid black +.ac_menu { + border: 1px solid black } -.ac_normal -{ - background-color:#ffffff; - cursor:pointer; + +.ac_normal { + background-color: #ffffff; + cursor: pointer; } -.ac_highlight -{ - background-color:#3366cc; - color:white; - cursor:pointer; + +.ac_highlight { + background-color: #3366cc; + color: white; + cursor: pointer; } -.ac_normal .a -{ - font-size:13px; - color:black; + +.ac_normal .a { + font-size: 13px; + color: black; } -.ac_highlight .a -{ - font-size:13px; + +.ac_highlight .a { + font-size: 13px; } -.ac_normal .d -{ - float:right; - font-size:10px; - color:green; + +.ac_normal .d { + float: right; + font-size: 10px; + color: green; } -.ac_highlight .d -{ - float:right; - font-size:10px; + +.ac_highlight .d { + float: right; + font-size: 10px; } + /************** sponsorInfo styles ****************/ div.sponsorinfo { - clear: both; - border-top: 1px solid #cccccc; - font-size: small; - color: #000000; - padding: 10px 10px 10px 10px; + clear: both; + border-top: 1px solid #cccccc; + font-size: small; + color: #000000; + padding: 10px 10px 10px 10px; } img.sponsorlogo { - margin-left: 10px; - margin-right: 10px; - border: 0px none; - vertical-align: middle; + margin-left: 10px; + margin-right: 10px; + border: 0px none; + vertical-align: middle; } + /************ Newsbox *************/ -#lnews { /* class for the text "Latest News" */ - font-size: small; - font-variant: small-caps; +#lnews { /* class for the text "Latest News" */ + font-size: small; + font-variant: small-caps; } div.newsbox { - border-top: 1px solid #cccccc; - color: #101010; - padding: 10px 10px 10px 10px; + border-top: 1px solid #cccccc; + color: #101010; + padding: 10px 10px 10px 10px; } + /************ SQL Performance ***********/ div.footerbar { - clear: both; - border-top: 1px solid #cccccc; - font-size: small; - color: black; - padding: 10px 10px 10px 10px; + clear: both; + border-top: 1px solid #cccccc; + font-size: small; + color: black; + padding: 10px 10px 10px 10px; } + /************ Honeypot ***********/ -.robotic { display: none; } +.robotic { + display: none; +} + + +/************ unicode fallbacks ***********/ + +/* Some embedding of font */ +@font-face { + font-family: 'Source Code Pro'; + src: local('Source Code Pro'); +/* src: url(/res/fonts/SourceCodePro-Medium.ttf); */ +} + +@font-face { + font-family: 'Last Resort'; + src: local('LastResort'); +/* src: url(/res/fonts/LastResort.ttf); */ +} + +.accountdetail { + font-family: 'Source Code Pro', 'Lucida Console', 'Arial Unicode MS', monospace, 'Last Resort'; + font-size: 1.1em; +} + +.accountdetail.fname { +} + +.accountdetail.mname { +} + +.accountdetail.lname { + font-weight: bold; +} +.accountdetail.suffix { +} diff --git a/www/wot.php b/www/wot.php index 858f81b..8395a58 100644 --- a/www/wot.php +++ b/www/wot.php @@ -18,6 +18,8 @@ <? require_once("../includes/loggedin.php"); require_once("../includes/lib/l10n.php"); +require_once("../includes/notary.inc.php"); + function show_page($target,$message,$error) @@ -113,9 +115,6 @@ function send_reminder() $_SESSION['_config']['error'] = _("A reminder notice has been sent."); } - - - loadem("account"); if(array_key_exists('date',$_POST) && $_POST['date'] != "") $_SESSION['_config']['date'] = $_POST['date']; @@ -127,7 +126,7 @@ function send_reminder() if($oldid == 12) $id = $oldid; - + if($oldid == 4) { if ($_POST['ttp']!='') { @@ -238,37 +237,79 @@ function send_reminder() if($oldid == 6) { $iecho= "c"; + //date checks + if(trim($_REQUEST['date']) == '') + { + show_page("VerifyData","",_("You must enter the date when you met the assuree.")); + exit; + } + + if(!check_date_format(trim($_REQUEST['date']))) + { + show_page("VerifyData","",_("You must enter the date in this format: YYYY-MM-DD.")); + exit; + } + + if(!check_date_difference(trim($_REQUEST['date']))) + { + show_page("VerifyData","",_("You must not enter a date in the future.")); + exit; + } + + //proof of identity check and accept arbitration, implements CCA 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) + //proof of CCA agreement by assuree after 2010-01-01 + if((!array_key_exists('CCAAgreed',$_POST) || $_POST['CCAAgreed'] != 1) and (check_date_format(trim($_REQUEST['date']),2010))) + { + show_page("VerifyData","",_("You failed to check all boxes to validate your adherence to the rules and policies of CAcert")); + exit; + } + + //assurance done according to rules + if(!array_key_exists('rules',$_POST) || $_POST['rules'] != 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('certify',$_POST) || $_POST['certify'] != 1 ) && $_SESSION['profile']['ttpadmin'] != 1) + //met assuree in person, not appliciable for TTP / TTP Topup assurances + if((!array_key_exists('certify',$_POST) || $_POST['certify'] != 1 ) && $_REQUEST['method'] != "Trusted 3rd Parties") { show_page("VerifyData","",_("You failed to check all boxes to validate your adherence to the rules and policies of CAcert")); exit; } - if($_SESSION['profile']['ttpadmin'] != 1 && $_POST['location'] == "") + //check location, min 3 characters + if(!array_key_exists('location',$_POST) || trim($_POST['location']) == "") { show_page("VerifyData","",_("You failed to enter a location of your meeting.")); exit; } + if(strlen(trim($_REQUEST['location']))<=2) + { + show_page("VerifyData","",_("You must enter a location with at least 3 characters eg town and country.")); + exit; + } + + //check for points in range 0-35, for nucleus 35 + 15 temporary 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; } + if($_REQUEST['points'] <0 || ($_REQUEST['points']>35)) + { + show_page("VerifyData","",_("The number of points you entered are out of the range given by policy.")); + exit; + } + $query = "select * from `users` where `id`='".$_SESSION['_config']['notarise']['id']."'"; $res = mysql_query($query); $row = mysql_fetch_assoc($res); @@ -315,7 +356,7 @@ $iecho= "c"; $res = mysql_query($query); if(mysql_num_rows($res) > 0) { - show_page("VerifyEmail","",_("Identical Assurance attempted, will not continue.")); + show_page("VerifyEmail","",_("Identical Assurance attempted, will not continue.")); exit; } } @@ -328,6 +369,10 @@ $iecho= "c"; `location`='".mysql_escape_string(stripslashes($_POST['location']))."', `date`='".mysql_escape_string(stripslashes($_POST['date']))."', `when`=NOW()"; + //record active acceptance by Assurer + if (check_date_format(trim($_REQUEST['date']),2010)) { + write_user_agreement($_SESSION['profile']['id'], "CCA", "Assurance", "Assurer", 1, $_SESSION['_config']['notarise']['id']); + } if($_SESSION['profile']['ttpadmin'] == 1 && ($_POST['method'] == 'Trusted 3rd Parties' || $_POST['method'] == 'Trusted Third Parties')) { $query .= ",\n`method`='TTP-Assisted'"; } @@ -404,16 +449,16 @@ $iecho= "c"; echo "<p>"._("Shortly you and the person you were assuring will receive an email confirmation. There is no action on your behalf required to complete this.")."</p>"; ?><form method="post" action="wot.php"> <table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper"> - <tr> - <td colspan="2" class="title"><?=_("Assure Someone")?></td> - </tr> - <tr> - <td class="DataTD"><?=_("Email")?>:</td> - <td class="DataTD"><input type="text" name="email" id="email" value=""></td> - </tr> - <tr> - <td class="DataTD" colspan="2"><input type="submit" name="process" value="<?=_("Next")?>"></td> - </tr> + <tr> + <td colspan="2" class="title"><?=_("Assure Someone")?></td> + </tr> + <tr> + <td class="DataTD"><?=_("Email")?>:</td> + <td class="DataTD"><input type="text" name="email" id="email" value=""></td> + </tr> + <tr> + <td class="DataTD" colspan="2"><input type="submit" name="process" value="<?=_("Next")?>"></td> + </tr> </table> <input type="hidden" name="oldid" value="5"> </form> @@ -466,7 +511,7 @@ $iecho= "c"; $subject = $_REQUEST['subject']; $userid = intval($_REQUEST['userid']); $user = mysql_fetch_assoc(mysql_query("select * from `users` where `id`='$userid' and `listme`=1")); - $points = mysql_num_rows(mysql_query("select sum(`points`) as `total` from `notary` + $points = mysql_num_rows(mysql_query("select sum(`points`) as `total` from `notary` where `to`='".$user['id']."' group by `to` HAVING SUM(`points`) > 0")); if($points > 0) { |