@@ -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 | /* GENERAL OPTIONS */ |
| 4 | 4 | $config['handlers'] = array('file', 'papertrail'); // valid handlers are ci_file | file | new_relic | hipchat | stderr | papertrail |
@@ -149,7 +149,7 @@ |
||
| 149 | 149 | | |
| 150 | 150 | <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 } ?> |
| 151 | 151 | | |
| 152 | - 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> |
|
| 152 | + 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> |
|
| 153 | 153 | <div class="input-group tag-edit" hidden> |
| 154 | 154 | <input type="text" class="form-control" placeholder="tag1,tag2,tag3" maxlength="255" pattern='[a-z0-9-_,]{0,255}' value="<?=$row['tag_list']?>"> |
| 155 | 155 | <span class="input-group-btn"> |
@@ -10,7 +10,7 @@ |
||
| 10 | 10 | <?=form_input($form_url)?> |
| 11 | 11 | </div> |
| 12 | 12 | |
| 13 | - <?=form_input('website','', ['id' => 'website'])?> |
|
| 13 | + <?=form_input('website', '', ['id' => 'website'])?> |
|
| 14 | 14 | |
| 15 | 15 | <?=validation_errors()?><?=($issue_submitted ? "Issue successfully submitted" : "")?> |
| 16 | 16 | <button type="submit" class="btn btn-primary">Submit</button> | Alternatively, post an issue on our <?=anchor('https://github.com/DakuTree/manga-tracker/issues/new', 'Github page')?>. |
@@ -5,7 +5,7 @@ |
||
| 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 | |
@@ -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 | /* GENERAL OPTIONS */ |
| 4 | 4 | $config['handlers'] = array('file', 'cli'); // valid handlers are ci_file | file | new_relic | hipchat | stderr | papertrail |
@@ -26,10 +26,10 @@ discard block |
||
| 26 | 26 | | always be used to set the mode correctly. |
| 27 | 27 | | |
| 28 | 28 | */ |
| 29 | -defined('FILE_READ_MODE') OR define('FILE_READ_MODE', 0644); |
|
| 29 | +defined('FILE_READ_MODE') OR define('FILE_READ_MODE', 0644); |
|
| 30 | 30 | defined('FILE_WRITE_MODE') OR define('FILE_WRITE_MODE', 0666); |
| 31 | -defined('DIR_READ_MODE') OR define('DIR_READ_MODE', 0755); |
|
| 32 | -defined('DIR_WRITE_MODE') OR define('DIR_WRITE_MODE', 0755); |
|
| 31 | +defined('DIR_READ_MODE') OR define('DIR_READ_MODE', 0755); |
|
| 32 | +defined('DIR_WRITE_MODE') OR define('DIR_WRITE_MODE', 0755); |
|
| 33 | 33 | |
| 34 | 34 | /* |
| 35 | 35 | |-------------------------------------------------------------------------- |
@@ -39,14 +39,14 @@ discard block |
||
| 39 | 39 | | These modes are used when working with fopen()/popen() |
| 40 | 40 | | |
| 41 | 41 | */ |
| 42 | -defined('FOPEN_READ') OR define('FOPEN_READ', 'rb'); |
|
| 43 | -defined('FOPEN_READ_WRITE') OR define('FOPEN_READ_WRITE', 'r+b'); |
|
| 44 | -defined('FOPEN_WRITE_CREATE_DESTRUCTIVE') OR define('FOPEN_WRITE_CREATE_DESTRUCTIVE', 'wb'); // truncates existing file data, use with care |
|
| 42 | +defined('FOPEN_READ') OR define('FOPEN_READ', 'rb'); |
|
| 43 | +defined('FOPEN_READ_WRITE') OR define('FOPEN_READ_WRITE', 'r+b'); |
|
| 44 | +defined('FOPEN_WRITE_CREATE_DESTRUCTIVE') OR define('FOPEN_WRITE_CREATE_DESTRUCTIVE', 'wb'); // truncates existing file data, use with care |
|
| 45 | 45 | defined('FOPEN_READ_WRITE_CREATE_DESCTRUCTIVE') OR define('FOPEN_READ_WRITE_CREATE_DESTRUCTIVE', 'w+b'); // truncates existing file data, use with care |
| 46 | -defined('FOPEN_WRITE_CREATE') OR define('FOPEN_WRITE_CREATE', 'ab'); |
|
| 47 | -defined('FOPEN_READ_WRITE_CREATE') OR define('FOPEN_READ_WRITE_CREATE', 'a+b'); |
|
| 48 | -defined('FOPEN_WRITE_CREATE_STRICT') OR define('FOPEN_WRITE_CREATE_STRICT', 'xb'); |
|
| 49 | -defined('FOPEN_READ_WRITE_CREATE_STRICT') OR define('FOPEN_READ_WRITE_CREATE_STRICT', 'x+b'); |
|
| 46 | +defined('FOPEN_WRITE_CREATE') OR define('FOPEN_WRITE_CREATE', 'ab'); |
|
| 47 | +defined('FOPEN_READ_WRITE_CREATE') OR define('FOPEN_READ_WRITE_CREATE', 'a+b'); |
|
| 48 | +defined('FOPEN_WRITE_CREATE_STRICT') OR define('FOPEN_WRITE_CREATE_STRICT', 'xb'); |
|
| 49 | +defined('FOPEN_READ_WRITE_CREATE_STRICT') OR define('FOPEN_READ_WRITE_CREATE_STRICT', 'x+b'); |
|
| 50 | 50 | |
| 51 | 51 | /* |
| 52 | 52 | |-------------------------------------------------------------------------- |
@@ -73,20 +73,20 @@ discard block |
||
| 73 | 73 | | http://tldp.org/LDP/abs/html/exitcodes.html |
| 74 | 74 | | |
| 75 | 75 | */ |
| 76 | -defined('EXIT_SUCCESS') OR define('EXIT_SUCCESS', 0); // no errors |
|
| 77 | -defined('EXIT_ERROR') OR define('EXIT_ERROR', 1); // generic error |
|
| 78 | -defined('EXIT_CONFIG') OR define('EXIT_CONFIG', 3); // configuration error |
|
| 79 | -defined('EXIT_UNKNOWN_FILE') OR define('EXIT_UNKNOWN_FILE', 4); // file not found |
|
| 80 | -defined('EXIT_UNKNOWN_CLASS') OR define('EXIT_UNKNOWN_CLASS', 5); // unknown class |
|
| 76 | +defined('EXIT_SUCCESS') OR define('EXIT_SUCCESS', 0); // no errors |
|
| 77 | +defined('EXIT_ERROR') OR define('EXIT_ERROR', 1); // generic error |
|
| 78 | +defined('EXIT_CONFIG') OR define('EXIT_CONFIG', 3); // configuration error |
|
| 79 | +defined('EXIT_UNKNOWN_FILE') OR define('EXIT_UNKNOWN_FILE', 4); // file not found |
|
| 80 | +defined('EXIT_UNKNOWN_CLASS') OR define('EXIT_UNKNOWN_CLASS', 5); // unknown class |
|
| 81 | 81 | defined('EXIT_UNKNOWN_METHOD') OR define('EXIT_UNKNOWN_METHOD', 6); // unknown class member |
| 82 | -defined('EXIT_USER_INPUT') OR define('EXIT_USER_INPUT', 7); // invalid user input |
|
| 83 | -defined('EXIT_DATABASE') OR define('EXIT_DATABASE', 8); // database error |
|
| 84 | -defined('EXIT__AUTO_MIN') OR define('EXIT__AUTO_MIN', 9); // lowest automatically-assigned error code |
|
| 85 | -defined('EXIT__AUTO_MAX') OR define('EXIT__AUTO_MAX', 125); // highest automatically-assigned error code |
|
| 82 | +defined('EXIT_USER_INPUT') OR define('EXIT_USER_INPUT', 7); // invalid user input |
|
| 83 | +defined('EXIT_DATABASE') OR define('EXIT_DATABASE', 8); // database error |
|
| 84 | +defined('EXIT__AUTO_MIN') OR define('EXIT__AUTO_MIN', 9); // lowest automatically-assigned error code |
|
| 85 | +defined('EXIT__AUTO_MAX') OR define('EXIT__AUTO_MAX', 125); // highest automatically-assigned error code |
|
| 86 | 86 | |
| 87 | 87 | /***** TIMEAGO CONSTANTS *****/ |
| 88 | 88 | defined('TIMEAGO_MONTH') OR define('TIMEAGO_MONTH', strtotime('-1 month')); //1 month ago |
| 89 | -defined('TIMEAGO_WEEK') OR define('TIMEAGO_WEEK', strtotime('-1 week')); //1 week ago |
|
| 90 | -defined('TIMEAGO_3DAY') OR define('TIMEAGO_3DAY', strtotime('-3 day')); //3 days ago |
|
| 89 | +defined('TIMEAGO_WEEK') OR define('TIMEAGO_WEEK', strtotime('-1 week')); //1 week ago |
|
| 90 | +defined('TIMEAGO_3DAY') OR define('TIMEAGO_3DAY', strtotime('-3 day')); //3 days ago |
|
| 91 | 91 | |
| 92 | 92 | defined('USERSCRIPT_VERSION') OR define('USERSCRIPT_VERSION', '1.10.42'); //This is automatically set by a PHPStorm File Watcher |
@@ -1,5 +1,5 @@ discard block |
||
| 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 | |-------------------------------------------------------------------------- |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | | of this setting |
| 12 | 12 | | |
| 13 | 13 | */ |
| 14 | -defined('SHOW_DEBUG_BACKTRACE') OR define('SHOW_DEBUG_BACKTRACE', TRUE); |
|
| 14 | +defined('SHOW_DEBUG_BACKTRACE') or define('SHOW_DEBUG_BACKTRACE', TRUE); |
|
| 15 | 15 | |
| 16 | 16 | /* |
| 17 | 17 | |-------------------------------------------------------------------------- |
@@ -26,10 +26,10 @@ discard block |
||
| 26 | 26 | | always be used to set the mode correctly. |
| 27 | 27 | | |
| 28 | 28 | */ |
| 29 | -defined('FILE_READ_MODE') OR define('FILE_READ_MODE', 0644); |
|
| 30 | -defined('FILE_WRITE_MODE') OR define('FILE_WRITE_MODE', 0666); |
|
| 31 | -defined('DIR_READ_MODE') OR define('DIR_READ_MODE', 0755); |
|
| 32 | -defined('DIR_WRITE_MODE') OR define('DIR_WRITE_MODE', 0755); |
|
| 29 | +defined('FILE_READ_MODE') or define('FILE_READ_MODE', 0644); |
|
| 30 | +defined('FILE_WRITE_MODE') or define('FILE_WRITE_MODE', 0666); |
|
| 31 | +defined('DIR_READ_MODE') or define('DIR_READ_MODE', 0755); |
|
| 32 | +defined('DIR_WRITE_MODE') or define('DIR_WRITE_MODE', 0755); |
|
| 33 | 33 | |
| 34 | 34 | /* |
| 35 | 35 | |-------------------------------------------------------------------------- |
@@ -39,14 +39,14 @@ discard block |
||
| 39 | 39 | | These modes are used when working with fopen()/popen() |
| 40 | 40 | | |
| 41 | 41 | */ |
| 42 | -defined('FOPEN_READ') OR define('FOPEN_READ', 'rb'); |
|
| 43 | -defined('FOPEN_READ_WRITE') OR define('FOPEN_READ_WRITE', 'r+b'); |
|
| 44 | -defined('FOPEN_WRITE_CREATE_DESTRUCTIVE') OR define('FOPEN_WRITE_CREATE_DESTRUCTIVE', 'wb'); // truncates existing file data, use with care |
|
| 45 | -defined('FOPEN_READ_WRITE_CREATE_DESCTRUCTIVE') OR define('FOPEN_READ_WRITE_CREATE_DESTRUCTIVE', 'w+b'); // truncates existing file data, use with care |
|
| 46 | -defined('FOPEN_WRITE_CREATE') OR define('FOPEN_WRITE_CREATE', 'ab'); |
|
| 47 | -defined('FOPEN_READ_WRITE_CREATE') OR define('FOPEN_READ_WRITE_CREATE', 'a+b'); |
|
| 48 | -defined('FOPEN_WRITE_CREATE_STRICT') OR define('FOPEN_WRITE_CREATE_STRICT', 'xb'); |
|
| 49 | -defined('FOPEN_READ_WRITE_CREATE_STRICT') OR define('FOPEN_READ_WRITE_CREATE_STRICT', 'x+b'); |
|
| 42 | +defined('FOPEN_READ') or define('FOPEN_READ', 'rb'); |
|
| 43 | +defined('FOPEN_READ_WRITE') or define('FOPEN_READ_WRITE', 'r+b'); |
|
| 44 | +defined('FOPEN_WRITE_CREATE_DESTRUCTIVE') or define('FOPEN_WRITE_CREATE_DESTRUCTIVE', 'wb'); // truncates existing file data, use with care |
|
| 45 | +defined('FOPEN_READ_WRITE_CREATE_DESCTRUCTIVE') or define('FOPEN_READ_WRITE_CREATE_DESTRUCTIVE', 'w+b'); // truncates existing file data, use with care |
|
| 46 | +defined('FOPEN_WRITE_CREATE') or define('FOPEN_WRITE_CREATE', 'ab'); |
|
| 47 | +defined('FOPEN_READ_WRITE_CREATE') or define('FOPEN_READ_WRITE_CREATE', 'a+b'); |
|
| 48 | +defined('FOPEN_WRITE_CREATE_STRICT') or define('FOPEN_WRITE_CREATE_STRICT', 'xb'); |
|
| 49 | +defined('FOPEN_READ_WRITE_CREATE_STRICT') or define('FOPEN_READ_WRITE_CREATE_STRICT', 'x+b'); |
|
| 50 | 50 | |
| 51 | 51 | /* |
| 52 | 52 | |-------------------------------------------------------------------------- |
@@ -73,20 +73,20 @@ discard block |
||
| 73 | 73 | | http://tldp.org/LDP/abs/html/exitcodes.html |
| 74 | 74 | | |
| 75 | 75 | */ |
| 76 | -defined('EXIT_SUCCESS') OR define('EXIT_SUCCESS', 0); // no errors |
|
| 77 | -defined('EXIT_ERROR') OR define('EXIT_ERROR', 1); // generic error |
|
| 78 | -defined('EXIT_CONFIG') OR define('EXIT_CONFIG', 3); // configuration error |
|
| 79 | -defined('EXIT_UNKNOWN_FILE') OR define('EXIT_UNKNOWN_FILE', 4); // file not found |
|
| 80 | -defined('EXIT_UNKNOWN_CLASS') OR define('EXIT_UNKNOWN_CLASS', 5); // unknown class |
|
| 81 | -defined('EXIT_UNKNOWN_METHOD') OR define('EXIT_UNKNOWN_METHOD', 6); // unknown class member |
|
| 82 | -defined('EXIT_USER_INPUT') OR define('EXIT_USER_INPUT', 7); // invalid user input |
|
| 83 | -defined('EXIT_DATABASE') OR define('EXIT_DATABASE', 8); // database error |
|
| 84 | -defined('EXIT__AUTO_MIN') OR define('EXIT__AUTO_MIN', 9); // lowest automatically-assigned error code |
|
| 85 | -defined('EXIT__AUTO_MAX') OR define('EXIT__AUTO_MAX', 125); // highest automatically-assigned error code |
|
| 76 | +defined('EXIT_SUCCESS') or define('EXIT_SUCCESS', 0); // no errors |
|
| 77 | +defined('EXIT_ERROR') or define('EXIT_ERROR', 1); // generic error |
|
| 78 | +defined('EXIT_CONFIG') or define('EXIT_CONFIG', 3); // configuration error |
|
| 79 | +defined('EXIT_UNKNOWN_FILE') or define('EXIT_UNKNOWN_FILE', 4); // file not found |
|
| 80 | +defined('EXIT_UNKNOWN_CLASS') or define('EXIT_UNKNOWN_CLASS', 5); // unknown class |
|
| 81 | +defined('EXIT_UNKNOWN_METHOD') or define('EXIT_UNKNOWN_METHOD', 6); // unknown class member |
|
| 82 | +defined('EXIT_USER_INPUT') or define('EXIT_USER_INPUT', 7); // invalid user input |
|
| 83 | +defined('EXIT_DATABASE') or define('EXIT_DATABASE', 8); // database error |
|
| 84 | +defined('EXIT__AUTO_MIN') or define('EXIT__AUTO_MIN', 9); // lowest automatically-assigned error code |
|
| 85 | +defined('EXIT__AUTO_MAX') or define('EXIT__AUTO_MAX', 125); // highest automatically-assigned error code |
|
| 86 | 86 | |
| 87 | 87 | /***** TIMEAGO CONSTANTS *****/ |
| 88 | -defined('TIMEAGO_MONTH') OR define('TIMEAGO_MONTH', strtotime('-1 month')); //1 month ago |
|
| 89 | -defined('TIMEAGO_WEEK') OR define('TIMEAGO_WEEK', strtotime('-1 week')); //1 week ago |
|
| 90 | -defined('TIMEAGO_3DAY') OR define('TIMEAGO_3DAY', strtotime('-3 day')); //3 days ago |
|
| 88 | +defined('TIMEAGO_MONTH') or define('TIMEAGO_MONTH', strtotime('-1 month')); //1 month ago |
|
| 89 | +defined('TIMEAGO_WEEK') or define('TIMEAGO_WEEK', strtotime('-1 week')); //1 week ago |
|
| 90 | +defined('TIMEAGO_3DAY') or define('TIMEAGO_3DAY', strtotime('-3 day')); //3 days ago |
|
| 91 | 91 | |
| 92 | -defined('USERSCRIPT_VERSION') OR define('USERSCRIPT_VERSION', '1.10.42'); //This is automatically set by a PHPStorm File Watcher |
|
| 92 | +defined('USERSCRIPT_VERSION') or define('USERSCRIPT_VERSION', '1.10.42'); //This is automatically set by a PHPStorm File Watcher |
|
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | * @param string $file Configuration file name |
| 12 | 12 | * @param bool $use_sections Whether configuration values should be loaded into their own section |
| 13 | 13 | * @param bool $fail_gracefully Whether to just return FALSE or display an error message |
| 14 | - * @return bool TRUE if the file was loaded correctly or FALSE on failure |
|
| 14 | + * @return boolean|null TRUE if the file was loaded correctly or FALSE on failure |
|
| 15 | 15 | */ |
| 16 | 16 | public function load($file = '', $use_sections = FALSE, $fail_gracefully = FALSE) |
| 17 | 17 | { |
@@ -18,26 +18,26 @@ discard block |
||
| 18 | 18 | $file = ($file === '') ? 'config' : str_replace('.php', '', $file); |
| 19 | 19 | $loaded = FALSE; |
| 20 | 20 | |
| 21 | - foreach ($this->_config_paths as $path) |
|
| 21 | + foreach($this->_config_paths as $path) |
|
| 22 | 22 | { |
| 23 | - foreach (array($file, '_secure'.DIRECTORY_SEPARATOR.$file, ENVIRONMENT.DIRECTORY_SEPARATOR.$file) as $location) |
|
| 23 | + foreach(array($file, '_secure'.DIRECTORY_SEPARATOR.$file, ENVIRONMENT.DIRECTORY_SEPARATOR.$file) as $location) |
|
| 24 | 24 | { |
| 25 | 25 | $file_path = $path.'config/'.$location.'.php'; |
| 26 | - if (in_array($file_path, $this->is_loaded, TRUE)) |
|
| 26 | + if(in_array($file_path, $this->is_loaded, TRUE)) |
|
| 27 | 27 | { |
| 28 | 28 | return TRUE; |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | - if ( ! file_exists($file_path)) |
|
| 31 | + if(!file_exists($file_path)) |
|
| 32 | 32 | { |
| 33 | 33 | continue; |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | include($file_path); |
| 37 | 37 | |
| 38 | - if ( ! isset($config) OR ! is_array($config)) |
|
| 38 | + if(!isset($config) OR !is_array($config)) |
|
| 39 | 39 | { |
| 40 | - if ($fail_gracefully === TRUE) |
|
| 40 | + if($fail_gracefully === TRUE) |
|
| 41 | 41 | { |
| 42 | 42 | return FALSE; |
| 43 | 43 | } |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | show_error('Your '.$file_path.' file does not appear to contain a valid configuration array.'); |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | - if ($use_sections === TRUE) |
|
| 48 | + if($use_sections === TRUE) |
|
| 49 | 49 | { |
| 50 | 50 | $this->config[$file] = isset($this->config[$file]) |
| 51 | 51 | ? array_merge($this->config[$file], $config) |
@@ -63,11 +63,11 @@ discard block |
||
| 63 | 63 | } |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | - if ($loaded === TRUE) |
|
| 66 | + if($loaded === TRUE) |
|
| 67 | 67 | { |
| 68 | 68 | return TRUE; |
| 69 | 69 | } |
| 70 | - elseif ($fail_gracefully === TRUE) |
|
| 70 | + elseif($fail_gracefully === TRUE) |
|
| 71 | 71 | { |
| 72 | 72 | return FALSE; |
| 73 | 73 | } |
@@ -13,46 +13,36 @@ discard block |
||
| 13 | 13 | * @param bool $fail_gracefully Whether to just return FALSE or display an error message |
| 14 | 14 | * @return bool TRUE if the file was loaded correctly or FALSE on failure |
| 15 | 15 | */ |
| 16 | - public function load($file = '', $use_sections = FALSE, $fail_gracefully = FALSE) |
|
| 17 | - { |
|
| 16 | + public function load($file = '', $use_sections = FALSE, $fail_gracefully = FALSE) { |
|
| 18 | 17 | $file = ($file === '') ? 'config' : str_replace('.php', '', $file); |
| 19 | 18 | $loaded = FALSE; |
| 20 | 19 | |
| 21 | - foreach ($this->_config_paths as $path) |
|
| 22 | - { |
|
| 23 | - foreach (array($file, '_secure'.DIRECTORY_SEPARATOR.$file, ENVIRONMENT.DIRECTORY_SEPARATOR.$file) as $location) |
|
| 24 | - { |
|
| 20 | + foreach ($this->_config_paths as $path) { |
|
| 21 | + foreach (array($file, '_secure'.DIRECTORY_SEPARATOR.$file, ENVIRONMENT.DIRECTORY_SEPARATOR.$file) as $location) { |
|
| 25 | 22 | $file_path = $path.'config/'.$location.'.php'; |
| 26 | - if (in_array($file_path, $this->is_loaded, TRUE)) |
|
| 27 | - { |
|
| 23 | + if (in_array($file_path, $this->is_loaded, TRUE)) { |
|
| 28 | 24 | return TRUE; |
| 29 | 25 | } |
| 30 | 26 | |
| 31 | - if ( ! file_exists($file_path)) |
|
| 32 | - { |
|
| 27 | + if ( ! file_exists($file_path)) { |
|
| 33 | 28 | continue; |
| 34 | 29 | } |
| 35 | 30 | |
| 36 | 31 | include($file_path); |
| 37 | 32 | |
| 38 | - if ( ! isset($config) OR ! is_array($config)) |
|
| 39 | - { |
|
| 40 | - if ($fail_gracefully === TRUE) |
|
| 41 | - { |
|
| 33 | + if ( ! isset($config) OR ! is_array($config)) { |
|
| 34 | + if ($fail_gracefully === TRUE) { |
|
| 42 | 35 | return FALSE; |
| 43 | 36 | } |
| 44 | 37 | |
| 45 | 38 | show_error('Your '.$file_path.' file does not appear to contain a valid configuration array.'); |
| 46 | 39 | } |
| 47 | 40 | |
| 48 | - if ($use_sections === TRUE) |
|
| 49 | - { |
|
| 41 | + if ($use_sections === TRUE) { |
|
| 50 | 42 | $this->config[$file] = isset($this->config[$file]) |
| 51 | 43 | ? array_merge($this->config[$file], $config) |
| 52 | 44 | : $config; |
| 53 | - } |
|
| 54 | - else |
|
| 55 | - { |
|
| 45 | + } else { |
|
| 56 | 46 | $this->config = array_merge($this->config, $config); |
| 57 | 47 | } |
| 58 | 48 | |
@@ -63,12 +53,9 @@ discard block |
||
| 63 | 53 | } |
| 64 | 54 | } |
| 65 | 55 | |
| 66 | - if ($loaded === TRUE) |
|
| 67 | - { |
|
| 56 | + if ($loaded === TRUE) { |
|
| 68 | 57 | return TRUE; |
| 69 | - } |
|
| 70 | - elseif ($fail_gracefully === TRUE) |
|
| 71 | - { |
|
| 58 | + } elseif ($fail_gracefully === TRUE) { |
|
| 72 | 59 | return FALSE; |
| 73 | 60 | } |
| 74 | 61 | |
@@ -1,4 +1,4 @@ discard block |
||
| 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_Config extends CI_Config { |
| 4 | 4 | public function __construct() { |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | |
| 36 | 36 | include($file_path); |
| 37 | 37 | |
| 38 | - if ( ! isset($config) OR ! is_array($config)) |
|
| 38 | + if ( ! isset($config) or ! is_array($config)) |
|
| 39 | 39 | { |
| 40 | 40 | if ($fail_gracefully === TRUE) |
| 41 | 41 | { |
@@ -71,7 +71,7 @@ |
||
| 71 | 71 | |
| 72 | 72 | /** |
| 73 | 73 | * @param string $verificationCode |
| 74 | - * @return mixed |
|
| 74 | + * @return string |
|
| 75 | 75 | */ |
| 76 | 76 | public function verificationCheck(string $verificationCode) { |
| 77 | 77 | //user is trying to validate their email for signup, check if verification code is still valid/exists |
@@ -76,9 +76,9 @@ discard block |
||
| 76 | 76 | public function verificationCheck(string $verificationCode) { |
| 77 | 77 | //user is trying to validate their email for signup, check if verification code is still valid/exists |
| 78 | 78 | $query = $this->db->select('email, verification_code_time') |
| 79 | - ->from('auth_signup_verification') |
|
| 80 | - ->where(array('verification_code' => $verificationCode)) |
|
| 81 | - ->get(); |
|
| 79 | + ->from('auth_signup_verification') |
|
| 80 | + ->where(array('verification_code' => $verificationCode)) |
|
| 81 | + ->get(); |
|
| 82 | 82 | |
| 83 | 83 | $return = FALSE; |
| 84 | 84 | if($query->num_rows() > 0) { |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | |
| 90 | 90 | $this->session->set_flashdata('errors', 'Verification code expired. Please re-submit signup.'); |
| 91 | 91 | $this->db->delete('auth_signup_verification') |
| 92 | - ->where(array('verification_code' => $verificationCode)); |
|
| 92 | + ->where(array('verification_code' => $verificationCode)); |
|
| 93 | 93 | } else { |
| 94 | 94 | //not expired, verification is valid, return email |
| 95 | 95 | $return = $result->email; |
@@ -125,9 +125,9 @@ discard block |
||
| 125 | 125 | $this->load->database(); |
| 126 | 126 | |
| 127 | 127 | $query = $this->db->select('email') |
| 128 | - ->from('auth_users') |
|
| 129 | - ->where('username', $identity) |
|
| 130 | - ->get(); |
|
| 128 | + ->from('auth_users') |
|
| 129 | + ->where('username', $identity) |
|
| 130 | + ->get(); |
|
| 131 | 131 | |
| 132 | 132 | if($query->num_rows() > 0) { |
| 133 | 133 | //username exists, grab email |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | $success = TRUE; |
| 62 | - } catch (Exception $e) { |
|
| 62 | + } catch(Exception $e) { |
|
| 63 | 63 | //echo 'Caught exception: ', $e->getMessage(), "\n"; |
| 64 | 64 | |
| 65 | 65 | //revert verification |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | ->where(array('verification_code' => $verificationCode)); |
| 93 | 93 | } else { |
| 94 | 94 | //not expired, verification is valid, return email |
| 95 | - $return = $result->email; |
|
| 95 | + $return = $result->email; |
|
| 96 | 96 | } |
| 97 | 97 | } |
| 98 | 98 | return $return; |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | if($query->num_rows() > 0) { |
| 133 | 133 | //username exists, grab email |
| 134 | 134 | $email = $query->row('email'); |
| 135 | - }else{ |
|
| 135 | + } else { |
|
| 136 | 136 | //username doesn't exist, return FALSE |
| 137 | 137 | $email = NULL; |
| 138 | 138 | } |
@@ -132,7 +132,7 @@ |
||
| 132 | 132 | if($query->num_rows() > 0) { |
| 133 | 133 | //username exists, grab email |
| 134 | 134 | $email = $query->row('email'); |
| 135 | - }else{ |
|
| 135 | + } else { |
|
| 136 | 136 | //username doesn't exist, return FALSE |
| 137 | 137 | $email = NULL; |
| 138 | 138 | } |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | 'is_unique_email' => 'Email already exists.' |
| 42 | 42 | )); |
| 43 | 43 | |
| 44 | - if ($isValid = ($this->form_validation->run() === TRUE)) { |
|
| 44 | + if($isValid = ($this->form_validation->run() === TRUE)) { |
|
| 45 | 45 | $email = $this->Auth->parseEmail($this->input->post('email')); |
| 46 | 46 | |
| 47 | 47 | $this->body_data['email'] = $email; |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | //login wasn't valid, failed, or this is a fresh login attempt |
| 57 | - if(!$isValid){ |
|
| 57 | + if(!$isValid) { |
|
| 58 | 58 | //display the email validation form |
| 59 | 59 | $this->body_data['form_email'] = array( |
| 60 | 60 | 'name' => 'email', |
@@ -89,14 +89,14 @@ discard block |
||
| 89 | 89 | if(!($email = $this->Auth->verificationCheck($verificationCode))) redirect('user/signup'); |
| 90 | 90 | |
| 91 | 91 | //validation is valid, proceed as normal |
| 92 | - $this->form_validation->set_rules('username', 'Username', 'required|min_length[4]|max_length[15]|valid_username|is_unique_username'); |
|
| 93 | - $this->form_validation->set_rules('password', 'Password', 'required|valid_password'); |
|
| 94 | - $this->form_validation->set_rules('password_confirm', 'Confirm Password', 'required|matches[password]'); |
|
| 95 | - $this->form_validation->set_rules('terms', 'Terms & Conditions', 'required'); |
|
| 92 | + $this->form_validation->set_rules('username', 'Username', 'required|min_length[4]|max_length[15]|valid_username|is_unique_username'); |
|
| 93 | + $this->form_validation->set_rules('password', 'Password', 'required|valid_password'); |
|
| 94 | + $this->form_validation->set_rules('password_confirm', 'Confirm Password', 'required|matches[password]'); |
|
| 95 | + $this->form_validation->set_rules('terms', 'Terms & Conditions', 'required'); |
|
| 96 | 96 | //TODO: timezone |
| 97 | 97 | //TODO: receive email |
| 98 | 98 | |
| 99 | - if ($isValid = ($this->form_validation->run() === TRUE)) { |
|
| 99 | + if($isValid = ($this->form_validation->run() === TRUE)) { |
|
| 100 | 100 | $username = $this->input->post('username'); |
| 101 | 101 | $password = $this->input->post('password'); |
| 102 | 102 | |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | //signup wasn't valid, failed, or this is a fresh signup attempt |
| 120 | - if(!$isValid){ |
|
| 120 | + if(!$isValid) { |
|
| 121 | 121 | //display the create user form |
| 122 | 122 | $this->body_data['verificationCode'] = $verificationCode; |
| 123 | 123 | |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | //login wasn't valid, failed, or this is a fresh login attempt |
| 57 | - if(!$isValid){ |
|
| 57 | + if(!$isValid) { |
|
| 58 | 58 | //display the email validation form |
| 59 | 59 | $this->body_data['form_email'] = array( |
| 60 | 60 | 'name' => 'email', |
@@ -86,7 +86,9 @@ discard block |
||
| 86 | 86 | //This continued signup occurs after the user clicks the verification link in their email. |
| 87 | 87 | private function _continue_signup($verificationCode) : void { |
| 88 | 88 | //check if validation is valid, if so return email, if not redirect to signup |
| 89 | - if(!($email = $this->Auth->verificationCheck($verificationCode))) redirect('user/signup'); |
|
| 89 | + if(!($email = $this->Auth->verificationCheck($verificationCode))) { |
|
| 90 | + redirect('user/signup'); |
|
| 91 | + } |
|
| 90 | 92 | |
| 91 | 93 | //validation is valid, proceed as normal |
| 92 | 94 | $this->form_validation->set_rules('username', 'Username', 'required|min_length[4]|max_length[15]|valid_username|is_unique_username'); |
@@ -110,14 +112,15 @@ discard block |
||
| 110 | 112 | $this->Auth->verificationComplete($email); |
| 111 | 113 | |
| 112 | 114 | redirect('help'); |
| 113 | - } else { //@codeCoverageIgnore |
|
| 115 | + } else { |
|
| 116 | +//@codeCoverageIgnore |
|
| 114 | 117 | //Signup failed. |
| 115 | 118 | $isValid = FALSE; |
| 116 | 119 | } |
| 117 | 120 | } |
| 118 | 121 | |
| 119 | 122 | //signup wasn't valid, failed, or this is a fresh signup attempt |
| 120 | - if(!$isValid){ |
|
| 123 | + if(!$isValid) { |
|
| 121 | 124 | //display the create user form |
| 122 | 125 | $this->body_data['verificationCode'] = $verificationCode; |
| 123 | 126 | |