]> git.mjollnir.org Git - moodle.git/commitdiff
Changes to improve usability when the admin folder has been renamed,
authormoodler <moodler>
Fri, 25 Oct 2002 02:02:02 +0000 (02:02 +0000)
committermoodler <moodler>
Fri, 25 Oct 2002 02:02:02 +0000 (02:02 +0000)
and also a change in checking for the admin user, just in case an
old session is hanging around

admin/config.php
admin/index.php
admin/site.php
admin/user.php

index 665dddcc71789e06a6edf4ff30e01d6f90269eb8..b6673fe27a5ba00661874e52963534f8c3876c12 100644 (file)
@@ -59,7 +59,7 @@
                     }
                 }
             }
-            redirect("$CFG->wwwroot/admin/index.php", get_string("changessaved"), 1);
+            redirect("index.php", get_string("changessaved"), 1);
             exit;
 
         } else {
@@ -80,7 +80,7 @@
 
     if ($site) {
         print_header("$site->shortname: $strconfigvariables", "$site->fullname",
-                      "<A HREF=\"$CFG->wwwroot/admin/\">$stradmin</A> -> $strconfigvariables", "$focus");
+                      "<A HREF=\"index.php\">$stradmin</A> -> $strconfigvariables", "$focus");
         print_heading($strconfigvariables);
     } else {
         print_header();
index dda74bbb977e5dddfe0bf33374239e855be6ba1b..997bc1bdbb7239d2130124151c39ee0c4cb941f3 100644 (file)
 /// If any new configurations were found then send to the config page to check
 
     if ($configchange) {
-        redirect("$CFG->wwwroot/admin/config.php");
+        redirect("config.php");
     }
 
 /// Set up the overall site name etc.
     if (! $site = get_site()) {
-        redirect("$CFG->wwwroot/admin/site.php");
+        redirect("site.php");
     }
 
 /// Set up the admin user
+    if (! record_exists_sql("SELECT * FROM user_admins")) {   // No admin user yet
+        redirect("user.php");
+    }
+
+/// Check for valid admin user
     if (!isadmin()) {
-        if (! record_exists_sql("SELECT * FROM user_admins")) {   // No admin user yet
-            redirect("$CFG->wwwroot/admin/user.php");
-        }
         error("You need to be an admin user to use this page.", "$CFG->wwwroot/login/index.php");
     }
 
index ca8090d2c7468bb4ca9674275f20fc75a029b24f..799471cb9b8dbfbf4b1f207bef867b62b7cf2a9f 100644 (file)
@@ -23,7 +23,7 @@
 
             if ($form->id) {
                 if (update_record("course", $form)) {
-                           redirect("$CFG->wwwroot/admin/index.php", get_string("changessaved"));
+                           redirect("index.php", get_string("changessaved"));
                 } else {
                     error("Serious Error! Could not update the site record! (id = $form->id)");
                 }
@@ -31,7 +31,7 @@
                 if ($newid = insert_record("course", $form)) {
                     $cat->name = get_string("miscellaneous");
                     if (insert_record("course_categories", $cat)) {
-                               redirect("$CFG->wwwroot/admin/index.php", get_string("changessaved"), "1");
+                               redirect("index.php", get_string("changessaved"), "1");
                     } else {
                         error("Serious Error! Could not set up a default course category!");
                     }
@@ -62,7 +62,7 @@
     $strsitesettings = get_string("sitesettings");
 
     print_header("$site->shortname: $strsitesettings", "$site->fullname",
-                  "<A HREF=\"$CFG->wwwroot/admin/\">$stradmin</A> -> $strsitesettings", "$focus");
+                  "<A HREF=\"index.php\">$stradmin</A> -> $strsitesettings", "$focus");
 
     print_heading($strsitesettings);
     print_simple_box_start("center", "", "$THEME->cellheading");
index 5cc8f6d29ed629949e10ddbbacc3796d0f9dc0fd..ce30f76e3f542bd13876de33ef97687135ec5c1e 100644 (file)
@@ -94,7 +94,7 @@
         $strdeletecheck = get_string("deletecheck");
 
         print_header("$site->shortname: $stredituser", $site->fullname, 
-                     "<A HREF=\"$CFG->wwwroot/admin\">$stradministration</A> -> $stredituser");
+                     "<A HREF=\"index.php\">$stradministration</A> -> $stredituser");
 
         if ($delete) {              // Delete a selected user, after confirmation
             if (!$user = get_record("user", "id", "$delete")) {