MDL-15249 towards cli install script

This commit is contained in:
skodak
2009-05-25 21:46:28 +00:00
parent 58c2e0697d
commit 1deff123aa
3 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -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;
-5
View File
@@ -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
View File
@@ -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