summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenny Baumann <BenBE@geshi.org>2015-04-30 00:18:16 +0200
committerBenny Baumann <BenBE@geshi.org>2015-04-30 00:18:16 +0200
commit0e4b9df2644939d69bd5818a40eff8ffc8f0f4fd (patch)
tree040413fe9d650dd8b017efcd448e2fb87b7707aa
parentcdca646992a618c9063c912af12997ef1d0695a5 (diff)
parent9429f6bf21943069d6a577b64f5fa3bce45563c1 (diff)
downloadcacert-devel-0e4b9df2644939d69bd5818a40eff8ffc8f0f4fd.tar.gz
cacert-devel-0e4b9df2644939d69bd5818a40eff8ffc8f0f4fd.tar.xz
cacert-devel-0e4b9df2644939d69bd5818a40eff8ffc8f0f4fd.zip
Merge branch 'bug-1054' into bug-1042
-rw-r--r--includes/general.php9
1 files changed, 2 insertions, 7 deletions
diff --git a/includes/general.php b/includes/general.php
index 2b31fc6..889b8d8 100644
--- a/includes/general.php
+++ b/includes/general.php
@@ -81,10 +81,7 @@
$locked = mysql_fetch_assoc(mysql_query("select `locked` from `users` where `id`='".intval($_SESSION['profile']['id'])."'"));
if($locked['locked'] == 0)
{
- $query = "select sum(`points`) as `total` from `notary` where `to`='".intval($_SESSION['profile']['id'])."' and `deleted` = 0 group by `to`";
- $res = mysql_query($query);
- $row = mysql_fetch_assoc($res);
- $_SESSION['profile']['points'] = $row['total'];
+ update_points_in_profile();
} else {
$_SESSION['profile'] = "";
unset($_SESSION['profile']);
@@ -476,9 +473,7 @@
if($id <= 0)
$id = $_SESSION['profile']['id'];
- $query = "select sum(`points`) as `points` from `notary` where `to`='$id' and `deleted` = 0 group by `to`";
- $row = mysql_fetch_assoc(mysql_query($query));
- $points = $row['points'];
+ $points = get_received_total_points($id);
$dob = date("Y-m-d", mktime(0,0,0,date("m"),date("d"),date("Y")-18));
$query = "select * from `users` where `id`='".intval($_SESSION['profile']['id'])."' and `dob` < '$dob'";