| 1 | <?php |
||
| 25 | class UsrAuth |
||
| 26 | { |
||
| 27 | protected $identified = false; |
||
| 28 | protected $strategy; |
||
| 29 | |||
| 30 | use SingletonInstance; |
||
| 31 | |||
| 32 | /** |
||
| 33 | * User authentication strategy initialization |
||
| 34 | */ |
||
| 35 | 1 | protected function __construct() |
|
| 40 | |||
| 41 | /** |
||
| 42 | * Method returns bitwise values of auth-errors |
||
| 43 | * |
||
| 44 | * @return int Bitwise auth-errors |
||
| 45 | */ |
||
| 46 | 1 | public static function getErrors() |
|
| 50 | |||
| 51 | /** |
||
| 52 | * Check for user groups |
||
| 53 | * |
||
| 54 | * @param int $groups Sum of user groups |
||
| 55 | * |
||
| 56 | * @return bool |
||
| 57 | */ |
||
| 58 | 6 | public static function hasAccess($groups) |
|
| 64 | |||
| 65 | /** |
||
| 66 | * Get user |
||
| 67 | * |
||
| 68 | * @return User |
||
| 69 | */ |
||
| 70 | 1 | public static function getUser() |
|
| 74 | } |
||
| 75 |