@@ -16,12 +16,12 @@ discard block |
||
16 | 16 | $this->header_data['page'] = "forgot_password"; |
17 | 17 | |
18 | 18 | //TODO (RESEARCH): Should we allow username here too? |
19 | - $this->form_validation->set_rules('email', 'Email', 'required|valid_email', array( |
|
19 | + $this->form_validation->set_rules('email', 'Email', 'required|valid_email', array( |
|
20 | 20 | 'required' => 'Please enter your email.', |
21 | 21 | 'valid_email' => 'The email your entered is invalid.' |
22 | 22 | )); |
23 | 23 | |
24 | - if ($this->form_validation->run() === TRUE) { |
|
24 | + if($this->form_validation->run() === TRUE) { |
|
25 | 25 | //form is valid |
26 | 26 | |
27 | 27 | $identity = $this->ion_auth->where('email', $this->input->post('email'))->users()->row(); |
@@ -71,21 +71,21 @@ discard block |
||
71 | 71 | $this->header_data['page'] = "reset-password"; |
72 | 72 | |
73 | 73 | $user = $this->ion_auth->forgotten_password_check($code); |
74 | - if ($user) { |
|
74 | + if($user) { |
|
75 | 75 | //code is valid, show reset form or process reset |
76 | 76 | $min_password_length = $this->config->item('min_password_length', 'ion_auth'); |
77 | 77 | $max_password_length = $this->config->item('max_password_length', 'ion_auth'); |
78 | - $this->form_validation->set_rules('new_password', "Password", 'required|min_length['.$min_password_length.']|max_length['.$max_password_length.']'); |
|
78 | + $this->form_validation->set_rules('new_password', "Password", 'required|min_length['.$min_password_length.']|max_length['.$max_password_length.']'); |
|
79 | 79 | $this->form_validation->set_rules('new_password_confirm', "Password Confirm", 'required|matches[new_password]'); |
80 | 80 | |
81 | - if ($this->form_validation->run() === TRUE) { |
|
81 | + if($this->form_validation->run() === TRUE) { |
|
82 | 82 | //form is valid, process the password reset request |
83 | 83 | //TODO (Research): The original ion_auth auth.php sent the userid to the form, then matched it on return, is there any point to this? |
84 | 84 | |
85 | 85 | $identity = $user->{'email'}; |
86 | 86 | $change = $this->ion_auth->reset_password($identity, $this->input->post('new_password')); |
87 | 87 | |
88 | - if ($change) { |
|
88 | + if($change) { |
|
89 | 89 | //password changed successfully, redirect to login |
90 | 90 | $this->session->set_flashdata('notices', $this->ion_auth->messages()); |
91 | 91 | redirect("user/login", 'refresh'); |
@@ -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 History_Model extends CI_Model { |
4 | 4 | public function __construct() { |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | foreach($result as $row) { |
50 | 50 | $arrRow = []; |
51 | 51 | |
52 | - $arrRow['updated_at'] = $row->updated_at; |
|
52 | + $arrRow['updated_at'] = $row->updated_at; |
|
53 | 53 | |
54 | 54 | $newChapterData = $this->Tracker->sites->{$row->site_class}->getChapterData($row->title_url, $row->new_chapter); |
55 | 55 | $arrRow['new_chapter'] = "<a href=\"{$newChapterData['url']}\">{$newChapterData['number']}</a>"; |
@@ -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( |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | $query = $this->db->select('value_str, value_int') |
201 | 201 | ->from('user_options') |
202 | 202 | ->where('user_id', $userID) |
203 | - ->where('name', $option) |
|
203 | + ->where('name', $option) |
|
204 | 204 | ->limit(1); |
205 | 205 | $data = $query->get()->row_array(); |
206 | 206 | } else { |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | $query = $this->db->select('value_str, value_int') |
209 | 209 | ->from('user_options') |
210 | 210 | ->where('user_id', $userID) |
211 | - ->where('name', $option) |
|
211 | + ->where('name', $option) |
|
212 | 212 | ->limit(1); |
213 | 213 | $data = $query->get()->row_array(); |
214 | 214 | $this->session->set_tempdata("option_{$option}", $data, 3600); |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | ); |
262 | 262 | //FIXME: Get a better solution than str_replace for removing special characters |
263 | 263 | $elements = array(); |
264 | - foreach (array_values($this->options[$option]['valid_options']) as $valid_option) { |
|
264 | + foreach(array_values($this->options[$option]['valid_options']) as $valid_option) { |
|
265 | 265 | $elements[$option.'_'.str_replace(',', '_', $valid_option)] = array_merge($base_attributes, array( |
266 | 266 | 'value' => $valid_option |
267 | 267 | )); |
@@ -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_Base_Model extends CI_Model { |
4 | 4 | public $sites; |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | $this->enabledCategories['custom3'] = $this->User_Options->get('category_custom_3_text'); |
27 | 27 | } |
28 | 28 | |
29 | - foreach (glob(APPPATH.'models/Tracker/Sites/*.php') as $filename) { |
|
29 | + foreach(glob(APPPATH.'models/Tracker/Sites/*.php') as $filename) { |
|
30 | 30 | /** @noinspection PhpIncludeInspection */ |
31 | 31 | include_once $filename; |
32 | 32 | } |
@@ -136,7 +136,7 @@ |
||
136 | 136 | | |
137 | 137 | <a href="#" class="set-mal-id" data-mal-id="<?=$row['mal_id']?>" data-mal-type="<?=$row['mal_type']?>">Set MAL ID</a> <?php if(!is_null($row['mal_id']) && $row['mal_type'] == 'chapter') { ?><span>(<small><?=($row['mal_id'] !== '0' ? $row['mal_id'] : 'none')?></small>)</span><?php } ?> |
138 | 138 | | |
139 | - Tags (<a href="#" class="edit-tags small">Edit</a>): <span class="text-lowercase tag-list"><?=($row['has_tags'] ? implode("", array_map(function ($str) { return "<i class='tag'>{$str}</i>"; }, explode(",", $row['tag_list']))) : "none")?></span> |
|
139 | + Tags (<a href="#" class="edit-tags small">Edit</a>): <span class="text-lowercase tag-list"><?=($row['has_tags'] ? implode("", array_map(function($str) { return "<i class='tag'>{$str}</i>"; }, explode(",", $row['tag_list']))) : "none")?></span> |
|
140 | 140 | <div class="input-group hidden tag-edit"> |
141 | 141 | <input type="text" class="form-control" placeholder="tag1,tag2,tag3" maxlength="255" pattern='[a-z0-9-_,]{0,255}' value="<?=$row['tag_list']?>"> |
142 | 142 | <span class="input-group-btn"> |
@@ -1,11 +1,11 @@ |
||
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 | //Because we can't autoload the cache driver with params - https://forum.codeigniter.com/thread-62217-post-319687.html#pid319687 |
4 | 4 | class Cacher { |
5 | 5 | protected $CI; |
6 | 6 | |
7 | 7 | public function __construct() { |
8 | - $this->CI =& get_instance(); //grab an instance of CI |
|
8 | + $this->CI = & get_instance(); //grab an instance of CI |
|
9 | 9 | $this->initiate_cache(); |
10 | 10 | } |
11 | 11 |
@@ -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. |
@@ -18,10 +18,10 @@ discard block |
||
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 |
||
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) { |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | // break; |
27 | 27 | |
28 | 28 | case 'html': |
29 | - $this->body_data['trackerData'] = $trackerData['series']; |
|
29 | + $this->body_data['trackerData'] = $trackerData['series']; |
|
30 | 30 | |
31 | 31 | $this->header_data['show_header'] = FALSE; |
32 | 32 | $this->footer_data['show_footer'] = FALSE; |
@@ -62,12 +62,12 @@ discard block |
||
62 | 62 | if($show_404) show_404(); |
63 | 63 | } |
64 | 64 | |
65 | - private function _walk_recursive_remove (array $array, callable $callback) : array { |
|
66 | - foreach ($array as $k => $v) { |
|
67 | - if (is_array($v)) { |
|
65 | + private function _walk_recursive_remove(array $array, callable $callback) : array { |
|
66 | + foreach($array as $k => $v) { |
|
67 | + if(is_array($v)) { |
|
68 | 68 | $array[$k] = $this->_walk_recursive_remove($v, $callback); |
69 | 69 | } else { |
70 | - if ($callback($v, $k)) { |
|
70 | + if($callback($v, $k)) { |
|
71 | 71 | unset($array[$k]); |
72 | 72 | } |
73 | 73 | } |
@@ -31,7 +31,7 @@ |
||
31 | 31 | |
32 | 32 | case 'csv': |
33 | 33 | $this->output->set_content_type('text/csv', 'utf-8'); |
34 | - $this->_render_content($this->Tracker->portation->arrayToCSVRecursive($historyData, 'Date/Time,Title,URL,Site,Status'), 'csv',TRUE, 'tracker-history'); |
|
34 | + $this->_render_content($this->Tracker->portation->arrayToCSVRecursive($historyData, 'Date/Time,Title,URL,Site,Status'), 'csv', TRUE, 'tracker-history'); |
|
35 | 35 | break; |
36 | 36 | |
37 | 37 | default: |