summaryrefslogtreecommitdiff
path: root/www
diff options
context:
space:
mode:
authorMichael Tänzer <neo@nhng.de>2011-08-21 02:10:57 +0200
committerMichael Tänzer <neo@nhng.de>2011-08-21 02:10:57 +0200
commita7b28f722eacc63fdb0b1e521962a9125a03ebdb (patch)
tree928de67d5ad9836c332a2478735c930c4e1a761e /www
parent8e5648c663a5b775487c176f13e83e208b2a7de9 (diff)
parentce4bfbaf0c2babb5bba2568d3b8712e1615aa651 (diff)
downloadcacert-devel-a7b28f722eacc63fdb0b1e521962a9125a03ebdb.tar.gz
cacert-devel-a7b28f722eacc63fdb0b1e521962a9125a03ebdb.tar.xz
cacert-devel-a7b28f722eacc63fdb0b1e521962a9125a03ebdb.zip
Merge branch 'tarballs' into release
Diffstat (limited to 'www')
-rw-r--r--www/cats/cats_import.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/www/cats/cats_import.php b/www/cats/cats_import.php
index 6d77a75..56dd0cf 100644
--- a/www/cats/cats_import.php
+++ b/www/cats/cats_import.php
@@ -24,6 +24,8 @@
API for CATS to import passed tests into main CAcert database.
*/
+require_once('../../includes/lib/account.php');
+
function sanitize_string($buffer) {
return htmlentities(utf8_decode($buffer), (int)ENQ_QUOTES);
}
@@ -154,8 +156,7 @@ if (!$query) {
}
// Update Assurer-Flag on users table if 100 points. Should the number of points be SUM(points) or SUM(awarded)?
-$query = mysql_query('UPDATE `users` AS `u` SET `assurer` = 1 WHERE `u`.`id` = \''.(int)intval($userID).'\' AND EXISTS(SELECT 1 FROM `cats_passed` AS `tp` WHERE `tp`.`user_id` = `u`.`id`) AND (SELECT SUM(`points`) FROM `notary` AS `n` WHERE `n`.`to` = `u`.`id` AND `expire` < now()) >= 100;'); // Challenge has been passed and non-expired points >= 100
-if (!$query) {
+if (!fix_assurer_flag($userID)) {
echo 'Invalid query'."\r\n";
trigger_error('Invalid query', E_USER_ERROR);
exit();