@@ -18,6 +18,11 @@ discard block |
||
| 18 | 18 | |
| 19 | 19 | // TODO - НЕ ОБЯЗАТЕЛЬНО ОТПРАВЛЯТЬ ЧЕРЕЗ ЕМЕЙЛ! ЕСЛИ ЭТО ФЕЙСБУЧЕК ИЛИ ВКШЕЧКА - МОЖНО ЧЕРЕЗ ЛС ПИСАТЬ!! |
| 20 | 20 | // TODO - OK 4.6 |
| 21 | + |
|
| 22 | + /** |
|
| 23 | + * @param integer $confirmation_type_safe |
|
| 24 | + * @param string $email_unsafe |
|
| 25 | + */ |
|
| 21 | 26 | public function db_confirmation_get_latest_by_type_and_email($confirmation_type_safe, $email_unsafe) { |
| 22 | 27 | $email_safe = $this->db->db_escape($email_unsafe); |
| 23 | 28 | |
@@ -26,12 +31,21 @@ discard block |
||
| 26 | 31 | `type` = {$confirmation_type_safe} AND `email` = '{$email_safe}' ORDER BY create_time DESC LIMIT 1;", true); |
| 27 | 32 | } |
| 28 | 33 | // TODO - OK 4.6 |
| 34 | + |
|
| 35 | + /** |
|
| 36 | + * @param integer $confirmation_type_safe |
|
| 37 | + */ |
|
| 29 | 38 | public function db_confirmation_delete_by_type_and_email($confirmation_type_safe, $email_unsafe) { |
| 30 | 39 | $email_safe = $this->db->db_escape($email_unsafe); |
| 31 | 40 | |
| 32 | 41 | return $this->db->doquery("DELETE FROM {{confirmations}} WHERE `type` = {$confirmation_type_safe} AND `email` = '{$email_safe}'"); |
| 33 | 42 | } |
| 34 | 43 | // TODO - OK 4.6 |
| 44 | + |
|
| 45 | + /** |
|
| 46 | + * @param integer $confirmation_type_safe |
|
| 47 | + * @param string $email_unsafe |
|
| 48 | + */ |
|
| 35 | 49 | public function db_confirmation_get_unique_code_by_type_and_email($confirmation_type_safe, $email_unsafe) { |
| 36 | 50 | $email_safe = $this->db->db_escape($email_unsafe); |
| 37 | 51 | |
@@ -50,6 +64,11 @@ discard block |
||
| 50 | 64 | return $confirm_code_unsafe; |
| 51 | 65 | } |
| 52 | 66 | // TODO - OK 4.6 |
| 67 | + |
|
| 68 | + /** |
|
| 69 | + * @param integer $confirmation_type_safe |
|
| 70 | + * @param string $confirmation_code_unsafe |
|
| 71 | + */ |
|
| 53 | 72 | public function db_confirmation_get_by_type_and_code($confirmation_type_safe, $confirmation_code_unsafe) { |
| 54 | 73 | $confirmation_code_safe = $this->db->db_escape($confirmation_code_unsafe); |
| 55 | 74 | |
@@ -286,7 +286,6 @@ discard block |
||
| 286 | 286 | /** |
| 287 | 287 | * Функция пытается залогиниться по всем известным провайдерам |
| 288 | 288 | * |
| 289 | - * @param null $result |
|
| 290 | 289 | */ |
| 291 | 290 | public function login() { |
| 292 | 291 | if(empty(sn_module::$sn_module_list['auth'])) { |
@@ -823,10 +822,17 @@ discard block |
||
| 823 | 822 | |
| 824 | 823 | // OK v4.5 |
| 825 | 824 | // TODO - REMEMBER_ME |
| 825 | + |
|
| 826 | + /** |
|
| 827 | + * @param integer $period |
|
| 828 | + */ |
|
| 826 | 829 | protected static function cookie_set($value, $impersonate = false, $period = null) { |
| 827 | 830 | sn_setcookie($impersonate ? SN_COOKIE_U_I : SN_COOKIE_U, $value, $period === null ? SN_TIME_NOW + PERIOD_YEAR : $period, SN_ROOT_RELATIVE); |
| 828 | 831 | } |
| 829 | 832 | |
| 833 | + /** |
|
| 834 | + * @param string $message |
|
| 835 | + */ |
|
| 830 | 836 | protected static function flog($message, $die = false) { |
| 831 | 837 | if(!defined('DEBUG_AUTH') || !DEBUG_AUTH) { |
| 832 | 838 | return; |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | /** |
| 158 | 158 | * @param string $query |
| 159 | 159 | * |
| 160 | - * @return mixed|string |
|
| 160 | + * @return string |
|
| 161 | 161 | */ |
| 162 | 162 | public function replaceTablePlaceholders($query) { |
| 163 | 163 | $sql = $query; |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | } |
| 172 | 172 | |
| 173 | 173 | /** |
| 174 | - * @param $query |
|
| 174 | + * @param string $query |
|
| 175 | 175 | */ |
| 176 | 176 | protected function logQuery($query) { |
| 177 | 177 | if (!classSupernova::$config->debug) { |
@@ -286,6 +286,7 @@ discard block |
||
| 286 | 286 | * @param array $fields |
| 287 | 287 | * @param array $where |
| 288 | 288 | * @param bool $isOneRecord |
| 289 | + * @param boolean $forUpdate |
|
| 289 | 290 | * |
| 290 | 291 | * @return array|bool|mysqli_result|null |
| 291 | 292 | */ |
@@ -331,6 +332,11 @@ discard block |
||
| 331 | 332 | |
| 332 | 333 | |
| 333 | 334 | // INSERT/REPLACE |
| 335 | + |
|
| 336 | + /** |
|
| 337 | + * @param string $table |
|
| 338 | + * @param integer $replace |
|
| 339 | + */ |
|
| 334 | 340 | protected function doSet($table, $fieldsAndValues, $replace = DB_INSERT_PLAIN) { |
| 335 | 341 | $query = DbQuery::build($this) |
| 336 | 342 | ->setTable($table) |
@@ -368,6 +374,10 @@ discard block |
||
| 368 | 374 | |
| 369 | 375 | |
| 370 | 376 | // INSERTERS |
| 377 | + |
|
| 378 | + /** |
|
| 379 | + * @param string $query |
|
| 380 | + */ |
|
| 371 | 381 | public function doInsertComplex($query) { |
| 372 | 382 | return $this->doSql($query); |
| 373 | 383 | } |
@@ -387,7 +397,7 @@ discard block |
||
| 387 | 397 | * Values should be passed as-is |
| 388 | 398 | * |
| 389 | 399 | * @param string $table |
| 390 | - * @param array $fields |
|
| 400 | + * @param string[] $fields |
|
| 391 | 401 | * @param string[] $values |
| 392 | 402 | * |
| 393 | 403 | * @return array|bool|mysqli_result|null |
@@ -440,7 +450,7 @@ discard block |
||
| 440 | 450 | * Self-contained - means no params used |
| 441 | 451 | * Such queries usually used to make large amount of in-base calculations |
| 442 | 452 | * |
| 443 | - * @param $query |
|
| 453 | + * @param string $query |
|
| 444 | 454 | * |
| 445 | 455 | * @return array|bool|mysqli_result|null |
| 446 | 456 | */ |
@@ -457,13 +467,16 @@ discard block |
||
| 457 | 467 | } |
| 458 | 468 | |
| 459 | 469 | /** |
| 460 | - * @param $DbQuery DbQuery |
|
| 470 | + * @param DbQuery $DbQuery DbQuery |
|
| 461 | 471 | */ |
| 462 | 472 | public function doUpdateDbQueryAdjust($DbQuery) { |
| 463 | 473 | return $this->doUpdateDbQuery($DbQuery); |
| 464 | 474 | } |
| 465 | 475 | |
| 466 | 476 | |
| 477 | + /** |
|
| 478 | + * @param boolean $isOneRecord |
|
| 479 | + */ |
|
| 467 | 480 | protected function doUpdateWhere($table, $fieldsSet, $fieldsAdjust = array(), $where = array(), $isOneRecord = DB_RECORDS_ALL, $whereDanger = array()) { |
| 468 | 481 | $query = DbQuery::build($this) |
| 469 | 482 | ->setTable($table) |
@@ -482,6 +495,9 @@ discard block |
||
| 482 | 495 | return $this->doUpdateWhere($table, $fieldsAndValues, array(), $where, DB_RECORD_ONE); |
| 483 | 496 | } |
| 484 | 497 | |
| 498 | + /** |
|
| 499 | + * @param string $table |
|
| 500 | + */ |
|
| 485 | 501 | public function doUpdateTableSet($table, $fieldsAndValues, $where = array()) { |
| 486 | 502 | return $this->doUpdateWhere($table, $fieldsAndValues, array(), $where, DB_RECORDS_ALL); |
| 487 | 503 | } |
@@ -597,6 +613,10 @@ discard block |
||
| 597 | 613 | } |
| 598 | 614 | |
| 599 | 615 | // TODO Заменить это на новый логгер |
| 616 | + |
|
| 617 | + /** |
|
| 618 | + * @param string $query |
|
| 619 | + */ |
|
| 600 | 620 | protected function security_watch_user_queries($query) { |
| 601 | 621 | global $user; |
| 602 | 622 | |
@@ -620,6 +640,9 @@ discard block |
||
| 620 | 640 | } |
| 621 | 641 | |
| 622 | 642 | |
| 643 | + /** |
|
| 644 | + * @param string $query |
|
| 645 | + */ |
|
| 623 | 646 | public function security_query_check_bad_words($query) { |
| 624 | 647 | if ($this->skipQueryCheck) { |
| 625 | 648 | return; |
@@ -39,7 +39,7 @@ |
||
| 39 | 39 | * <p>true - транзакция должна быть запущена - для совместимости с $for_update</p> |
| 40 | 40 | * <p>false - всё равно - для совместимости с $for_update</p> |
| 41 | 41 | * |
| 42 | - * @return bool Текущий статус транзакции |
|
| 42 | + * @return null|boolean Текущий статус транзакции |
|
| 43 | 43 | */ |
| 44 | 44 | public function check($status = null) { |
| 45 | 45 | $error_msg = false; |
@@ -444,7 +444,6 @@ discard block |
||
| 444 | 444 | } |
| 445 | 445 | |
| 446 | 446 | /** |
| 447 | - * @param bool $skip_query_check |
|
| 448 | 447 | * |
| 449 | 448 | * @return array |
| 450 | 449 | */ |
@@ -455,7 +454,6 @@ discard block |
||
| 455 | 454 | } |
| 456 | 455 | |
| 457 | 456 | /** |
| 458 | - * @param bool $skip_query_check |
|
| 459 | 457 | * |
| 460 | 458 | * @return mixed|null |
| 461 | 459 | */ |
@@ -85,6 +85,9 @@ |
||
| 85 | 85 | return $this->db->doSelectIterator($query); |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | + /** |
|
| 89 | + * @param string $table |
|
| 90 | + */ |
|
| 88 | 91 | public function doUpdateRowSetAffected($table, $fieldsAndValues, $where) { |
| 89 | 92 | $this->db->doUpdateRowSet($table, $fieldsAndValues, $where); |
| 90 | 93 | return $this->db->db_affected_rows(); |
@@ -26,7 +26,7 @@ |
||
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | /** |
| 29 | - * @param mixed $value |
|
| 29 | + * @param string $value |
|
| 30 | 30 | * |
| 31 | 31 | * @return $this |
| 32 | 32 | */ |
@@ -293,7 +293,7 @@ |
||
| 293 | 293 | } |
| 294 | 294 | |
| 295 | 295 | /** |
| 296 | - * @param $ranklist |
|
| 296 | + * @param string $ranklist |
|
| 297 | 297 | * @param $user |
| 298 | 298 | */ |
| 299 | 299 | public static function db_ally_update_ranklist($ranklist, $user) { |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | |
| 20 | 20 | /** |
| 21 | 21 | * @param $user_id |
| 22 | - * @param $nickUnsafe |
|
| 22 | + * @param string $nickUnsafe |
|
| 23 | 23 | * @param $ally_id |
| 24 | 24 | * @param $message_unsafe |
| 25 | 25 | * @param $chat_message_sender_name_unsafe |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | * @param $alliance |
| 55 | 55 | * @param $where_add |
| 56 | 56 | * @param $start_row |
| 57 | - * @param $page_limit |
|
| 57 | + * @param integer $page_limit |
|
| 58 | 58 | * |
| 59 | 59 | * @return array|bool|mysqli_result|null |
| 60 | 60 | */ |