bug 959: Limit the awarded points to the maximum number of points the
authorMichael Tänzer <neo@nhng.de>
Wed, 13 Jul 2011 00:19:41 +0000 (02:19 +0200)
committerMichael Tänzer <neo@nhng.de>
Wed, 13 Jul 2011 00:19:41 +0000 (02:19 +0200)
user may issue

Signed-off-by: Michael Tänzer <neo@nhng.de>
www/wot.php

index 2bd4622..1941861 100644 (file)
        if($oldid == 6)
        {
                $max =  maxpoints();
-               $awarded = $newpoints = intval($_POST['points']);
-               if($newpoints > $max)
-                       $newpoints = $max;
+               
+               if (intval($_POST['points']) > $max) {
+                       $awarded = $newpoints = $max;
+               } else {
+                       $awarded = $newpoints = intval($_POST['points']);
+               }
+               
                $query = "select sum(`points`) as `total` from `notary` where `to`='".$_SESSION['_config']['notarise']['id']."' group by `to`";
                $res = mysql_query($query);
                $drow = mysql_fetch_assoc($res);