@@ -169,6 +169,10 @@ discard block |
||
169 | 169 | * @return bool |
170 | 170 | */ |
171 | 171 | // OK v4.5 |
172 | + |
|
173 | + /** |
|
174 | + * @param string $account_name_unsafe |
|
175 | + */ |
|
172 | 176 | public function db_get_by_name($account_name_unsafe) { |
173 | 177 | $this->reset(); |
174 | 178 | |
@@ -203,6 +207,11 @@ discard block |
||
203 | 207 | * |
204 | 208 | */ |
205 | 209 | // OK v4.5 |
210 | + |
|
211 | + /** |
|
212 | + * @param string $account_name_unsafe |
|
213 | + * @param string $email_unsafe |
|
214 | + */ |
|
206 | 215 | public function db_get_by_name_or_email($account_name_unsafe, $email_unsafe) { |
207 | 216 | $this->reset(); |
208 | 217 | |
@@ -218,6 +227,13 @@ discard block |
||
218 | 227 | * @throws Exception |
219 | 228 | */ |
220 | 229 | // OK v4.5 |
230 | + |
|
231 | + /** |
|
232 | + * @param string $account_name_unsafe |
|
233 | + * @param string $password_raw |
|
234 | + * @param string $email_unsafe |
|
235 | + * @param string $language_unsafe |
|
236 | + */ |
|
221 | 237 | public function db_create($account_name_unsafe, $password_raw, $email_unsafe, $language_unsafe = null, $salt_unsafe = null) { |
222 | 238 | $this->reset(); |
223 | 239 | |
@@ -312,6 +328,10 @@ discard block |
||
312 | 328 | * @return int|string |
313 | 329 | */ |
314 | 330 | // OK 4.8 |
331 | + |
|
332 | + /** |
|
333 | + * @param double $metamatter |
|
334 | + */ |
|
315 | 335 | protected function db_mm_log_insert($comment, $change_type, $metamatter, $user_id_unsafe) { |
316 | 336 | $provider_id_safe = intval(core_auth::$main_provider->provider_id); |
317 | 337 | //$account_id_safe = $this->db->db_escape($this->account_id); |
@@ -209,6 +209,10 @@ discard block |
||
209 | 209 | * @return array|bool|resource |
210 | 210 | */ |
211 | 211 | // OK v4.5 |
212 | + |
|
213 | + /** |
|
214 | + * @param string $salt_unsafe |
|
215 | + */ |
|
212 | 216 | public function password_change($old_password_unsafe, $new_password_unsafe, $salt_unsafe = null) { |
213 | 217 | $result = parent::password_change($old_password_unsafe, $new_password_unsafe, $salt_unsafe); |
214 | 218 | if($result) { |
@@ -218,6 +222,9 @@ discard block |
||
218 | 222 | return $result; |
219 | 223 | } |
220 | 224 | |
225 | + /** |
|
226 | + * @param Account $account_to_impersonate |
|
227 | + */ |
|
221 | 228 | public function impersonate($account_to_impersonate) { |
222 | 229 | $this->cookie_set($account_to_impersonate); |
223 | 230 | } |
@@ -81,6 +81,10 @@ discard block |
||
81 | 81 | // ------------------------------------------------------------------------- |
82 | 82 | // Here comes low-level functions - those that directly works with cacher engines |
83 | 83 | // ------------------------------------------------------------------------- |
84 | + |
|
85 | + /** |
|
86 | + * @param string $name |
|
87 | + */ |
|
84 | 88 | public function __set($name, $value) { |
85 | 89 | switch ($name) { |
86 | 90 | case '_MODE': |
@@ -132,6 +136,9 @@ discard block |
||
132 | 136 | return null; |
133 | 137 | } |
134 | 138 | |
139 | + /** |
|
140 | + * @param string $name |
|
141 | + */ |
|
135 | 142 | public function __isset($name) { |
136 | 143 | switch (self::$mode) { |
137 | 144 | case CACHER_NO_CACHE: |
@@ -332,6 +339,9 @@ discard block |
||
332 | 339 | return self::$cacheObject; |
333 | 340 | } |
334 | 341 | |
342 | + /** |
|
343 | + * @param string $index |
|
344 | + */ |
|
335 | 345 | public function db_loadItem($index) { |
336 | 346 | $result = null; |
337 | 347 | if($index) { |
@@ -371,6 +381,9 @@ discard block |
||
371 | 381 | $this->db_saveItem(array_combine(array_keys($this->defaults), array_fill(0, count($this->defaults), null))); |
372 | 382 | } |
373 | 383 | |
384 | + /** |
|
385 | + * @param integer $value |
|
386 | + */ |
|
374 | 387 | public function db_saveItem($item_list, $value = NULL) { |
375 | 388 | if(empty($item_list)) { |
376 | 389 | return; |
@@ -59,7 +59,7 @@ |
||
59 | 59 | if(self::$mode === CACHER_NOT_INIT) { |
60 | 60 | self::$mode = CACHER_NO_CACHE; |
61 | 61 | if(!self::$data) { |
62 | - self::$data = array(); |
|
62 | + self::$data = array(); |
|
63 | 63 | } |
64 | 64 | } |
65 | 65 | } |
@@ -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 |
@@ -180,6 +180,9 @@ discard block |
||
180 | 180 | } |
181 | 181 | |
182 | 182 | |
183 | + /** |
|
184 | + * @param string $query |
|
185 | + */ |
|
183 | 186 | function security_watch_user_queries($query) { |
184 | 187 | // TODO Заменить это на новый логгер |
185 | 188 | global $config, $is_watching, $user, $debug; |
@@ -202,6 +205,9 @@ discard block |
||
202 | 205 | } |
203 | 206 | |
204 | 207 | |
208 | + /** |
|
209 | + * @param string $query |
|
210 | + */ |
|
205 | 211 | function security_query_check_bad_words($query) { |
206 | 212 | global $user, $dm_change_legit, $mm_change_legit; |
207 | 213 |
@@ -55,6 +55,9 @@ |
||
55 | 55 | return true; |
56 | 56 | } |
57 | 57 | |
58 | + /** |
|
59 | + * @param string $query_string |
|
60 | + */ |
|
58 | 61 | function mysql_query($query_string) { |
59 | 62 | return mysql_query($query_string, $this->link); |
60 | 63 | } |
@@ -47,6 +47,7 @@ discard block |
||
47 | 47 | |
48 | 48 | /** |
49 | 49 | * constuctor |
50 | + * @param template $template |
|
50 | 51 | */ |
51 | 52 | function template_compile(&$template) |
52 | 53 | { |
@@ -463,6 +464,7 @@ discard block |
||
463 | 464 | * Compile IF tags - much of this is from Smarty with |
464 | 465 | * some adaptions for our block level methods |
465 | 466 | * @access private |
467 | + * @param boolean $elseif |
|
466 | 468 | */ |
467 | 469 | function compile_tag_if($tag_args, $elseif) |
468 | 470 | { |
@@ -620,6 +622,7 @@ discard block |
||
620 | 622 | /** |
621 | 623 | * Compile DEFINE tags |
622 | 624 | * @access private |
625 | + * @param boolean $op |
|
623 | 626 | */ |
624 | 627 | function compile_tag_define($tag_args, $op) |
625 | 628 | { |
@@ -698,6 +701,7 @@ discard block |
||
698 | 701 | * parse expression |
699 | 702 | * This is from Smarty |
700 | 703 | * @access private |
704 | + * @param string $is_arg |
|
701 | 705 | */ |
702 | 706 | function _parse_is_expr($is_arg, $tokens) |
703 | 707 | { |
@@ -794,6 +798,8 @@ discard block |
||
794 | 798 | * If $include_last_iterator is true, then [$_childN_i] will be appended to the form shown above. |
795 | 799 | * NOTE: does not expect a trailing "." on the blockname. |
796 | 800 | * @access private |
801 | + * @param string $blockname |
|
802 | + * @param boolean $include_last_iterator |
|
797 | 803 | */ |
798 | 804 | function generate_block_data_ref($blockname, $include_last_iterator, $defop = false) |
799 | 805 | { |
@@ -832,6 +838,7 @@ discard block |
||
832 | 838 | /** |
833 | 839 | * Write compiled file to cache directory |
834 | 840 | * @access private |
841 | + * @param string $data |
|
835 | 842 | */ |
836 | 843 | function compile_write($handle, $data) |
837 | 844 | { |
@@ -857,6 +864,7 @@ discard block |
||
857 | 864 | /** |
858 | 865 | * Minifies template w/i PHP code by removing extra spaces |
859 | 866 | * @access private |
867 | + * @return string |
|
860 | 868 | */ |
861 | 869 | function minify($html) |
862 | 870 | { |
@@ -46,17 +46,17 @@ discard block |
||
46 | 46 | var $block_else_level = array(); |
47 | 47 | |
48 | 48 | /** |
49 | - * constuctor |
|
50 | - */ |
|
49 | + * constuctor |
|
50 | + */ |
|
51 | 51 | function template_compile(&$template) |
52 | 52 | { |
53 | 53 | $this->template = &$template; |
54 | 54 | } |
55 | 55 | |
56 | 56 | /** |
57 | - * Load template source from file |
|
58 | - * @access private |
|
59 | - */ |
|
57 | + * Load template source from file |
|
58 | + * @access private |
|
59 | + */ |
|
60 | 60 | function _tpl_load_file($handle, $store_in_db = false) |
61 | 61 | { |
62 | 62 | // Try and open template for read |
@@ -99,10 +99,10 @@ discard block |
||
99 | 99 | } |
100 | 100 | |
101 | 101 | /** |
102 | - * Remove any PHP tags that do not belong, these regular expressions are derived from |
|
103 | - * the ones that exist in zend_language_scanner.l |
|
104 | - * @access private |
|
105 | - */ |
|
102 | + * Remove any PHP tags that do not belong, these regular expressions are derived from |
|
103 | + * the ones that exist in zend_language_scanner.l |
|
104 | + * @access private |
|
105 | + */ |
|
106 | 106 | function remove_php_tags(&$code) |
107 | 107 | { |
108 | 108 | // This matches the information gathered from the internal PHP lexer |
@@ -116,9 +116,9 @@ discard block |
||
116 | 116 | } |
117 | 117 | |
118 | 118 | /** |
119 | - * The all seeing all doing compile method. Parts are inspired by or directly from Smarty |
|
120 | - * @access private |
|
121 | - */ |
|
119 | + * The all seeing all doing compile method. Parts are inspired by or directly from Smarty |
|
120 | + * @access private |
|
121 | + */ |
|
122 | 122 | function compile($code, $no_echo = false, $echo_var = '') |
123 | 123 | { |
124 | 124 | global $config; |
@@ -289,9 +289,9 @@ discard block |
||
289 | 289 | } |
290 | 290 | |
291 | 291 | /** |
292 | - * Compile variables |
|
293 | - * @access private |
|
294 | - */ |
|
292 | + * Compile variables |
|
293 | + * @access private |
|
294 | + */ |
|
295 | 295 | function compile_var_tags(&$text_blocks) |
296 | 296 | { |
297 | 297 | // including $lang variable |
@@ -354,9 +354,9 @@ discard block |
||
354 | 354 | } |
355 | 355 | |
356 | 356 | /** |
357 | - * Compile blocks |
|
358 | - * @access private |
|
359 | - */ |
|
357 | + * Compile blocks |
|
358 | + * @access private |
|
359 | + */ |
|
360 | 360 | function compile_tag_block($tag_args) |
361 | 361 | { |
362 | 362 | $no_nesting = false; |
@@ -442,14 +442,14 @@ discard block |
||
442 | 442 | $tag_template_php .= 'if ($_' . $tag_args . '_count) {'; |
443 | 443 | |
444 | 444 | /** |
445 | - * The following uses foreach for iteration instead of a for loop, foreach is faster but requires PHP to make a copy of the contents of the array which uses more memory |
|
446 | - * <code> |
|
447 | - * if (!$offset) |
|
448 | - * { |
|
449 | - * $tag_template_php .= 'foreach (' . $varref . ' as $_' . $tag_args . '_i => $_' . $tag_args . '_val){'; |
|
450 | - * } |
|
451 | - * </code> |
|
452 | - */ |
|
445 | + * The following uses foreach for iteration instead of a for loop, foreach is faster but requires PHP to make a copy of the contents of the array which uses more memory |
|
446 | + * <code> |
|
447 | + * if (!$offset) |
|
448 | + * { |
|
449 | + * $tag_template_php .= 'foreach (' . $varref . ' as $_' . $tag_args . '_i => $_' . $tag_args . '_val){'; |
|
450 | + * } |
|
451 | + * </code> |
|
452 | + */ |
|
453 | 453 | |
454 | 454 | $tag_template_php .= 'for ($_' . $tag_args . '_i = ' . $loop_start . '; $_' . $tag_args . '_i < ' . $loop_end . '; ++$_' . $tag_args . '_i){'; |
455 | 455 | // $tag_template_php .= '$this->_block_counter["'. $tag_args . '"] = $_' . $tag_args . '_i;'; |
@@ -460,10 +460,10 @@ discard block |
||
460 | 460 | } |
461 | 461 | |
462 | 462 | /** |
463 | - * Compile IF tags - much of this is from Smarty with |
|
464 | - * some adaptions for our block level methods |
|
465 | - * @access private |
|
466 | - */ |
|
463 | + * Compile IF tags - much of this is from Smarty with |
|
464 | + * some adaptions for our block level methods |
|
465 | + * @access private |
|
466 | + */ |
|
467 | 467 | function compile_tag_if($tag_args, $elseif) |
468 | 468 | { |
469 | 469 | // Tokenize args for 'if' tag. |
@@ -618,9 +618,9 @@ discard block |
||
618 | 618 | } |
619 | 619 | |
620 | 620 | /** |
621 | - * Compile DEFINE tags |
|
622 | - * @access private |
|
623 | - */ |
|
621 | + * Compile DEFINE tags |
|
622 | + * @access private |
|
623 | + */ |
|
624 | 624 | function compile_tag_define($tag_args, $op) |
625 | 625 | { |
626 | 626 | preg_match('#^((?:[a-z0-9\-_]+\.)+)?\$(?=[A-Z])([A-Z0-9_\-]*)(?: = (\'?)([^\']*)(\'?))?$#', $tag_args, $match); |
@@ -671,9 +671,9 @@ discard block |
||
671 | 671 | } |
672 | 672 | |
673 | 673 | /** |
674 | - * Compile INCLUDE tag |
|
675 | - * @access private |
|
676 | - */ |
|
674 | + * Compile INCLUDE tag |
|
675 | + * @access private |
|
676 | + */ |
|
677 | 677 | function compile_tag_include($tag_args) |
678 | 678 | { |
679 | 679 | // Process dynamic includes |
@@ -686,19 +686,19 @@ discard block |
||
686 | 686 | } |
687 | 687 | |
688 | 688 | /** |
689 | - * Compile INCLUDE_PHP tag |
|
690 | - * @access private |
|
691 | - */ |
|
689 | + * Compile INCLUDE_PHP tag |
|
690 | + * @access private |
|
691 | + */ |
|
692 | 692 | function compile_tag_include_php($tag_args) |
693 | 693 | { |
694 | 694 | return "\$this->_php_include('$tag_args');"; |
695 | 695 | } |
696 | 696 | |
697 | 697 | /** |
698 | - * parse expression |
|
699 | - * This is from Smarty |
|
700 | - * @access private |
|
701 | - */ |
|
698 | + * parse expression |
|
699 | + * This is from Smarty |
|
700 | + * @access private |
|
701 | + */ |
|
702 | 702 | function _parse_is_expr($is_arg, $tokens) |
703 | 703 | { |
704 | 704 | $expr_end = 0; |
@@ -763,13 +763,13 @@ discard block |
||
763 | 763 | } |
764 | 764 | |
765 | 765 | /** |
766 | - * Generates a reference to the given variable inside the given (possibly nested) |
|
767 | - * block namespace. This is a string of the form: |
|
768 | - * ' . $this->_tpldata['parent'][$_parent_i]['$child1'][$_child1_i]['$child2'][$_child2_i]...['varname'] . ' |
|
769 | - * It's ready to be inserted into an "echo" line in one of the templates. |
|
770 | - * NOTE: expects a trailing "." on the namespace. |
|
771 | - * @access private |
|
772 | - */ |
|
766 | + * Generates a reference to the given variable inside the given (possibly nested) |
|
767 | + * block namespace. This is a string of the form: |
|
768 | + * ' . $this->_tpldata['parent'][$_parent_i]['$child1'][$_child1_i]['$child2'][$_child2_i]...['varname'] . ' |
|
769 | + * It's ready to be inserted into an "echo" line in one of the templates. |
|
770 | + * NOTE: expects a trailing "." on the namespace. |
|
771 | + * @access private |
|
772 | + */ |
|
773 | 773 | function generate_block_varref($namespace, $varname, $echo = true, $defop = false) |
774 | 774 | { |
775 | 775 | // Strip the trailing period. |
@@ -787,14 +787,14 @@ discard block |
||
787 | 787 | } |
788 | 788 | |
789 | 789 | /** |
790 | - * Generates a reference to the array of data values for the given |
|
791 | - * (possibly nested) block namespace. This is a string of the form: |
|
792 | - * $this->_tpldata['parent'][$_parent_i]['$child1'][$_child1_i]['$child2'][$_child2_i]...['$childN'] |
|
793 | - * |
|
794 | - * If $include_last_iterator is true, then [$_childN_i] will be appended to the form shown above. |
|
795 | - * NOTE: does not expect a trailing "." on the blockname. |
|
796 | - * @access private |
|
797 | - */ |
|
790 | + * Generates a reference to the array of data values for the given |
|
791 | + * (possibly nested) block namespace. This is a string of the form: |
|
792 | + * $this->_tpldata['parent'][$_parent_i]['$child1'][$_child1_i]['$child2'][$_child2_i]...['$childN'] |
|
793 | + * |
|
794 | + * If $include_last_iterator is true, then [$_childN_i] will be appended to the form shown above. |
|
795 | + * NOTE: does not expect a trailing "." on the blockname. |
|
796 | + * @access private |
|
797 | + */ |
|
798 | 798 | function generate_block_data_ref($blockname, $include_last_iterator, $defop = false) |
799 | 799 | { |
800 | 800 | // Get an array of the blocks involved. |
@@ -830,9 +830,9 @@ discard block |
||
830 | 830 | } |
831 | 831 | |
832 | 832 | /** |
833 | - * Write compiled file to cache directory |
|
834 | - * @access private |
|
835 | - */ |
|
833 | + * Write compiled file to cache directory |
|
834 | + * @access private |
|
835 | + */ |
|
836 | 836 | function compile_write($handle, $data) |
837 | 837 | { |
838 | 838 | $filename = $this->template->cachepath . str_replace('/', '.', $this->template->filename[$handle]) . DOT_PHP_EX; |
@@ -855,9 +855,9 @@ discard block |
||
855 | 855 | |
856 | 856 | // Gorlum's minifier BOF |
857 | 857 | /** |
858 | - * Minifies template w/i PHP code by removing extra spaces |
|
859 | - * @access private |
|
860 | - */ |
|
858 | + * Minifies template w/i PHP code by removing extra spaces |
|
859 | + * @access private |
|
860 | + */ |
|
861 | 861 | function minify($html) |
862 | 862 | { |
863 | 863 | global $config; |
@@ -173,6 +173,9 @@ |
||
173 | 173 | } |
174 | 174 | |
175 | 175 | |
176 | + /** |
|
177 | + * @param string $path |
|
178 | + */ |
|
176 | 179 | protected function lng_try_filepath($path, $file_path_relative) { |
177 | 180 | $file_path = SN_ROOT_PHYSICAL . ($path && file_exists(SN_ROOT_PHYSICAL . $path . $file_path_relative) ? $path : '') . $file_path_relative; |
178 | 181 | return file_exists($file_path) ? $file_path : false; |
@@ -702,7 +702,7 @@ discard block |
||
702 | 702 | * Рассчёт бонуса ММ |
703 | 703 | * |
704 | 704 | * @param $dark_matter |
705 | - * @param bool|true $direct |
|
705 | + * @param boolean $direct |
|
706 | 706 | * @param bool|false $return_bonus |
707 | 707 | * |
708 | 708 | * @return float|int |
@@ -738,6 +738,12 @@ discard block |
||
738 | 738 | |
739 | 739 | // Дополнительная ре-трансляция адреса, если в каком-то случае платежная система ожидает нелогичный ответ |
740 | 740 | // Пример: иксолла при неправильно заданном пользователе в ордере ожидает НЕПРАВИЛЬНЫЙ_ОРДЕР, а не НЕПРАВИЛЬНЫЙ_ПОЛЬЗОВАТЕЛЬ |
741 | + |
|
742 | + /** |
|
743 | + * @param integer $error_code |
|
744 | + * |
|
745 | + * @return integer|null |
|
746 | + */ |
|
741 | 747 | function retranslate_error($error_code, $options = array()) { |
742 | 748 | return isset($options['retranslate_error'][$error_code]) ? $options['retranslate_error'][$error_code] : $error_code; |
743 | 749 | } |