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 665dddc..b6673fe 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 dda74bb..997bc1b 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 ca8090d..799471c 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 5cc8f6d..ce30f76 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")) {