Fix Bug #830: Negative assurance points

If the user had more than 100 points adding more points through an
automated assurance resulted in negative points

Signed-off-by: Michael Tänzer <neo@nhng.de>
This commit is contained in:
Michael Tänzer 2010-08-03 21:19:05 +02:00
parent 46d228ccc3
commit be39a06a11

View file

@ -91,6 +91,11 @@ class ManageAccountController extends Zend_Controller_Action
$assurance['points'] = $assurance['awarded']; $assurance['points'] = $assurance['awarded'];
} }
// Only assign positive amounts
if ($assurance['points'] < 0){
$assurance['points'] = 0;
}
$this->db->insert('notary', $assurance); $this->db->insert('notary', $assurance);
$user['points'] += $assurance['points']; $user['points'] += $assurance['points'];