@@ -7,11 +7,11 @@ |
||
7 | 7 | Filename: <?php echo $filepath, "\n"; ?> |
8 | 8 | Line Number: <?php echo $line; ?> |
9 | 9 | |
10 | -<?php if (defined('SHOW_DEBUG_BACKTRACE') && SHOW_DEBUG_BACKTRACE === TRUE): ?> |
|
10 | +<?php if(defined('SHOW_DEBUG_BACKTRACE') && SHOW_DEBUG_BACKTRACE === TRUE): ?> |
|
11 | 11 | |
12 | 12 | Backtrace: |
13 | -<?php foreach (debug_backtrace() as $error): ?> |
|
14 | -<?php if (isset($error['file']) && strpos($error['file'], realpath(BASEPATH)) !== 0): ?> |
|
13 | +<?php foreach(debug_backtrace() as $error): ?> |
|
14 | +<?php if(isset($error['file']) && strpos($error['file'], realpath(BASEPATH)) !== 0): ?> |
|
15 | 15 | File: <?php echo $error['file'], "\n"; ?> |
16 | 16 | Line: <?php echo $error['line'], "\n"; ?> |
17 | 17 | Function: <?php echo $error['function'], "\n\n"; ?> |
@@ -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 | A PHP Error was encountered |
4 | 4 |
@@ -7,11 +7,11 @@ |
||
7 | 7 | Filename: <?php echo $exception->getFile(), "\n"; ?> |
8 | 8 | Line Number: <?php echo $exception->getLine(); ?> |
9 | 9 | |
10 | -<?php if (defined('SHOW_DEBUG_BACKTRACE') && SHOW_DEBUG_BACKTRACE === TRUE): ?> |
|
10 | +<?php if(defined('SHOW_DEBUG_BACKTRACE') && SHOW_DEBUG_BACKTRACE === TRUE): ?> |
|
11 | 11 | |
12 | 12 | Backtrace: |
13 | -<?php foreach ($exception->getTrace() as $error): ?> |
|
14 | -<?php if (isset($error['file']) && strpos($error['file'], realpath(BASEPATH)) !== 0): ?> |
|
13 | +<?php foreach($exception->getTrace() as $error): ?> |
|
14 | +<?php if(isset($error['file']) && strpos($error['file'], realpath(BASEPATH)) !== 0): ?> |
|
15 | 15 | File: <?php echo $error['file'], "\n"; ?> |
16 | 16 | Line: <?php echo $error['line'], "\n"; ?> |
17 | 17 | Function: <?php echo $error['function'], "\n\n"; ?> |
@@ -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 | An uncaught Exception was encountered |
4 | 4 |
@@ -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 | echo "\nDatabase error: ", |
5 | 5 | $heading, |
@@ -6,7 +6,7 @@ discard block |
||
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 |
||
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 |
@@ -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 MY_Controller extends CI_Controller { |
4 | 4 | protected $header_data = array(); |
@@ -6,7 +6,7 @@ discard block |
||
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. |
@@ -17,13 +17,13 @@ discard block |
||
17 | 17 | |
18 | 18 | $this->global_data['theme'] = $this->User_Options->get('theme'); |
19 | 19 | if(ENVIRONMENT === 'production') { |
20 | - $this->global_data['compiled_css_path'] = function () { |
|
20 | + $this->global_data['compiled_css_path'] = function() { |
|
21 | 21 | $css_path = "css/main.{$this->global_data['theme']}"; |
22 | - return asset_url() . $css_path . '.' . filemtime(APPPATH . "../public/assets/{$css_path}.css") . '.css'; |
|
22 | + return asset_url().$css_path.'.'.filemtime(APPPATH."../public/assets/{$css_path}.css").'.css'; |
|
23 | 23 | }; |
24 | 24 | |
25 | 25 | $js_path = 'js/compiled.min'; |
26 | - $this->global_data['compiled_js_path'] = asset_url() . $js_path . '.' . filemtime(APPPATH . "../public/assets/{$js_path}.js") . '.js'; |
|
26 | + $this->global_data['compiled_js_path'] = asset_url().$js_path.'.'.filemtime(APPPATH."../public/assets/{$js_path}.js").'.js'; |
|
27 | 27 | } |
28 | 28 | } |
29 | 29 | |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | $json = is_array($json_input) ? json_encode($json_input) : $json_input; |
55 | 55 | |
56 | 56 | $this->output->set_content_type('application/json', 'utf-8'); |
57 | - $this->_render_content($json ?? '{}','json', $download, $filenamePrefix); |
|
57 | + $this->_render_content($json ?? '{}', 'json', $download, $filenamePrefix); |
|
58 | 58 | } |
59 | 59 | public function _render_content(string $content, string $filenameExt, bool $download = FALSE, string $filenamePrefix = 'tracker') : void { |
60 | 60 | if($download) { |
@@ -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 MY_Output extends CI_Output { |
4 | 4 | protected $current_header = [ |
@@ -71,7 +71,7 @@ |
||
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 | } |
@@ -1,4 +1,4 @@ |
||
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; |
@@ -45,9 +45,9 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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, |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | if($query->num_rows() > 0) { |
77 | 77 | //username exists, grab email |
78 | 78 | $email = $query->row('email'); |
79 | - }else{ |
|
79 | + } else { |
|
80 | 80 | //username doesn't exist, return FALSE |
81 | 81 | $email = FALSE; |
82 | 82 | } |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | public function get_new_api_key() : string { |
109 | 109 | $api_key = NULL; |
110 | 110 | if($this->logged_in()) { |
111 | - $api_key = substr("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", mt_rand(0, 51), 1) . substr(md5((string) time()), 1); |
|
111 | + $api_key = substr("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", mt_rand(0, 51), 1).substr(md5((string) time()), 1); |
|
112 | 112 | |
113 | 113 | $this->db->where('id', $this->id); |
114 | 114 | $this->db->update('auth_users', ['api_key' => $api_key]); |
@@ -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 | /* |
4 | 4 | | ------------------------------------------------------------------- |
@@ -40,6 +40,6 @@ |
||
40 | 40 | |
41 | 41 | $config['dsn'] = TRUE; |
42 | 42 | |
43 | -if(file_exists(APPPATH . 'config/_secure/email.php')) { |
|
44 | - include APPPATH . 'config/_secure/email.php'; //CI BUG: For some odd reason, this isn't picked up by MY_Config. Possibly due to MY_Config not being loaded yet? |
|
43 | +if(file_exists(APPPATH.'config/_secure/email.php')) { |
|
44 | + include APPPATH.'config/_secure/email.php'; //CI BUG: For some odd reason, this isn't picked up by MY_Config. Possibly due to MY_Config not being loaded yet? |
|
45 | 45 | } |
@@ -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 | |-------------------------------------------------------------------------- |
@@ -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 | /* |
4 | 4 | |-------------------------------------------------------------------------- |