@@ -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 | $this->load->driver('cache', array('adapter' => 'file', 'backup' => 'apc')); //Sadly we can't autoload this with params |
@@ -88,7 +88,9 @@ discard block |
||
88 | 88 | public function __construct() { |
89 | 89 | parent::__construct(); |
90 | 90 | |
91 | - if($this->ion_auth->logged_in()) redirect('/'); |
|
91 | + if($this->ion_auth->logged_in()) { |
|
92 | + redirect('/'); |
|
93 | + } |
|
92 | 94 | } |
93 | 95 | } |
94 | 96 |
@@ -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 | $this->load->driver('cache', array('adapter' => 'file', 'backup' => 'apc')); //Sadly we can't autoload this with params |
@@ -20,10 +20,10 @@ discard block |
||
20 | 20 | $this->global_data['analytics_tracking_id'] = $this->config->item('tracking_id'); |
21 | 21 | |
22 | 22 | $css_path = "css/main.{$this->User_Options->get('theme')}"; |
23 | - $this->global_data['complied_css_path'] = asset_url()."{$css_path}.".filemtime(APPPATH . "../public/assets/{$css_path}.css").".css"; |
|
23 | + $this->global_data['complied_css_path'] = asset_url()."{$css_path}.".filemtime(APPPATH."../public/assets/{$css_path}.css").".css"; |
|
24 | 24 | |
25 | 25 | $js_path = 'js/compiled.min'; |
26 | - $this->global_data['complied_js_path'] = asset_url()."{$js_path}.".filemtime(APPPATH . "../public/assets/{$js_path}.js").".js"; |
|
26 | + $this->global_data['complied_js_path'] = asset_url()."{$js_path}.".filemtime(APPPATH."../public/assets/{$js_path}.js").".js"; |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | public function _render_page(/*(array) $paths*/) : void { |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | $json = is_array($json_input) ? json_encode($json_input) : $json_input; |
48 | 48 | |
49 | 49 | $this->output->set_content_type('application/json', 'utf-8'); |
50 | - $this->_render_content($json,'json', $download, $filenamePrefix); |
|
50 | + $this->_render_content($json, 'json', $download, $filenamePrefix); |
|
51 | 51 | } |
52 | 52 | public function _render_content(string $content, string $filenameExt, bool $download = FALSE, string $filenamePrefix = 'tracker') : void { |
53 | 53 | 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 = [ |
@@ -1,4 +1,4 @@ discard block |
||
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 |
||
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 |
||
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]); |
@@ -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; |
@@ -40,9 +40,9 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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, |
@@ -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 | | ------------------------------------------------------------------- |
@@ -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 | |-------------------------------------------------------------------------- |
@@ -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 | * Name: Ion Auth |
4 | 4 | * |
@@ -66,8 +66,8 @@ discard block |
||
66 | 66 | | salt_prefix: Used for bcrypt. Versions of PHP before 5.3.7 only support "$2a$" as the salt prefix |
67 | 67 | | Versions 5.3.7 or greater should use the default of "$2y$". |
68 | 68 | */ |
69 | -$config['hash_method'] = 'bcrypt'; // sha1 or bcrypt, bcrypt is STRONGLY recommended |
|
70 | -$config['default_rounds'] = 8; // This does not apply if random_rounds is set to true |
|
69 | +$config['hash_method'] = 'bcrypt'; // sha1 or bcrypt, bcrypt is STRONGLY recommended |
|
70 | +$config['default_rounds'] = 8; // This does not apply if random_rounds is set to true |
|
71 | 71 | $config['random_rounds'] = FALSE; |
72 | 72 | $config['min_rounds'] = 5; |
73 | 73 | $config['max_rounds'] = 9; |
@@ -82,22 +82,22 @@ discard block |
||
82 | 82 | | The controller should check this function and act |
83 | 83 | | appropriately. If this variable set to 0, there is no maximum. |
84 | 84 | */ |
85 | -$config['site_title'] = "Manga Tracker"; // Site Title, example.com |
|
86 | -$config['admin_email'] = "[email protected]"; // Admin Email, [email protected] //FIXME: This is being used for a lot of things it shouldn't be. We need a diff config option. |
|
87 | -$config['default_group'] = 'members'; // Default group, use name |
|
88 | -$config['admin_group'] = 'admin'; // Default administrators group, use name |
|
89 | -$config['identity'] = 'email'; // [NOTE: username can be used too] You can use any unique column in your table as identity column. The values in this column, alongside password, will be used for login purposes |
|
90 | -$config['min_password_length'] = 6; // Minimum Required Length of Password |
|
91 | -$config['max_password_length'] = 64; // Maximum Allowed Length of Password |
|
92 | -$config['email_activation'] = FALSE; // Email Activation for registration |
|
93 | -$config['manual_activation'] = FALSE; // Manual Activation for registration |
|
94 | -$config['remember_users'] = TRUE; // Allow users to be remembered and enable auto-login |
|
85 | +$config['site_title'] = "Manga Tracker"; // Site Title, example.com |
|
86 | +$config['admin_email'] = "[email protected]"; // Admin Email, [email protected] //FIXME: This is being used for a lot of things it shouldn't be. We need a diff config option. |
|
87 | +$config['default_group'] = 'members'; // Default group, use name |
|
88 | +$config['admin_group'] = 'admin'; // Default administrators group, use name |
|
89 | +$config['identity'] = 'email'; // [NOTE: username can be used too] You can use any unique column in your table as identity column. The values in this column, alongside password, will be used for login purposes |
|
90 | +$config['min_password_length'] = 6; // Minimum Required Length of Password |
|
91 | +$config['max_password_length'] = 64; // Maximum Allowed Length of Password |
|
92 | +$config['email_activation'] = FALSE; // Email Activation for registration |
|
93 | +$config['manual_activation'] = FALSE; // Manual Activation for registration |
|
94 | +$config['remember_users'] = TRUE; // Allow users to be remembered and enable auto-login |
|
95 | 95 | $config['user_expire'] = 259200; /*3DAYS*/ // How long to remember the user (seconds). Set to zero for no expiration |
96 | -$config['user_extend_on_login'] = TRUE; // Extend the users cookies every time they auto-login |
|
97 | -$config['track_login_attempts'] = FALSE; // Track the number of failed login attempts for each user or ip. //CHECK: Should this be true? |
|
98 | -$config['track_login_ip_address'] = TRUE; // Track login attempts by IP Address, if FALSE will track based on identity. (Default: TRUE) |
|
99 | -$config['maximum_login_attempts'] = 3; // The maximum number of failed login attempts. |
|
100 | -$config['lockout_time'] = 600; // The number of seconds to lockout an account due to exceeded attempts |
|
96 | +$config['user_extend_on_login'] = TRUE; // Extend the users cookies every time they auto-login |
|
97 | +$config['track_login_attempts'] = FALSE; // Track the number of failed login attempts for each user or ip. //CHECK: Should this be true? |
|
98 | +$config['track_login_ip_address'] = TRUE; // Track login attempts by IP Address, if FALSE will track based on identity. (Default: TRUE) |
|
99 | +$config['maximum_login_attempts'] = 3; // The maximum number of failed login attempts. |
|
100 | +$config['lockout_time'] = 600; // The number of seconds to lockout an account due to exceeded attempts |
|
101 | 101 | $config['forgot_password_expiration'] = 43200000; /*12HR*/ // The number of milliseconds after which a forgot password request will expire. If set to 0, forgot password requests will not expire. |
102 | 102 | |
103 | 103 | /* |
@@ -175,11 +175,11 @@ discard block |
||
175 | 175 | | Message Delimiters. |
176 | 176 | | ------------------------------------------------------------------------- |
177 | 177 | */ |
178 | -$config['delimiters_source'] = 'config'; // "config" = use the settings defined here, "form_validation" = use the settings defined in CI's form validation library |
|
179 | -$config['message_start_delimiter'] = '<p>'; // Message start delimiter |
|
180 | -$config['message_end_delimiter'] = '</p>'; // Message end delimiter |
|
181 | -$config['error_start_delimiter'] = '<p>'; // Error message start delimiter |
|
182 | -$config['error_end_delimiter'] = '</p>'; // Error message end delimiter |
|
178 | +$config['delimiters_source'] = 'config'; // "config" = use the settings defined here, "form_validation" = use the settings defined in CI's form validation library |
|
179 | +$config['message_start_delimiter'] = '<p>'; // Message start delimiter |
|
180 | +$config['message_end_delimiter'] = '</p>'; // Message end delimiter |
|
181 | +$config['error_start_delimiter'] = '<p>'; // Error message start delimiter |
|
182 | +$config['error_end_delimiter'] = '</p>'; // Error message end delimiter |
|
183 | 183 | |
184 | 184 | /* End of file ion_auth.php */ |
185 | 185 | /* Location: ./application/config/ion_auth.php */ |
@@ -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 | | ------------------------------------------------------------------- |