@@ -210,10 +210,10 @@ |
||
210 | 210 | { |
211 | 211 | // Ensure there's a trailing slash |
212 | 212 | $system_path = strtr( |
213 | - rtrim($system_path, '/\\'), |
|
214 | - '/\\', |
|
215 | - DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR |
|
216 | - ).DIRECTORY_SEPARATOR; |
|
213 | + rtrim($system_path, '/\\'), |
|
214 | + '/\\', |
|
215 | + DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR |
|
216 | + ).DIRECTORY_SEPARATOR; |
|
217 | 217 | } |
218 | 218 | |
219 | 219 | // Is the system path correct? |
@@ -63,8 +63,7 @@ discard block |
||
63 | 63 | * Different environments will require different levels of error reporting. |
64 | 64 | * By default development will show errors but testing and live will hide them. |
65 | 65 | */ |
66 | -switch (ENVIRONMENT) |
|
67 | -{ |
|
66 | +switch (ENVIRONMENT) { |
|
68 | 67 | case 'development': |
69 | 68 | error_reporting(-1); |
70 | 69 | ini_set('display_errors', 1); |
@@ -79,12 +78,9 @@ discard block |
||
79 | 78 | case 'testing': |
80 | 79 | case 'production': |
81 | 80 | ini_set('display_errors', 0); |
82 | - if (version_compare(PHP_VERSION, '5.3', '>=')) |
|
83 | - { |
|
81 | + if (version_compare(PHP_VERSION, '5.3', '>=')) { |
|
84 | 82 | error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT & ~E_USER_NOTICE & ~E_USER_DEPRECATED); |
85 | - } |
|
86 | - else |
|
87 | - { |
|
83 | + } else { |
|
88 | 84 | error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_USER_NOTICE); |
89 | 85 | } |
90 | 86 | break; |
@@ -197,17 +193,13 @@ discard block |
||
197 | 193 | */ |
198 | 194 | |
199 | 195 | // Set the current directory correctly for CLI requests |
200 | -if (defined('STDIN')) |
|
201 | -{ |
|
196 | +if (defined('STDIN')) { |
|
202 | 197 | chdir(dirname(__FILE__)); |
203 | 198 | } |
204 | 199 | |
205 | -if (($_temp = realpath($system_path)) !== FALSE) |
|
206 | -{ |
|
200 | +if (($_temp = realpath($system_path)) !== FALSE) { |
|
207 | 201 | $system_path = $_temp.DIRECTORY_SEPARATOR; |
208 | -} |
|
209 | -else |
|
210 | -{ |
|
202 | +} else { |
|
211 | 203 | // Ensure there's a trailing slash |
212 | 204 | $system_path = strtr( |
213 | 205 | rtrim($system_path, '/\\'), |
@@ -217,8 +209,7 @@ discard block |
||
217 | 209 | } |
218 | 210 | |
219 | 211 | // Is the system path correct? |
220 | -if ( ! is_dir($system_path)) |
|
221 | -{ |
|
212 | +if ( ! is_dir($system_path)) { |
|
222 | 213 | header('HTTP/1.1 503 Service Unavailable.', TRUE, 503); |
223 | 214 | echo 'Your system folder path does not appear to be set correctly. Please open the following file and correct this: '.pathinfo(__FILE__, PATHINFO_BASENAME); |
224 | 215 | exit(3); // EXIT_CONFIG |
@@ -242,31 +233,23 @@ discard block |
||
242 | 233 | define('SYSDIR', basename(BASEPATH)); |
243 | 234 | |
244 | 235 | // The path to the "application" directory |
245 | -if (is_dir($application_folder)) |
|
246 | -{ |
|
247 | - if (($_temp = realpath($application_folder)) !== FALSE) |
|
248 | - { |
|
236 | +if (is_dir($application_folder)) { |
|
237 | + if (($_temp = realpath($application_folder)) !== FALSE) { |
|
249 | 238 | $application_folder = $_temp; |
250 | - } |
|
251 | - else |
|
252 | - { |
|
239 | + } else { |
|
253 | 240 | $application_folder = strtr( |
254 | 241 | rtrim($application_folder, '/\\'), |
255 | 242 | '/\\', |
256 | 243 | DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR |
257 | 244 | ); |
258 | 245 | } |
259 | -} |
|
260 | -elseif (is_dir(BASEPATH.$application_folder.DIRECTORY_SEPARATOR)) |
|
261 | -{ |
|
246 | +} elseif (is_dir(BASEPATH.$application_folder.DIRECTORY_SEPARATOR)) { |
|
262 | 247 | $application_folder = BASEPATH.strtr( |
263 | 248 | trim($application_folder, '/\\'), |
264 | 249 | '/\\', |
265 | 250 | DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR |
266 | 251 | ); |
267 | -} |
|
268 | -else |
|
269 | -{ |
|
252 | +} else { |
|
270 | 253 | header('HTTP/1.1 503 Service Unavailable.', TRUE, 503); |
271 | 254 | echo 'Your application folder path does not appear to be set correctly. Please open the following file and correct this: '.SELF; |
272 | 255 | exit(3); // EXIT_CONFIG |
@@ -275,35 +258,25 @@ discard block |
||
275 | 258 | define('APPPATH', $application_folder.DIRECTORY_SEPARATOR); |
276 | 259 | |
277 | 260 | // The path to the "views" directory |
278 | -if ( ! isset($view_folder[0]) && is_dir(APPPATH.'views'.DIRECTORY_SEPARATOR)) |
|
279 | -{ |
|
261 | +if ( ! isset($view_folder[0]) && is_dir(APPPATH.'views'.DIRECTORY_SEPARATOR)) { |
|
280 | 262 | $view_folder = APPPATH.'views'; |
281 | -} |
|
282 | -elseif (is_dir($view_folder)) |
|
283 | -{ |
|
284 | - if (($_temp = realpath($view_folder)) !== FALSE) |
|
285 | - { |
|
263 | +} elseif (is_dir($view_folder)) { |
|
264 | + if (($_temp = realpath($view_folder)) !== FALSE) { |
|
286 | 265 | $view_folder = $_temp; |
287 | - } |
|
288 | - else |
|
289 | - { |
|
266 | + } else { |
|
290 | 267 | $view_folder = strtr( |
291 | 268 | rtrim($view_folder, '/\\'), |
292 | 269 | '/\\', |
293 | 270 | DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR |
294 | 271 | ); |
295 | 272 | } |
296 | -} |
|
297 | -elseif (is_dir(APPPATH.$view_folder.DIRECTORY_SEPARATOR)) |
|
298 | -{ |
|
273 | +} elseif (is_dir(APPPATH.$view_folder.DIRECTORY_SEPARATOR)) { |
|
299 | 274 | $view_folder = APPPATH.strtr( |
300 | 275 | trim($view_folder, '/\\'), |
301 | 276 | '/\\', |
302 | 277 | DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR |
303 | 278 | ); |
304 | -} |
|
305 | -else |
|
306 | -{ |
|
279 | +} else { |
|
307 | 280 | header('HTTP/1.1 503 Service Unavailable.', TRUE, 503); |
308 | 281 | echo 'Your view folder path does not appear to be set correctly. Please open the following file and correct this: '.SELF; |
309 | 282 | exit(3); // EXIT_CONFIG |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | // Maintenance Mode |
40 | 40 | define('MAINTENANCE', FALSE); |
41 | 41 | if(MAINTENANCE && PHP_SAPI !== 'cli') { |
42 | - require_once __DIR__ . DIRECTORY_SEPARATOR . '../application/views/common/maintenance.php'; ## call view |
|
42 | + require_once __DIR__.DIRECTORY_SEPARATOR.'../application/views/common/maintenance.php'; ## call view |
|
43 | 43 | exit(); |
44 | 44 | } |
45 | 45 | |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | * Different environments will require different levels of error reporting. |
82 | 82 | * By default development will show errors but testing and live will hide them. |
83 | 83 | */ |
84 | -switch (ENVIRONMENT) |
|
84 | +switch(ENVIRONMENT) |
|
85 | 85 | { |
86 | 86 | case 'development': |
87 | 87 | error_reporting(-1); |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | case 'testing': |
95 | 95 | case 'production': |
96 | 96 | ini_set('display_errors', 0); |
97 | - if (version_compare(PHP_VERSION, '5.3', '>=')) |
|
97 | + if(version_compare(PHP_VERSION, '5.3', '>=')) |
|
98 | 98 | { |
99 | 99 | error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT & ~E_USER_NOTICE & ~E_USER_DEPRECATED); |
100 | 100 | } |
@@ -212,12 +212,12 @@ discard block |
||
212 | 212 | */ |
213 | 213 | |
214 | 214 | // Set the current directory correctly for CLI requests |
215 | -if (defined('STDIN')) |
|
215 | +if(defined('STDIN')) |
|
216 | 216 | { |
217 | 217 | chdir(dirname(__FILE__)); |
218 | 218 | } |
219 | 219 | |
220 | -if (($_temp = realpath($system_path)) !== FALSE) |
|
220 | +if(($_temp = realpath($system_path)) !== FALSE) |
|
221 | 221 | { |
222 | 222 | $system_path = $_temp.DIRECTORY_SEPARATOR; |
223 | 223 | } |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | } |
233 | 233 | |
234 | 234 | // Is the system path correct? |
235 | -if ( ! is_dir($system_path)) |
|
235 | +if(!is_dir($system_path)) |
|
236 | 236 | { |
237 | 237 | header('HTTP/1.1 503 Service Unavailable.', TRUE, 503); |
238 | 238 | echo 'Your system folder path does not appear to be set correctly. Please open the following file and correct this: '.pathinfo(__FILE__, PATHINFO_BASENAME); |
@@ -257,9 +257,9 @@ discard block |
||
257 | 257 | define('SYSDIR', basename(BASEPATH)); |
258 | 258 | |
259 | 259 | // The path to the "application" directory |
260 | -if (is_dir($application_folder)) |
|
260 | +if(is_dir($application_folder)) |
|
261 | 261 | { |
262 | - if (($_temp = realpath($application_folder)) !== FALSE) |
|
262 | + if(($_temp = realpath($application_folder)) !== FALSE) |
|
263 | 263 | { |
264 | 264 | $application_folder = $_temp; |
265 | 265 | } |
@@ -272,7 +272,7 @@ discard block |
||
272 | 272 | ); |
273 | 273 | } |
274 | 274 | } |
275 | -elseif (is_dir(BASEPATH.$application_folder.DIRECTORY_SEPARATOR)) |
|
275 | +elseif(is_dir(BASEPATH.$application_folder.DIRECTORY_SEPARATOR)) |
|
276 | 276 | { |
277 | 277 | $application_folder = BASEPATH.strtr( |
278 | 278 | trim($application_folder, '/\\'), |
@@ -290,13 +290,13 @@ discard block |
||
290 | 290 | define('APPPATH', $application_folder.DIRECTORY_SEPARATOR); |
291 | 291 | |
292 | 292 | // The path to the "views" directory |
293 | -if ( ! isset($view_folder[0]) && is_dir(APPPATH.'views'.DIRECTORY_SEPARATOR)) |
|
293 | +if(!isset($view_folder[0]) && is_dir(APPPATH.'views'.DIRECTORY_SEPARATOR)) |
|
294 | 294 | { |
295 | 295 | $view_folder = APPPATH.'views'; |
296 | 296 | } |
297 | -elseif (is_dir($view_folder)) |
|
297 | +elseif(is_dir($view_folder)) |
|
298 | 298 | { |
299 | - if (($_temp = realpath($view_folder)) !== FALSE) |
|
299 | + if(($_temp = realpath($view_folder)) !== FALSE) |
|
300 | 300 | { |
301 | 301 | $view_folder = $_temp; |
302 | 302 | } |
@@ -309,7 +309,7 @@ discard block |
||
309 | 309 | ); |
310 | 310 | } |
311 | 311 | } |
312 | -elseif (is_dir(APPPATH.$view_folder.DIRECTORY_SEPARATOR)) |
|
312 | +elseif(is_dir(APPPATH.$view_folder.DIRECTORY_SEPARATOR)) |
|
313 | 313 | { |
314 | 314 | $view_folder = APPPATH.strtr( |
315 | 315 | trim($view_folder, '/\\'), |
@@ -1,4 +1,4 @@ |
||
1 | -<?php defined('BASEPATH') OR exit('No direct script access allowed'); |
|
1 | +<?php defined('BASEPATH') or exit('No direct script access allowed'); |
|
2 | 2 | |
3 | 3 | class Forgot_Password extends No_Auth_Controller { |
4 | 4 | public function __construct() { |
@@ -16,12 +16,12 @@ discard block |
||
16 | 16 | $this->header_data['page'] = 'forgot_password'; |
17 | 17 | |
18 | 18 | //TODO (RESEARCH): Should we allow username here too? |
19 | - $this->form_validation->set_rules('email', 'Email', 'required|valid_email', array( |
|
19 | + $this->form_validation->set_rules('email', 'Email', 'required|valid_email', array( |
|
20 | 20 | 'required' => 'Please enter your email.', |
21 | 21 | 'valid_email' => 'The email your entered is invalid.' |
22 | 22 | )); |
23 | 23 | |
24 | - if ($this->form_validation->run() === TRUE) { |
|
24 | + if($this->form_validation->run() === TRUE) { |
|
25 | 25 | //form is valid |
26 | 26 | |
27 | 27 | $identity = $this->ion_auth->where('email', $this->input->post('email'))->users()->row(); |
@@ -67,20 +67,20 @@ discard block |
||
67 | 67 | $this->header_data['page'] = 'reset-password'; |
68 | 68 | |
69 | 69 | $user = $this->ion_auth->forgotten_password_check($code); |
70 | - if ($user) { |
|
70 | + if($user) { |
|
71 | 71 | //code is valid, show reset form or process reset |
72 | 72 | $min_password_length = $this->config->item('min_password_length', 'ion_auth'); |
73 | 73 | $max_password_length = $this->config->item('max_password_length', 'ion_auth'); |
74 | - $this->form_validation->set_rules('new_password', 'Password', 'required|min_length['.$min_password_length.']|max_length['.$max_password_length.']'); |
|
74 | + $this->form_validation->set_rules('new_password', 'Password', 'required|min_length['.$min_password_length.']|max_length['.$max_password_length.']'); |
|
75 | 75 | $this->form_validation->set_rules('new_password_confirm', 'Password Confirm', 'required|matches[new_password]'); |
76 | 76 | |
77 | - if ($this->form_validation->run() === TRUE) { |
|
77 | + if($this->form_validation->run() === TRUE) { |
|
78 | 78 | //form is valid, process the password reset request |
79 | 79 | |
80 | 80 | $identity = $user->{'email'}; |
81 | 81 | $change = $this->ion_auth->reset_password($identity, $this->input->post('new_password')); |
82 | 82 | |
83 | - if ($change) { |
|
83 | + if($change) { |
|
84 | 84 | //password changed successfully, redirect to login |
85 | 85 | redirect('user/login', 'refresh'); |
86 | 86 | } else { //@codeCoverageIgnore |
@@ -83,11 +83,13 @@ |
||
83 | 83 | if ($change) { |
84 | 84 | //password changed successfully, redirect to login |
85 | 85 | redirect('user/login', 'refresh'); |
86 | - } else { //@codeCoverageIgnore |
|
86 | + } else { |
|
87 | +//@codeCoverageIgnore |
|
87 | 88 | //password changed unsuccessfully, refresh page. |
88 | 89 | redirect('user/reset_password/'.$code, 'refresh'); |
89 | 90 | } |
90 | - } else { //@codeCoverageIgnore |
|
91 | + } else { |
|
92 | +//@codeCoverageIgnore |
|
91 | 93 | //form is invalid OR first-time viewing page |
92 | 94 | $this->body_data['reset_code'] = $code; |
93 | 95 | $this->body_data['form_password'] = array( |
@@ -1,4 +1,4 @@ |
||
1 | -<?php defined('BASEPATH') OR exit('No direct script access allowed'); |
|
1 | +<?php defined('BASEPATH') or exit('No direct script access allowed'); |
|
2 | 2 | |
3 | 3 | class Login extends No_Auth_Controller { |
4 | 4 | public function __construct() { |
@@ -13,17 +13,17 @@ discard block |
||
13 | 13 | $this->header_data['title'] = 'Login'; |
14 | 14 | $this->header_data['page'] = 'login'; |
15 | 15 | |
16 | - $this->form_validation->set_rules('identity', 'Identity', 'required|max_length[254]', array( |
|
16 | + $this->form_validation->set_rules('identity', 'Identity', 'required|max_length[254]', array( |
|
17 | 17 | 'required' => 'Please enter your username or email.', |
18 | 18 | 'max_length' => 'Invalid username.' |
19 | 19 | |
20 | 20 | )); |
21 | - $this->form_validation->set_rules('password', 'Password', 'required|max_length[64]', array( |
|
21 | + $this->form_validation->set_rules('password', 'Password', 'required|max_length[64]', array( |
|
22 | 22 | 'required' => 'Please enter your password.', |
23 | 23 | 'max_length' => 'Invalid password.' |
24 | 24 | )); |
25 | 25 | |
26 | - if ($isValid = ($this->form_validation->run() === TRUE)) { |
|
26 | + if($isValid = ($this->form_validation->run() === TRUE)) { |
|
27 | 27 | //form is valid |
28 | 28 | |
29 | 29 | //check if identity is email, if not then attempt to use grab from DB |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | |
66 | 66 | //login wasn't valid, failed, or this is a fresh login attempt |
67 | 67 | if(!$isValid) { |
68 | - $this->body_data['form_create'] = array ( |
|
68 | + $this->body_data['form_create'] = array( |
|
69 | 69 | 'action' => 'user/login', |
70 | 70 | |
71 | 71 | 'role' => 'form' |
@@ -46,7 +46,8 @@ |
||
46 | 46 | $this->session->keep_flashdata('referred_from'); |
47 | 47 | if($prevURL = $this->session->flashdata('referred_from')) { |
48 | 48 | redirect($prevURL); |
49 | - } else { //@codeCoverageIgnore |
|
49 | + } else { |
|
50 | +//@codeCoverageIgnore |
|
50 | 51 | redirect('/user/dashboard', 'refresh'); |
51 | 52 | } //@codeCoverageIgnore |
52 | 53 | } else { |
@@ -1,4 +1,4 @@ |
||
1 | -<?php defined('BASEPATH') OR exit('No direct script access allowed'); |
|
1 | +<?php defined('BASEPATH') or exit('No direct script access allowed'); |
|
2 | 2 | |
3 | 3 | class Logout extends User_Controller { |
4 | 4 | //we shouldn't care if the user is logged in or not, since ion_auth will take care of things |
@@ -1,4 +1,4 @@ |
||
1 | -<?php defined('BASEPATH') OR exit('No direct script access allowed'); |
|
1 | +<?php defined('BASEPATH') or exit('No direct script access allowed'); |
|
2 | 2 | |
3 | 3 | class AdminCLI extends CLI_Controller { |
4 | 4 | public function __construct() { |
@@ -30,10 +30,10 @@ |
||
30 | 30 | * Series are only checked if they haven't been updated in 16+ hours (unless they are marked as complete, to which they are only checked once a week). |
31 | 31 | */ |
32 | 32 | public function updateSeries() { |
33 | - print 'Environment: ' . ENVIRONMENT . "\n"; |
|
33 | + print 'Environment: '.ENVIRONMENT."\n"; |
|
34 | 34 | |
35 | 35 | // hack, just incase something happens |
36 | - if (!(date("Y-m-d") > '2019-08-01')) { |
|
36 | + if(!(date("Y-m-d") > '2019-08-01')) { |
|
37 | 37 | $this->Tracker->admin->updateLatestChapters(); |
38 | 38 | } |
39 | 39 | } |
@@ -19,7 +19,7 @@ |
||
19 | 19 | |
20 | 20 | <div class="row"> |
21 | 21 | <div class="col-xs-12 col-md-12"> |
22 | - <?=form_submit($form_submit);?> |
|
22 | + <?=form_submit($form_submit); ?> |
|
23 | 23 | </div> |
24 | 24 | </div> |
25 | 25 | </form> |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -defined('BASEPATH') OR exit('No direct script access allowed'); |
|
2 | +defined('BASEPATH') or exit('No direct script access allowed'); |
|
3 | 3 | ?><!DOCTYPE html> |
4 | 4 | <html lang="en"> |
5 | 5 | <head> |
@@ -11,12 +11,12 @@ |
||
11 | 11 | <p>Filename: <?php echo $filepath; ?></p> |
12 | 12 | <p>Line Number: <?php echo $line; ?></p> |
13 | 13 | |
14 | -<?php if (defined('SHOW_DEBUG_BACKTRACE') && SHOW_DEBUG_BACKTRACE === TRUE): ?> |
|
14 | +<?php if(defined('SHOW_DEBUG_BACKTRACE') && SHOW_DEBUG_BACKTRACE === TRUE): ?> |
|
15 | 15 | |
16 | 16 | <p>Backtrace:</p> |
17 | - <?php foreach (debug_backtrace() as $error): ?> |
|
17 | + <?php foreach(debug_backtrace() as $error): ?> |
|
18 | 18 | |
19 | - <?php if (isset($error['file']) && strpos($error['file'], realpath(BASEPATH)) !== 0): ?> |
|
19 | + <?php if(isset($error['file']) && strpos($error['file'], realpath(BASEPATH)) !== 0): ?> |
|
20 | 20 | |
21 | 21 | <p style="margin-left:10px"> |
22 | 22 | File: <?php echo $error['file'] ?><br /> |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -defined('BASEPATH') OR exit('No direct script access allowed'); |
|
2 | +defined('BASEPATH') or exit('No direct script access allowed'); |
|
3 | 3 | ?> |
4 | 4 | |
5 | 5 | <div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;"> |
@@ -11,12 +11,12 @@ |
||
11 | 11 | <p>Filename: <?php echo $exception->getFile(); ?></p> |
12 | 12 | <p>Line Number: <?php echo $exception->getLine(); ?></p> |
13 | 13 | |
14 | -<?php if (defined('SHOW_DEBUG_BACKTRACE') && SHOW_DEBUG_BACKTRACE === TRUE): ?> |
|
14 | +<?php if(defined('SHOW_DEBUG_BACKTRACE') && SHOW_DEBUG_BACKTRACE === TRUE): ?> |
|
15 | 15 | |
16 | 16 | <p>Backtrace:</p> |
17 | - <?php foreach ($exception->getTrace() as $error): ?> |
|
17 | + <?php foreach($exception->getTrace() as $error): ?> |
|
18 | 18 | |
19 | - <?php if (isset($error['file']) && strpos($error['file'], realpath(BASEPATH)) !== 0): ?> |
|
19 | + <?php if(isset($error['file']) && strpos($error['file'], realpath(BASEPATH)) !== 0): ?> |
|
20 | 20 | |
21 | 21 | <p style="margin-left:10px"> |
22 | 22 | File: <?php echo $error['file']; ?><br /> |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -defined('BASEPATH') OR exit('No direct script access allowed'); |
|
2 | +defined('BASEPATH') or exit('No direct script access allowed'); |
|
3 | 3 | ?> |
4 | 4 | |
5 | 5 | <div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;"> |