@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | * Returns +1 min and +1 hour rollovers hashes |
| 20 | 20 | * @param string $user user or IP/host address |
| 21 | 21 | * @param string $type page name or other unique per-page identifier |
| 22 | - * @return array 1min and 1hour hashes |
|
| 22 | + * @return string[] 1min and 1hour hashes |
|
| 23 | 23 | */ |
| 24 | 24 | public function checkAdditional($user, $type) { |
| 25 | 25 | $date = date('m/d/y/H/i'); |
@@ -89,6 +89,9 @@ discard block |
||
| 89 | 89 | return $string; |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | + /** |
|
| 93 | + * @param string $string |
|
| 94 | + */ |
|
| 92 | 95 | private function getHash($string) { |
| 93 | 96 | return hash('sha256', $this->salty.$string.$this->salt); |
| 94 | 97 | } |
@@ -68,11 +68,7 @@ |
||
| 68 | 68 | /** |
| 69 | 69 | * We fill our data array here |
| 70 | 70 | * @param string $msg Debug Message |
| 71 | - * @param string $file [optional] File name |
|
| 72 | - * @param integer $line [optional] Line inside the $file |
|
| 73 | 71 | * @param integer $debug [optional] Debugging level, default 1 |
| 74 | - * @param string $class [optional] Class this is called from |
|
| 75 | - * @param string $method [optional] Method this is called from |
|
| 76 | 72 | * @return none |
| 77 | 73 | */ |
| 78 | 74 | function append($msg, $debug=1) { |
@@ -137,6 +137,9 @@ |
||
| 137 | 137 | |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | + /** |
|
| 141 | + * @param string $path |
|
| 142 | + */ |
|
| 140 | 143 | private function _getTemplatesTreeRecursive($path) { |
| 141 | 144 | if( !is_dir($path) ) { |
| 142 | 145 | return preg_match("/\.tpl$/", $path); |
@@ -394,6 +394,10 @@ |
||
| 394 | 394 | public function createDebitAPRecord($account_id, $coin_address, $amount) { |
| 395 | 395 | return $this->createDebitRecord($account_id, $coin_address, $amount, 'Debit_AP'); |
| 396 | 396 | } |
| 397 | + |
|
| 398 | + /** |
|
| 399 | + * @param string $type |
|
| 400 | + */ |
|
| 397 | 401 | private function createDebitRecord($account_id, $coin_address, $amount, $type) { |
| 398 | 402 | // Calculate and deduct txfee from amount |
| 399 | 403 | $type == 'Debit_MP' ? $txfee = $this->config['txfee_manual'] : $txfee = $this->config['txfee_auto']; |
@@ -34,6 +34,10 @@ discard block |
||
| 34 | 34 | public function getUserNameAnon($id) { |
| 35 | 35 | return $this->getSingle($id, 'is_anonymous', 'id'); |
| 36 | 36 | } |
| 37 | + |
|
| 38 | + /** |
|
| 39 | + * @param string $email |
|
| 40 | + */ |
|
| 37 | 41 | public function getUserNameByEmail($email) { |
| 38 | 42 | return $this->getSingle($email, 'username', 'email', 's'); |
| 39 | 43 | } |
@@ -46,12 +50,20 @@ discard block |
||
| 46 | 50 | public function getUserEmail($username, $lower=false) { |
| 47 | 51 | return $this->getSingle($username, 'email', 'username', 's', $lower); |
| 48 | 52 | } |
| 53 | + |
|
| 54 | + /** |
|
| 55 | + * @param integer $id |
|
| 56 | + */ |
|
| 49 | 57 | public function getUserEmailById($id) { |
| 50 | 58 | return $this->getSingle($id, 'email', 'id', 'i'); |
| 51 | 59 | } |
| 52 | 60 | public function getUserPasswordHashById($id) { |
| 53 | 61 | return $this->getSingle($id, 'pass', 'id', 'i'); |
| 54 | 62 | } |
| 63 | + |
|
| 64 | + /** |
|
| 65 | + * @param integer $id |
|
| 66 | + */ |
|
| 55 | 67 | public function getUserPinHashById($id) { |
| 56 | 68 | return $this->getSingle($id, 'pin', 'id', 'i'); |
| 57 | 69 | } |
@@ -73,6 +85,10 @@ discard block |
||
| 73 | 85 | public function getLastLogin($id) { |
| 74 | 86 | return $this->getSingle($id, 'last_login', 'id'); |
| 75 | 87 | } |
| 88 | + |
|
| 89 | + /** |
|
| 90 | + * @param string $email |
|
| 91 | + */ |
|
| 76 | 92 | public function getEmail($email) { |
| 77 | 93 | return $this->getSingle($email, 'email', 'email', 's'); |
| 78 | 94 | } |
@@ -99,6 +115,10 @@ discard block |
||
| 99 | 115 | $this->log->log("warn", $this->getUserName($id)." changed no_fees to ".$this->isNoFee($id)); |
| 100 | 116 | return $this->updateSingle($id, $field); |
| 101 | 117 | } |
| 118 | + |
|
| 119 | + /** |
|
| 120 | + * @param integer $value |
|
| 121 | + */ |
|
| 102 | 122 | public function setLocked($id, $value) { |
| 103 | 123 | $field = array('name' => 'is_locked', 'type' => 'i', 'value' => $value); |
| 104 | 124 | $this->log->log("warn", $this->getUserName($id)." changed is_locked to $value"); |
@@ -113,6 +133,11 @@ discard block |
||
| 113 | 133 | $field = array( 'name' => 'failed_logins', 'type' => 'i', 'value' => $value); |
| 114 | 134 | return $this->updateSingle($id, $field); |
| 115 | 135 | } |
| 136 | + |
|
| 137 | + /** |
|
| 138 | + * @param integer $id |
|
| 139 | + * @param integer $value |
|
| 140 | + */ |
|
| 116 | 141 | public function setUserPinFailed($id, $value) { |
| 117 | 142 | $field = array( 'name' => 'failed_pins', 'type' => 'i', 'value' => $value); |
| 118 | 143 | return $this->updateSingle($id, $field); |
@@ -121,6 +146,10 @@ discard block |
||
| 121 | 146 | $field = array( 'name' => 'failed_logins', 'type' => 'i', 'value' => $this->getUserFailed($id) + 1); |
| 122 | 147 | return $this->updateSingle($id, $field); |
| 123 | 148 | } |
| 149 | + |
|
| 150 | + /** |
|
| 151 | + * @param integer $id |
|
| 152 | + */ |
|
| 124 | 153 | private function incUserPinFailed($id) { |
| 125 | 154 | $field = array( 'name' => 'failed_pins', 'type' => 'i', 'value' => $this->getUserPinFailed($id) + 1); |
| 126 | 155 | return $this->updateSingle($id, $field); |
@@ -694,7 +723,7 @@ discard block |
||
| 694 | 723 | |
| 695 | 724 | /** |
| 696 | 725 | * Fetch this classes table name |
| 697 | - * @return table string This classes table name |
|
| 726 | + * @return string string This classes table name |
|
| 698 | 727 | **/ |
| 699 | 728 | public function getTableName() { |
| 700 | 729 | $this->debug->append("STA " . __METHOD__, 4); |