Compare commits

...

27 commits

Author SHA1 Message Date
Benny Baumann
13901dd1a1 Merge branch 'bug-932' 2015-09-08 22:32:10 +02:00
INOPIAE
870a936694 bug 932: adjusmtent of function iconv_mime_decode 2015-09-08 22:31:53 +02:00
Benny Baumann
7f20913d8b Merge branch 'bug-932' 2015-09-08 20:37:53 +02:00
INOPIAE
9987c02e3e bug 932: changed encoding function for subject 2015-08-20 20:56:49 +02:00
Benny Baumann
4e5c9dd72b Merge branch 'bug-932' 2015-08-09 22:52:44 +02:00
INOPIAE
269829b175 bug 932: added escaping with htmlspecialchars function for user name 2015-08-09 22:49:23 +02:00
INOPIAE
51d8dffac8 bug 932: added escaping with htmlspecialchars function and encoding UTF-8 for subject 2015-08-09 22:41:09 +02:00
Benny Baumann
8a5059809e Merge branch 'bug-1396' 2015-08-09 22:26:17 +02:00
INOPIAE
09e2615ec5 bug 1396: Codestyle cleanup 2015-08-09 22:24:30 +02:00
INOPIAE
4edd7b57c0 bug 1396: Codestyle cleanup 2015-08-09 22:23:21 +02:00
Benny Baumann
ce38587c84 bug 1396: Normalize Linefeed to Unix format in Repository 2015-08-09 22:11:50 +02:00
Benny Baumann
2cbb6d9c9c Merge branch 'bug-1391' 2015-08-04 22:12:44 +02:00
Benny Baumann
f9a2da80b9 bug 1391: Codestyle cleanup 2015-08-04 22:12:24 +02:00
Benny Baumann
97cfec7705 Merge branch 'bug-1391' 2015-08-04 22:08:09 +02:00
INOPIAE
e33a8de01c bug 1391: Ensure current number of assurer's points used for determining maximum points for an assurance. 2015-07-31 09:43:22 +02:00
INOPIAE
f97cb26f07 bug 1391: corrected value check 2015-07-31 09:12:31 +02:00
Benny Baumann
39b237c1d4 Merge branch 'bug-1391' 2015-07-31 08:54:58 +02:00
INOPIAE
bbfbb59454 bug 1391: fixed syntax in sql statement 2015-07-31 08:53:09 +02:00
Benny Baumann
fc7a085b29 Merge branch 'bug-1391' 2015-07-31 08:40:33 +02:00
INOPIAE
7239b831f8 bug 1391: added range check for points 2015-07-31 08:38:44 +02:00
Benny Baumann
733814fd08 Merge branch 'bug-1391' 2015-07-31 08:05:37 +02:00
Benny Baumann
3c8663a208 bug 1391: fix sql statement 2015-07-31 08:05:00 +02:00
Benny Baumann
e6af0ab4c9 bug 1391: Fix Whitespace 2015-07-31 08:05:00 +02:00
Benny Baumann
dae1d5c7f8 Merge branch 'bug-1391' 2015-07-28 22:37:58 +02:00
Benny Baumann
5a7e585320 Merge branch 'bug-1390' 2015-07-28 22:37:53 +02:00
INOPIAE
1c5bceeae7 bug 1391: adjusted query so that only the non administrative increase assurance are taken for the point calculation 2015-07-22 21:40:31 +02:00
INOPIAE
5a03b6f6f2 bug 1391: removed insert of administrative increase entry for normal assurance 2015-07-22 21:37:16 +02:00
57 changed files with 3709 additions and 3704 deletions

7
.gitattributes vendored Normal file
View file

@ -0,0 +1,7 @@
* text=auto
*.php text
*.html text
*.phtml text
*.js text
*.css text

View file

@ -32,4 +32,3 @@ class ErrorController extends Zend_Controller_Action
} }
} }

