]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-15249 towards cli install script
authorskodak <skodak>
Mon, 25 May 2009 21:46:28 +0000 (21:46 +0000)
committerskodak <skodak>
Mon, 25 May 2009 21:46:28 +0000 (21:46 +0000)
lib/db/install.php
user/editadvanced_form.php
user/view.php

index b0e092cc9373faafb3a8173118f5db81350e91c1..1f46bf843b15d4dbbc97d7d3fffc563b21761c07 100644 (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;
index e498ed02442380a40ab0aa7d2ccdfe6595a1f789..0a7b5748aba833232fd2b6a43308bb4c3c146b8d 100644 (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
index a63881932156f2e1d05f3cc78fb8a993ab268bbc..491dc35d62a35cb43fcc1f23e642e1de1e439061 100644 (file)
         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