From 00ee91837faf4807fb17dde3272ca8248a9dcd94 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Mon, 5 Oct 2009 14:04:27 -0700 Subject: Convert direct lookups for the user table using ORM to using the user::lookup_by_name and user_lookup API methods. Convert the Admin_User controller Convert the login and password change controller Change the item model to call user::lookup to get the owner. On the log model, delete the relationship between the log and user table, and replace with a call to user::lookup (cherry picked from commit 194cc3b27a73afe5119da9f09407c1e068dc6fa3) Create the get_user_list, lookup_by_name, lookup_by_hash and get_group_list api functions --- modules/user/helpers/group.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'modules/user/helpers/group.php') diff --git a/modules/user/helpers/group.php b/modules/user/helpers/group.php index b13895bc..2590c7d1 100644 --- a/modules/user/helpers/group.php +++ b/modules/user/helpers/group.php @@ -73,6 +73,20 @@ class group_Core { return null; } + /** + * List the users + * @param mixed filters (@see Database.php + * @return array the group list. + */ + static function get_group_list($filter=array()) { + $group = ORM::factory("group"); + + foreach($filter as $method => $args) { + $group->$method($args); + } + return $group->find_all(); + } + static function get_edit_form_admin($group) { $form = new Forge("admin/users/edit_group/$group->id", "", "post", array("id" => "g-edit-group-form")); $form_group = $form->group("edit_group")->label(t("Edit Group")); -- cgit v1.2.3