use Identity::ID enum set

This commit is contained in:
yggverse 2024-08-03 19:46:36 +03:00
parent 22fd5a74db
commit 5f76121c29
2 changed files with 18 additions and 6 deletions

View file

@ -72,16 +72,24 @@ class Auth
);
// Init new certificate option
$this->_options[0] = new Auth\Option\Identity(
$this->_options[
Auth\Option\Identity::ID_CRT_NEW
] = new Auth\Option\Identity(
$this
);
$this->_options[0]->setGroup(
$this->_options[0]
$this->_options[
Auth\Option\Identity::ID_CRT_NEW
]->setGroup(
$this->_options[
Auth\Option\Identity::ID_CRT_NEW
]
);
$this->_options[0]->setLabel(
0, null
$this->_options[
Auth\Option\Identity::ID_CRT_NEW
]->setLabel(
Auth\Option\Identity::ID_CRT_NEW
);
// Search database for auth records
@ -100,7 +108,9 @@ class Auth
);
$this->_options[$identity->id]->setGroup(
$this->_options[0]
$this->_options[
Auth\Option\Identity::ID_CRT_NEW
]
);
$this->_options[$identity->id]->setLabel(

View file

@ -27,6 +27,8 @@ class Identity
public const LABEL_NO_NAME = '#%d (no name)';
public const LABEL_CRT_NEW = 'Create new for this resource';
public const ID_CRT_NEW = 0; // free < 0 > reserved by DB
public function __construct(
Auth $auth
) {