Finish integrating the move of the user edit/update functions into the user module. The premise is that the plugable user module will provide the update screens if the user backend supports updates.

This commit is contained in:
Tim Almdal
2009-10-15 10:44:25 -07:00
parent 9e833c9443
commit be6765336e
12 changed files with 29 additions and 34 deletions

View File

@@ -21,7 +21,6 @@ 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->writable = user::is_writable();
$view->content->users = user::get_user_list(array("orderby" => array("name" => "ASC")));
$view->content->groups = group::get_group_list(array("orderby" => array("name" => "ASC")));
print $view;
@@ -304,7 +303,7 @@ class Admin_Users_Controller extends Admin_Controller {
$group->input("email")->label(t("Email"))->id("g-email")->value($user->email);
$group->input("url")->label(t("URL"))->id("g-url")->value($user->url);
$group->checkbox("admin")->label(t("Admin"))->id("g-admin")->checked($user->admin);
$form->add_rules_from($user);
$form->add_rules_from(user::get_edit_rules());
$form->edit_user->password->rules("-required");
module::event("user_edit_form_admin", $user, $form);
@@ -327,7 +326,7 @@ class Admin_Users_Controller extends Admin_Controller {
self::_add_locale_dropdown($group);
$group->checkbox("admin")->label(t("Admin"))->id("g-admin");
$user = ORM::factory("user");
$form->add_rules_from($user);
$form->add_rules_from(user::get_edit_rules());
module::event("user_add_form_admin", $user, $form);
$group->submit("")->value(t("Add User"));
@@ -367,7 +366,7 @@ class Admin_Users_Controller extends Admin_Controller {
$form_group->inputs["name"]->error_messages(
"in_use", t("There is already a group with that name"));
$form_group->submit("")->value(t("Save"));
$form->add_rules_from($group);
$form->add_rules_from(group::get_edit_rules());
return $form;
}
@@ -380,7 +379,7 @@ class Admin_Users_Controller extends Admin_Controller {
"in_use", t("There is already a group with that name"));
$form_group->submit("")->value(t("Add Group"));
$group = ORM::factory("group");
$form->add_rules_from($group);
$form->add_rules_from(group::get_edit_rules());
return $form;
}