Move the first-admin-login steps out of the user module and into an event listener in core

This commit is contained in:
Bharat Mediratta
2009-05-20 16:49:06 +00:00
parent 3dc5571629
commit f24c8f66ea
2 changed files with 9 additions and 7 deletions

View File

@@ -59,4 +59,13 @@ class core_event_Core {
$event_parms->panes[] = array("label" => t("Sort Order"), "content" => $sortPane);
}
}
static function user_login($user) {
// If this user is an admin, check to see if there are any post-install tasks that we need
// to run and take care of those now.
if ($user->admin && module::get_var("core", "choose_default_tookit", null)) {
graphics::choose_default_toolkit();
module::clear_var("core", "choose_default_tookit");
}
}
}

View File

@@ -67,13 +67,6 @@ class Login_Controller extends Controller {
if ($valid) {
user::login($user);
log::info("user", t("User %name logged in", array("name" => $user->name)));
// If this user is an admin, check to see if there are any post-install tasks that we need
// to run and take care of those now.
if ($user->admin && module::get_var("core", "choose_default_tookit", null)) {
graphics::choose_default_toolkit();
module::clear_var("core", "choose_default_tookit");
}
}
return array($valid, $form);