summaryrefslogtreecommitdiff
path: root/includes/general.php
diff options
context:
space:
mode:
authorINOPIAE <inopiae@cacert.org>2012-11-28 07:24:10 +0100
committerINOPIAE <inopiae@cacert.org>2012-11-28 07:24:10 +0100
commitd1c08b5743eba6519f3ff6bb20ce984ab59f2eae (patch)
tree746e94cd17a3afa8bab84413857c4c82bd753b20 /includes/general.php
parent7baaa9a0ac611329539a43031ca3d0e81bba2b5f (diff)
downloadcacert-devel-d1c08b5743eba6519f3ff6bb20ce984ab59f2eae.tar.gz
cacert-devel-d1c08b5743eba6519f3ff6bb20ce984ab59f2eae.tar.xz
cacert-devel-d1c08b5743eba6519f3ff6bb20ce984ab59f2eae.zip
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
Diffstat (limited to 'includes/general.php')
-rw-r--r--includes/general.php35
1 files changed, 4 insertions, 31 deletions
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)
{