@@ -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) { |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | |
55 | 55 | if (count($where) > 0) { |
56 | 56 | foreach ($where as $column => $value) { |
57 | - $queryBuilder->andWhere($column . ' = ' . $queryBuilder->createNamedParameter($value)); |
|
57 | + $queryBuilder->andWhere($column . ' = ' . $queryBuilder->createNamedParameter($value)); |
|
58 | 58 | } |
59 | 59 | } |
60 | 60 | |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | $databaseArray |
98 | 98 | ); |
99 | 99 | |
100 | - $entity->id = (int) $this->connection->lastInsertId(); |
|
100 | + $entity->id = (int)$this->connection->lastInsertId(); |
|
101 | 101 | |
102 | 102 | return $entity; |
103 | 103 | } |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | ['id' => $entity->id] |
126 | 126 | ); |
127 | 127 | |
128 | - $entity->id = (int) $this->connection->lastInsertId(); |
|
128 | + $entity->id = (int)$this->connection->lastInsertId(); |
|
129 | 129 | |
130 | 130 | return $entity; |
131 | 131 | } |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | 'page_id' => $entity->pageId, |
170 | 170 | 'title' => $entity->title, |
171 | 171 | 'html' => $entity->html, |
172 | - 'position' => (int) $entity->position, |
|
172 | + 'position' => (int)$entity->position, |
|
173 | 173 | 'updated_at' => $entity->updatedAt->format(DateTime::ATOM), |
174 | 174 | 'active' => $entity->active |
175 | 175 | ]; |
@@ -185,13 +185,13 @@ discard block |
||
185 | 185 | public function getEntityFromDatabaseArray(array $data) |
186 | 186 | { |
187 | 187 | $entity = new BlockEntity(); |
188 | - $entity->id = (int) $data['id']; |
|
189 | - $entity->pageId = (int) $data['page_id']; |
|
190 | - $entity->title = (string) $data['title']; |
|
191 | - $entity->html = (string) $data['html']; |
|
192 | - $entity->position = (int) $data['position']; |
|
188 | + $entity->id = (int)$data['id']; |
|
189 | + $entity->pageId = (int)$data['page_id']; |
|
190 | + $entity->title = (string)$data['title']; |
|
191 | + $entity->html = (string)$data['html']; |
|
192 | + $entity->position = (int)$data['position']; |
|
193 | 193 | $entity->updatedAt = new DateTime($data['updated_at']); |
194 | - $entity->active = (bool) $data['active']; |
|
194 | + $entity->active = (bool)$data['active']; |
|
195 | 195 | |
196 | 196 | return $entity; |
197 | 197 | } |
@@ -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 | /** |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | |
86 | 86 | if (count($where) > 0) { |
87 | 87 | foreach ($where as $column => $value) { |
88 | - $queryBuilder->andWhere($column . ' = ' . $queryBuilder->createNamedParameter($value)); |
|
88 | + $queryBuilder->andWhere($column . ' = ' . $queryBuilder->createNamedParameter($value)); |
|
89 | 89 | } |
90 | 90 | } |
91 | 91 | |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | |
118 | 118 | if (count($where) > 0) { |
119 | 119 | foreach ($where as $column => $value) { |
120 | - $queryBuilder->andWhere($column . ' = ' . $queryBuilder->createNamedParameter($value)); |
|
120 | + $queryBuilder->andWhere($column . ' = ' . $queryBuilder->createNamedParameter($value)); |
|
121 | 121 | } |
122 | 122 | } |
123 | 123 | |
@@ -292,27 +292,27 @@ discard block |
||
292 | 292 | public function getEntityFromDatabaseArray(array $data) |
293 | 293 | { |
294 | 294 | $entity = new GeoCacheLogEntity(); |
295 | - $entity->id = (int) $data['id']; |
|
296 | - $entity->uuid = (string) $data['uuid']; |
|
297 | - $entity->node = (int) $data['node']; |
|
295 | + $entity->id = (int)$data['id']; |
|
296 | + $entity->uuid = (string)$data['uuid']; |
|
297 | + $entity->node = (int)$data['node']; |
|
298 | 298 | $entity->dateCreated = new DateTime($data['date_created']); |
299 | 299 | $entity->entryLastModified = new DateTime($data['entry_last_modified']); |
300 | 300 | $entity->lastModified = new DateTime($data['last_modified']); |
301 | - $entity->okapiSyncbase = (int) $data['okapi_syncbase']; |
|
301 | + $entity->okapiSyncbase = (int)$data['okapi_syncbase']; |
|
302 | 302 | $entity->logLastModified = new DateTime($data['log_last_modified']); |
303 | - $entity->cacheId = (int) $data['cache_id']; |
|
304 | - $entity->userId = (int) $data['user_id']; |
|
305 | - $entity->type = (int) $data['type']; |
|
306 | - $entity->ocTeamComment = (bool) $data['oc_team_comment']; |
|
303 | + $entity->cacheId = (int)$data['cache_id']; |
|
304 | + $entity->userId = (int)$data['user_id']; |
|
305 | + $entity->type = (int)$data['type']; |
|
306 | + $entity->ocTeamComment = (bool)$data['oc_team_comment']; |
|
307 | 307 | $entity->date = new DateTime($data['date']); |
308 | 308 | $entity->orderDate = new DateTime($data['order_date']); |
309 | - $entity->needsMaintenance = (bool) $data['needs_maintenance']; |
|
310 | - $entity->listingOutdated = (bool) $data['listing_outdated']; |
|
311 | - $entity->text = (string) $data['text']; |
|
312 | - $entity->textHtml = (bool) $data['text_html']; |
|
313 | - $entity->textHtmledit = (bool) $data['text_htmledit']; |
|
314 | - $entity->ownerNotified = (bool) $data['owner_notified']; |
|
315 | - $entity->picture = (int) $data['picture']; |
|
309 | + $entity->needsMaintenance = (bool)$data['needs_maintenance']; |
|
310 | + $entity->listingOutdated = (bool)$data['listing_outdated']; |
|
311 | + $entity->text = (string)$data['text']; |
|
312 | + $entity->textHtml = (bool)$data['text_html']; |
|
313 | + $entity->textHtmledit = (bool)$data['text_htmledit']; |
|
314 | + $entity->ownerNotified = (bool)$data['owner_notified']; |
|
315 | + $entity->picture = (int)$data['picture']; |
|
316 | 316 | |
317 | 317 | return $entity; |
318 | 318 | } |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | |
87 | 87 | if (count($where) > 0) { |
88 | 88 | foreach ($where as $column => $value) { |
89 | - $queryBuilder->andWhere($column . ' = ' . $queryBuilder->createNamedParameter($value)); |
|
89 | + $queryBuilder->andWhere($column . ' = ' . $queryBuilder->createNamedParameter($value)); |
|
90 | 90 | } |
91 | 91 | } |
92 | 92 | |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | |
119 | 119 | if (count($where) > 0) { |
120 | 120 | foreach ($where as $column => $value) { |
121 | - $queryBuilder->andWhere($column . ' = ' . $queryBuilder->createNamedParameter($value)); |
|
121 | + $queryBuilder->andWhere($column . ' = ' . $queryBuilder->createNamedParameter($value)); |
|
122 | 122 | } |
123 | 123 | } |
124 | 124 | |
@@ -310,40 +310,40 @@ discard block |
||
310 | 310 | public function getEntityFromDatabaseArray(array $data) |
311 | 311 | { |
312 | 312 | $entity = new GeoCacheEntity(); |
313 | - $entity->cacheId = (string) $data['cache_id']; |
|
314 | - $entity->uuid = (string) $data['uuid']; |
|
315 | - $entity->node = (int) $data['node']; |
|
313 | + $entity->cacheId = (string)$data['cache_id']; |
|
314 | + $entity->uuid = (string)$data['uuid']; |
|
315 | + $entity->node = (int)$data['node']; |
|
316 | 316 | $entity->dateCreated = new DateTime($data['date_created']); |
317 | - $entity->isPublishdate = (bool) $data['is_publishdate']; |
|
317 | + $entity->isPublishdate = (bool)$data['is_publishdate']; |
|
318 | 318 | $entity->lastModified = new DateTime($data['last_modified']); |
319 | - $entity->okapiSyncbase = (int) $data['okapi_syncbase']; |
|
319 | + $entity->okapiSyncbase = (int)$data['okapi_syncbase']; |
|
320 | 320 | $entity->listingLastModified = new DateTime($data['listing_last_modified']); |
321 | 321 | $entity->metaLastModified = new DateTime($data['meta_last_modified']); |
322 | - $entity->userId = (int) $data['user_id']; |
|
323 | - $entity->name = (string) $data['name']; |
|
324 | - $entity->longitude = (double) $data['longitude']; |
|
325 | - $entity->latitude = (double) $data['latitude']; |
|
326 | - $entity->type = (int) $data['type']; |
|
327 | - $entity->status = (int) $data['status']; |
|
328 | - $entity->country = (string) $data['country']; |
|
322 | + $entity->userId = (int)$data['user_id']; |
|
323 | + $entity->name = (string)$data['name']; |
|
324 | + $entity->longitude = (double)$data['longitude']; |
|
325 | + $entity->latitude = (double)$data['latitude']; |
|
326 | + $entity->type = (int)$data['type']; |
|
327 | + $entity->status = (int)$data['status']; |
|
328 | + $entity->country = (string)$data['country']; |
|
329 | 329 | $entity->dateHidden = new DateTime($data['date_hidden']); |
330 | - $entity->size = (int) $data['size']; |
|
331 | - $entity->difficulty = (int) $data['difficulty']; |
|
332 | - $entity->terrain = (int) $data['terrain']; |
|
333 | - $entity->logpw = (string) $data['logpw']; |
|
334 | - $entity->searchTime = (float) $data['search_time']; |
|
335 | - $entity->wayLength = (float) $data['way_length']; |
|
336 | - $entity->wpGc = (string) $data['wp_gc']; |
|
337 | - $entity->wpGcMaintained = (string) $data['wp_gc_maintained']; |
|
338 | - $entity->wpOc = (string) $data['wp_oc']; |
|
339 | - $entity->descLanguages = (string) $data['desc_languages']; |
|
340 | - $entity->defaultDesclang = (string) $data['default_desclang']; |
|
330 | + $entity->size = (int)$data['size']; |
|
331 | + $entity->difficulty = (int)$data['difficulty']; |
|
332 | + $entity->terrain = (int)$data['terrain']; |
|
333 | + $entity->logpw = (string)$data['logpw']; |
|
334 | + $entity->searchTime = (float)$data['search_time']; |
|
335 | + $entity->wayLength = (float)$data['way_length']; |
|
336 | + $entity->wpGc = (string)$data['wp_gc']; |
|
337 | + $entity->wpGcMaintained = (string)$data['wp_gc_maintained']; |
|
338 | + $entity->wpOc = (string)$data['wp_oc']; |
|
339 | + $entity->descLanguages = (string)$data['desc_languages']; |
|
340 | + $entity->defaultDesclang = (string)$data['default_desclang']; |
|
341 | 341 | $entity->dateActivate = new DateTime($data['date_activate']); |
342 | - $entity->needNpaRecalc = (bool) $data['need_npa_recalc']; |
|
343 | - $entity->showCachelists = (bool) $data['show_cachelists']; |
|
344 | - $entity->protectOldCoords = (bool) $data['protect_old_coords']; |
|
345 | - $entity->needsMaintenance = (bool) $data['needs_maintenance']; |
|
346 | - $entity->listingOutdated = (bool) $data['listing_outdated']; |
|
342 | + $entity->needNpaRecalc = (bool)$data['need_npa_recalc']; |
|
343 | + $entity->showCachelists = (bool)$data['show_cachelists']; |
|
344 | + $entity->protectOldCoords = (bool)$data['protect_old_coords']; |
|
345 | + $entity->needsMaintenance = (bool)$data['needs_maintenance']; |
|
346 | + $entity->listingOutdated = (bool)$data['listing_outdated']; |
|
347 | 347 | $entity->flagsLastModified = new DateTime($data['flags_last_modified']); |
348 | 348 | |
349 | 349 | return $entity; |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | ->from(self::TABLE); |
91 | 91 | |
92 | 92 | foreach ($where as $column => $value) { |
93 | - $queryBuilder->andWhere($column . ' = ' . $queryBuilder->createNamedParameter($value)); |
|
93 | + $queryBuilder->andWhere($column . ' = ' . $queryBuilder->createNamedParameter($value)); |
|
94 | 94 | } |
95 | 95 | |
96 | 96 | foreach ($order as $field => $direction) { |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | |
133 | 133 | if (count($where) > 0) { |
134 | 134 | foreach ($where as $column => $value) { |
135 | - $queryBuilder->andWhere($column . ' = ' . $queryBuilder->createNamedParameter($value)); |
|
135 | + $queryBuilder->andWhere($column . ' = ' . $queryBuilder->createNamedParameter($value)); |
|
136 | 136 | } |
137 | 137 | } |
138 | 138 | |
@@ -286,7 +286,7 @@ discard block |
||
286 | 286 | public function getEntityFromDatabaseArray(array $data) |
287 | 287 | { |
288 | 288 | $entity = new FieldNoteEntity(); |
289 | - $entity->id = (string) $data['id']; |
|
289 | + $entity->id = (string)$data['id']; |
|
290 | 290 | $entity->userId = $data['user_id']; |
291 | 291 | $entity->geocacheId = $data['geocache_id']; |
292 | 292 | $entity->type = $data['type']; |