@@ -55,8 +55,8 @@ |
||
55 | 55 | } |
56 | 56 | |
57 | 57 | /** |
58 | - * @param int|string $recordId |
|
59 | - * @param mixed|array $fieldList |
|
58 | + * @param integer $recordId |
|
59 | + * @param string[] $fieldList |
|
60 | 60 | * @param bool $forUpdate |
61 | 61 | * |
62 | 62 | * @return array|null |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | * @return array|null |
84 | 84 | */ |
85 | 85 | public static function getRecordById($recordId, $fieldList = '*', $forUpdate = false) { |
86 | - return static::getRecord(array(static::$_idField . '=' . $recordId), $fieldList, $forUpdate); |
|
86 | + return static::getRecord(array(static::$_idField.'='.$recordId), $fieldList, $forUpdate); |
|
87 | 87 | } |
88 | 88 | |
89 | 89 | /** |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | * @return array|bool|mysqli_result|null |
93 | 93 | */ |
94 | 94 | protected static function execute($statement) { |
95 | - return static::$dbStatic->execute((string)$statement); |
|
95 | + return static::$dbStatic->execute((string) $statement); |
|
96 | 96 | } |
97 | 97 | |
98 | 98 | /** |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | $query = static::execute( |
121 | 121 | static::buildSelectAll() |
122 | 122 | ->fields(static::$_idField) |
123 | - ->where(array("`" . static::$_idField . "` IN (" . implode(',', $idList) . ")")) |
|
123 | + ->where(array("`".static::$_idField."` IN (".implode(',', $idList).")")) |
|
124 | 124 | ); |
125 | 125 | } |
126 | 126 | |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | $result = array(); |
141 | 141 | if (!empty($idList)) { |
142 | 142 | $query = static::queryExistsIdInList($idList); |
143 | - while($row = db_fetch($query)) { |
|
143 | + while ($row = db_fetch($query)) { |
|
144 | 144 | $result[] = $row[static::$_idField]; |
145 | 145 | } |
146 | 146 | } |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | define('INSTALL', false); |
11 | 11 | define('IN_ADMIN', true); |
12 | 12 | |
13 | -require('../common.' . substr(strrchr(__FILE__, '.'), 1)); |
|
13 | +require('../common.'.substr(strrchr(__FILE__, '.'), 1)); |
|
14 | 14 | |
15 | 15 | if ($user['authlevel'] < 3) { |
16 | 16 | AdminMessage(classLocale::$lang['adm_err_denied']); |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | foreach ($value as $interval_data) { |
112 | 112 | print("<tr>"); |
113 | 113 | print("<td>{$user_id}</td><td>{$user_record['username']}</td><td>{$interval_data[0]}</td><td>{$interval_data[1]}</td><td>{$interval_data[2]}</td>"); |
114 | - print("<td>" . date(FMT_DATE_TIME_SQL, $user_record['onlinetime']) . "</td>"); |
|
114 | + print("<td>".date(FMT_DATE_TIME_SQL, $user_record['onlinetime'])."</td>"); |
|
115 | 115 | print("</tr>"); |
116 | 116 | } |
117 | 117 | } |
@@ -45,8 +45,8 @@ |
||
45 | 45 | */ |
46 | 46 | protected function quoteStringAsFieldByRef(&$string) { |
47 | 47 | $string = $this->stringEscape($string); |
48 | - if ((string)$string && '*' != $string) { |
|
49 | - $string = '`' . $string . '`'; |
|
48 | + if ((string) $string && '*' != $string) { |
|
49 | + $string = '`'.$string.'`'; |
|
50 | 50 | } |
51 | 51 | } |
52 | 52 |
@@ -23,7 +23,7 @@ |
||
23 | 23 | * @param mixed &$value |
24 | 24 | */ |
25 | 25 | public static function makeArrayRef(&$value, $index = 0) { |
26 | - if(!is_array($value)) { |
|
26 | + if (!is_array($value)) { |
|
27 | 27 | $value = array($index => $value); |
28 | 28 | } |
29 | 29 | } |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | /** |
125 | 125 | * @param string $query |
126 | 126 | * |
127 | - * @return mixed|string |
|
127 | + * @return string |
|
128 | 128 | */ |
129 | 129 | public function replaceTablePlaceholders($query) { |
130 | 130 | $sql = $query; |
@@ -138,8 +138,8 @@ discard block |
||
138 | 138 | } |
139 | 139 | |
140 | 140 | /** |
141 | - * @param $query |
|
142 | - * @param $fetch |
|
141 | + * @param string $query |
|
142 | + * @param boolean $fetch |
|
143 | 143 | */ |
144 | 144 | protected function logQuery($query, $fetch) { |
145 | 145 | if (!classSupernova::$config->debug) { |
@@ -257,6 +257,10 @@ discard block |
||
257 | 257 | |
258 | 258 | |
259 | 259 | // TODO Заменить это на новый логгер |
260 | + |
|
261 | + /** |
|
262 | + * @param string $query |
|
263 | + */ |
|
260 | 264 | protected function security_watch_user_queries($query) { |
261 | 265 | global $user; |
262 | 266 | |
@@ -280,6 +284,9 @@ discard block |
||
280 | 284 | } |
281 | 285 | |
282 | 286 | |
287 | + /** |
|
288 | + * @param string $query |
|
289 | + */ |
|
283 | 290 | public function security_query_check_bad_words($query, $skip_query_check = false) { |
284 | 291 | if ($skip_query_check) { |
285 | 292 | return; |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | public function load_db_settings() { |
66 | 66 | $dbsettings = array(); |
67 | 67 | |
68 | - require(SN_ROOT_PHYSICAL . "config" . DOT_PHP_EX); |
|
68 | + require(SN_ROOT_PHYSICAL."config".DOT_PHP_EX); |
|
69 | 69 | |
70 | 70 | $this->dbsettings = $dbsettings; |
71 | 71 | } |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | $sql = $query; |
131 | 131 | if (strpos($sql, '{{') !== false) { |
132 | 132 | foreach ($this->table_list as $tableName) { |
133 | - $sql = str_replace("{{{$tableName}}}", $this->db_prefix . $tableName, $sql); |
|
133 | + $sql = str_replace("{{{$tableName}}}", $this->db_prefix.$tableName, $sql); |
|
134 | 134 | } |
135 | 135 | } |
136 | 136 | |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | $arr = debug_backtrace(); |
151 | 151 | $file = end(explode('/', $arr[0]['file'])); |
152 | 152 | $line = $arr[0]['line']; |
153 | - classSupernova::$debug->add("<tr><th>Query {$this->queryCount}: </th><th>$query</th><th>{$file} @ {$line}</th><th> </th><th> " . ($fetch ? '+' : ' ') . " </th></tr>"); |
|
153 | + classSupernova::$debug->add("<tr><th>Query {$this->queryCount}: </th><th>$query</th><th>{$file} @ {$line}</th><th> </th><th> ".($fetch ? '+' : ' ')." </th></tr>"); |
|
154 | 154 | } |
155 | 155 | |
156 | 156 | |
@@ -252,13 +252,13 @@ discard block |
||
252 | 252 | ->execute() |
253 | 253 | ->getResult(); |
254 | 254 | } else { |
255 | - $queryResult = $this->db_sql_query($stringQuery . DbSqlHelper::quoteComment($queryTrace)); |
|
255 | + $queryResult = $this->db_sql_query($stringQuery.DbSqlHelper::quoteComment($queryTrace)); |
|
256 | 256 | } |
257 | 257 | if (!$queryResult) { |
258 | 258 | throw new Exception(); |
259 | 259 | } |
260 | 260 | } catch (Exception $e) { |
261 | - classSupernova::$debug->error($this->db_error() . "<br />{$query}<br />", 'SQL Error'); |
|
261 | + classSupernova::$debug->error($this->db_error()."<br />{$query}<br />", 'SQL Error'); |
|
262 | 262 | } |
263 | 263 | |
264 | 264 | if ($fetch) { |
@@ -283,10 +283,10 @@ discard block |
||
283 | 283 | $this->isWatching = true; |
284 | 284 | $msg = "\$query = \"{$query}\"\n\r"; |
285 | 285 | if (!empty($_POST)) { |
286 | - $msg .= "\n\r" . dump($_POST, '$_POST'); |
|
286 | + $msg .= "\n\r".dump($_POST, '$_POST'); |
|
287 | 287 | } |
288 | 288 | if (!empty($_GET)) { |
289 | - $msg .= "\n\r" . dump($_GET, '$_GET'); |
|
289 | + $msg .= "\n\r".dump($_GET, '$_GET'); |
|
290 | 290 | } |
291 | 291 | classSupernova::$debug->warning($msg, "Watching user {$user['id']}", 399, array('base_dump' => true)); |
292 | 292 | $this->isWatching = false; |
@@ -312,37 +312,37 @@ discard block |
||
312 | 312 | case stripos($query, 'RPG_POINTS') != false && stripos(trim($query), 'UPDATE ') === 0 && !$dm_change_legit: |
313 | 313 | case stripos($query, 'METAMATTER') != false && stripos(trim($query), 'UPDATE ') === 0 && !$mm_change_legit: |
314 | 314 | case stripos($query, 'AUTHLEVEL') != false && $user['authlevel'] < 3 && stripos($query, 'SELECT') !== 0: |
315 | - $report = "Hacking attempt (" . date("d.m.Y H:i:s") . " - [" . time() . "]):\n"; |
|
315 | + $report = "Hacking attempt (".date("d.m.Y H:i:s")." - [".time()."]):\n"; |
|
316 | 316 | $report .= ">Database Inforamation\n"; |
317 | - $report .= "\tID - " . $user['id'] . "\n"; |
|
318 | - $report .= "\tUser - " . $user['username'] . "\n"; |
|
319 | - $report .= "\tAuth level - " . $user['authlevel'] . "\n"; |
|
320 | - $report .= "\tAdmin Notes - " . $user['adminNotes'] . "\n"; |
|
321 | - $report .= "\tCurrent Planet - " . $user['current_planet'] . "\n"; |
|
322 | - $report .= "\tUser IP - " . $user['user_lastip'] . "\n"; |
|
323 | - $report .= "\tUser IP at Reg - " . $user['ip_at_reg'] . "\n"; |
|
324 | - $report .= "\tUser Agent- " . $_SERVER['HTTP_USER_AGENT'] . "\n"; |
|
325 | - $report .= "\tCurrent Page - " . $user['current_page'] . "\n"; |
|
326 | - $report .= "\tRegister Time - " . $user['register_time'] . "\n"; |
|
317 | + $report .= "\tID - ".$user['id']."\n"; |
|
318 | + $report .= "\tUser - ".$user['username']."\n"; |
|
319 | + $report .= "\tAuth level - ".$user['authlevel']."\n"; |
|
320 | + $report .= "\tAdmin Notes - ".$user['adminNotes']."\n"; |
|
321 | + $report .= "\tCurrent Planet - ".$user['current_planet']."\n"; |
|
322 | + $report .= "\tUser IP - ".$user['user_lastip']."\n"; |
|
323 | + $report .= "\tUser IP at Reg - ".$user['ip_at_reg']."\n"; |
|
324 | + $report .= "\tUser Agent- ".$_SERVER['HTTP_USER_AGENT']."\n"; |
|
325 | + $report .= "\tCurrent Page - ".$user['current_page']."\n"; |
|
326 | + $report .= "\tRegister Time - ".$user['register_time']."\n"; |
|
327 | 327 | $report .= "\n"; |
328 | 328 | |
329 | 329 | $report .= ">Query Information\n"; |
330 | - $report .= "\tQuery - " . $query . "\n"; |
|
330 | + $report .= "\tQuery - ".$query."\n"; |
|
331 | 331 | $report .= "\n"; |
332 | 332 | |
333 | 333 | $report .= ">\$_SERVER Information\n"; |
334 | - $report .= "\tIP - " . $_SERVER['REMOTE_ADDR'] . "\n"; |
|
335 | - $report .= "\tHost Name - " . $_SERVER['HTTP_HOST'] . "\n"; |
|
336 | - $report .= "\tUser Agent - " . $_SERVER['HTTP_USER_AGENT'] . "\n"; |
|
337 | - $report .= "\tRequest Method - " . $_SERVER['REQUEST_METHOD'] . "\n"; |
|
338 | - $report .= "\tCame From - " . $_SERVER['HTTP_REFERER'] . "\n"; |
|
339 | - $report .= "\tPage is - " . $_SERVER['SCRIPT_NAME'] . "\n"; |
|
340 | - $report .= "\tUses Port - " . $_SERVER['REMOTE_PORT'] . "\n"; |
|
341 | - $report .= "\tServer Protocol - " . $_SERVER['SERVER_PROTOCOL'] . "\n"; |
|
334 | + $report .= "\tIP - ".$_SERVER['REMOTE_ADDR']."\n"; |
|
335 | + $report .= "\tHost Name - ".$_SERVER['HTTP_HOST']."\n"; |
|
336 | + $report .= "\tUser Agent - ".$_SERVER['HTTP_USER_AGENT']."\n"; |
|
337 | + $report .= "\tRequest Method - ".$_SERVER['REQUEST_METHOD']."\n"; |
|
338 | + $report .= "\tCame From - ".$_SERVER['HTTP_REFERER']."\n"; |
|
339 | + $report .= "\tPage is - ".$_SERVER['SCRIPT_NAME']."\n"; |
|
340 | + $report .= "\tUses Port - ".$_SERVER['REMOTE_PORT']."\n"; |
|
341 | + $report .= "\tServer Protocol - ".$_SERVER['SERVER_PROTOCOL']."\n"; |
|
342 | 342 | |
343 | 343 | $report .= "\n--------------------------------------------------------------------------------------------------\n"; |
344 | 344 | |
345 | - $fp = fopen(SN_ROOT_PHYSICAL . 'badqrys.txt', 'a'); |
|
345 | + $fp = fopen(SN_ROOT_PHYSICAL.'badqrys.txt', 'a'); |
|
346 | 346 | fwrite($fp, $report); |
347 | 347 | fclose($fp); |
348 | 348 |
@@ -59,6 +59,9 @@ discard block |
||
59 | 59 | } |
60 | 60 | |
61 | 61 | |
62 | + /** |
|
63 | + * @param string $query |
|
64 | + */ |
|
62 | 65 | public function setQuery($query) { |
63 | 66 | $this->query = $query; |
64 | 67 | |
@@ -72,6 +75,9 @@ discard block |
||
72 | 75 | } |
73 | 76 | } |
74 | 77 | |
78 | + /** |
|
79 | + * @param string $comment |
|
80 | + */ |
|
75 | 81 | public function commentAdd($comment) { |
76 | 82 | if (empty($this->values[static::COMMENT_PLACEHOLDER])) { |
77 | 83 | $this->query .= ' ' . static::COMMENT_PLACEHOLDER; |
@@ -149,7 +149,7 @@ |
||
149 | 149 | // Removing comment placeholder from statement |
150 | 150 | $this->queryPrepared = str_replace(static::COMMENT_PLACEHOLDER, DbSqlHelper::quoteComment($this->comment), $this->queryPrepared); |
151 | 151 | // Removing comment value from values list |
152 | - $this->paramsPrepared = array_filter($this->paramsPrepared, function ($value) { return $value != DbSqlPrepare::COMMENT_PLACEHOLDER; }); |
|
152 | + $this->paramsPrepared = array_filter($this->paramsPrepared, function($value) { return $value != DbSqlPrepare::COMMENT_PLACEHOLDER; }); |
|
153 | 153 | // TODO - Add comment value directly to statement |
154 | 154 | } |
155 | 155 |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | * @return $this |
32 | 32 | */ |
33 | 33 | public function literal($value) { |
34 | - $this->literal = (string)$value; |
|
34 | + $this->literal = (string) $value; |
|
35 | 35 | |
36 | 36 | return $this; |
37 | 37 | } |
@@ -64,10 +64,10 @@ discard block |
||
64 | 64 | $alias = $this->aliasFromField($functionName, $field); |
65 | 65 | } |
66 | 66 | |
67 | - $this->literal = strtoupper($functionName) . '(' . $this->quoteField($field) . ')'; |
|
67 | + $this->literal = strtoupper($functionName).'('.$this->quoteField($field).')'; |
|
68 | 68 | |
69 | 69 | if (self::SQL_LITERAL_ALIAS_NONE !== $alias && !empty($alias)) { |
70 | - $this->literal .= ' AS `' . $alias . '`'; |
|
70 | + $this->literal .= ' AS `'.$alias.'`'; |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | return $this; |
@@ -124,10 +124,10 @@ discard block |
||
124 | 124 | $alias = $this->aliasFromField($functionName, $field); |
125 | 125 | } |
126 | 126 | |
127 | - $this->literal = $this->quoteField($field) . ' IS NULL'; |
|
127 | + $this->literal = $this->quoteField($field).' IS NULL'; |
|
128 | 128 | |
129 | 129 | if (!empty($alias)) { |
130 | - $this->literal .= ' AS `' . $alias . '`'; |
|
130 | + $this->literal .= ' AS `'.$alias.'`'; |
|
131 | 131 | } |
132 | 132 | |
133 | 133 | return $this; |
@@ -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 | */ |
@@ -108,11 +108,11 @@ discard block |
||
108 | 108 | $arguments = func_get_args(); |
109 | 109 | |
110 | 110 | // Special case - call method with array of fields |
111 | - if(count($arguments) == 1 && is_array($arguments[0])) { |
|
111 | + if (count($arguments) == 1 && is_array($arguments[0])) { |
|
112 | 112 | $arguments = array_shift($arguments); |
113 | 113 | } |
114 | 114 | |
115 | - foreach($arguments as $arg) { |
|
115 | + foreach ($arguments as $arg) { |
|
116 | 116 | $this->fields[] = $arg; |
117 | 117 | } |
118 | 118 | |
@@ -293,9 +293,9 @@ discard block |
||
293 | 293 | } |
294 | 294 | |
295 | 295 | protected function compileFrom() { |
296 | - $this->_compiledQuery[] = 'FROM `{{' . $this->escapeString($this->table) . '}}`'; |
|
296 | + $this->_compiledQuery[] = 'FROM `{{'.$this->escapeString($this->table).'}}`'; |
|
297 | 297 | if (!empty($this->alias)) { |
298 | - $this->_compiledQuery[] = 'AS `' . $this->escapeString($this->alias) . '`'; |
|
298 | + $this->_compiledQuery[] = 'AS `'.$this->escapeString($this->alias).'`'; |
|
299 | 299 | } |
300 | 300 | } |
301 | 301 | |
@@ -305,29 +305,29 @@ discard block |
||
305 | 305 | |
306 | 306 | protected function compileWhere() { |
307 | 307 | // TODO - fields should be escaped !! |
308 | - !empty($this->where) ? $this->_compiledQuery[] = 'WHERE ' . implode(' AND ', $this->where) : false; |
|
308 | + !empty($this->where) ? $this->_compiledQuery[] = 'WHERE '.implode(' AND ', $this->where) : false; |
|
309 | 309 | } |
310 | 310 | |
311 | 311 | protected function compileGroupBy() { |
312 | 312 | // TODO - fields should be escaped !! |
313 | 313 | // !empty($this->groupBy) ? $this->_compiledQuery[] = 'GROUP BY ' . implode(',', $this->arrayEscape($this->groupBy)) : false; |
314 | - !empty($this->groupBy) ? $this->_compiledQuery[] = 'GROUP BY ' . $this->selectFieldsToString($this->groupBy) : false; |
|
314 | + !empty($this->groupBy) ? $this->_compiledQuery[] = 'GROUP BY '.$this->selectFieldsToString($this->groupBy) : false; |
|
315 | 315 | } |
316 | 316 | |
317 | 317 | protected function compileOrderBy() { |
318 | 318 | // TODO - fields should be escaped !! |
319 | - !empty($this->orderBy) ? $this->_compiledQuery[] = 'ORDER BY ' . implode(',', $this->arrayEscape($this->orderBy)) : false; |
|
319 | + !empty($this->orderBy) ? $this->_compiledQuery[] = 'ORDER BY '.implode(',', $this->arrayEscape($this->orderBy)) : false; |
|
320 | 320 | } |
321 | 321 | |
322 | 322 | protected function compileHaving() { |
323 | 323 | // TODO - fields should be escaped !! |
324 | - !empty($this->having) ? $this->_compiledQuery[] = 'HAVING ' . implode(' AND ', $this->having) : false; |
|
324 | + !empty($this->having) ? $this->_compiledQuery[] = 'HAVING '.implode(' AND ', $this->having) : false; |
|
325 | 325 | } |
326 | 326 | |
327 | 327 | protected function compileLimit() { |
328 | 328 | // TODO - fields should be escaped !! |
329 | 329 | if ($limit = $this->fetchOne ? 1 : $this->limit) { |
330 | - $this->_compiledQuery[] = 'LIMIT ' . $limit . (!empty($this->offset) ? ' OFFSET ' . $this->offset : ''); |
|
330 | + $this->_compiledQuery[] = 'LIMIT '.$limit.(!empty($this->offset) ? ' OFFSET '.$this->offset : ''); |
|
331 | 331 | } |
332 | 332 | } |
333 | 333 | |
@@ -371,14 +371,14 @@ discard block |
||
371 | 371 | */ |
372 | 372 | protected function processField($fieldName) { |
373 | 373 | if (is_bool($fieldName)) { |
374 | - $result = (string)intval($fieldName); |
|
374 | + $result = (string) intval($fieldName); |
|
375 | 375 | } elseif (is_numeric($fieldName)) { |
376 | 376 | $result = $fieldName; |
377 | 377 | } elseif (is_null($fieldName)) { |
378 | 378 | $result = 'NULL'; |
379 | 379 | } else { |
380 | 380 | // Field has other type - string or should be convertible to string |
381 | - $result = (string)$fieldName; |
|
381 | + $result = (string) $fieldName; |
|
382 | 382 | if (!$fieldName instanceof DbSqlLiteral) { |
383 | 383 | $result = $this->quoteField($fieldName); |
384 | 384 | } |
@@ -119,10 +119,17 @@ |
||
119 | 119 | return $this; |
120 | 120 | } |
121 | 121 | |
122 | + /** |
|
123 | + * @param string $functionName |
|
124 | + * @param string $alias |
|
125 | + */ |
|
122 | 126 | public function fieldSingleFunction($functionName, $field = '*', $alias = DbSqlLiteral::SQL_LITERAL_ALIAS_NONE) { |
123 | 127 | return $this->field(DbSqlLiteral::build($this->db)->buildSingleArgument($functionName, $field, $alias)); |
124 | 128 | } |
125 | 129 | |
130 | + /** |
|
131 | + * @param string $alias |
|
132 | + */ |
|
126 | 133 | public function fieldCount($field = '*', $alias = DbSqlLiteral::SQL_LITERAL_ALIAS_NONE) { |
127 | 134 | return $this->field(DbSqlLiteral::build($this->db)->count($field, $alias)); |
128 | 135 | } |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | static::buildSelectAll() |
55 | 55 | ->fields('id') |
56 | 56 | ->where(array( |
57 | - "`user_as_ally` IS NULL AND `user_bot` = " . USER_BOT_PLAYER . " FOR UPDATE;" |
|
57 | + "`user_as_ally` IS NULL AND `user_bot` = ".USER_BOT_PLAYER." FOR UPDATE;" |
|
58 | 58 | )) |
59 | 59 | ); |
60 | 60 | |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | } |
226 | 226 | |
227 | 227 | public static function db_user_list_set_mass_mail(&$owners_list, $set) { |
228 | - return classSupernova::db_upd_record_list(LOC_USER, !empty($owners_list) ? '`id` IN (' . implode(',', $owners_list) . ');' : '', $set); |
|
228 | + return classSupernova::db_upd_record_list(LOC_USER, !empty($owners_list) ? '`id` IN ('.implode(',', $owners_list).');' : '', $set); |
|
229 | 229 | } |
230 | 230 | |
231 | 231 | public static function db_user_list_set_by_ally_and_rank($ally_id, $ally_rank_id, $set) { |
@@ -131,6 +131,9 @@ discard block |
||
131 | 131 | ); |
132 | 132 | } |
133 | 133 | |
134 | + /** |
|
135 | + * @param integer $config_user_birthday_range |
|
136 | + */ |
|
134 | 137 | public static function db_user_list_to_celebrate($config_user_birthday_range) { |
135 | 138 | // $query = "SELECT |
136 | 139 | // `id`, `username`, `user_birthday`, `user_birthday_celebrated`, |
@@ -208,6 +211,9 @@ discard block |
||
208 | 211 | } |
209 | 212 | |
210 | 213 | |
214 | + /** |
|
215 | + * @param string $username_unsafe |
|
216 | + */ |
|
211 | 217 | public static function db_user_by_username($username_unsafe, $for_update = false, $fields = '*', $player = null, $like = false) { |
212 | 218 | return classSupernova::db_get_user_by_username($username_unsafe, $for_update, $fields, $player, $like); |
213 | 219 | } |
@@ -220,6 +226,9 @@ discard block |
||
220 | 226 | return classSupernova::db_upd_record_by_id(LOC_USER, $user_id, $set); |
221 | 227 | } |
222 | 228 | |
229 | + /** |
|
230 | + * @param boolean $player |
|
231 | + */ |
|
223 | 232 | public static function db_user_by_id($user_id_unsafe, $for_update = false, $fields = '*', $player = null) { |
224 | 233 | return classSupernova::db_get_user_by_id($user_id_unsafe, $for_update, $fields, $player); |
225 | 234 | } |