Definition at line 5 of file Admin.php.
| __construct |
( |
|
$id = null | ) |
|
Definition at line 37 of file Admin.php.
39 $this->lastConnect = new \DateTime();
41 parent::__construct(
$id);
Definition at line 54 of file Admin.php.
56 if ($key ==
"password")
58 return parent::__set($key, $value);
Definition at line 44 of file Admin.php.
46 return password_verify($value, $this->password);
Role -> 0 : no access -> 1 : read access -> 2 : +write access -> 3 : +delete /disable access
[0] -> admin (add user, change site configuration) [1] -> cms (add / modify / delete pages) [2] -> products [3] -> orders [4] -> translations
'*' Is the site admin, have all rights and no one can change this role
Definition at line 21 of file Admin.php.
24 $result = self::$dbo->exec(
"CREATE TABLE IF NOT EXISTS `{$dbPrefix}admin` (
25 `id` INTEGER(11) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
26 `email` VARCHAR(128) NOT NULL UNIQUE,
27 `password` VARCHAR(64),
28 `role` VARCHAR(8) NOT NULL DEFAULT '00000',
29 `lastConnect` DATETIME NOT NULL,
30 `lastConnectIp` VARCHAR(42) NOT NULL
32 if ($result ===
false)
33 throw new \Exception(get_class().
": ".self::$dbo->errorInfo()[2]);
Definition at line 49 of file Admin.php.
51 parent::__set(
"password", password_hash($value, PASSWORD_BCRYPT));
The documentation for this class was generated from the following file: