@@ -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 = [ |
@@ -77,9 +77,9 @@ |
||
| 77 | 77 | public function verification_check(string $verificationCode) { |
| 78 | 78 | //user is trying to validate their email for signup, check if verification code is still valid/exists |
| 79 | 79 | $query = $this->db->select('email, verification_code_time') |
| 80 | - ->from('auth_signup_verification') |
|
| 81 | - ->where(array('verification_code' => $verificationCode)) |
|
| 82 | - ->get(); |
|
| 80 | + ->from('auth_signup_verification') |
|
| 81 | + ->where(array('verification_code' => $verificationCode)) |
|
| 82 | + ->get(); |
|
| 83 | 83 | |
| 84 | 84 | $return = FALSE; |
| 85 | 85 | if($query->num_rows() > 0) { |
@@ -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 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,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 | | ------------------------------------------------------------------------- |
@@ -78,7 +78,7 @@ |
||
| 78 | 78 | //TEMP |
| 79 | 79 | $route['user/dashboard_beta'] = 'User/DashboardBeta'; |
| 80 | 80 | |
| 81 | -$route['api/internal/get_list'] = 'API/Internal/GetList'; |
|
| 81 | +$route['api/internal/get_list'] = 'API/Internal/GetList'; |
|
| 82 | 82 | $route['api/internal/get_list/(all|reading|on-hold|plan-to-read|(custom(?:1|2|3)))'] = 'API/Internal/GetList/index/$1'; |
| 83 | 83 | |
| 84 | 84 | $route['ajax/username_check']['post'] = 'Ajax/UsernameCheck'; //rate limited |