mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-08-22 23:05:18 -04:00
Handle the filters on Identity/Gallery::list_users and Identity/Gallery::list_groups
This commit is contained in:
@@ -106,6 +106,7 @@ interface Identity_Driver {
|
||||
/**
|
||||
* List the users
|
||||
* @param mixed options to apply to the selection of the user
|
||||
* @todo Do a longer write up on format of filters (@see Database.php)
|
||||
* @return array the group list.
|
||||
*/
|
||||
public function list_users($filter=array());
|
||||
@@ -113,6 +114,7 @@ interface Identity_Driver {
|
||||
/**
|
||||
* List the groups
|
||||
* @param mixed options to apply to the selection of the user
|
||||
* @todo Do a longer write up on format of filters (@see Database.php)
|
||||
* @return array the group list.
|
||||
*/
|
||||
public function list_groups($filter=array());
|
||||
|
||||
@@ -21,8 +21,8 @@ class Admin_Users_Controller extends Admin_Controller {
|
||||
public function index() {
|
||||
$view = new Admin_View("admin.html");
|
||||
$view->content = new View("admin_users.html");
|
||||
$view->content->users = user::users(array("orderby" => array("name")));
|
||||
$view->content->groups = group::groups(array("orderby" => array("name")));
|
||||
$view->content->users = user::users(array("orderby" => array("name" => "ASC")));
|
||||
$view->content->groups = group::groups(array("orderby" => array("name" => "ASC")));
|
||||
print $view;
|
||||
}
|
||||
|
||||
|
||||
@@ -211,7 +211,12 @@ class Identity_Gallery_Driver implements Identity_Driver {
|
||||
* @return array the group list.
|
||||
*/
|
||||
public function list_users($filter=array()) {
|
||||
return ORM::factory("user")->orderby("name")->find_all();
|
||||
$user = ORM::factory("user");
|
||||
foreach($filter as $method => $args) {
|
||||
$user->$method($args);
|
||||
}
|
||||
|
||||
return $user->find_all();
|
||||
}
|
||||
|
||||
|
||||
@@ -221,7 +226,12 @@ class Identity_Gallery_Driver implements Identity_Driver {
|
||||
* @return array the group list.
|
||||
*/
|
||||
public function list_groups($filter=array()) {
|
||||
return ORM::factory("group")->orderby("name")->find_all();
|
||||
$user = ORM::factory("group");
|
||||
foreach($filter as $method => $args) {
|
||||
$user->$method($args);
|
||||
}
|
||||
|
||||
return $user->find_all();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user