@@ -132,7 +132,7 @@ |
||
132 | 132 | if($query->num_rows() > 0) { |
133 | 133 | //username exists, grab email |
134 | 134 | $email = $query->row('email'); |
135 | - }else{ |
|
135 | + } else { |
|
136 | 136 | //username doesn't exist, return FALSE |
137 | 137 | $email = NULL; |
138 | 138 | } |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | } |
55 | 55 | |
56 | 56 | //login wasn't valid, failed, or this is a fresh login attempt |
57 | - if(!$isValid){ |
|
57 | + if(!$isValid) { |
|
58 | 58 | //display the email validation form |
59 | 59 | $this->body_data['form_email'] = array( |
60 | 60 | 'name' => 'email', |
@@ -86,7 +86,9 @@ discard block |
||
86 | 86 | //This continued signup occurs after the user clicks the verification link in their email. |
87 | 87 | private function _continue_signup($verificationCode) : void { |
88 | 88 | //check if validation is valid, if so return email, if not redirect to signup |
89 | - if(!($email = $this->Auth->verificationCheck($verificationCode))) redirect('user/signup'); |
|
89 | + if(!($email = $this->Auth->verificationCheck($verificationCode))) { |
|
90 | + redirect('user/signup'); |
|
91 | + } |
|
90 | 92 | |
91 | 93 | //validation is valid, proceed as normal |
92 | 94 | $this->form_validation->set_rules('username', 'Username', 'required|min_length[4]|max_length[15]|valid_username|is_unique_username'); |
@@ -110,14 +112,15 @@ discard block |
||
110 | 112 | $this->Auth->verificationComplete($email); |
111 | 113 | |
112 | 114 | redirect('help'); |
113 | - } else { //@codeCoverageIgnore |
|
115 | + } else { |
|
116 | +//@codeCoverageIgnore |
|
114 | 117 | //Signup failed. |
115 | 118 | $isValid = FALSE; |
116 | 119 | } |
117 | 120 | } |
118 | 121 | |
119 | 122 | //signup wasn't valid, failed, or this is a fresh signup attempt |
120 | - if(!$isValid){ |
|
123 | + if(!$isValid) { |
|
121 | 124 | //display the create user form |
122 | 125 | $this->body_data['verificationCode'] = $verificationCode; |
123 | 126 |
@@ -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( |
@@ -43,8 +43,7 @@ discard block |
||
43 | 43 | public function valid_password(string $password) : bool { |
44 | 44 | if(!($isValid = $this->min_length($password, $this->CI->config->item('min_password_length', 'ion_auth')))) { |
45 | 45 | $this->set_message('valid_password', 'The password is too short!'); |
46 | - } |
|
47 | - elseif(!($isValid = $this->max_length($password, $this->CI->config->item('max_password_length', 'ion_auth')))) { |
|
46 | + } elseif(!($isValid = $this->max_length($password, $this->CI->config->item('max_password_length', 'ion_auth')))) { |
|
48 | 47 | $this->set_message('valid_password', 'The password is too long!'); |
49 | 48 | } |
50 | 49 | return $isValid; |
@@ -108,7 +107,7 @@ discard block |
||
108 | 107 | */ |
109 | 108 | public function isRuleValid(string $ruleName) : bool { |
110 | 109 | $isValid = FALSE; |
111 | - if(is_string($ruleName) && $this->has_rule($ruleName)){ |
|
110 | + if(is_string($ruleName) && $this->has_rule($ruleName)) { |
|
112 | 111 | $isValid = !array_key_exists($ruleName, $this->error_array()); |
113 | 112 | } |
114 | 113 | return $isValid; |
@@ -13,46 +13,36 @@ discard block |
||
13 | 13 | * @param bool $fail_gracefully Whether to just return FALSE or display an error message |
14 | 14 | * @return bool TRUE if the file was loaded correctly or FALSE on failure |
15 | 15 | */ |
16 | - public function load($file = '', $use_sections = FALSE, $fail_gracefully = FALSE) |
|
17 | - { |
|
16 | + public function load($file = '', $use_sections = FALSE, $fail_gracefully = FALSE) { |
|
18 | 17 | $file = ($file === '') ? 'config' : str_replace('.php', '', $file); |
19 | 18 | $loaded = FALSE; |
20 | 19 | |
21 | - foreach ($this->_config_paths as $path) |
|
22 | - { |
|
23 | - foreach (array($file, '_secure'.DIRECTORY_SEPARATOR.$file, ENVIRONMENT.DIRECTORY_SEPARATOR.$file) as $location) |
|
24 | - { |
|
20 | + foreach ($this->_config_paths as $path) { |
|
21 | + foreach (array($file, '_secure'.DIRECTORY_SEPARATOR.$file, ENVIRONMENT.DIRECTORY_SEPARATOR.$file) as $location) { |
|
25 | 22 | $file_path = $path.'config/'.$location.'.php'; |
26 | - if (in_array($file_path, $this->is_loaded, TRUE)) |
|
27 | - { |
|
23 | + if (in_array($file_path, $this->is_loaded, TRUE)) { |
|
28 | 24 | return TRUE; |
29 | 25 | } |
30 | 26 | |
31 | - if ( ! file_exists($file_path)) |
|
32 | - { |
|
27 | + if ( ! file_exists($file_path)) { |
|
33 | 28 | continue; |
34 | 29 | } |
35 | 30 | |
36 | 31 | include($file_path); |
37 | 32 | |
38 | - if ( ! isset($config) OR ! is_array($config)) |
|
39 | - { |
|
40 | - if ($fail_gracefully === TRUE) |
|
41 | - { |
|
33 | + if ( ! isset($config) OR ! is_array($config)) { |
|
34 | + if ($fail_gracefully === TRUE) { |
|
42 | 35 | return FALSE; |
43 | 36 | } |
44 | 37 | |
45 | 38 | show_error('Your '.$file_path.' file does not appear to contain a valid configuration array.'); |
46 | 39 | } |
47 | 40 | |
48 | - if ($use_sections === TRUE) |
|
49 | - { |
|
41 | + if ($use_sections === TRUE) { |
|
50 | 42 | $this->config[$file] = isset($this->config[$file]) |
51 | 43 | ? array_merge($this->config[$file], $config) |
52 | 44 | : $config; |
53 | - } |
|
54 | - else |
|
55 | - { |
|
45 | + } else { |
|
56 | 46 | $this->config = array_merge($this->config, $config); |
57 | 47 | } |
58 | 48 | |
@@ -63,12 +53,9 @@ discard block |
||
63 | 53 | } |
64 | 54 | } |
65 | 55 | |
66 | - if ($loaded === TRUE) |
|
67 | - { |
|
56 | + if ($loaded === TRUE) { |
|
68 | 57 | return TRUE; |
69 | - } |
|
70 | - elseif ($fail_gracefully === TRUE) |
|
71 | - { |
|
58 | + } elseif ($fail_gracefully === TRUE) { |
|
72 | 59 | return FALSE; |
73 | 60 | } |
74 | 61 |
@@ -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 { |
@@ -9,7 +9,9 @@ |
||
9 | 9 | $this->header_data['title'] = 'Index'; |
10 | 10 | $this->header_data['page'] = 'index'; |
11 | 11 | |
12 | - if($this->User->logged_in()) redirect('user/dashboard'); |
|
12 | + if($this->User->logged_in()) { |
|
13 | + redirect('user/dashboard'); |
|
14 | + } |
|
13 | 15 | $this->_render_page('FrontPage'); |
14 | 16 | } |
15 | 17 | } |
@@ -6,7 +6,9 @@ |
||
6 | 6 | */ |
7 | 7 | namespace Deployer; |
8 | 8 | |
9 | -if(basename(getcwd()) !== 'manga-tracker') die('Bad CWD: Call from manga-tracker with dep -f=_scripts/deploy.php deploy'); |
|
9 | +if(basename(getcwd()) !== 'manga-tracker') { |
|
10 | + die('Bad CWD: Call from manga-tracker with dep -f=_scripts/deploy.php deploy'); |
|
11 | +} |
|
10 | 12 | |
11 | 13 | require 'recipe/cachetool.php'; //requires deployer/recipes |
12 | 14 | require 'recipe/codeigniter.php'; |
@@ -85,7 +85,9 @@ discard block |
||
85 | 85 | } |
86 | 86 | |
87 | 87 | $siteRateLimits[$row->site_class]++; |
88 | - if($siteRateLimits[$row->site_class] > $hardRateLimit) continue; |
|
88 | + if($siteRateLimits[$row->site_class] > $hardRateLimit) { |
|
89 | + continue; |
|
90 | + } |
|
89 | 91 | |
90 | 92 | usleep(500000); // Delay requests by .5 seconds. |
91 | 93 | if($siteRateLimits[$row->site_class] > 25) { |
@@ -175,8 +177,7 @@ discard block |
||
175 | 177 | |
176 | 178 | print " - Something went wrong?\n"; |
177 | 179 | } |
178 | - } |
|
179 | - else if(array_key_exists('status', $titleData)) { |
|
180 | + } else if(array_key_exists('status', $titleData)) { |
|
180 | 181 | // Series has probably been deleted. |
181 | 182 | |
182 | 183 | if($this->Tracker->title->updateTitleDataByID((int) $row->title_id, $titleData)) { |
@@ -186,8 +187,7 @@ discard block |
||
186 | 187 | |
187 | 188 | print " - Something went wrong?\n"; |
188 | 189 | } |
189 | - } |
|
190 | - else if($site->canHaveNoChapters) { |
|
190 | + } else if($site->canHaveNoChapters) { |
|
191 | 191 | // Previous statements failed, however site can have no chapters. |
192 | 192 | if($this->Tracker->title->updateTitleDataByID((int) $row->title_id, ['latest_chapter' => NULL])) { |
193 | 193 | print " - (No chapters found?)\n"; |
@@ -196,12 +196,10 @@ discard block |
||
196 | 196 | |
197 | 197 | print " - Something went wrong?\n"; |
198 | 198 | } |
199 | - } |
|
200 | - else { |
|
199 | + } else { |
|
201 | 200 | log_message('error', 'handleUpdate failed due to invalid titleData info?'); |
202 | 201 | } |
203 | - } |
|
204 | - else { |
|
202 | + } else { |
|
205 | 203 | // If TitleData does not exist, either something has broken, or we've set up the site wrong. |
206 | 204 | |
207 | 205 | //TODO: We should have some way to handle this in the site models. |