Completed
Push — master ( d6ef10...270242 )
by Angus
03:27
created
application/models/Auth_Model.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@
 block discarded – undo
72 72
 
73 73
 	/**
74 74
 	 * @param string $verificationCode
75
-	 * @return mixed
75
+	 * @return string
76 76
 	 */
77 77
 	public function verification_check(string $verificationCode) {
78 78
 		//user is trying to validate their email for signup, check if verification code is still valid/exists
Please login to merge, or discard this patch.
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -77,9 +77,9 @@
 block discarded – undo
77 77
 	public function verification_check(string $verificationCode) {
78 78
 		//user is trying to validate their email for signup, check if verification code is still valid/exists
79 79
 		$query = $this->db->select('email, verification_code_time')
80
-		                  ->from('auth_signup_verification')
81
-		                  ->where(array('verification_code' => $verificationCode))
82
-		                  ->get();
80
+						  ->from('auth_signup_verification')
81
+						  ->where(array('verification_code' => $verificationCode))
82
+						  ->get();
83 83
 
84 84
 		$return = FALSE;
85 85
 		if($query->num_rows() > 0) {
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php declare(strict_types=1); defined('BASEPATH') or exit('No direct script access allowed');
1
+<?php declare(strict_types = 1); defined('BASEPATH') or exit('No direct script access allowed');
2 2
 
3 3
 class Auth_Model extends CI_Model {
4 4
 	public function __construct() {
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 			}
61 61
 
62 62
 			$success = TRUE;
63
-		} catch (Exception $e) {
63
+		} catch(Exception $e) {
64 64
 			//echo 'Caught exception: ',  $e->getMessage(), "\n";
65 65
 
66 66
 			//revert verification
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 				//TODO: Remove from DB, send user error that verification expired.
92 92
 			} else {
93 93
 				//not expired, verification is valid, return email
94
-				$return =  $result->email;
94
+				$return = $result->email;
95 95
 			}
96 96
 		}
97 97
 		return $return;
Please login to merge, or discard this patch.
application/models/User_Options_Model.php 4 patches
Doc Comments   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 	/**
74 74
 	 * Get user option, or default option if it does not exist.
75 75
 	 * @param string $option
76
-	 * @return mixed Returns option value as STRING, or FALSE if option does not exist.
76
+	 * @return string Returns option value as STRING, or FALSE if option does not exist.
77 77
 	 */
78 78
 	public function get(string $option) {
79 79
 		return $this->get_by_userid($option, (int) $this->User->id);
@@ -135,6 +135,9 @@  discard block
 block discarded – undo
135 135
 		return $success;
136 136
 	}
137 137
 
138
+	/**
139
+	 * @return string
140
+	 */
138 141
 	private function get_db(string $option, int $userID) {
139 142
 		//This function assumes we've already done some basic validation.
140 143
 		$query = $this->db->select('value_str, value_int')
Please login to merge, or discard this patch.
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -170,10 +170,10 @@
 block discarded – undo
170 170
 		//This function assumes we've already done some basic validation.
171 171
 		if(!($data = $this->session->tempdata("option_{$option}"))) {
172 172
 			$query = $this->db->select('value_str, value_int')
173
-			                  ->from('user_options')
174
-			                  ->where('user_id', $userID)
175
-			                  ->where('name',    $option)
176
-			                  ->limit(1);
173
+							  ->from('user_options')
174
+							  ->where('user_id', $userID)
175
+							  ->where('name',    $option)
176
+							  ->limit(1);
177 177
 			$data = $query->get()->row_array();
178 178
 			$this->session->set_tempdata("option_{$option}", $data, 3600);
179 179
 		}
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php declare(strict_types=1); defined('BASEPATH') or exit('No direct script access allowed');
1
+<?php declare(strict_types = 1); defined('BASEPATH') or exit('No direct script access allowed');
2 2
 
3 3
 class User_Options_Model extends CI_Model {
4 4
 	public $options = array(
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
 			$query = $this->db->select('value_str, value_int')
173 173
 			                  ->from('user_options')
174 174
 			                  ->where('user_id', $userID)
175
-			                  ->where('name',    $option)
175
+			                  ->where('name', $option)
176 176
 			                  ->limit(1);
177 177
 			$data = $query->get()->row_array();
178 178
 			$this->session->set_tempdata("option_{$option}", $data, 3600);
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
 			);
215 215
 			//FIXME: Get a better solution than str_replace for removing special characters
216 216
 			$elements = array();
217
-			foreach (array_values($this->options[$option]['valid_options']) as $valid_option) {
217
+			foreach(array_values($this->options[$option]['valid_options']) as $valid_option) {
218 218
 				$elements[$option.'_'.str_replace(',', '_', $valid_option)] = array_merge($base_attributes, array(
219 219
 					'value' => $valid_option
220 220
 				));
Please login to merge, or discard this patch.
Braces   +10 added lines, -3 removed lines patch added patch discarded remove patch
@@ -137,7 +137,9 @@  discard block
 block discarded – undo
137 137
 				}
138 138
 
139 139
 				$success = $this->set_db($idData, $valueData);
140
-				if($success) $this->session->unset_tempdata("option_{$option}");
140
+				if($success) {
141
+					$this->session->unset_tempdata("option_{$option}");
142
+				}
141 143
 			} else {
142 144
 				$success = FALSE;
143 145
 			}
@@ -164,7 +166,9 @@  discard block
 block discarded – undo
164 166
 			}
165 167
 
166 168
 			//Overall fallback method.
167
-			if(!isset($value)) $value = $this->options[$option]['default'];
169
+			if(!isset($value)) {
170
+				$value = $this->options[$option]['default'];
171
+			}
168 172
 		} else {
169 173
 			$value = FALSE;
170 174
 		}
@@ -215,7 +219,10 @@  discard block
 block discarded – undo
215 219
 				//This should never happen.
216 220
 				break;
217 221
 		}
218
-		if(!isset($value)) $value = FALSE; //FIXME: This won't play nice with BOOL type false?
222
+		if(!isset($value)) {
223
+			$value = FALSE;
224
+		}
225
+		//FIXME: This won't play nice with BOOL type false?
219 226
 
220 227
 		return $value;
221 228
 	}
