MDL-17772 fixed guest access; MDL-17754 $USER object initialisation cleanup

This commit is contained in:
skodak
2009-01-02 21:05:16 +00:00
parent b7b64ff2e0
commit 1b813f5c2a
8 changed files with 22 additions and 21 deletions
+3 -3
View File
@@ -1414,9 +1414,9 @@ function create_admin_user($user_input=NULL) {
// Log the user in.
set_config('rolesactive', 1);
$USER = get_complete_user_data('username', 'admin');
$USER->newadminuser = 1;
load_all_capabilities();
$user = get_complete_user_data('username', 'admin');
$user->newadminuser = 1;
complete_user_login($user);
if (!defined('CLI_UPGRADE')||!CLI_UPGRADE) {
redirect("$CFG->wwwroot/user/editadvanced.php?id=$user->id"); // Edit thyself