@@ -299,7 +299,7 @@ |
||
| 299 | 299 | |
| 300 | 300 | /** |
| 301 | 301 | * @param $releaseID |
| 302 | - * @param $uniqueid |
|
| 302 | + * @param string $uniqueid |
|
| 303 | 303 | */ |
| 304 | 304 | public function addUID($releaseID, $uniqueid) |
| 305 | 305 | { |
@@ -49,6 +49,7 @@ |
||
| 49 | 49 | /** |
| 50 | 50 | * Construct. |
| 51 | 51 | * @param \DB() |
| 52 | + * @param db\DB $pdo |
|
| 52 | 53 | */ |
| 53 | 54 | public function __construct(&$pdo = null) |
| 54 | 55 | { |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | * @param string $orderBy |
| 193 | 193 | * @param int $maxAge |
| 194 | 194 | * @param array $excludedCats |
| 195 | - * @param mixed $groupName |
|
| 195 | + * @param integer $groupName |
|
| 196 | 196 | * @param int $minSize |
| 197 | 197 | * |
| 198 | 198 | * @return array |
@@ -1307,7 +1307,7 @@ discard block |
||
| 1307 | 1307 | /** |
| 1308 | 1308 | * @param string $guid |
| 1309 | 1309 | * |
| 1310 | - * @return array|bool |
|
| 1310 | + * @return string |
|
| 1311 | 1311 | */ |
| 1312 | 1312 | public function getByGuid($guid) |
| 1313 | 1313 | { |
@@ -162,6 +162,9 @@ |
||
| 162 | 162 | return $missingpatch; |
| 163 | 163 | } |
| 164 | 164 | |
| 165 | + /** |
|
| 166 | + * @param string $setting |
|
| 167 | + */ |
|
| 165 | 168 | public function updateItem($setting, $value) |
| 166 | 169 | { |
| 167 | 170 | $sql = sprintf("update settings set value = %s where setting = %s", $this->_db->escapeString($value), $this->_db->escapeString($setting)); |
@@ -1869,6 +1869,10 @@ discard block |
||
| 1869 | 1869 | } |
| 1870 | 1870 | |
| 1871 | 1871 | // *********************************************************************** |
| 1872 | + |
|
| 1873 | + /** |
|
| 1874 | + * @param integer $len |
|
| 1875 | + */ |
|
| 1872 | 1876 | public function getRandomStr($len) { |
| 1873 | 1877 | // Valid Characters |
| 1874 | 1878 | static $vc = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'; |
@@ -2183,6 +2187,10 @@ discard block |
||
| 2183 | 2187 | } |
| 2184 | 2188 | |
| 2185 | 2189 | // *********************************************************************** |
| 2190 | + |
|
| 2191 | + /** |
|
| 2192 | + * @param string $source |
|
| 2193 | + */ |
|
| 2186 | 2194 | public function encrypt ($source, $prvkey = NULL, $passphrase = NULL){ |
| 2187 | 2195 | // Encryption performed using private key |
| 2188 | 2196 | if($prvkey === NULL) |
@@ -331,6 +331,9 @@ discard block |
||
| 331 | 331 | return self::SUCCESS; |
| 332 | 332 | } |
| 333 | 333 | |
| 334 | + /** |
|
| 335 | + * @param string $userName |
|
| 336 | + */ |
|
| 334 | 337 | public function isValidUsername($userName) |
| 335 | 338 | { |
| 336 | 339 | return preg_match("/^[a-z][a-z0-9_]{2,}$/i", $userName); |
@@ -348,11 +351,17 @@ discard block |
||
| 348 | 351 | return (bool)preg_match('/^([\w\+-]+)(\.[\w\+-]+)*@([a-z0-9-]+\.)+[a-z]{2,6}$/i', $email); |
| 349 | 352 | } |
| 350 | 353 | |
| 354 | + /** |
|
| 355 | + * @param string $userName |
|
| 356 | + */ |
|
| 351 | 357 | public function getByUsername($userName) |
| 352 | 358 | { |
| 353 | 359 | return $this->pdo->queryOneRow(sprintf("SELECT users.*, user_roles.name as rolename, user_roles.apirequests, user_roles.downloadrequests FROM users INNER JOIN user_roles on user_roles.id = users.role WHERE username = %s ", $this->pdo->escapeString($userName))); |
| 354 | 360 | } |
| 355 | 361 | |
| 362 | + /** |
|
| 363 | + * @param string $email |
|
| 364 | + */ |
|
| 356 | 365 | public function getByEmail($email) |
| 357 | 366 | { |
| 358 | 367 | return $this->pdo->queryOneRow(sprintf("SELECT * FROM users WHERE lower(email) = %s ", $this->pdo->escapeString(strtolower($email)))); |
@@ -419,6 +428,9 @@ discard block |
||
| 419 | 428 | return password_hash($password, PASSWORD_DEFAULT, ['cost' => $this->password_hash_cost]); |
| 420 | 429 | } |
| 421 | 430 | |
| 431 | + /** |
|
| 432 | + * @param string $string |
|
| 433 | + */ |
|
| 422 | 434 | public static function hashSHA1($string) |
| 423 | 435 | { |
| 424 | 436 | return sha1($string); |
@@ -564,6 +576,9 @@ discard block |
||
| 564 | 576 | return $this->add($userName, $password, $email, $role, $notes, $host, $invites, $invitedBy); |
| 565 | 577 | } |
| 566 | 578 | |
| 579 | + /** |
|
| 580 | + * @param string $password |
|
| 581 | + */ |
|
| 567 | 582 | public function isValidPassword($password) |
| 568 | 583 | { |
| 569 | 584 | return (strlen($password) > 5); |
@@ -588,6 +603,9 @@ discard block |
||
| 588 | 603 | return $invite["users_id"]; |
| 589 | 604 | } |
| 590 | 605 | |
| 606 | + /** |
|
| 607 | + * @param integer $inviteToken |
|
| 608 | + */ |
|
| 591 | 609 | public function getInvite($inviteToken) |
| 592 | 610 | { |
| 593 | 611 | |
@@ -605,6 +623,9 @@ discard block |
||
| 605 | 623 | ); |
| 606 | 624 | } |
| 607 | 625 | |
| 626 | + /** |
|
| 627 | + * @param integer $inviteToken |
|
| 628 | + */ |
|
| 608 | 629 | public function deleteInvite($inviteToken) |
| 609 | 630 | { |
| 610 | 631 | |
@@ -893,6 +914,9 @@ discard block |
||
| 893 | 914 | return $url; |
| 894 | 915 | } |
| 895 | 916 | |
| 917 | + /** |
|
| 918 | + * @param string $inviteToken |
|
| 919 | + */ |
|
| 896 | 920 | public function addInvite($uid, $inviteToken) |
| 897 | 921 | { |
| 898 | 922 | $this->pdo->queryInsert(sprintf("INSERT INTO invitations (guid, users_id, createddate) VALUES (%s, %d, now())", $this->pdo->escapeString($inviteToken), $uid)); |
@@ -73,7 +73,7 @@ |
||
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | /** |
| 76 | - * @param $gitObject |
|
| 76 | + * @param string $gitObject |
|
| 77 | 77 | * |
| 78 | 78 | * @return bool |
| 79 | 79 | * @throws \Exception |
@@ -38,7 +38,7 @@ |
||
| 38 | 38 | * @param string $text Text to match against. |
| 39 | 39 | * @param string $page Type of page. browse or search. |
| 40 | 40 | * |
| 41 | - *@return bool|string |
|
| 41 | + *@return string|false |
|
| 42 | 42 | */ |
| 43 | 43 | function release_flag($text, $page) |
| 44 | 44 | { |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | /** |
| 181 | 181 | * Detect if the command is accessible on the system. |
| 182 | 182 | * |
| 183 | - * @param $cmd |
|
| 183 | + * @param string $cmd |
|
| 184 | 184 | * |
| 185 | 185 | * @return bool|null Returns true if found, false if not found, and null if which is not detected. |
| 186 | 186 | */ |
@@ -273,7 +273,7 @@ discard block |
||
| 273 | 273 | * Operates directly on the text string, but also returns the result for situations requiring a |
| 274 | 274 | * return value (use in ternary, etc.)/ |
| 275 | 275 | * |
| 276 | - * @param $text String variable to strip. |
|
| 276 | + * @param string $text String variable to strip. |
|
| 277 | 277 | * |
| 278 | 278 | * @return string The stripped variable. |
| 279 | 279 | */ |