summaryrefslogtreecommitdiff
path: root/www/cats/cats_import.php
diff options
context:
space:
mode:
Diffstat (limited to 'www/cats/cats_import.php')
-rw-r--r--www/cats/cats_import.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/www/cats/cats_import.php b/www/cats/cats_import.php
index 6d77a75..7662fce 100644
--- a/www/cats/cats_import.php
+++ b/www/cats/cats_import.php
@@ -154,7 +154,10 @@ 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
+$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`, `cats_variant` AS `cv` WHERE `tp`.`variant_id` = `cv`.`id` AND `cv`.`type_id` = 1 AND `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) {
echo 'Invalid query'."\r\n";
trigger_error('Invalid query', E_USER_ERROR);