Please login to merge, or discard this patch.
public/index.php 3 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -210,10 +210,10 @@
 block discarded – undo
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?
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
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)
66
+switch(ENVIRONMENT)
67 67
 {
68 68
 	case 'development':
69 69
 		error_reporting(-1);
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 	case 'testing':
80 80
 	case 'production':
81 81
 		ini_set('display_errors', 0);
82
-		if (version_compare(PHP_VERSION, '5.3', '>='))
82
+		if(version_compare(PHP_VERSION, '5.3', '>='))
83 83
 		{
84 84
 			error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT & ~E_USER_NOTICE & ~E_USER_DEPRECATED);
85 85
 		}
@@ -197,12 +197,12 @@  discard block
 block discarded – undo
197 197
  */
198 198
 
199 199
 // Set the current directory correctly for CLI requests
200
-if (defined('STDIN'))
200
+if(defined('STDIN'))
201 201
 {
202 202
 	chdir(dirname(__FILE__));
203 203
 }
204 204
 
205
-if (($_temp = realpath($system_path)) !== FALSE)
205
+if(($_temp = realpath($system_path)) !== FALSE)
206 206
 {
207 207
 	$system_path = $_temp.DIRECTORY_SEPARATOR;
208 208
 }
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
 }
218 218
 
219 219
 // Is the system path correct?
220
-if ( ! is_dir($system_path))
220
+if(!is_dir($system_path))
221 221
 {
222 222
 	header('HTTP/1.1 503 Service Unavailable.', TRUE, 503);
223 223
 	echo 'Your system folder path does not appear to be set correctly. Please open the following file and correct this: '.pathinfo(__FILE__, PATHINFO_BASENAME);
@@ -242,9 +242,9 @@  discard block
 block discarded – undo
242 242
 define('SYSDIR', basename(BASEPATH));
243 243
 
244 244
 // The path to the "application" directory
245
-if (is_dir($application_folder))
245
+if(is_dir($application_folder))
246 246
 {
247
-	if (($_temp = realpath($application_folder)) !== FALSE)
247
+	if(($_temp = realpath($application_folder)) !== FALSE)
248 248
 	{
249 249
 		$application_folder = $_temp;
250 250
 	}
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
 		);
258 258
 	}
259 259
 }
