Completed
Push — master ( 5ee431...89a822 )
by Angus
09:05
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   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -40,9 +40,9 @@  discard block
 block discarded – undo
40 40
 		$this->load->database();
41 41
 
42 42
 		$query = $this->db->select('*')
43
-		                  ->from('auth_users')
44
-		                  ->where('username', $username)
45
-		                  ->get();
43
+						  ->from('auth_users')
44
+						  ->where('username', $username)
45
+						  ->get();
46 46
 
47 47
 		return (bool) $query->num_rows();
48 48
 	}
@@ -64,9 +64,9 @@  discard block
 block discarded – undo
64 64
 			$this->load->database();
65 65
 
66 66
 			$query = $this->db->select('email')
67
-			                  ->from('auth_users')
68
-			                  ->where('username', $identity)
69
-			                  ->get();
67
+							  ->from('auth_users')
68
+							  ->where('username', $identity)
69
+							  ->get();
70 70
 
71 71
 			if($query->num_rows() > 0) {
72 72
 				//username exists, grab email
@@ -84,9 +84,9 @@  discard block
 block discarded – undo
84 84
 		$user = NULL;
85 85
 
86 86
 		$query = $this->db->select('*')
87
-		                  ->from('auth_users')
88
-		                  ->where('username', $username)
89
-		                  ->get();
87
+						  ->from('auth_users')
88
+						  ->where('username', $username)
89
+						  ->get();
90 90
 
91 91
 		if($query->num_rows() > 0) {
92 92
 			$user = $query->row();
@@ -114,9 +114,9 @@  discard block
 block discarded – undo
114 114
 	
115 115
 	public function get_id_from_api_key(string $api_key) {
116 116
 		$query = $this->db->select('id')
117
-		                  ->from('auth_users')
118
-		                  ->where('api_key', $api_key)
119
-		                  ->get();
117
+						  ->from('auth_users')
118
+						  ->where('api_key', $api_key)
119
+						  ->get();
120 120
 
121 121
 		if($query->num_rows() > 0) {
122 122
 			$userID = $query->row('id');
@@ -150,12 +150,12 @@  discard block
 block discarded – undo
150 150
 	}
151 151
 	public function hideLatestNotice() {
152 152
 		$idQuery = $this->db->select('1')
153
-		                    ->where('user_id', $this->User->id)
154
-		                    ->get('tracker_user_notices');
153
+							->where('user_id', $this->User->id)
154
+							->get('tracker_user_notices');
155 155
 		if($idQuery->num_rows() > 0) {
156 156
 			$success = (bool) $this->db->set('hidden_notice_id', '(SELECT id FROM tracker_notices ORDER BY id DESC LIMIT 1)', FALSE)
157
-			                           ->where('user_id', $this->User->id)
158
-			                           ->update('tracker_user_notices');
157
+									   ->where('user_id', $this->User->id)
158
+									   ->update('tracker_user_notices');
159 159
 		} else {
160 160
 			$success = (bool) $this->db->insert('tracker_user_notices', [
161 161
 				'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.