⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.14
Server IP:
178.33.27.10
Server:
Linux cpanel.dev-unit.com 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
Server Software:
Apache/2.4.62 (Unix) OpenSSL/1.0.2k-fips
PHP Version:
8.2.25
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
id
/
taxi.dev-unit.com
/
app
/
Helpers
/
Auth
/
View File Name :
AuthHelpers.php
<?php namespace App\Helpers\Auth; use App\Base\Constants\Auth\Role; trait AuthHelpers { /** * Get the roles that are allowed to login with OTP. * * @return array */ protected function otpLoginRoles() { return [ Role::USER, Role::DRIVER, Role::OWNER, ]; } /** * Get all the roles which uses username instead of email. * * @return array */ protected function rolesUsingUsername() { return Role::adminRoles(); } /** * Check if the given role(s) can login with username. * * @param string|array $role * @return bool */ protected function roleAllowedUsernameLogin($role) { return $this->roleAllowed($role, $this->rolesUsingUsername()); } /** * Check if the given role(s) can login with OTP. * * @param string|array $role * @return bool */ protected function roleAllowedOTPLogin($role) { return $this->roleAllowed($role, $this->otpLoginRoles()); } /** * Check if the given role(s) are in the allowed list. * * @param string|array $role * @param array $allowedList * @return bool */ protected function roleAllowed($role, array $allowedList) { $role = is_string($role) ? [$role] : $role; return array_has_all($role, $allowedList); } }