| Total Complexity | 4 |
| Total Lines | 53 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 8 | trait UserTrait |
||
| 9 | { |
||
| 10 | use AbstractTrait; |
||
| 11 | |||
| 12 | /** |
||
| 13 | * Get the facade to user features |
||
| 14 | * |
||
| 15 | * @return UserFacade |
||
| 16 | */ |
||
| 17 | protected function userFacade(): UserFacade |
||
| 20 | } |
||
| 21 | |||
| 22 | /** |
||
| 23 | * Get the privilege list |
||
| 24 | * This feature is available only for MySQL |
||
| 25 | * |
||
| 26 | * @param string $database The database name |
||
| 27 | * |
||
| 28 | * @return array |
||
| 29 | */ |
||
| 30 | public function getPrivileges(string $database = ''): array |
||
| 31 | { |
||
| 32 | $this->connectToServer(); |
||
| 33 | $this->breadcrumbs()->clear()->item($this->utils->trans->lang('Privileges')); |
||
| 34 | return $this->userFacade()->getPrivileges($database); |
||
| 35 | } |
||
| 36 | |||
| 37 | /** |
||
| 38 | * Get the privileges for a new user |
||
| 39 | * |
||
| 40 | * @return array |
||
| 41 | */ |
||
| 42 | public function newUserPrivileges(): array |
||
| 46 | } |
||
| 47 | |||
| 48 | /** |
||
| 49 | * Get the privileges for a new user |
||
| 50 | * |
||
| 51 | * @param string $user The user name |
||
| 52 | * @param string $host The host name |
||
| 53 | * @param string $database The database name |
||
| 54 | * |
||
| 55 | * @return array |
||
| 56 | */ |
||
| 57 | public function getUserPrivileges(string $user, string $host, string $database): array |
||
| 61 | } |
||
| 62 | } |
||
| 63 |