Handle the filters on Identity/Gallery::list_users and Identity/Gallery::list_groups

This commit is contained in:
Tim Almdal
2009-10-05 18:10:39 -07:00
parent ca17727478
commit 8285cd58e2
3 changed files with 16 additions and 4 deletions
@@ -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());
+2 -2
View File
@@ -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();
}
/**