$admin->lastname = get_string('user');
$admin->username = 'admin';
$admin->password = 'adminsetuppending';
- $admin->email = 'root@localhost';
+ $admin->email = '';
$admin->confirmed = 1;
$admin->mnethostid = $CFG->mnet_localhost_id;
$admin->lang = $CFG->lang;
// admin must choose some password and supply correct email
if (!empty($USER->newadminuser)) {
$mform->addRule('newpassword', get_string('required'), 'required', null, 'client');
-
- $email_el =& $mform->getElement('email');
- if ($email_el->getValue() == 'root@localhost') {
- $email_el->setValue('');
- }
}
// require password for new users
print_error('invalidcourseid');
}
+ // special hack for cli installer - continue to site settings
+ $systemcontext = get_context_instance(CONTEXT_SYSTEM);
+ if ($SITE->shortname === '' and has_capability('moodle/site:config', $systemcontext)) {
+ redirect($CFG->wwwroot .'/'. $CFG->admin .'/index.php');
+ }
+
/// Make sure the current user is allowed to see this user
if (empty($USER->id)) {
$coursecontext = get_context_instance(CONTEXT_COURSE, $course->id); // Course context
}
$usercontext = get_context_instance(CONTEXT_USER, $user->id); // User context
- $systemcontext = get_context_instance(CONTEXT_SYSTEM); // SYSTEM context
if (!empty($CFG->forcelogin) || $course->id != SITEID) {
// do not force parents to enrol