@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | } |
18 | 18 | |
19 | 19 | /** |
20 | - * @param $userCountry |
|
20 | + * @param string $userCountry |
|
21 | 21 | */ |
22 | 22 | public function set_userCountry($userCountry) |
23 | 23 | { |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | * |
42 | 42 | * @param string $type type of the "new"-information, i.e. cache, event, rating, etc |
43 | 43 | * @param array $args numeric array containing the parameter for "sql_slave" |
44 | - * @return object mysql result used by smarty assign_rs |
|
44 | + * @return resource|null mysql result used by smarty assign_rs |
|
45 | 45 | */ |
46 | 46 | public function rsForSmarty($type, $args = null) |
47 | 47 | { |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | * cacheRs executes the database statements for type "cache" |
90 | 90 | * |
91 | 91 | * @param array $args numeric array containing the parameter for "sql_slave" |
92 | - * @return object mysql result used by smarty assign_rs |
|
92 | + * @return resource mysql result used by smarty assign_rs |
|
93 | 93 | */ |
94 | 94 | private function cacheRs($args = null) |
95 | 95 | { |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | * eventRs executes the database statements for type "event" |
144 | 144 | * |
145 | 145 | * @param array $args numeric array containing the parameter for "sql_slave" |
146 | - * @return object mysql result used by smarty assign_rs |
|
146 | + * @return resource mysql result used by smarty assign_rs |
|
147 | 147 | */ |
148 | 148 | private function eventRs($args = null) |
149 | 149 | { |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | * ratingRs executes the database statements for type "rating" |
216 | 216 | * |
217 | 217 | * @param array $args numeric array containing the parameter for "sql_slave" |
218 | - * @return object mysql result used by smarty assign_rs |
|
218 | + * @return resource mysql result used by smarty assign_rs |
|
219 | 219 | */ |
220 | 220 | private function ratingRs($args = null) |
221 | 221 | { |
@@ -86,7 +86,7 @@ |
||
86 | 86 | // decide if the cache is new |
87 | 87 | $dDiff = dateDiff('d', $rCache['date_created'], date('Y-m-d')); |
88 | 88 | |
89 | - $rCache['isnew'] = ($dDiff <= NEWCACHES_DAYS && (int) $rCache['type'] !== 6); |
|
89 | + $rCache['isnew'] = ($dDiff <= NEWCACHES_DAYS && (int)$rCache['type'] !== 6); |
|
90 | 90 | |
91 | 91 | // get last logs |
92 | 92 | if ($options['sort'] != 'bymylastlog' || !$login->logged_in()) { |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | $tpl->menuitem = MNU_CACHES_ADDTOLIST; |
10 | 10 | |
11 | 11 | $login->verify(); |
12 | -if ($login->userid == 0) { |
|
12 | +if ($login->userid == 0) { |
|
13 | 13 | $tpl->redirect_login(); |
14 | 14 | } |
15 | 15 | |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | $default_list = isset($_REQUEST['listid']) ? (int)$_REQUEST['listid'] : cachelist::getMyLastAddedToListId(); |
33 | 33 | |
34 | 34 | if (isset($_REQUEST['save'], $_REQUEST['listid'])) { |
35 | - $listId = (int) $_REQUEST['listid']; |
|
35 | + $listId = (int)$_REQUEST['listid']; |
|
36 | 36 | if ($listId === 0) { |
37 | 37 | $cacheList = new cachelist(ID_NEW, $login->userid); |
38 | 38 | $name_error = $cacheList->setNameAndVisibility($newListName, $newListPublic ? 2 : 0); |
@@ -14,11 +14,11 @@ discard block |
||
14 | 14 | } |
15 | 15 | |
16 | 16 | $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : 'listbyuser'; |
17 | -$cacheId = isset($_REQUEST['cacheid']) ? (int) $_REQUEST['cacheid'] : 0; |
|
17 | +$cacheId = isset($_REQUEST['cacheid']) ? (int)$_REQUEST['cacheid'] : 0; |
|
18 | 18 | $tpl->assign('action', $action); |
19 | 19 | $tpl->assign('error', ''); |
20 | 20 | if (isset($_REQUEST['cacheid'])) { |
21 | - $tpl->assign('cacheid', (int) $_REQUEST['cacheid']); |
|
21 | + $tpl->assign('cacheid', (int)$_REQUEST['cacheid']); |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | if ($action === 'listbycache') { |
@@ -26,14 +26,14 @@ discard block |
||
26 | 26 | } elseif ($action === 'add') { |
27 | 27 | $tpl->assign('action', 'listbycache'); |
28 | 28 | |
29 | - $tou = isset($_REQUEST['tou']) ? (int) $_REQUEST['tou'] : 0; |
|
30 | - $submit = isset($_REQUEST['submit']) ? (int) $_REQUEST['submit'] : 0; |
|
29 | + $tou = isset($_REQUEST['tou']) ? (int)$_REQUEST['tou'] : 0; |
|
30 | + $submit = isset($_REQUEST['submit']) ? (int)$_REQUEST['submit'] : 0; |
|
31 | 31 | |
32 | 32 | $username = isset($_REQUEST['username']) ? $_REQUEST['username'] : ''; |
33 | 33 | $tpl->assign('adoptusername', $username); |
34 | 34 | |
35 | 35 | if ($submit === 1) { |
36 | - $userId = (int) sql_value("SELECT `user_id` FROM `user` WHERE `username`='&1'", 0, $username); |
|
36 | + $userId = (int)sql_value("SELECT `user_id` FROM `user` WHERE `username`='&1'", 0, $username); |
|
37 | 37 | if ($userId === 0) { |
38 | 38 | $tpl->assign('error', 'userunknown'); |
39 | 39 | } elseif ($tou !== 1) { |
@@ -45,11 +45,11 @@ discard block |
||
45 | 45 | |
46 | 46 | listRequestsByCacheId($cacheId); |
47 | 47 | } elseif ($action === 'cancel') { |
48 | - $userId = isset($_REQUEST['userid']) ? (int) $_REQUEST['userid']: 0; |
|
48 | + $userId = isset($_REQUEST['userid']) ? (int)$_REQUEST['userid'] : 0; |
|
49 | 49 | cancelRequest($cacheId, $userId); |
50 | 50 | } elseif ($action === 'commit') { |
51 | - $submit = isset($_REQUEST['submit']) ? (int) $_REQUEST['submit'] : 0; |
|
52 | - $tou = isset($_REQUEST['tou']) ? (int) $_REQUEST['tou'] : 0; |
|
51 | + $submit = isset($_REQUEST['submit']) ? (int)$_REQUEST['submit'] : 0; |
|
52 | + $tou = isset($_REQUEST['tou']) ? (int)$_REQUEST['tou'] : 0; |
|
53 | 53 | |
54 | 54 | if ($submit === 1 && $tou === 1) { |
55 | 55 | commitRequest($cacheId); |
@@ -11,7 +11,7 @@ |
||
11 | 11 | |
12 | 12 | $cache = null; |
13 | 13 | if (isset($_REQUEST['cacheid'])) { |
14 | - $cacheId = (int) $_REQUEST['cacheid']; |
|
14 | + $cacheId = (int)$_REQUEST['cacheid']; |
|
15 | 15 | $cache = new cache($cacheId); |
16 | 16 | } else { |
17 | 17 | if (isset($_REQUEST['uuid'])) { |
@@ -162,7 +162,7 @@ |
||
162 | 162 | } |
163 | 163 | |
164 | 164 | /** |
165 | - * @param int|bool $privilege |
|
165 | + * @param integer $privilege |
|
166 | 166 | * @return bool |
167 | 167 | */ |
168 | 168 | public function hasAdminPriv($privilege = false) |
@@ -121,7 +121,7 @@ |
||
121 | 121 | // user.last_login gives the overall last login date, including OKAPI logins. |
122 | 122 | |
123 | 123 | if ($rUser = sql_fetch_assoc($rs)) { |
124 | - if ((($this->permanent == true) && (strtotime($rUser['last_login']) + LOGIN_TIME_PERMANENT / 2 < time())) || |
|
124 | + if ((($this->permanent == true) && (strtotime($rUser['last_login']) + LOGIN_TIME_PERMANENT / 2 < time())) || |
|
125 | 125 | (($this->permanent == false) && (strtotime($rUser['last_login']) + LOGIN_TIME / 2 < time())) |
126 | 126 | ) { |
127 | 127 | sql( |
@@ -162,7 +162,7 @@ |
||
162 | 162 | } |
163 | 163 | |
164 | 164 | /** |
165 | - * @param int|bool $privilege |
|
165 | + * @param integer $privilege |
|
166 | 166 | * @return bool |
167 | 167 | */ |
168 | 168 | public function hasAdminPriv($privilege = false) |
@@ -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); |
@@ -22,8 +22,8 @@ discard block |
||
22 | 22 | isset($_REQUEST['desclang']) && |
23 | 23 | !isset($_REQUEST['descid'])) { // Ocprop |
24 | 24 | |
25 | - $cache_id = $_REQUEST['cacheid']; // Ocprop |
|
26 | - $desc_lang = $_REQUEST['desclang']; // Ocprop |
|
25 | + $cache_id = $_REQUEST['cacheid']; // Ocprop |
|
26 | + $desc_lang = $_REQUEST['desclang']; // Ocprop |
|
27 | 27 | |
28 | 28 | $rs = sql("SELECT `id` FROM `cache_desc` WHERE `cache_id`='&1' AND `language`='&2'", $cache_id, $desc_lang); |
29 | 29 | if (mysql_num_rows($rs) == 1) { |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | //save to DB? |
90 | 90 | if (isset($_POST['post'])) { // Ocprop |
91 | 91 | //here we read all used information from the form if submitted |
92 | - $descMode = isset($_POST['descMode']) ? $_POST['descMode'] + 0 : 1; // Ocprop |
|
92 | + $descMode = isset($_POST['descMode']) ? $_POST['descMode'] + 0 : 1; // Ocprop |
|
93 | 93 | |
94 | 94 | // fuer alte Versionen von OCProp |
95 | 95 | if (isset($_POST['submit']) && !isset($_POST['version2'])) { |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | $oldDescMode = $descMode; |
123 | 123 | } |
124 | 124 | |
125 | - $short_desc = trim($_POST['short_desc']); // Ocprop |
|
125 | + $short_desc = trim($_POST['short_desc']); // Ocprop |
|
126 | 126 | $hint = htmlspecialchars(trim($_POST['hints']), ENT_COMPAT, 'UTF-8'); |
127 | 127 | $desclang = $_POST['desclang']; |
128 | 128 | $show_all_langs = isset($_POST['show_all_langs_value']) ? $_POST['show_all_langs_value'] : 0; |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | } |
138 | 138 | |
139 | 139 | // Text from textarea |
140 | - $desc = trim($_POST['desc']); // Ocprop |
|
140 | + $desc = trim($_POST['desc']); // Ocprop |
|
141 | 141 | |
142 | 142 | // fuer alte Versionen von OCProp |
143 | 143 | if (isset($_POST['submit']) && !isset($_POST['version2'])) { |
@@ -296,7 +296,7 @@ discard block |
||
296 | 296 | tpl_set_var('desclang', htmlspecialchars($desc_lang, ENT_COMPAT, 'UTF-8')); |
297 | 297 | tpl_set_var('desclang_name', htmlspecialchars(db_LanguageFromShort($desc_lang), ENT_COMPAT, 'UTF-8')); |
298 | 298 | tpl_set_var('cachename', htmlspecialchars($desc_record['name'], ENT_COMPAT, 'UTF-8')); |
299 | - tpl_set_var('reset', $reset); // obsolete |
|
299 | + tpl_set_var('reset', $reset); // obsolete |
|
300 | 300 | tpl_set_var('submit', $submit); |
301 | 301 | |
302 | 302 | // Text / normal HTML / HTML editor |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | if ($error == false) { |
74 | 74 | $cache_id = 0; |
75 | 75 | if (isset($_REQUEST['cacheid'])) { |
76 | - $cache_id = (int) $_REQUEST['cacheid']; |
|
76 | + $cache_id = (int)$_REQUEST['cacheid']; |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | if ($usr === false) { |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | } |
135 | 135 | |
136 | 136 | //here we read all used information from the form if submitted, otherwise from DB |
137 | - $cache_name = trim(isset($_POST['name']) ? trim($_POST['name']) : $cache_record['name']); // Ocprop |
|
137 | + $cache_name = trim(isset($_POST['name']) ? trim($_POST['name']) : $cache_record['name']); // Ocprop |
|
138 | 138 | $cache_type = isset($_POST['type']) ? $_POST['type'] : $cache_record['type']; |
139 | 139 | if (!isset($_POST['size'])) { |
140 | 140 | if ($cache_type == 4 || $cache_type == 5) { |
@@ -148,15 +148,15 @@ discard block |
||
148 | 148 | $cache_hidden_day = isset($_POST['hidden_day']) ? $_POST['hidden_day'] : date( |
149 | 149 | 'd', |
150 | 150 | strtotime($cache_record['date_hidden']) |
151 | - ); // Ocprop |
|
151 | + ); // Ocprop |
|
152 | 152 | $cache_hidden_month = isset($_POST['hidden_month']) ? $_POST['hidden_month'] : date( |
153 | 153 | 'm', |
154 | 154 | strtotime($cache_record['date_hidden']) |
155 | - ); // Ocprop |
|
155 | + ); // Ocprop |
|
156 | 156 | $cache_hidden_year = isset($_POST['hidden_year']) ? $_POST['hidden_year'] : date( |
157 | 157 | 'Y', |
158 | 158 | strtotime($cache_record['date_hidden']) |
159 | - ); // Ocprop |
|
159 | + ); // Ocprop |
|
160 | 160 | |
161 | 161 | if (is_null($cache_record['date_activate'])) { |
162 | 162 | $cache_activate_day = isset($_POST['activate_day']) ? $_POST['activate_day'] : date('d'); |
@@ -182,12 +182,12 @@ discard block |
||
182 | 182 | ); |
183 | 183 | } |
184 | 184 | |
185 | - $cache_difficulty = isset($_POST['difficulty']) ? $_POST['difficulty'] : $cache_record['difficulty']; // Ocprop |
|
186 | - $cache_terrain = isset($_POST['terrain']) ? $_POST['terrain'] : $cache_record['terrain']; // Ocprop |
|
187 | - $cache_country = isset($_POST['country']) ? $_POST['country'] : $cache_record['country']; // Ocprop |
|
185 | + $cache_difficulty = isset($_POST['difficulty']) ? $_POST['difficulty'] : $cache_record['difficulty']; // Ocprop |
|
186 | + $cache_terrain = isset($_POST['terrain']) ? $_POST['terrain'] : $cache_record['terrain']; // Ocprop |
|
187 | + $cache_country = isset($_POST['country']) ? $_POST['country'] : $cache_record['country']; // Ocprop |
|
188 | 188 | $show_all_countries = isset($_POST['show_all_countries']) ? $_POST['show_all_countries'] : 0; |
189 | 189 | $listing_modified = isset($_POST['listing_modified']) ? $_POST['listing_modified'] + 0 : 0; |
190 | - $status = isset($_POST['status']) ? $_POST['status'] : $cache_record['status']; // Ocprop |
|
190 | + $status = isset($_POST['status']) ? $_POST['status'] : $cache_record['status']; // Ocprop |
|
191 | 191 | $status_old = $cache_record['status']; |
192 | 192 | $search_time = isset($_POST['search_time']) ? trim($_POST['search_time']) : $cache_record['search_time']; |
193 | 193 | $way_length = isset($_POST['way_length']) ? trim($_POST['way_length']) : $cache_record['way_length']; |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | |
249 | 249 | $log_pw = isset($_POST['log_pw']) ? mb_substr($_POST['log_pw'], 0, 20) : $cache_record['logpw']; |
250 | 250 | // fix #4356: gc waypoints are frequently copy&pasted with leading spaces |
251 | - $wp_gc = isset($_POST['wp_gc']) ? strtoupper(trim($_POST['wp_gc'])) : $cache_record['wp_gc']; // Ocprop |
|
251 | + $wp_gc = isset($_POST['wp_gc']) ? strtoupper(trim($_POST['wp_gc'])) : $cache_record['wp_gc']; // Ocprop |
|
252 | 252 | $showlists = isset($_POST['showlists']) ? 1 : $cache_record['show_cachelists'] + 0; |
253 | 253 | $protect_old_coords = isset($_POST['protect_old_coords']) ? 1 : $cache_record['protect_old_coords'] + 0; |
254 | 254 | |
@@ -260,12 +260,12 @@ discard block |
||
260 | 260 | |
261 | 261 | if (isset($_POST['latNS'])) { |
262 | 262 | //get coords from post-form |
263 | - $coords_latNS = $_POST['latNS']; // Ocprop |
|
264 | - $coords_lonEW = $_POST['lonEW']; // Ocprop |
|
265 | - $coords_lat_h = trim($_POST['lat_h']); // Ocprop |
|
266 | - $coords_lon_h = trim($_POST['lon_h']); // Ocprop |
|
267 | - $coords_lat_min = trim($_POST['lat_min']); // Ocprop |
|
268 | - $coords_lon_min = trim($_POST['lon_min']); // Ocprop |
|
263 | + $coords_latNS = $_POST['latNS']; // Ocprop |
|
264 | + $coords_lonEW = $_POST['lonEW']; // Ocprop |
|
265 | + $coords_lat_h = trim($_POST['lat_h']); // Ocprop |
|
266 | + $coords_lon_h = trim($_POST['lon_h']); // Ocprop |
|
267 | + $coords_lat_min = trim($_POST['lat_min']); // Ocprop |
|
268 | + $coords_lon_min = trim($_POST['lon_min']); // Ocprop |
|
269 | 269 | } else { |
270 | 270 | //get coords from DB |
271 | 271 | $coords_lon = $cache_record['longitude']; |
@@ -563,7 +563,7 @@ discard block |
||
563 | 563 | $logtype = 13; |
564 | 564 | break; |
565 | 565 | default: |
566 | - $logtype = 0; // ??? |
|
566 | + $logtype = 0; // ??? |
|
567 | 567 | } |
568 | 568 | if ($logtype > 0) { |
569 | 569 | sql( |
@@ -959,8 +959,8 @@ discard block |
||
959 | 959 | . '</option>'; |
960 | 960 | } |
961 | 961 | tpl_set_var('statusoptions', $statusoptions); |
962 | - $statuschange_a_msg = mb_ereg_replace('%1', $cache_id, $status_change_a); |
|
963 | - $statuschange_msg = mb_ereg_replace('{a}', $statuschange_a_msg, $status_change); |
|
962 | + $statuschange_a_msg = mb_ereg_replace('%1', $cache_id, $status_change_a); |
|
963 | + $statuschange_msg = mb_ereg_replace('{a}', $statuschange_a_msg, $status_change); |
|
964 | 964 | tpl_set_var('statuschange', $status_old == 5 ? '' : $statuschange_msg); |
965 | 965 | |
966 | 966 | // show activation form? |
@@ -1105,7 +1105,7 @@ discard block |
||
1105 | 1105 | tpl_set_var('showlists_checked', $showlists ? 'checked="checked"' : ''); |
1106 | 1106 | tpl_set_var('protectcoords_checked', $protect_old_coords ? 'checked="checked"' : ''); |
1107 | 1107 | |
1108 | - tpl_set_var('reset', $reset); // obsolete |
|
1108 | + tpl_set_var('reset', $reset); // obsolete |
|
1109 | 1109 | tpl_set_var('submit', $submit); |
1110 | 1110 | } |
1111 | 1111 | } |