MDL-15249 towards cli install script
This commit is contained in:
+1
-1
@@ -152,7 +152,7 @@ function xmldb_main_install() {
|
||||
$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;
|
||||
|
||||
@@ -84,11 +84,6 @@ class user_editadvanced_form extends moodleform {
|
||||
// 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
|
||||
|
||||
+6
-1
@@ -24,6 +24,12 @@
|
||||
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)) {
|
||||
@@ -38,7 +44,6 @@
|
||||
$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
|
||||
|
||||
Reference in New Issue
Block a user