@@ -13,10 +13,10 @@ |
||
| 13 | 13 | $tpl->name = 'usertops'; |
| 14 | 14 | $tpl->menuitem = MNU_CACHES_USERTOPS; |
| 15 | 15 | |
| 16 | -$userId = (int) isset($_REQUEST['userid']) ? $_REQUEST['userid']: 0; |
|
| 16 | +$userId = (int)isset($_REQUEST['userid']) ? $_REQUEST['userid'] : 0; |
|
| 17 | 17 | $ocOnly = isset($_REQUEST['oconly']) && $_REQUEST['oconly']; |
| 18 | 18 | |
| 19 | -$sUsername = $connection->fetchColumn('SELECT `username` FROM `user` WHERE `user_id` = :userId',['userId' => $userId]); |
|
| 19 | +$sUsername = $connection->fetchColumn('SELECT `username` FROM `user` WHERE `user_id` = :userId', ['userId' => $userId]); |
|
| 20 | 20 | if ($sUsername == null) { |
| 21 | 21 | $tpl->error(ERROR_USER_NOT_EXISTS); |
| 22 | 22 | } |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | $jpegQuality = 80; |
| 12 | 12 | $fontFile = __DIR__ . '/resource2/' . $opt['template']['style'] . '/fonts/dejavu/ttf/DejaVuSans.ttf'; |
| 13 | 13 | |
| 14 | -$userId = isset($_REQUEST['userid']) ? (int) $_REQUEST['userid'] : 0; |
|
| 14 | +$userId = isset($_REQUEST['userid']) ? (int)$_REQUEST['userid'] : 0; |
|
| 15 | 15 | $lang = isset($_REQUEST['lang']) ? mb_strtoupper($_REQUEST['lang']) : $opt['template']['locale']; |
| 16 | 16 | |
| 17 | 17 | if (!isset($opt['locale'][$lang])) { |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | $connection = AppKernel::Container()->get(Connection::class); |
| 23 | 23 | |
| 24 | 24 | $fileName = __DIR__ . '/images/statpics/statpic' . $userId . $lang . '.jpg'; |
| 25 | -$userStatisticPicture = (int) $connection->createQueryBuilder() |
|
| 25 | +$userStatisticPicture = (int)$connection->createQueryBuilder() |
|
| 26 | 26 | ->select('COUNT(*)') |
| 27 | 27 | ->from('user_statpic') |
| 28 | 28 | ->where('user_id = :userId') |
@@ -48,9 +48,9 @@ discard block |
||
| 48 | 48 | |
| 49 | 49 | if (is_array($userData)) { |
| 50 | 50 | $username = $userData['username']; |
| 51 | - $found = (int) $userData['found']; |
|
| 52 | - $hidden = (int) $userData['hidden']; |
|
| 53 | - $logo = (int) $userData['statpic_logo']; |
|
| 51 | + $found = (int)$userData['found']; |
|
| 52 | + $hidden = (int)$userData['hidden']; |
|
| 53 | + $logo = (int)$userData['statpic_logo']; |
|
| 54 | 54 | $logoText = $userData['statpic_text']; |
| 55 | 55 | |
| 56 | 56 | $textCounterStatistic = $translate->t('Finds: %1 Hidden: %2', '', '', 0, '', 0, $lang); |
@@ -24,10 +24,10 @@ discard block |
||
| 24 | 24 | /** @var Connection $connection */ |
| 25 | 25 | $connection = AppKernel::Container()->get(Connection::class); |
| 26 | 26 | |
| 27 | -$id = (int) isset($_REQUEST['id']) ? $_REQUEST['id'] : 0; |
|
| 28 | -$rId = (int) isset($_REQUEST['rid']) ? $_REQUEST['rid'] : 0; |
|
| 29 | -$cacheId = (int) isset($_REQUEST['cacheid']) ? $_REQUEST['cacheid'] : 0; |
|
| 30 | -$ownerId = (int) isset($_REQUEST['ownerid']) ? $_REQUEST['ownerid'] : 0; |
|
| 27 | +$id = (int)isset($_REQUEST['id']) ? $_REQUEST['id'] : 0; |
|
| 28 | +$rId = (int)isset($_REQUEST['rid']) ? $_REQUEST['rid'] : 0; |
|
| 29 | +$cacheId = (int)isset($_REQUEST['cacheid']) ? $_REQUEST['cacheid'] : 0; |
|
| 30 | +$ownerId = (int)isset($_REQUEST['ownerid']) ? $_REQUEST['ownerid'] : 0; |
|
| 31 | 31 | |
| 32 | 32 | $reportData = $connection |
| 33 | 33 | ->fetchAssoc( |
@@ -37,8 +37,8 @@ discard block |
||
| 37 | 37 | ['id' => $rId] |
| 38 | 38 | ); |
| 39 | 39 | |
| 40 | -$reporterId = (int) $reportData['userid']; |
|
| 41 | -$adminId = (int) $reportData['adminid']; |
|
| 40 | +$reporterId = (int)$reportData['userid']; |
|
| 41 | +$adminId = (int)$reportData['adminid']; |
|
| 42 | 42 | $age = $reportData['age']; |
| 43 | 43 | |
| 44 | 44 | if (isset($_REQUEST['savecomment'])) { |
@@ -15,13 +15,13 @@ discard block |
||
| 15 | 15 | |
| 16 | 16 | use OcLegacy\Util\PasswordCrypt; |
| 17 | 17 | |
| 18 | -define('LOGIN_UNKNOWN_ERROR', -1); // unknown error occurred |
|
| 19 | -define('LOGIN_OK', 0); // login succeeded |
|
| 20 | -define('LOGIN_BADUSERPW', 1); // bad username or password |
|
| 21 | -define('LOGIN_TOOMUCHLOGINS', 2); // too many logins in short time |
|
| 22 | -define('LOGIN_USERNOTACTIVE', 3); // the userAccount locked |
|
| 18 | +define('LOGIN_UNKNOWN_ERROR', -1); // unknown error occurred |
|
| 19 | +define('LOGIN_OK', 0); // login succeeded |
|
| 20 | +define('LOGIN_BADUSERPW', 1); // bad username or password |
|
| 21 | +define('LOGIN_TOOMUCHLOGINS', 2); // too many logins in short time |
|
| 22 | +define('LOGIN_USERNOTACTIVE', 3); // the userAccount locked |
|
| 23 | 23 | define('LOGIN_EMPTY_USERPASSWORD', 4); // given username/password was empty |
| 24 | -define('LOGIN_LOGOUT_OK', 5); // logout was successful |
|
| 24 | +define('LOGIN_LOGOUT_OK', 5); // logout was successful |
|
| 25 | 25 | |
| 26 | 26 | // login times in seconds |
| 27 | 27 | define('LOGIN_TIME', 60 * 60); |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | |
| 70 | 70 | // TODO good input evaluation |
| 71 | 71 | if ($cookie->is_set('userid') && $cookie->is_set('username')) { |
| 72 | - $this->userid = (int) $cookie->get('userid'); |
|
| 72 | + $this->userid = (int)$cookie->get('userid'); |
|
| 73 | 73 | $this->username = $cookie->get('username'); |
| 74 | 74 | $this->permanent = (($cookie->get('permanent') + 0) == 1); |
| 75 | 75 | $this->lastlogin = $cookie->get('lastlogin'); |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | public function pStoreCookie() |
| 101 | 101 | { |
| 102 | 102 | global $cookie; |
| 103 | - $cookie->set('userid', (int) $this->userid); |
|
| 103 | + $cookie->set('userid', (int)$this->userid); |
|
| 104 | 104 | $cookie->set('username', $this->username); |
| 105 | 105 | $cookie->set('permanent', ($this->permanent === true ? 1 : 0)); |
| 106 | 106 | $cookie->set('lastlogin', $this->lastlogin); |
@@ -297,7 +297,7 @@ discard block |
||
| 297 | 297 | $rUser['user_id'], |
| 298 | 298 | ($permanent != false ? 1 : 0) |
| 299 | 299 | ); |
| 300 | - $this->userid = (int) $rUser['user_id']; |
|
| 300 | + $this->userid = (int)$rUser['user_id']; |
|
| 301 | 301 | $this->username = $rUser['username']; |
| 302 | 302 | $this->permanent = $permanent; |
| 303 | 303 | $this->lastlogin = date('Y-m-d H:i:s'); |
@@ -343,7 +343,7 @@ discard block |
||
| 343 | 343 | ); |
| 344 | 344 | if ($rUser = sql_fetch_assoc($rs)) { |
| 345 | 345 | $this->username = $rUser['username']; |
| 346 | - $this->userid = (int) $rUser['user_id']; |
|
| 346 | + $this->userid = (int)$rUser['user_id']; |
|
| 347 | 347 | $this->admin = $rUser['admin']; |
| 348 | 348 | $this->verified = true; |
| 349 | 349 | sqlf("UPDATE `user` SET `user`.`last_login`=NOW() WHERE `user`.`user_id`='&1'", $this->userid); |
@@ -31,7 +31,7 @@ |
||
| 31 | 31 | ORDER BY username' |
| 32 | 32 | ); |
| 33 | 33 | |
| 34 | -foreach($admins as &$admin) { |
|
| 34 | +foreach ($admins as &$admin) { |
|
| 35 | 35 | $rights = []; |
| 36 | 36 | |
| 37 | 37 | if ($admin['admin'] & ADMIN_TRANSLATE) { |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | { |
| 26 | 26 | $this->setViolations($violations); |
| 27 | 27 | |
| 28 | - parent::__construct((string) $this); |
|
| 28 | + parent::__construct((string)$this); |
|
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | /** |
@@ -49,8 +49,8 @@ discard block |
||
| 49 | 49 | $fieldNoteService = AppKernel::Container()->get(FieldNoteService::class); |
| 50 | 50 | |
| 51 | 51 | $fieldNote = $fieldNoteService->fetchOneBy([ |
| 52 | - 'id' => (int) $_GET['fieldnoteid'], |
|
| 53 | - 'user_id' => (int) $user->getUserId() |
|
| 52 | + 'id' => (int)$_GET['fieldnoteid'], |
|
| 53 | + 'user_id' => (int)$user->getUserId() |
|
| 54 | 54 | ]); |
| 55 | 55 | |
| 56 | 56 | if ($fieldNote !== null) { |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | // get log text editor mode (from form or from userprofile) |
| 172 | 172 | // 1 = text; 2 = HTML; 3 = tinyMCE |
| 173 | 173 | if (isset($_POST['descMode'])) { |
| 174 | - $descMode = $_POST['descMode'] + 0; // Ocprop: 2 |
|
| 174 | + $descMode = $_POST['descMode'] + 0; // Ocprop: 2 |
|
| 175 | 175 | if (($descMode < 1) || ($descMode > 3)) { |
| 176 | 176 | $descMode = 3; |
| 177 | 177 | } |
@@ -313,7 +313,7 @@ discard block |
||
| 313 | 313 | if (isset($_REQUEST['fieldnoteid']) && $_REQUEST['fieldnoteid']) { |
| 314 | 314 | sql( |
| 315 | 315 | 'DELETE FROM field_note WHERE `id` = &1 AND `user_id` = &2', |
| 316 | - (int) $_REQUEST['fieldnoteid'], |
|
| 316 | + (int)$_REQUEST['fieldnoteid'], |
|
| 317 | 317 | $user->getUserId() |
| 318 | 318 | ); |
| 319 | 319 | |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | ); |
| 38 | 38 | if ($r) { |
| 39 | 39 | if ($r['object_type'] == 1) { |
| 40 | - $check = (int) $connection |
|
| 40 | + $check = (int)$connection |
|
| 41 | 41 | ->fetchColumn( |
| 42 | 42 | 'SELECT COUNT(*) |
| 43 | 43 | FROM `cache_logs` |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | |
| 63 | 63 | } |
| 64 | 64 | } elseif ($r['object_type'] == 2) { |
| 65 | - $check = (int) $connection |
|
| 65 | + $check = (int)$connection |
|
| 66 | 66 | ->fetchColumn( |
| 67 | 67 | 'SELECT COUNT(*) |
| 68 | 68 | FROM `caches` |
@@ -142,22 +142,22 @@ |
||
| 142 | 142 | |
| 143 | 143 | $tpl->assign('showdetails', true); |
| 144 | 144 | |
| 145 | - $r['hidden'] = (int) $connection->fetchColumn( |
|
| 145 | + $r['hidden'] = (int)$connection->fetchColumn( |
|
| 146 | 146 | 'SELECT COUNT(*) FROM `caches` WHERE `user_id`=:userId', [':userId' => $r['user_id']] |
| 147 | 147 | ); |
| 148 | - $r['hidden_active'] = (int) $connection->fetchColumn( |
|
| 148 | + $r['hidden_active'] = (int)$connection->fetchColumn( |
|
| 149 | 149 | 'SELECT COUNT(*) FROM `caches` WHERE `user_id`= :userId AND `status`=1', |
| 150 | 150 | [':userId' => $r['user_id']] |
| 151 | 151 | ); |
| 152 | - $r['logentries'] = (int) $connection->fetchColumn( |
|
| 152 | + $r['logentries'] = (int)$connection->fetchColumn( |
|
| 153 | 153 | 'SELECT COUNT(*) FROM `cache_logs` WHERE `user_id`= :userId', |
| 154 | 154 | [':userId' => $r['user_id']] |
| 155 | 155 | ); |
| 156 | - $r['deleted_logentries'] = (int) $connection->fetchColumn( |
|
| 156 | + $r['deleted_logentries'] = (int)$connection->fetchColumn( |
|
| 157 | 157 | 'SELECT COUNT(*) FROM `cache_logs_archived` WHERE `user_id`= :userId', |
| 158 | 158 | [':userId' => $r['user_id']] |
| 159 | 159 | ); |
| 160 | - $r['reports'] = (int) $connection->fetchColumn( |
|
| 160 | + $r['reports'] = (int)$connection->fetchColumn( |
|
| 161 | 161 | 'SELECT COUNT(*) FROM `cache_reports` WHERE `userid`= :userId', |
| 162 | 162 | [':userId' => $r['user_id']] |
| 163 | 163 | ); |