From 5c9da3d7d4b910c358a8f630d314eb2a142745a6 Mon Sep 17 00:00:00 2001 From: REJack Date: Wed, 28 Feb 2018 12:26:28 +0100 Subject: [PATCH] added missing `get_perm()` & `get_group()` --- application/libraries/Aauth.php | 34 +++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/application/libraries/Aauth.php b/application/libraries/Aauth.php index c13f47d..c1d2544 100644 --- a/application/libraries/Aauth.php +++ b/application/libraries/Aauth.php @@ -1488,6 +1488,23 @@ class Aauth { return $row->id; } + /** + * Get group + * Get group from group name or id ( ! Case sensitive) + * @param int|string $group_par Group id or name to get + * @return int Group id + */ + public function get_group ( $group_par ) { + if ($group_id = $this->get_group_id($group_par)) { + $query = $this->aauth_db->where('id', $group_id); + $query = $this->aauth_db->get($this->config_vars['groups']); + + return $query->row(); + } + + return FALSE; + } + /** * Get subgroups * Get subgroups from group name or id ( ! Case sensitive) @@ -1856,6 +1873,23 @@ class Aauth { return $row->id; } + /** + * Get permission + * Get permission from permisison name or id + * @param int|string $perm_par Permission id or name to get + * @return int Permission id or NULL if perm does not exist + */ + public function get_perm($perm_par) { + if ($perm_id = $this->get_perm_id($perm_par)) { + $query = $this->aauth_db->where('id', $perm_id); + $query = $this->aauth_db->get($this->config_vars['perms']); + + return $query->row(); + } + + return FALSE; + } + ######################## # Private Message Functions ########################