Compare commits
27 commits
Author | SHA1 | Date | |
---|---|---|---|
|
13901dd1a1 | ||
|
870a936694 | ||
|
7f20913d8b | ||
|
9987c02e3e | ||
|
4e5c9dd72b | ||
|
269829b175 | ||
|
51d8dffac8 | ||
|
8a5059809e | ||
|
09e2615ec5 | ||
|
4edd7b57c0 | ||
|
ce38587c84 | ||
|
2cbb6d9c9c | ||
|
f9a2da80b9 | ||
|
97cfec7705 | ||
|
e33a8de01c | ||
|
f97cb26f07 | ||
|
39b237c1d4 | ||
|
bbfbb59454 | ||
|
fc7a085b29 | ||
|
7239b831f8 | ||
|
733814fd08 | ||
|
3c8663a208 | ||
|
e6af0ab4c9 | ||
|
dae1d5c7f8 | ||
|
5a7e585320 | ||
|
1c5bceeae7 | ||
|
5a03b6f6f2 |
57 changed files with 3709 additions and 3704 deletions
7
.gitattributes
vendored
Normal file
7
.gitattributes
vendored
Normal file
|
@ -0,0 +1,7 @@
|
|||
* text=auto
|
||||
|
||||
*.php text
|
||||
*.html text
|
||||
*.phtml text
|
||||
*.js text
|
||||
*.css text
|
|
@ -32,4 +32,3 @@ class ErrorController extends Zend_Controller_Action
|
|||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -108,13 +108,25 @@ class Default_Model_User {
|
|||
* user's points
|
||||
*/
|
||||
public function refreshPoints() {
|
||||
$query = 'select sum(`points`) as `total` from `notary` '.
|
||||
'where `to` = :user';
|
||||
$query = "SELECT SUM(`points`) AS `total` FROM `notary` " .
|
||||
"WHERE `to` = :user AND `method` != 'Administrative Increase' 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'];
|
||||
|
||||
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';
|
||||
$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 '.
|
||||
|
||||
|
@ -225,8 +241,7 @@ 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);
|
||||
|
@ -297,18 +312,6 @@ 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: " . $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";
|
||||
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>" . $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->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>" . $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->Size . "</td>";
|
||||
print " <td><a class=\"delete\" href=\"" . $header->deletelink . "\"><img src=\"/img/delete_icon.jpg\"></a></td>";
|
||||
|
|
|
@ -101,4 +101,3 @@ class Config {
|
|||
return $this->config;
|
||||
}
|
||||
}
|
||||
?>
|
|
@ -34,4 +34,3 @@ class HumanReadableTimeException extends BaseException {
|
|||
}
|
||||
*/
|
||||
}
|
||||
?>
|
|
@ -13,4 +13,3 @@ 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,4 +95,3 @@ class BaseException extends Exception {
|
|||
}
|
||||
|
||||
}
|
||||
?>
|
Loading…
Reference in a new issue