From d1c08b5743eba6519f3ff6bb20ce984ab59f2eae Mon Sep 17 00:00:00 2001 From: INOPIAE Date: Wed, 28 Nov 2012 07:24:10 +0100 Subject: bug 512:Moved get_assurer_status from includes/general.php to includes/lib/general.php to make the function available for the scripting. Changed script to includes/lib/general.php --- includes/general.php | 35 ++-------- includes/lib/general.php | 31 +++++++++ scripts/oa02-mailingtextCats.txt | 71 ++++++++++++++++++++ scripts/oa02-mailingtextPoints.txt | 79 ++++++++++++++++++++++ scripts/oa02-mailingtextPointsCats.txt | 82 +++++++++++++++++++++++ scripts/oa02-orgainformation.php.txt | 119 +++++++++++++++++++++++++++++++++ 6 files changed, 386 insertions(+), 31 deletions(-) create mode 100644 scripts/oa02-mailingtextCats.txt create mode 100644 scripts/oa02-mailingtextPoints.txt create mode 100644 scripts/oa02-mailingtextPointsCats.txt create mode 100644 scripts/oa02-orgainformation.php.txt diff --git a/includes/general.php b/includes/general.php index 3478dd4..db859b6 100644 --- a/includes/general.php +++ b/includes/general.php @@ -15,6 +15,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ + + require_once("../includes/lib/general.php"); + session_name("cacert"); session_start(); @@ -725,37 +728,7 @@ return($text); } - // returns 0 if $userID is an Assurer - // Otherwise : - // Bit 0 is always set - // Bit 1 is set if 100 Assurance Points are not reached - // Bit 2 is set if Assurer Test is missing - // Bit 3 is set if the user is not allowed to be an Assurer (assurer_blocked > 0) - function get_assurer_status($userID) - { - $Result = 0; - $query = mysql_query('SELECT * FROM `cats_passed` AS `tp`, `cats_variant` AS `cv` '. - ' WHERE `tp`.`variant_id` = `cv`.`id` AND `cv`.`type_id` = 1 AND `tp`.`user_id` = \''.(int)intval($userID).'\''); - if(mysql_num_rows($query) < 1) - { - $Result |= 5; - } - - $query = mysql_query('SELECT SUM(`points`) AS `points` FROM `notary` AS `n` WHERE `n`.`to` = \''.(int)intval($userID).'\' AND `n`.`expire` < now()'); - $row = mysql_fetch_assoc($query); - if ($row['points'] < 100) { - $Result |= 3; - } - - $query = mysql_query('SELECT `assurer_blocked` FROM `users` WHERE `id` = \''.(int)intval($userID).'\''); - $row = mysql_fetch_assoc($query); - if ($row['assurer_blocked'] > 0) { - $Result |= 9; - } - - return $Result; - } - + // returns text message to be shown to the user given the result of is_no_assurer function no_assurer_text($Status) { diff --git a/includes/lib/general.php b/includes/lib/general.php index d91b24e..85b132d 100644 --- a/includes/lib/general.php +++ b/includes/lib/general.php @@ -130,3 +130,34 @@ function runCommand($command, $input = "", &$output = null, &$errors = true) { } } + // returns 0 if $userID is an Assurer + // Otherwise : + // Bit 0 is always set + // Bit 1 is set if 100 Assurance Points are not reached + // Bit 2 is set if Assurer Test is missing + // Bit 3 is set if the user is not allowed to be an Assurer (assurer_blocked > 0) + function get_assurer_status($userID) + { + $Result = 0; + $query = mysql_query('SELECT * FROM `cats_passed` AS `tp`, `cats_variant` AS `cv` '. + ' WHERE `tp`.`variant_id` = `cv`.`id` AND `cv`.`type_id` = 1 AND `tp`.`user_id` = \''.(int)intval($userID).'\''); + if(mysql_num_rows($query) < 1) + { + $Result |= 5; + } + + $query = mysql_query('SELECT SUM(`points`) AS `points` FROM `notary` AS `n` WHERE `n`.`to` = \''.(int)intval($userID).'\' AND `n`.`expire` < now()'); + $row = mysql_fetch_assoc($query); + if ($row['points'] < 100) { + $Result |= 3; + } + + $query = mysql_query('SELECT `assurer_blocked` FROM `users` WHERE `id` = \''.(int)intval($userID).'\''); + $row = mysql_fetch_assoc($query); + if ($row['assurer_blocked'] > 0) { + $Result |= 9; + } + + return $Result; + } + \ No newline at end of file diff --git a/scripts/oa02-mailingtextCats.txt b/scripts/oa02-mailingtextCats.txt new file mode 100644 index 0000000..044b49b --- /dev/null +++ b/scripts/oa02-mailingtextCats.txt @@ -0,0 +1,71 @@ +(German see below) + +Hello , + +In preparation for an internal test prior to the audit, we checked if the data +entries in the Organisation Accounts are valid. As you are listed as an +Organisation Administrator for at least one organisation account, I found out +that you currently do not match the requirements to be an Organisation +Administrator - in that you need to be an CAcert Assurer. + +The premise to be a CAcert Assurer are that you have: + - got at least 100 Assurance Points + - passed the CATS test + +It is possible that you may have missed some changes within the CAcert +assurance system. + +In 2009 the CATS challenge [1] was introduced. You have to pass it before you +get the CAcert Assurer status. + +In addition, CAcert will be changing the points calculation in the near future. +This was announced in 2011 [2]. + +As you are only missing the CATS challenge, I ask you to do the challenge within +the next 2 months. If you have not passed the CATS test by then, I will have +to delete you as Organisation Administrator from the appropriate accounts. + +[1] https://wiki.cacert.org/AssurerChallenge +[2] https://wiki.cacert.org/PR/News/NewPointsCalculation + +Thank you for your support. + +Marcus Maengel +CAcert Organisation Assurance Officer + +--------------------------------------------------- + +[German Version] + +Hallo , + +bei der Vorbereitung eines internen Tests vor dem Audit haben wir ueberprueft, +ob die Datensaetze in den Organisationskonten gueltig sind. Da Sie als +Organisations Administrator fuer mindestens ein Organisationskonto eingetragen +sind, habe ich festgestellt, dass Sie zurzeit kein CAcert Assurer sind, was die +Voraussetzung fuer die Taetigkeit als Organisations Administrator ist. + +Als CAcert Assurer muessen Sie die folgenden Vorausetzungen erfuellen: + - Mindestens 100 Assurance-Punkte + - Bestandene Assurer-Pruefung (CATS-Test) + +Moeglicherweise haben Sie einige aenderungen bei CAcert verpasst. + +Im Jahre 2009 wurde die Assurer-Pruefung (Assurer Challenge, CATS Test) [1] +eingefuehrt. Die muessen Sie bestehen, um den Assurer-Status zu erhalten. + +CAcert wird die Punkte-Berechnung in naher Zukunft aendern. Dies wurde bereits +2011 angekuendigt [2]. + +Da Ihnen lediglich die Assurer-Pruefung fehlt, fordere ich Sie auf, diese +Pruefung innerhalb der naechsten 2 Monate nachzuholen. Wenn Sie diese Pruefung +bis dahin nicht abgelegt haben, werde ich Sie als Organisations Administrator +aus den betreffenden Konten austragen. + +[1] https://wiki.cacert.org/AssurerChallenge +[2] https://wiki.cacert.org/PR/News/NewPointsCalculation + +Vielen Dank fuer Ihre Unterstuetzung. + +Marcus Maengel +CAcert Organisation Assurance Officer \ No newline at end of file diff --git a/scripts/oa02-mailingtextPoints.txt b/scripts/oa02-mailingtextPoints.txt new file mode 100644 index 0000000..5e0eadf --- /dev/null +++ b/scripts/oa02-mailingtextPoints.txt @@ -0,0 +1,79 @@ +(German see below) + +Hello , + +In preparation for an internal test prior to the audit, we checked if the data +entries in the Organisation Accounts are valid. As you are listed as an +Organisation Administrator for at least one organisation account, I found out +that you currently do not match the requirements to be an Organisation +Administrator - in that you need to be an CAcert Assurer. + +The premise to be a CAcert Assurer are that you have: + - got at least 100 Assurance Points + - passed the CATS test + +It is possible that you may have missed some changes within the CAcert +assurance system. + +In 2009 the CATS challenge [1] was introduced. You have to pass it before you +get the CAcert Assurer status. + +In addition, CAcert will be changing the points calculation in the near future. +This was announced in 2011 [2]. + +As you are missing the 100 Assurance Points requirement (which might be due to +the new points calculation) I ask you to get assured during the next 3 months to +reach the 100 Assurance Points. If you have problems in getting assured, please +let me know, so I can see what can be done to help you. If you have not reached +the 100 points by then (or after an additional grace period in cases of +hardship), I will have to delete you as Organisation Administrator from the +appropriate accounts. + +[1] https://wiki.cacert.org/AssurerChallenge +[2] https://wiki.cacert.org/PR/News/NewPointsCalculation + +Thank you for your support. + +Marcus Maengel +CAcert Organisation Assurance Officer + +--------------------------------------------------- + +[German Version] + +Hallo , + +bei der Vorbereitung eines internen Tests vor dem Audit haben wir ueberprueft, +ob die Datensaetze in den Organisationskonten gueltig sind. Da Sie als +Organisations Administrator fuer mindestens ein Organisationskonto eingetragen +sind, habe ich festgestellt, dass Sie zurzeit kein CAcert Assurer sind, was die +Voraussetzung fuer die Taetigkeit als Organisations Administrator ist. + +Als CAcert Assurer muessen Sie die folgenden Vorausetzungen erfuellen: + - Mindestens 100 Assurance-Punkte + - Bestandene Assurer-Pruefung (CATS-Test) + +Moeglicherweise haben Sie einige aenderungen bei CAcert verpasst. + +Im Jahre 2009 wurde die Assurer-Pruefung (Assurer Challenge, CATS Test) [1] +eingefuehrt. Die muessen Sie bestehen, um den Assurer-Status zu erhalten. + +CAcert wird die Punkte-Berechnung in naher Zukunft aendern. Dies wurde bereits +2011 angekuendigt [2]. + +Da Sie die 100 Assurance-Punkte nicht erreicht haben, was auch an der neuen +Punkteberechnung liegen kann, fordere ich Sie auf, sich innerhalb der naechsten +3 Monate assuren zu lassen, um die 100 Punkte zu erreichen. Wenn Sie Probleme +haben, sich assuren zu lassen, teilen Sie mir das bitte mit und wir werden +sehen, wie wir Ihnen dabei helfen koennen. Wenn Sie bis dahin (oder nach einer +zusaetzlichen Gnadenfrist in schwierigen Faellen) die 100 Punkte nicht erreicht +haben, werde ich Sie als Organisations Administrator aus den betreffenden Konten +austragen. + +[1] https://wiki.cacert.org/AssurerChallenge +[2] https://wiki.cacert.org/PR/News/NewPointsCalculation + +Vielen Dank fuer Ihre Unterstuetzung. + +Marcus Maengel +CAcert Organisation Assurance Officer \ No newline at end of file diff --git a/scripts/oa02-mailingtextPointsCats.txt b/scripts/oa02-mailingtextPointsCats.txt new file mode 100644 index 0000000..67bc5d3 --- /dev/null +++ b/scripts/oa02-mailingtextPointsCats.txt @@ -0,0 +1,82 @@ +(German see below) + +Hello , + +In preparation for an internal test prior to the audit, we checked if the data +entries in the Organisation Accounts are valid. As you are listed as an +Organisation Administrator for at least one organisation account, I found out +that you currently do not match the requirements to be an Organisation +Administrator - in that you need to be an CAcert Assurer. + +The premise to be a CAcert Assurer are that you have: + - got at least 100 Assurance Points + - passed the CATS test + +It is possible that you may have missed some changes within the CAcert +assurance system. + +In 2009 the CATS challenge [1] was introduced. You have to pass it before you +get the CAcert Assurer status. + +In addition, CAcert will be changing the points calculation in the near future. +This was announced in 2011 [2]. + +As you are missing the 100 Assurance Points requirement (which might be due to +the new points calculation) and the CATS challenge, I ask you to get assured +during the next 3 months to reach the 100 Assurance Points and do the CATS test. +If you have problems in getting assured, please let me know, so I can see what +can be done to help you. If you have not passed the CATS test and reached the +100 points by then (or after an additional grace period in cases of hardship), +I will have to delete you as Organisation Administrator from the appropriate +accounts. + +[1] https://wiki.cacert.org/AssurerChallenge +[2] https://wiki.cacert.org/PR/News/NewPointsCalculation + +Thank you for your support. + +Marcus Maengel +CAcert Organisation Assurance Officer + +--------------------------------------------------- + +[German Version] + +Hallo , + +bei der Vorbereitung eines internen Tests vor dem Audit haben wir ueberprueft, +ob die Datensaetze in den Organisationskonten gueltig sind. Da Sie als +Organisations Administrator fuer mindestens ein Organisationskonto eingetragen +sind, habe ich festgestellt, dass Sie zurzeit kein CAcert Assurer sind, was die +Voraussetzung fuer die Taetigkeit als Organisations Administrator ist. + +Als CAcert Assurer muessen Sie die folgenden Vorausetzungen erfuellen: + - Mindestens 100 Assurance-Punkte + - Bestandene Assurer-Pruefung (CATS-Test) + +Moeglicherweise haben Sie einige aenderungen bei CAcert verpasst. + +Im Jahre 2009 wurde die Assurer-Pruefung (Assurer Challenge, CATS Test) [1] +eingefuehrt. Die muessen Sie bestehen, um den Assurer-Status zu erhalten. + +CAcert wird die Punkte-Berechnung in naher Zukunft aendern. Dies wurde bereits +2011 angekuendigt [2]. + +Da Sie die 100 Assurance-Punkte nicht erreicht haben, was auch an der neuen +Punkteberechnung liegen kann, und auch die Assurer-Pruefung nicht abgelegt +haben, fordere ich Sie auf, sich innerhalb der naechsten 3 Monate assuren zu +lassen, um die 100 Punkte zu erreichen, und die Assurer-Pruefung abzulegen. +Wenn Sie Probleme haben, sich assuren zu lassen, teilen Sie mir das bitte mit +und wir werden sehen, wie wir Ihnen dabei helfen koennen. Wenn Sie bis dahin +(oder nach einer zusaetzlichen Gnadenfrist in schwierigen Faellen) die +100 Punkte nicht erreicht haben oder die Assurer-Pruefung nicht abgelegt haben, +werde ich Sie als Organisations-Administrator aus den betreffenden Konten +austragen. + +[1] https://wiki.cacert.org/AssurerChallenge +[2] https://wiki.cacert.org/PR/News/NewPointsCalculation + +Vielen Dank fuer Ihre Unterstuetzung. + +Marcus Maengel +CAcert Organisation Assurance Officer \ No newline at end of file diff --git a/scripts/oa02-orgainformation.php.txt b/scripts/oa02-orgainformation.php.txt new file mode 100644 index 0000000..e0d8ca2 --- /dev/null +++ b/scripts/oa02-orgainformation.php.txt @@ -0,0 +1,119 @@ +#!/usr/bin/php -q +",$fullname,$lines); + sendmail($row['email'], "[CAcert.org] Assurer Status Requirement Check on Organisation Adminstrators", $mail, "support@cacert.org", "", "", "CAcert Organisation Assurer", "returns@cacert.org", 1); + $report = $row['email'].", ".$fullname.", ".$row['O']."\n"; + } elseif (5 == $status) { + $mail = str_replace("",$fullname,$lines1); + sendmail($row['email'], "[CAcert.org] Assurer Status Requirement Check on Organisation Adminstrators", $mail, "support@cacert.org", "", "", "CAcert Organisation Assurer", "returns@cacert.org", 1); + $report1 = $row['email'].", ".$fullname.", ".$row['O']."\n"; + } elseif (7 == $status){ + $mail = str_replace("",$fullname,$lines2); + sendmail($row['email'], "[CAcert.org] Assurer Status Requirement Check on Organisation Adminstrators", $mail, "support@cacert.org", "", "", "CAcert Organisation Assurer", "returns@cacert.org", 1); + $report2 = $row['email'].", ".$fullname.", ".$row['O']."\n"; + } else { + $report3 = $row['email'].", ".$fullname.", ".$row['O']."\n"; + } + } + + // 1x cc to oao.cacert.org + sendmail("oao@cacert.org", "[CAcert.org] Assurer Status Requirement Check on Organisation Adminstrators", $lines."\n\n".$lines1."\n\n".$lines2, "oao@cacert.org", "", "", "CAcert OA Support", "returns@cacert.org", 1); + + // 1x mailing report to oao.cacert.org + sendmail("oao@cacert.org", "[CAcert.org] Assurer Status Requirement Check on Organisation Adminstrators - Report", "oa-mailing sent to $xrows recipients.", "support@cacert.org", "", "", "CAcert OA Support", "returns@cacert.org", 1); + + // 1x detailed mailing report to OAO + $reporttotal = "Result of the Mailing \n\n Organisation Administrators with missing points \n".$report."\n\n Organisation Adminstrators with missing points ".$report1."\n\n Organisation Adminstrators with missing points and CATS ".$report2."\n\n Organisation Adminstrators with blocked assurer ".$report3; + sendmail("oao@cacert.org", "[CAcert.org] Assurer Status Requirement Check on Organisation Adminstrators - Report", $reporttotal, "support@cacert.org", "", "", "CAcert Organisation Assurer", "returns@cacert.org", 1); + + // 1x mailing report to Arbitrator of case http://wiki.cacert.org/wiki/Arbitrations/a20110608.1 + sendmail("bernhard@cacert.org", "[CAcert.org] Assurer Status Requirement Check on Organisation Adminstrators - Report", "oa-mailing sent to $xrows recipients.", "support@cacert.org", "", "", "CAcert OA Support", "returns@cacert.org", 1); + + echo "oa-mailing sent to $xrows recipients.\n"; -- cgit v1.2.1 From 95f5aeb888e4ce1b9e66db3462fd23ad280a7e8d Mon Sep 17 00:00:00 2001 From: Benny Baumann Date: Mon, 7 Jan 2013 18:08:56 +0100 Subject: bug 512: Fix a problem causing blank result pages --- includes/general.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/general.php b/includes/general.php index db859b6..d762586 100644 --- a/includes/general.php +++ b/includes/general.php @@ -16,8 +16,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ - require_once("../includes/lib/general.php"); - + require_once(dirname(__FILE__)."/lib/general.php"); + session_name("cacert"); session_start(); -- cgit v1.2.1