Compare commits
No commits in common. "master" and "bug-1390" have entirely different histories.
57 changed files with 3694 additions and 3699 deletions
7
.gitattributes
vendored
7
.gitattributes
vendored
|
@ -1,7 +0,0 @@
|
|||
* text=auto
|
||||
|
||||
*.php text
|
||||
*.html text
|
||||
*.phtml text
|
||||
*.js text
|
||||
*.css text
|
|
@ -32,3 +32,4 @@ class ErrorController extends Zend_Controller_Action
|
|||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -108,25 +108,13 @@ class Default_Model_User {
|
|||
* user's points
|
||||
*/
|
||||
public function refreshPoints() {
|
||||
$query = "SELECT SUM(`points`) AS `total` FROM `notary` " .
|
||||
"WHERE `to` = :user AND `method` != 'Administrative Increase' AND `from` != `to`";
|
||||
$query = 'select sum(`points`) as `total` from `notary` '.
|
||||
'where `to` = :user';
|
||||
$query_params['user'] = $this->id;
|
||||
$row = $this->db->query($query, $query_params)->fetch();
|
||||
if ($row['total'] === null) $row['total'] = 0;
|
||||
|
||||
$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'];
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -161,16 +149,12 @@ class Default_Model_User {
|
|||
'`expire` < now()) >= 100';
|
||||
$query_params['user'] = $this->id;
|
||||
$this->db->query($query, $query_params);
|
||||
|
||||
$this->refreshPoints();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return boolean
|
||||
*/
|
||||
public function getAssurerStatus() {
|
||||
$this->refreshPoints();
|
||||
|
||||
$query = 'SELECT 1 FROM `users` WHERE `users`.`id` = :user AND '.
|
||||
'`assurer_blocked` = 0 AND '.
|
||||
|
||||
|
@ -241,7 +225,8 @@ class Default_Model_User {
|
|||
* The amount of points that have been issued (might be less than
|
||||
* $points)
|
||||
*/
|
||||
public function assure(Default_Model_User $assuree, $points, $location, $date) {
|
||||
public function assure(Default_Model_User $assuree, $points, $location,
|
||||
$date) {
|
||||
// Sanitize inputs
|
||||
$points = intval($points);
|
||||
$location = stripslashes($location);
|
||||
|
@ -312,6 +297,18 @@ class Default_Model_User {
|
|||
$this->db->insert('notary', $assurance);
|
||||
$assuree->points += $rounddown;
|
||||
$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;
|
||||
}
|
||||
|
||||
|
|
|
@ -82,7 +82,7 @@ class Zend_View_Helper_UserInfo extends Zend_View_Helper_Placeholder_Container_S
|
|||
|
||||
$output .= $indent . "<div id=\"userinfo\">\n";
|
||||
$output .= $indent . "\tUser: " . $this->items['authed_username'] . "<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 . "\tName: " . $this->items['authed_fname'] . ' ' . $this->items['authed_lname'] . "<br>\n";
|
||||
$output .= $indent . "\tRole: " . $this->items['authed_role'] . "<br>\n";
|
||||
if ($this->items['authed_by_crt'] === true)
|
||||
$output .= $indent . "\tLoginmethod: CRT<br>\n";
|
||||
|
|
|
@ -26,7 +26,7 @@ else {
|
|||
print " <tr>\n";
|
||||
print " <td><a href=\"" . $header->detailslink . "\">" . $header->fromaddress . "</a></td>";
|
||||
print " <td>" . $header->toaddress . "</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->subject . "</td>";
|
||||
print " <td>" . $header->date . "</td>";
|
||||
print " <td>" . $header->Size . "</td>";
|
||||
print " <td><a class=\"delete\" href=\"" . $header->deletelink . "\"><img src=\"/img/delete_icon.jpg\"></a></td>";
|
||||
|
|
|
@ -26,7 +26,7 @@ else {
|
|||
print " <tr>\n";
|
||||
print " <td><a href=\"" . $header->detailslink . "\">" . $header->fromaddress . "</a></td>";
|
||||
print " <td>" . $header->toaddress . "</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->subject . "</td>";
|
||||
print " <td>" . $header->date . "</td>";
|
||||
print " <td>" . $header->Size . "</td>";
|
||||
print " <td><a class=\"delete\" href=\"" . $header->deletelink . "\"><img src=\"/img/delete_icon.jpg\"></a></td>";
|
||||
|
|
|
@ -101,3 +101,4 @@ class Config {
|
|||
return $this->config;
|
||||
}
|
||||
}
|
||||
?>
|
|
@ -34,3 +34,4 @@ class HumanReadableTimeException extends BaseException {
|
|||
}
|
||||
*/
|
||||
}
|
||||
?>
|
|
@ -13,3 +13,4 @@ print 'Day: ' . HumanReadableTime::Seconds2HR($hrf, 'd') . "\n";
|
|||
print 'Hour: ' . HumanReadableTime::Seconds2HR($hrf, 'h') . "\n";
|
||||
print 'Minute: ' . HumanReadableTime::Seconds2HR($hrf, 'm') . "\n";
|
||||
print 'Second: ' . HumanReadableTime::Seconds2HR($hrf, 's') . "\n";
|
||||
|
||||
|
|
|
@ -95,3 +95,4 @@ class BaseException extends Exception {
|
|||
}
|
||||
|
||||
}
|
||||
?>
|
Loading…
Reference in a new issue