260
-elseif (is_dir(BASEPATH.$application_folder.DIRECTORY_SEPARATOR))
260
+elseif(is_dir(BASEPATH.$application_folder.DIRECTORY_SEPARATOR))
261 261
 {
262 262
 	$application_folder = BASEPATH.strtr(
263 263
 			trim($application_folder, '/\\'),
@@ -275,13 +275,13 @@  discard block
 block discarded – undo
275 275
 define('APPPATH', $application_folder.DIRECTORY_SEPARATOR);
276 276
 
277 277
 // The path to the "views" directory
278
-if ( ! isset($view_folder[0]) && is_dir(APPPATH.'views'.DIRECTORY_SEPARATOR))
278
+if(!isset($view_folder[0]) && is_dir(APPPATH.'views'.DIRECTORY_SEPARATOR))
279 279
 {
280 280
 	$view_folder = APPPATH.'views';
281 281
 }
282
-elseif (is_dir($view_folder))
282
+elseif(is_dir($view_folder))
283 283
 {
284
-	if (($_temp = realpath($view_folder)) !== FALSE)
284
+	if(($_temp = realpath($view_folder)) !== FALSE)
285 285
 	{
286 286
 		$view_folder = $_temp;
287 287
 	}
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
 		);
295 295
 	}
296 296
 }