View file

@ -108,13 +108,25 @@ class Default_Model_User {
* user's points * user's points
*/ */
public function refreshPoints() { public function refreshPoints() {
$query = 'select sum(`points`) as `total` from `notary` '. $query = "SELECT SUM(`points`) AS `total` FROM `notary` " .
'where `to` = :user'; "WHERE `to` = :user AND `method` != 'Administrative Increase' AND `from` != `to`";
$query_params['user'] = $this->id; $query_params['user'] = $this->id;
$row = $this->db->query($query, $query_params)->fetch(); $row = $this->db->query($query, $query_params)->fetch();
if ($row['total'] === null) $row['total'] = 0; if ($row['total'] === null) $row['total'] = 0;
$this->points = $row['total']; $this->points = $row['total'];
if($this->points < 100) return;
$this->points = 100;
$query = "SELECT COUNT(`points`) AS `total` FROM `notary` " .
"WHERE `from` = :user AND `method` = 'Face to Face Meeting' AND `from` != `to`";
$query_params['user'] = $this->id;
$row = $this->db->query($query, $query_params)->fetch();
if ($row['total'] === null) $row['total'] = 0;
$this->points += ($row['total'] > 25) ? 50 : 2 * $row['total'];
} }
/** /**
@ -149,12 +161,16 @@ class Default_Model_User {
'`expire` < now()) >= 100'; '`expire` < now()) >= 100';
$query_params['user'] = $this->id; $query_params['user'] = $this->id;
$this->db->query($query, $query_params); $this->db->query($query, $query_params);
$this->refreshPoints();
} }
/** /**
* @return boolean * @return boolean
*/ */
public function getAssurerStatus() { public function getAssurerStatus() {
$this->refreshPoints();
$query = 'SELECT 1 FROM `users` WHERE `users`.`id` = :user AND '. $query = 'SELECT 1 FROM `users` WHERE `users`.`id` = :user AND '.
'`assurer_blocked` = 0 AND '. '`assurer_blocked` = 0 AND '.
@ -225,8 +241,7 @@ class Default_Model_User {
* The amount of points that have been issued (might be less than * The amount of points that have been issued (might be less than
* $points) * $points)
*/ */
public function assure(Default_Model_User $assuree, $points, $location, public function assure(Default_Model_User $assuree, $points, $location, $date) {
$date) {
// Sanitize inputs // Sanitize inputs
$points = intval($points); $points = intval($points);
$location = stripslashes($location); $location = stripslashes($location);
@ -297,18 +312,6 @@ class Default_Model_User {
$this->db->insert('notary', $assurance); $this->db->insert('notary', $assurance);
$assuree->points += $rounddown; $assuree->points += $rounddown;
$assuree->fixAssurerFlag(); $assuree->fixAssurerFlag();
if ($this->getPoints() < 150) {
$addpoints = 0;
if ($this->getPoints() < 149 && $this->getPoints() >= 100) {
$addpoints = 2;
} elseif ($this->getPoints() === 149) {
$addpoints = 1;
}
$this->adminIncrease($addpoints, $location, $date);
}
return $rounddown; return $rounddown;
} }

View file

@ -82,7 +82,7 @@ class Zend_View_Helper_UserInfo extends Zend_View_Helper_Placeholder_Container_S
$output .= $indent . "<div id=\"userinfo\">\n"; $output .= $indent . "<div id=\"userinfo\">\n";
$output .= $indent . "\tUser: " . $this->items['authed_username'] . "<br>\n"; $output .= $indent . "\tUser: " . $this->items['authed_username'] . "<br>\n";
$output .= $indent . "\tName: " . $this->items['authed_fname'] . ' ' . $this->items['authed_lname'] . "<br>\n"; $output .= $indent . "\tName: " . htmlentities(strip_tags($this->items['authed_fname'] . ' ' . $this->items['authed_lname']), ENT_QUOTES, 'ISO-8859-1') . "<br>\n";
$output .= $indent . "\tRole: " . $this->items['authed_role'] . "<br>\n"; $output .= $indent . "\tRole: " . $this->items['authed_role'] . "<br>\n";
if ($this->items['authed_by_crt'] === true) if ($this->items['authed_by_crt'] === true)
$output .= $indent . "\tLoginmethod: CRT<br>\n"; $output .= $indent . "\tLoginmethod: CRT<br>\n";

View file

@ -26,7 +26,7 @@ else {
print " <tr>\n"; print " <tr>\n";
print " <td><a href=\"" . $header->detailslink . "\">" . $header->fromaddress . "</a></td>"; print " <td><a href=\"" . $header->detailslink . "\">" . $header->fromaddress . "</a></td>";
print " <td>" . $header->toaddress . "</td>"; print " <td>" . $header->toaddress . "</td>";
print " <td>" . $header->subject . "</td>"; print " <td>" . htmlspecialchars(iconv_mime_decode($header->subject, ICONV_MIME_DECODE_CONTINUE_ON_ERROR, 'UTF-8'), ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8') . "</td>";
print " <td>" . $header->date . "</td>"; print " <td>" . $header->date . "</td>";
print " <td>" . $header->Size . "</td>"; print " <td>" . $header->Size . "</td>";
print " <td><a class=\"delete\" href=\"" . $header->deletelink . "\"><img src=\"/img/delete_icon.jpg\"></a></td>"; print " <td><a class=\"delete\" href=\"" . $header->deletelink . "\"><img src=\"/img/delete_icon.jpg\"></a></td>";

View file

@ -26,7 +26,7 @@ else {
print " <tr>\n"; print " <tr>\n";
print " <td><a href=\"" . $header->detailslink . "\">" . $header->fromaddress . "</a></td>"; print " <td><a href=\"" . $header->detailslink . "\">" . $header->fromaddress . "</a></td>";
print " <td>" . $header->toaddress . "</td>"; print " <td>" . $header->toaddress . "</td>";
print " <td>" . $header->subject . "</td>"; print " <td>" . htmlspecialchars(iconv_mime_decode($header->subject, ICONV_MIME_DECODE_CONTINUE_ON_ERROR, 'UTF-8'), ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8') . "</td>";
print " <td>" . $header->date . "</td>"; print " <td>" . $header->date . "</td>";
print " <td>" . $header->Size . "</td>"; print " <td>" . $header->Size . "</td>";
print " <td><a class=\"delete\" href=\"" . $header->deletelink . "\"><img src=\"/img/delete_icon.jpg\"></a></td>"; print " <td><a class=\"delete\" href=\"" . $header->deletelink . "\"><img src=\"/img/delete_icon.jpg\"></a></td>";

View file

@ -101,4 +101,3 @@ class Config {
return $this->config; return $this->config;
} }
} }
?>

View file

@ -34,4 +34,3 @@ class HumanReadableTimeException extends BaseException {
} }
*/ */
} }
?>

View file

@ -13,4 +13,3 @@ print 'Day: ' . HumanReadableTime::Seconds2HR($hrf, 'd') . "\n";
print 'Hour: ' . HumanReadableTime::Seconds2HR($hrf, 'h') . "\n"; print 'Hour: ' . HumanReadableTime::Seconds2HR($hrf, 'h') . "\n";
print 'Minute: ' . HumanReadableTime::Seconds2HR($hrf, 'm') . "\n"; print 'Minute: ' . HumanReadableTime::Seconds2HR($hrf, 'm') . "\n";
print 'Second: ' . HumanReadableTime::Seconds2HR($hrf, 's') . "\n"; print 'Second: ' . HumanReadableTime::Seconds2HR($hrf, 's') . "\n";

View file

@ -95,4 +95,3 @@ class BaseException extends Exception {
} }
} }
?>