diff --git a/app/Http/Controllers/Auth/ForgotPasswordController.php b/app/Http/Controllers/Auth/ForgotPasswordController.php deleted file mode 100644 index 6a247fe..0000000 --- a/app/Http/Controllers/Auth/ForgotPasswordController.php +++ /dev/null @@ -1,32 +0,0 @@ -middleware('guest'); - } -} diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php deleted file mode 100644 index b2ea669..0000000 --- a/app/Http/Controllers/Auth/LoginController.php +++ /dev/null @@ -1,39 +0,0 @@ -middleware('guest')->except('logout'); - } -} diff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.php deleted file mode 100644 index ebdf50b..0000000 --- a/app/Http/Controllers/Auth/RegisterController.php +++ /dev/null @@ -1,71 +0,0 @@ -middleware('guest'); - } - - /** - * Get a validator for an incoming registration request. - * - * @param array $data - * @return \Illuminate\Contracts\Validation\Validator - */ - protected function validator(array $data) - { - return Validator::make($data, [ - 'username' => 'required|string|max:255', - 'email' => 'required|string|email|max:255|unique:users', - 'password' => 'required|string|min:6|confirmed', - ]); - } - - /** - * Create a new user instance after a valid registration. - * - * @param array $data - * @return \App\User - */ - protected function create(array $data) - { - return User::create([ - 'username' => $data['username'], - 'email' => $data['email'], - 'password' => bcrypt($data['password']), - ]); - } -} diff --git a/app/Http/Controllers/Auth/ResetPasswordController.php b/app/Http/Controllers/Auth/ResetPasswordController.php deleted file mode 100644 index cf726ee..0000000 --- a/app/Http/Controllers/Auth/ResetPasswordController.php +++ /dev/null @@ -1,39 +0,0 @@ -middleware('guest'); - } -} diff --git a/app/Http/Controllers/BaseController.php b/app/Http/Controllers/BaseController.php deleted file mode 100644 index 468d164..0000000 --- a/app/Http/Controllers/BaseController.php +++ /dev/null @@ -1,10 +0,0 @@ -checkForToken($request); // Check presence of a token. - - try { - if (!$this->auth->parseToken()->authenticate()) { // Check user not found. Check token has expired. - throw new UnauthorizedHttpException('jwt-auth', 'User not found'); - } - $payload = $this->auth->manager()->getPayloadFactory()->buildClaimsCollection()->toPlainArray(); - return $next($request); // Token is valid. User logged. Response without any token. - } catch (TokenExpiredException $t) { // Token expired. User not logged. - $payload = $this->auth->manager()->getPayloadFactory()->buildClaimsCollection()->toPlainArray(); - $key = 'block_refresh_token_for_user_' . $payload['sub']; - $cachedBefore = (int) Cache::has($key); - if ($cachedBefore) { // If a token alredy was refreshed and sent to the client in the last JWT_BLACKLIST_GRACE_PERIOD seconds. - \Auth::onceUsingId($payload['sub']); // Log the user using id. - return $next($request); // Token expired. Response without any token because in grace period. - } - try { - $newtoken = $this->auth->refresh(); // Get new token. - $gracePeriod = $this->auth->manager()->getBlacklist()->getGracePeriod(); - $expiresAt = Carbon::now()->addSeconds($gracePeriod); - Cache::put($key, $newtoken, $expiresAt); - } catch (JWTException $e) { - throw new UnauthorizedHttpException('jwt-auth', $e->getMessage(), $e, $e->getCode()); - } - } - - $response = $next($request); // Token refreshed and continue. - - return $this->setAuthenticationHeader($response, $newtoken); // Response with new token on header Authorization. - } - -} \ No newline at end of file diff --git a/app/Models/ForUser.php b/app/Models/ForUser.php deleted file mode 100644 index 49946c0..0000000 --- a/app/Models/ForUser.php +++ /dev/null @@ -1,149 +0,0 @@ -getKey(); // Eloquent Model method - } - - /** - * Return a key value array, containing any custom claims to be added to the JWT. - * - * @return array - */ - public function getJWTCustomClaims() { - return []; - } - - public $timestamps = false; - - protected $casts = [ - 'group' => 'int', - 'perm_id' => 'int', - 'permission_id' => 'int', - 'total_posts' => 'int', - 'total_threads' => 'int', - 'reg_date' => 'int', - 'last_post_date' => 'int', - 'last_post_location' => 'int', - 'gender' => 'int', - 'birthday' => 'int', - 'ontime' => 'int', - 'ostatus' => 'int', - 'strikes' => 'int', - 'permission_access' => 'int', - 'usr_per_id' => 'int', - 'blg_per_id' => 'int', - 'for_per_id' => 'int', - 'sbx_per_id' => 'int', - 'str_per_id' => 'int', - 'doc_per_id' => 'int', - 'odb_per_id' => 'int' - ]; - - protected $hidden = [ - 'password', - 'salt' - ]; - - protected $fillable = [ - 'username', - 'password', - 'salt', - 'group', - 'perm_id', - 'member_title', - 'permission_id', - 'total_posts', - 'total_threads', - 'reg_date', - 'last_post_date', - 'last_post_location', - 'email', - 'website_address', - 'website_name', - 'gender', - 'location', - 'birthday', - 'bio', - 'ip_address', - 'avatar', - 'ontime', - 'ostatus', - 'header', - 'footer', - 'strikes', - 'name_colour', - 'permission_access', - 'display_name', - 'yt_channel', - 'country', - 'usr_per_id', - 'blg_per_id', - 'for_per_id', - 'sbx_per_id', - 'str_per_id', - 'doc_per_id', - 'odb_per_id' - ]; -} diff --git a/app/Models/StrCategory.php b/app/Models/StrCategory.php deleted file mode 100644 index 933b29e..0000000 --- a/app/Models/StrCategory.php +++ /dev/null @@ -1,37 +0,0 @@ - 'int', - 'min_screenshots' => 'int' - ]; - - protected $fillable = [ - 'name', - 'parent_id', - 'min_screenshots' - ]; -} diff --git a/app/Models/StrFile.php b/app/Models/StrFile.php deleted file mode 100644 index 30601ed..0000000 --- a/app/Models/StrFile.php +++ /dev/null @@ -1,33 +0,0 @@ - 'int' - ]; - - protected $fillable = [ - 'file_id', - 'filename' - ]; -} diff --git a/app/Models/StrOwner.php b/app/Models/StrOwner.php deleted file mode 100644 index f856d45..0000000 --- a/app/Models/StrOwner.php +++ /dev/null @@ -1,34 +0,0 @@ - 'int', - 'file_id' => 'int' - ]; - - protected $fillable = [ - 'user_id', - 'file_id' - ]; -} diff --git a/app/Models/StrPermission.php b/app/Models/StrPermission.php deleted file mode 100644 index d6232fc..0000000 --- a/app/Models/StrPermission.php +++ /dev/null @@ -1,55 +0,0 @@ - 'int', - 'upload' => 'int', - 'approve' => 'int', - 'fail' => 'int', - 'delfile' => 'int', - 'delscreen' => 'int', - 'editfile' => 'int', - 'allowfull' => 'int', - 'canwarn' => 'int' - ]; - - protected $fillable = [ - 'canview', - 'upload', - 'approve', - 'fail', - 'delfile', - 'delscreen', - 'editfile', - 'allowfull', - 'canwarn' - ]; -} diff --git a/app/Models/StrUserPermission.php b/app/Models/StrUserPermission.php deleted file mode 100644 index e6a74a2..0000000 --- a/app/Models/StrUserPermission.php +++ /dev/null @@ -1,58 +0,0 @@ - 'int', - 'canview' => 'int', - 'upload' => 'int', - 'approve' => 'int', - 'fail' => 'int', - 'delfile' => 'int', - 'delscreen' => 'int', - 'editfile' => 'int', - 'allowfull' => 'int', - 'canwarn' => 'int' - ]; - - protected $fillable = [ - 'user_id', - 'canview', - 'upload', - 'approve', - 'fail', - 'delfile', - 'delscreen', - 'editfile', - 'allowfull', - 'canwarn' - ]; -} diff --git a/app/Models/UsrPermModule.php b/app/Models/UsrPermModule.php deleted file mode 100644 index 7150ef4..0000000 --- a/app/Models/UsrPermModule.php +++ /dev/null @@ -1,66 +0,0 @@ - 'int', - 'banned' => 'int', - 'usr_perm_id' => 'int', - 'blg_perm_id' => 'int', - 'for_perm_id' => 'int', - 'sbx_perm_id' => 'int', - 'str_perm_id' => 'int', - 'doc_perm_id' => 'int', - 'odb_perm_id' => 'int' - ]; - - protected $fillable = [ - 'name', - 'root', - 'banned', - 'colour_m', - 'colour_f', - 'colour_u', - 'badge', - 'usr_perm_id', - 'blg_perm_id', - 'for_perm_id', - 'sbx_perm_id', - 'str_perm_id', - 'doc_perm_id', - 'odb_perm_id' - ]; -} diff --git a/app/Models/UsrPermission.php b/app/Models/UsrPermission.php deleted file mode 100644 index 456508c..0000000 --- a/app/Models/UsrPermission.php +++ /dev/null @@ -1,82 +0,0 @@ - 'int', - 'editprofile' => 'int', - 'delprofile' => 'int', - 'postlayout' => 'int', - 'namecol' => 'int', - 'displayname' => 'int', - 'title' => 'int', - 'ipshow' => 'int', - 'emailshow' => 'int', - 'editother' => 'int', - 'ban' => 'int', - 'setgroup' => 'int', - 'setspecial' => 'int', - 'settrust' => 'int', - 'canpm' => 'int', - 'canwarn' => 'int', - 'canblock' => 'int', - 'ipban' => 'int' - ]; - - protected $fillable = [ - 'viewprofile', - 'editprofile', - 'delprofile', - 'postlayout', - 'namecol', - 'displayname', - 'title', - 'ipshow', - 'emailshow', - 'editother', - 'ban', - 'setgroup', - 'setspecial', - 'settrust', - 'canpm', - 'canwarn', - 'canblock', - 'ipban' - ]; -} diff --git a/app/Models/UsrUserPermission.php b/app/Models/UsrUserPermission.php deleted file mode 100644 index 7488cfe..0000000 --- a/app/Models/UsrUserPermission.php +++ /dev/null @@ -1,85 +0,0 @@ - 'int', - 'viewprofile' => 'int', - 'editprofile' => 'int', - 'delprofile' => 'int', - 'postlayout' => 'int', - 'namecol' => 'int', - 'displayname' => 'int', - 'title' => 'int', - 'ipshow' => 'int', - 'emailshow' => 'int', - 'editother' => 'int', - 'ban' => 'int', - 'setgroup' => 'int', - 'setspecial' => 'int', - 'settrust' => 'int', - 'canpm' => 'int', - 'canwarn' => 'int', - 'canblock' => 'int', - 'ipban' => 'int' - ]; - - protected $fillable = [ - 'user_id', - 'viewprofile', - 'editprofile', - 'delprofile', - 'postlayout', - 'namecol', - 'displayname', - 'title', - 'ipshow', - 'emailshow', - 'editother', - 'ban', - 'setgroup', - 'setspecial', - 'settrust', - 'canpm', - 'canwarn', - 'canblock', - 'ipban' - ]; -} diff --git a/app/Transformers/UserTransformer.php b/app/Transformers/UserTransformer.php deleted file mode 100644 index f6b83c2..0000000 --- a/app/Transformers/UserTransformer.php +++ /dev/null @@ -1,15 +0,0 @@ - $user->id, - 'username' => $user->username - ]; - } -} \ No newline at end of file