297
-elseif (is_dir(APPPATH.$view_folder.DIRECTORY_SEPARATOR))
297
+elseif(is_dir(APPPATH.$view_folder.DIRECTORY_SEPARATOR))
298 298
 {
299 299
 	$view_folder = APPPATH.strtr(
300 300
 			trim($view_folder, '/\\'),
Please login to merge, or discard this patch.
Braces   +18 added lines, -45 removed lines patch added patch discarded remove patch
@@ -63,8 +63,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
Please login to merge, or discard this patch.
application/controllers/About.php 2 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,7 +1,6 @@
 block discarded – undo
1 1
 <?php defined('BASEPATH') OR exit('No direct script access allowed');
2 2
 
3
-class About extends MY_Controller
4
-{
3
+class About extends MY_Controller {
5 4
 	public function __construct() {
6 5
 		parent::__construct();
7 6
 	}
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 block discarded – undo
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
 /**
4 4
  * Rate Limiter Configuration
Please login to merge, or discard this patch.
application/controllers/User/Auth/Forgot_Password.php 3 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -16,12 +16,12 @@  discard block
 block discarded – undo
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();
@@ -71,21 +71,21 @@  discard block
 block discarded – undo
71 71
 		$this->header_data['page'] = "reset-password";
72 72
 
73 73
 		$user = $this->ion_auth->forgotten_password_check($code);
74
-		if ($user) {
74
+		if($user) {
75 75
 			//code is valid, show reset form or process reset
76 76
 			$min_password_length = $this->config->item('min_password_length', 'ion_auth');
77 77
 			$max_password_length = $this->config->item('max_password_length', 'ion_auth');
78
-			$this->form_validation->set_rules('new_password',         "Password",         'required|min_length['.$min_password_length.']|max_length['.$max_password_length.']');
78
+			$this->form_validation->set_rules('new_password', "Password", 'required|min_length['.$min_password_length.']|max_length['.$max_password_length.']');
79 79
 			$this->form_validation->set_rules('new_password_confirm', "Password Confirm", 'required|matches[password]');
80 80
 
81
-			if ($this->form_validation->run() === TRUE) {
81
+			if($this->form_validation->run() === TRUE) {
82 82
 				//form is valid, process the password reset request
83 83
 				//TODO (Reaearch): The original ion_auth auth.php sent the userid to the form, then matched it on return, is there any point to this?
84 84
 
85 85
 				$identity = $user->{'email'};
86 86
 				$change   = $this->ion_auth->reset_password($identity, $this->input->post('new_password'));
87 87
 
88
-				if ($change) {
88
+				if($change) {
89 89
 					//password changed successfully, redirect to login
90 90
 					$this->session->set_flashdata('notices', $this->ion_auth->messages());
91 91
 					redirect("user/login", 'refresh');
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -89,12 +89,14 @@
 block discarded – undo
89 89
 					//password changed successfully, redirect to login
90 90
 					$this->session->set_flashdata('notices', $this->ion_auth->messages());
91 91
 					redirect("user/login", 'refresh');
92
-				} else { //@codeCoverageIgnore
92
+				} else {
93
+//@codeCoverageIgnore
93 94
 					//password changed unsuccessfully, refresh page.
94 95
 					$this->session->set_flashdata('notices', $this->ion_auth->errors());
95 96
 					redirect('user/reset_password/'.$code, 'refresh');
96 97
 				}
97
-			} else { //@codeCoverageIgnore
98
+			} else {
99
+//@codeCoverageIgnore
98 100
 				//form is invalid OR first-time viewing page
99 101
 				$this->global_data['notices'] = (validation_errors()) ? validation_errors() : $this->session->flashdata('notices');
100 102
 
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 block discarded – undo
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
 /**
4 4
  * Rate Limiter Configuration
Please login to merge, or discard this patch.
application/controllers/User/Auth/Login.php 3 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -15,17 +15,17 @@  discard block
 block discarded – undo
15 15
 		$this->header_data['title'] = "Login";
16 16
 		$this->header_data['page']  = "login";
17 17
 
18
-		$this->form_validation->set_rules('identity', 'Identity',  'required|max_length[254]', array(
18
+		$this->form_validation->set_rules('identity', 'Identity', 'required|max_length[254]', array(
19 19
 			'required'   => 'Please enter your username or email.',
20 20
 			'max_length' => 'Invalid username.'
21 21
 
22 22
 		));
23
-		$this->form_validation->set_rules('password', 'Password',  'required|max_length[64]', array(
23
+		$this->form_validation->set_rules('password', 'Password', 'required|max_length[64]', array(
24 24
 			'required'   => 'Please enter your password.',
25 25
 			'max_length' => 'Invalid password.'
26 26
 		));
27 27
 
28
-		if ($isValid = $this->form_validation->run() === TRUE) {
28
+		if($isValid = $this->form_validation->run() === TRUE) {
29 29
 			//form is valid
30 30
 
31 31
 			//check if identity is email, if not then attempt to use grab from DB
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 			$this->body_data['notices'] = validation_errors() ? validation_errors() : $this->session->flashdata('notices');
64 64
 			//$errors = $this->form_validation->error_array();
65 65
 
66
-			$this->body_data['form_create'] = array (
66
+			$this->body_data['form_create'] = array(
67 67
 				'action' => 'user/login',
68 68
 
69 69
 				'role'   => 'form'
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -46,7 +46,8 @@
 block discarded – undo
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('/'); //TODO (CHECK): Should this be refresh?
51 52
 				} //@codeCoverageIgnore
52 53
 			} else {
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 block discarded – undo
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
 /**
4 4
  * Rate Limiter Configuration
Please login to merge, or discard this patch.
application/controllers/User/Auth/Signup.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 			'is_unique_email' => 'Email already exists.'
42 42
 		));
43 43
 
44
-		if ($isValid = $this->form_validation->run() === TRUE) {
44
+		if($isValid = $this->form_validation->run() === TRUE) {
45 45
 			$email = $this->Auth->parse_email($this->input->post('email'));
46 46
 
47 47
 			$this->body_data['email'] = $email;
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
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
 
60 60
 			$this->global_data['notices'] = (validation_errors() ? validation_errors() : ($this->ion_auth->errors() ? $this->ion_auth->errors() : $this->session->flashdata('message')));
@@ -92,14 +92,14 @@  discard block
 block discarded – undo
92 92
 		if(!($email = $this->Auth->verification_check($verificationCode))) redirect('user/signup');
93 93
 
94 94
 		//validation is valid, proceed as normal
95
-		$this->form_validation->set_rules('username',         'Username',           'required|min_length[4]|max_length[15]|valid_username|is_unique_username');
96
-		$this->form_validation->set_rules('password',         'Password',           'required|valid_password');
97
-		$this->form_validation->set_rules('password_confirm', 'Confirm Password',   'required|matches[password]');
98
-		$this->form_validation->set_rules('terms',            'Terms & Conditions', 'required');
95
+		$this->form_validation->set_rules('username', 'Username', 'required|min_length[4]|max_length[15]|valid_username|is_unique_username');
96
+		$this->form_validation->set_rules('password', 'Password', 'required|valid_password');
97
+		$this->form_validation->set_rules('password_confirm', 'Confirm Password', 'required|matches[password]');
98
+		$this->form_validation->set_rules('terms', 'Terms & Conditions', 'required');
99 99
 		//TODO: timezone
100 100
 		//TODO: receive email
101 101
 
102
-		if ($isValid = $this->form_validation->run() === TRUE) {
102
+		if($isValid = $this->form_validation->run() === TRUE) {
103 103
 			$username = $this->input->post('username');
104 104
 			$password = $this->input->post('password');
105 105
 
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
 		}
124 124
 
125 125
 		//signup wasn't valid, failed, or this is a fresh signup attempt
126
-		if(!$isValid){
126
+		if(!$isValid) {
127 127
 			//display the create user form
128 128
 
129 129
 			$this->global_data['notices'] = (validation_errors() ? validation_errors() : ($this->ion_auth->errors() ? $this->ion_auth->errors() : $this->session->flashdata('message')));
Please login to merge, or discard this patch.
Braces   +7 added lines, -4 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
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
 
60 60
 			$this->global_data['notices'] = (validation_errors() ? validation_errors() : ($this->ion_auth->errors() ? $this->ion_auth->errors() : $this->session->flashdata('message')));
@@ -89,7 +89,9 @@  discard block
 block discarded – undo
89 89
 	//This continued signup occurs after the user clicks the verification link in their email.
90 90
 	private function _continue_signup($verificationCode) {
91 91
 		//check if validation is valid, if so return email, if not redirect to signup
92
-		if(!($email = $this->Auth->verification_check($verificationCode))) redirect('user/signup');
92
+		if(!($email = $this->Auth->verification_check($verificationCode))) {
93
+			redirect('user/signup');
94
+		}
93 95
 
94 96
 		//validation is valid, proceed as normal
95 97
 		$this->form_validation->set_rules('username',         'Username',           'required|min_length[4]|max_length[15]|valid_username|is_unique_username');
@@ -113,7 +115,8 @@  discard block
 block discarded – undo
113 115
 				$this->Auth->verification_complete($email);
114 116
 
115 117
 				redirect('help');
116
-			} else { //@codeCoverageIgnore
118
+			} else {
119
+//@codeCoverageIgnore
117 120
 				//Signup failed.
118 121
 
119 122
 				$this->session->set_flashdata('notices', $this->ion_auth->errors());
@@ -123,7 +126,7 @@  discard block
 block discarded – undo
123 126
 		}
124 127
 
125 128
 		//signup wasn't valid, failed, or this is a fresh signup attempt
126
-		if(!$isValid){
129
+		if(!$isValid) {
127 130
 			//display the create user form
128 131
 
129 132
 			$this->global_data['notices'] = (validation_errors() ? validation_errors() : ($this->ion_auth->errors() ? $this->ion_auth->errors() : $this->session->flashdata('message')));
Please login to merge, or discard this patch.
application/controllers/Ajax/Userscript.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@
 block discarded – undo
68 68
 	public function report_bug() {
69 69
 		$this->load->library('user_agent');
70 70
 		if($this->output->is_custom_header_set()) { $this->output->reset_status_header(); return; }
71
-		$this->form_validation->set_rules('bug[url]',  'Bug [URL]',  'required');
71
+		$this->form_validation->set_rules('bug[url]', 'Bug [URL]', 'required');
72 72
 		$this->form_validation->set_rules('bug[text]', 'Bug [Text]', 'required');
73 73
 
74 74
 		if($this->form_validation->run() === TRUE) {
Please login to merge, or discard this patch.
application/controllers/Ajax/TrackerInline.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -26,8 +26,8 @@  discard block
 block discarded – undo
26 26
 	 * URL:        /ajax/update_tracker_inline
27 27
 	 */
28 28
 	public function update() {
29
-		$this->form_validation->set_rules('id',      'Chapter ID', 'required|ctype_digit');
30
-		$this->form_validation->set_rules('chapter', 'Chapter',    'required');
29
+		$this->form_validation->set_rules('id', 'Chapter ID', 'required|ctype_digit');
30
+		$this->form_validation->set_rules('chapter', 'Chapter', 'required');
31 31
 
32 32
 		if($this->form_validation->run() === TRUE) {
33 33
 			$success = $this->Tracker->updateTrackerByID($this->userID, $this->input->post('id'), $this->input->post('chapter'));
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 	 * URL:        /tag_update
123 123
 	 */
124 124
 	public function tag_update() {
125
-		$this->form_validation->set_rules('id',         'Chapter ID', 'required|ctype_digit');
125
+		$this->form_validation->set_rules('id', 'Chapter ID', 'required|ctype_digit');
126 126
 		$this->form_validation->set_rules('tag_string', 'Tag String', 'max_length[255]|is_valid_tag_string|not_contains[none]');
127 127
 
128 128
 		if($this->form_validation->run() === TRUE) {
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 	 * URL:        /set_category
147 147
 	 */
148 148
 	public function set_category() {
149
-		$this->form_validation->set_rules('id[]',     'List of IDs',   'required|ctype_digit');
149
+		$this->form_validation->set_rules('id[]', 'List of IDs', 'required|ctype_digit');
150 150
 		$this->form_validation->set_rules('category', 'Category Name', 'required|is_valid_category');
151 151
 
152 152
 		if($this->form_validation->run() === TRUE) {
Please login to merge, or discard this patch.