Kaynağa Gözat

Fixed redeclaring getRole()

pull/24/head
Teknikode 8 yıl önce
ebeveyn
işleme
f7da4ae69a
  1. 18
      includes/classes/Role.class.php

18
includes/classes/Role.class.php

@ -34,6 +34,7 @@ class Role @@ -34,6 +34,7 @@ class Role
return isset($this->permissions[$permission]);
}
// Get Role by Name
public function getRole($db, $role_name)
{
$role_list = $db->select('roles', "role_name=?", array($role_name));
@ -50,6 +51,7 @@ class Role @@ -50,6 +51,7 @@ class Role
return $roles;
}
// Get all Roles
public function getRoles($db)
{
$role_list = $db->select('roles', "1=?", array(1));
@ -65,21 +67,5 @@ class Role @@ -65,21 +67,5 @@ class Role
}
return $roles;
}
public function getRole($db, $role_name)
{
$role_list = $db->select('roles', "role_name=?", array($role_name));
$roles = array();
foreach ($role_list as $role)
{
if (!is_array($role))
{
$roles = array($role_list);
break;
}
array_push($roles, $role);
}
return $roles;
}
}
?>
Yükleniyor…
İptal
Kaydet