diff options
author | Camil Staps | 2016-07-26 14:30:57 +0200 |
---|---|---|
committer | Camil Staps | 2016-07-26 14:30:57 +0200 |
commit | 2f0e3ab98e0c304f3df3b6e0f686e52beb4d667c (patch) | |
tree | 1df8e41bf2ccbe34f819fe51630526ba2894a709 /classes | |
parent | Adding and deleting users (diff) |
Array of administrator IDs in constants.php
Diffstat (limited to 'classes')
-rw-r--r-- | classes/constants.php | 3 | ||||
-rw-r--r-- | classes/user.php | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/classes/constants.php b/classes/constants.php index e5630de..ef34668 100644 --- a/classes/constants.php +++ b/classes/constants.php @@ -69,6 +69,9 @@ class constants { /** @const fa_valuta see http://fontawesome.io/icons/#currency; the fa- postfix for valuta */ const fa_valuta = 'eur'; + /** @const user_admins The user ids that have administrator rights (creating and deleting users) */ + const user_admins = [1]; + /** * @const password_algo Algorithm for the password_hash function. * @const password_cost Cost for the password_hash function. Run install?password_cost to benchmark your system diff --git a/classes/user.php b/classes/user.php index 750e8bb..f6c6322 100644 --- a/classes/user.php +++ b/classes/user.php @@ -156,7 +156,7 @@ class user { * @return bool True iff the user has administrator rights */ public function isAdmin() { - return $this->getId() == 1; + return in_array($this->getId(), constants::user_admins); } /** |