Completed
Push — master ( 6f4587...d33bf7 )
by Angus
02:36
created
application/core/MY_Controller.php 3 patches
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
 	protected $footer_data = array();
7 7
 	public    $global_data = array();
8 8
 
9
-	public function __construct(){
9
+	public function __construct() {
10 10
 		parent::__construct();
11 11
 
12 12
 		//FIXME: This is pretty much a phpUnit hack. Without it phpUnit fails here. We need a proper way to fake user/admin testing.
@@ -80,7 +80,9 @@  discard block
 block discarded – undo
80 80
 	public function __construct() {
81 81
 		parent::__construct();
82 82
 
83
-		if($this->ion_auth->logged_in()) redirect('/');
83
+		if($this->ion_auth->logged_in()) {
84
+			redirect('/');
85
+		}
84 86
 	}
85 87
 }
86 88
 
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
 class MY_Controller extends CI_Controller {
4 4
 	protected $header_data = array();
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
 	protected $footer_data = array();
7 7
 	public    $global_data = array();
8 8
 
9
-	public function __construct(){
9
+	public function __construct() {
10 10
 		parent::__construct();
11 11
 
12 12
 		//FIXME: This is pretty much a phpUnit hack. Without it phpUnit fails here. We need a proper way to fake user/admin testing.
@@ -18,10 +18,10 @@  discard block
 block discarded – undo
18 18
 
19 19
 		$this->global_data['theme'] = $this->User_Options->get('theme');
20 20
 		$css_path = "css/main.{$this->User_Options->get('theme')}";
21
-		$this->global_data['complied_css_path'] = asset_url()."{$css_path}.".filemtime(APPPATH . "../public/assets/{$css_path}.css").".css";
21
+		$this->global_data['complied_css_path'] = asset_url()."{$css_path}.".filemtime(APPPATH."../public/assets/{$css_path}.css").".css";
22 22
 
23 23
 		$js_path = 'js/compiled.min';
24
-		$this->global_data['complied_js_path']  = asset_url()."{$js_path}.".filemtime(APPPATH . "../public/assets/{$js_path}.js").".js";
24
+		$this->global_data['complied_js_path']  = asset_url()."{$js_path}.".filemtime(APPPATH."../public/assets/{$js_path}.js").".js";
25 25
 	}
26 26
 
27 27
 	public function _render_page(/*(array) $paths*/) : void {
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 		$json = is_array($json_input) ? json_encode($json_input) : $json_input;
46 46
 
47 47
 		$this->output->set_content_type('application/json', 'utf-8');
48
-		$this->_render_content($json,'json', $download, $filenamePrefix);
48
+		$this->_render_content($json, 'json', $download, $filenamePrefix);
49 49
 	}
50 50
 	public function _render_content(string $content, string $filenameExt, bool $download = FALSE, string $filenamePrefix = 'tracker') : void {
51 51
 		if($download) {
Please login to merge, or discard this patch.
application/core/MY_Output.php 1 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
 class MY_Output extends CI_Output {
4 4
 	protected $current_header = [
Please login to merge, or discard this patch.
application/models/User_Model.php 4 patches
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_Model extends CI_Model {
4 4
 	public $id;
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 			if($query->num_rows() > 0) {
72 72
 				//username exists, grab email
73 73
 				$email = $query->row('email');
74
-			}else{
74
+			} else {
75 75
 				//username doesn't exist, return FALSE
76 76
 				$email = FALSE;
77 77
 			}
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
 	public function get_new_api_key() : string {
104 104
 		$api_key = NULL;
105 105
 		if($this->logged_in()) {
106
-			$api_key = substr("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", mt_rand(0, 51), 1) . substr(md5((string) time()), 1);
106
+			$api_key = substr("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", mt_rand(0, 51), 1).substr(md5((string) time()), 1);
107 107
 
108 108
 			$this->db->where('id', $this->id);
109 109
 			$this->db->update('auth_users', ['api_key' => $api_key]);
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@
 block discarded – undo
71 71
 			if($query->num_rows() > 0) {
72 72
 				//username exists, grab email
73 73
 				$email = $query->row('email');
74
-			}else{
74
+			} else {
75 75
 				//username doesn't exist, return FALSE
76 76
 				$email = FALSE;
77 77
 			}
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 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_Model extends CI_Model {
4 4
 	public $id;
Please login to merge, or discard this patch.
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -45,9 +45,9 @@  discard block
 block discarded – undo
45 45
 		$this->load->database();
46 46
 
47 47
 		$query = $this->db->select('*')
48
-		                  ->from('auth_users')
49
-		                  ->where('username', $username)
50
-		                  ->get();
48
+						  ->from('auth_users')
49
+						  ->where('username', $username)
50
+						  ->get();
51 51
 
52 52
 		return (bool) $query->num_rows();
53 53
 	}
@@ -69,9 +69,9 @@  discard block
 block discarded – undo
69 69
 			$this->load->database();
70 70
 
71 71
 			$query = $this->db->select('email')
72
-			                  ->from('auth_users')
73
-			                  ->where('username', $identity)
74
-			                  ->get();
72
+							  ->from('auth_users')
73
+							  ->where('username', $identity)
74
+							  ->get();
75 75
 
76 76
 			if($query->num_rows() > 0) {
77 77
 				//username exists, grab email
@@ -89,9 +89,9 @@  discard block
 block discarded – undo
89 89
 		$user = NULL;
90 90
 
91 91
 		$query = $this->db->select('*')
92
-		                  ->from('auth_users')
93
-		                  ->where('username', $username)
94
-		                  ->get();
92
+						  ->from('auth_users')
93
+						  ->where('username', $username)
94
+						  ->get();
95 95
 
96 96
 		if($query->num_rows() > 0) {
97 97
 			$user = $query->row();
@@ -120,12 +120,12 @@  discard block
 block discarded – undo
120 120
 		$api_key = NULL;
121 121
 		if($this->logged_in()) {
122 122
 			$this->db->select('api_key')
123
-			         ->where('id', $this->User->id)
124
-			         ->get('auth_users');
123
+					 ->where('id', $this->User->id)
124
+					 ->get('auth_users');
125 125
 
126 126
 			$query = $this->db->select('api_key')
127
-			                  ->where('id', $this->User->id)
128
-			                  ->get('auth_users');
127
+							  ->where('id', $this->User->id)
128
+							  ->get('auth_users');
129 129
 
130 130
 			if($query->num_rows() > 0) {
131 131
 				$api_key = $query->row('api_key');
@@ -137,9 +137,9 @@  discard block
 block discarded – undo
137 137
 	
138 138
 	public function get_id_from_api_key(string $api_key) {
139 139
 		$query = $this->db->select('id')
140
-		                  ->from('auth_users')
141
-		                  ->where('api_key', $api_key)
142
-		                  ->get();
140
+						  ->from('auth_users')
141
+						  ->where('api_key', $api_key)
142
+						  ->get();
143 143
 
144 144
 		if($query->num_rows() > 0) {
145 145
 			$userID = $query->row('id');
@@ -201,12 +201,12 @@  discard block
 block discarded – undo
201 201
 	}
202 202
 	public function hideLatestNotice() {
203 203
 		$idQuery = $this->db->select('1')
204
-		                    ->where('user_id', $this->User->id)
205
-		                    ->get('tracker_user_notices');
204
+							->where('user_id', $this->User->id)
205
+							->get('tracker_user_notices');
206 206
 		if($idQuery->num_rows() > 0) {
207 207
 			$success = (bool) $this->db->set('hidden_notice_id', '(SELECT id FROM tracker_notices ORDER BY id DESC LIMIT 1)', FALSE)
208
-			                           ->where('user_id', $this->User->id)
209
-			                           ->update('tracker_user_notices');
208
+									   ->where('user_id', $this->User->id)
209
+									   ->update('tracker_user_notices');
210 210
 		} else {
211 211
 			$success = (bool) $this->db->insert('tracker_user_notices', [
212 212
 				'user_id'           => $this->User->id,
Please login to merge, or discard this patch.
application/config/email.php 1 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
 | -------------------------------------------------------------------
Please login to merge, or discard this patch.
application/config/migration.php 1 patch
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
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
 |--------------------------------------------------------------------------
Please login to merge, or discard this patch.
application/config/testing/migration.php 1 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
 |--------------------------------------------------------------------------
Please login to merge, or discard this patch.
application/config/profiler.php 1 patch
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
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
 | -------------------------------------------------------------------------
Please login to merge, or discard this patch.
application/config/user_agents.php 1 patch
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
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
 | -------------------------------------------------------------------
Please login to merge, or discard this patch.
application/config/routes.php 2 patches
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
 | -------------------------------------------------------------------------
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@
 block discarded – undo
78 78
 //TEMP
79 79
 $route['user/dashboard_beta'] = 'User/DashboardBeta';
80 80
 
81
-$route['api/internal/get_list']                                                  = 'API/Internal/GetList';
81
+$route['api/internal/get_list'] = 'API/Internal/GetList';
82 82
 $route['api/internal/get_list/(all|reading|on-hold|plan-to-read|(custom(?:1|2|3)))'] = 'API/Internal/GetList/index/$1';
83 83
 
84 84
 $route['ajax/username_check']['post'] = 'Ajax/UsernameCheck'; //rate limited
Please login to merge, or discard this patch.