summaryrefslogtreecommitdiff
path: root/manager
diff options
context:
space:
mode:
authorMichael Tänzer <neo@nhng.de>2010-04-29 21:21:47 +0200
committerMichael Tänzer <neo@nhng.de>2010-04-29 21:21:47 +0200
commit66174d6fb339cee7014017f10df5d7ce06455382 (patch)
treec77ed2ed7d5bdd7f329603a12c27e9712f530a4e /manager
parente93541c58f2888a53d8eaf51496b20a2a6256f80 (diff)
downloadcacert-mgr-66174d6fb339cee7014017f10df5d7ce06455382.tar.gz
cacert-mgr-66174d6fb339cee7014017f10df5d7ce06455382.tar.xz
cacert-mgr-66174d6fb339cee7014017f10df5d7ce06455382.zip
A new Assurer has to be selected for every single assurance
Signed-off-by: Michael Tänzer <neo@nhng.de>
Diffstat (limited to 'manager')
-rw-r--r--manager/application/controllers/AddPointsController.php8
1 files changed, 3 insertions, 5 deletions
diff --git a/manager/application/controllers/AddPointsController.php b/manager/application/controllers/AddPointsController.php
index 86557f3..891ee5d 100644
--- a/manager/application/controllers/AddPointsController.php
+++ b/manager/application/controllers/AddPointsController.php
@@ -57,10 +57,6 @@ class AddPointsController extends Zend_Controller_Action
$user['id'] = $row['id'];
- // Get the first assurer who didn't already assure the user
- $assurer = $this->getNewAssurer($user['id']);
-
-
// Get current points of the user
$query = 'select sum(`points`) as `total` from `notary` where `to` = :user';
$query_params['user'] = $user['id'];
@@ -71,7 +67,6 @@ class AddPointsController extends Zend_Controller_Action
// Do the actual assurances
$assurance = array(); // Make sure the array is empty
- $assurance['from'] = $assurer;
$assurance['to'] = $user['id'];
$assurance['location'] = $values['location'];
$assurance['date'] = $values['date'];
@@ -89,6 +84,9 @@ class AddPointsController extends Zend_Controller_Action
$quantity = 0;
}
+ // Get the assurer for this assurance
+ $assurance['from'] = $this->getNewAssurer($user['id']);
+
// only assign points whithin the limit
if ($user['points'] + $assurance['awarded'] > self::MAX_ASSURANCE_POINTS){
$assurance['points'] = self::MAX_ASSURANCE_POINTS - $user['points'];