@@ -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"; ?> |
@@ -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"; ?> |
@@ -6,7 +6,7 @@ |
||
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. |
@@ -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 Auth_Model extends CI_Model { |
4 | 4 | public function __construct() { |
@@ -60,7 +60,7 @@ discard block |
||
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 |
||
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; |
@@ -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 Tracker_Model extends CI_Model { |
4 | 4 | public $sites; |
@@ -49,8 +49,8 @@ discard block |
||
49 | 49 | ]; |
50 | 50 | } |
51 | 51 | if($query->num_rows() > 0) { |
52 | - foreach ($query->result() as $row) { |
|
53 | - $is_unread = intval($row->latest_chapter == $row->current_chapter ? '1' : '0'); |
|
52 | + foreach($query->result() as $row) { |
|
53 | + $is_unread = intval($row->latest_chapter == $row->current_chapter ? '1' : '0'); |
|
54 | 54 | $arr[$row->category]['unread_count'] = (($arr[$row->category]['unread_count'] ?? 0) + !$is_unread); |
55 | 55 | $arr[$row->category]['manga'][] = [ |
56 | 56 | 'id' => $row->id, |
@@ -79,8 +79,8 @@ discard block |
||
79 | 79 | } |
80 | 80 | |
81 | 81 | //NOTE: This does not sort in the same way as tablesorter, but it works better. |
82 | - foreach (array_keys($arr) as $category) { |
|
83 | - usort($arr[$category]['manga'], function ($a, $b) { |
|
82 | + foreach(array_keys($arr) as $category) { |
|
83 | + usort($arr[$category]['manga'], function($a, $b) { |
|
84 | 84 | return strtolower("{$a['new_chapter_exists']} - {$a['title_data']['title']}") <=> strtolower("{$b['new_chapter_exists']} - {$b['title_data']['title']}"); |
85 | 85 | }); |
86 | 86 | } |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | ->get(); |
227 | 227 | |
228 | 228 | if($query->num_rows() > 0) { |
229 | - foreach ($query->result() as $row) { |
|
229 | + foreach($query->result() as $row) { |
|
230 | 230 | print "> {$row->title} <{$row->site_class}>"; //Print this prior to doing anything so we can more easily find out if something went wrong |
231 | 231 | $titleData = $this->sites->{$row->site_class}->getTitleData($row->title_url); |
232 | 232 | if(!is_null($titleData['latest_chapter'])) { |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | |
262 | 262 | $arr = []; |
263 | 263 | if($query->num_rows() > 0) { |
264 | - foreach ($query->result() as $row) { |
|
264 | + foreach($query->result() as $row) { |
|
265 | 265 | $arr[$row->category][] = [ |
266 | 266 | 'site' => $row->site, |
267 | 267 | 'title_url' => $row->title_url, |
@@ -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_Options_Model extends CI_Model { |
4 | 4 | public $options = array( |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | $query = $this->db->select('value_str, value_int') |
141 | 141 | ->from('user_options') |
142 | 142 | ->where('user_id', $userID) |
143 | - ->where('name', $option) |
|
143 | + ->where('name', $option) |
|
144 | 144 | ->limit(1); |
145 | 145 | return $query->get()->row_array(); |
146 | 146 | } |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | ); |
180 | 180 | //FIXME: Get a better solution than str_replace for removing special characters |
181 | 181 | $elements = array(); |
182 | - foreach (array_values($this->options[$option]['valid_options']) as $valid_option) { |
|
182 | + foreach(array_values($this->options[$option]['valid_options']) as $valid_option) { |
|
183 | 183 | $elements[$option.'_'.str_replace(',', '_', $valid_option)] = array_merge($base_attributes, array( |
184 | 184 | 'value' => $valid_option |
185 | 185 | )); |
@@ -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]); |
@@ -11,14 +11,14 @@ |
||
11 | 11 | |
12 | 12 | $config['gravatar_base_url'] = 'http://www.gravatar.com/'; |
13 | 13 | $config['gravatar_secure_base_url'] = 'https://secure.gravatar.com/'; |
14 | -$config['gravatar_image_extension'] = '.png'; // '', '.png' or '.jpg'. |
|
14 | +$config['gravatar_image_extension'] = '.png'; // '', '.png' or '.jpg'. |
|
15 | 15 | $config['gravatar_image_size'] = 44; |
16 | 16 | |
17 | 17 | $config['gravatar_default_image'] = 'identicon'; // '', '404', 'mm', 'identicon', 'monsterid', 'wavatar', 'retro', 'blank'. |
18 | 18 | //$config['gravatar_default_image'] = BASE_URL.'assets/img/lib/default-person.png'; // Another possible option: a custon image. |
19 | 19 | |
20 | 20 | $config['gravatar_force_default_image'] = false; |
21 | -$config['gravatar_rating'] = ''; // '', 'g' (default), 'pg', 'r', 'x'. |
|
21 | +$config['gravatar_rating'] = ''; // '', 'g' (default), 'pg', 'r', 'x'. |
|
22 | 22 | |
23 | 23 | // Useragent string for server-made requests. |
24 | 24 | // It is for not getting 403 forbidden response. |
@@ -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] //TODO: Change later. |
|
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 //TODO: Enable later. |
|
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 | -$config['user_expire'] = 86500; // 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. |
|
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 |
|
85 | +$config['site_title'] = "Manga Tracker"; // Site Title, example.com |
|
86 | +$config['admin_email'] = "[email protected]"; // Admin Email, [email protected] //TODO: Change later. |
|
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 //TODO: Enable later. |
|
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 | +$config['user_expire'] = 86500; // 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. |
|
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 */ |