]> git.mjollnir.org Git - moodle.git/commitdiff
This version installs smoothly for me on PostgreSQL
authormoodler <moodler>
Mon, 23 Dec 2002 14:19:45 +0000 (14:19 +0000)
committermoodler <moodler>
Mon, 23 Dec 2002 14:19:45 +0000 (14:19 +0000)
admin/index.php
admin/site.html
admin/user.php
lib/datalib.php
lib/weblib.php

index dcff806264c3d780690bac0c4150c343dc3b631c..4163934700b2b8ca27c220070ccf26589b5c5014 100644 (file)
@@ -42,7 +42,7 @@
             set_time_limit(0);  // To allow slow databases to complete the long SQL
             if (modify_database("$CFG->libdir/db/$CFG->dbtype.sql")) {
                 $db->debug = false;
-                notify($strdatabasesuccess);
+                notify($strdatabasesuccess, "green");
             } else {
                 $db->debug = false;
                 error("Error: Main databases NOT set up successfully");
             $strdatabasechecking = get_string("databasechecking", "", $a);
             $strdatabasesuccess  = get_string("databasesuccess");
             print_header($strdatabasechecking, $strdatabasechecking, $strdatabasechecking);
-            notify($strdatabasechecking);
+            print_heading($strdatabasechecking);
             $db->debug=true;
             if (main_upgrade($CFG->version)) {
                 $db->debug=false;
                 if (set_config("version", $version)) {
-                    notify($strdatabasesuccess);
+                    notify($strdatabasesuccess, "green");
                     print_continue("index.php");
                     die;
                 } else {
@@ -91,7 +91,7 @@
         print_header($strdatabaseupgrades, $strdatabaseupgrades, $strdatabaseupgrades);
 
         if (set_config("version", $version)) {
-            notify("You are currently using Moodle version $version (Release $release)");
+            print_heading("You are currently using Moodle version $version (Release $release)");
             print_continue("index.php");
             die;
         } else {
             if ($currmodule->version == $module->version) {
                 // do nothing
             } else if ($currmodule->version < $module->version) {
-                notify("$module->name module needs upgrading");
+                print_heading("$module->name module needs upgrading");
                 $upgrade_function = $module->name."_upgrade";
                 if (function_exists($upgrade_function)) {
                     $db->debug=true;
                         if (! update_record("modules", $module)) {
                             error("Could not update $module->name record in modules table!");
                         }
-                        notify(get_string("modulesuccess", "", $module->name));
+                        notify(get_string("modulesuccess", "", $module->name), "green");
+                        echo "<HR>";
                     } else {
                         $db->debug=false;
                         notify("Upgrading $module->name from $currmodule->version to $module->version FAILED!");
                 $strmodulesetup    = get_string("modulesetup");
                 print_header($strmodulesetup, $strmodulesetup, $strmodulesetup);
             }
+            print_heading($module->name);
             $updated_modules = true;
             $db->debug = true;
             set_time_limit(0);  // To allow slow databases to complete the long SQL
             if (modify_database("$fullmod/db/$CFG->dbtype.sql")) {
                 $db->debug = false;
                 if ($module->id = insert_record("modules", $module)) {
-                    notify(get_string("modulesuccess", "", $module->name));
+                    notify(get_string("modulesuccess", "", $module->name), "green");
+                    echo "<HR>";
                 } else {
                     error("$module->name module could not be added to the module list!");
                 }
index d27a5d3933ddc3910ef88cdbb51431e0d9ce513e..ed94e5db5f3548bf0d13f4b5cd2e9675eb072d49 100644 (file)
@@ -14,7 +14,8 @@
 </tr>
 <tr valign=top>
     <td align=right><P><? print_string("frontpagedescription") ?>:</P><BR>
-        <? helpbutton("text", get_string("helptext")) ?>
+     <? helpbutton("writing", get_string("helpwriting"), "moodle", true, true) ?><br \>
+     <? helpbutton("text", get_string("helptext"), "moodle", true, true) ?><br \>
     </td>
     <td><TEXTAREA NAME=summary COLS=50 ROWS=10 WRAP=virtual><? p($form->summary) ?></TEXTAREA>
     <? formerr($err["summary"]) ?>
index 4749cd64f59bf5b728327043d039c6e43ad5b481..593a239b9f5c0673feda7dcd20eb9a001eee4ed4 100644 (file)
@@ -6,6 +6,8 @@
 
     $recordsperpage = 30;
 
+    $db->debug = true;
+
     optional_variable($newuser, "");
     optional_variable($delete, "");
     optional_variable($confirm, "");
index 34bdc116848274b93bd942d55fbeb14dda104aa7..69d8eb50d2e1585cfa637dae1089e671cca59137 100644 (file)
@@ -411,9 +411,9 @@ function insert_record($table, $dataobject, $returnid=true) {
     }
 
     if ($returnid) {
-        //if ($db->hasInsertID) {
-            //return $db->Insert_ID();   // ADOdb has stored the ID for us
-        //}
+        if ($CFG->dbtype == "mysql") { 
+            return $db->Insert_ID();   // ADOdb has stored the ID for us, but it isn't reliable
+        }
         
         // Try to pull the record out again to find the id.  This is the most cross-platform method.
         if ($rs = $db->Execute("SELECT id FROM $CFG->prefix$table WHERE $select")) {
@@ -735,7 +735,7 @@ function get_users_confirmed() {
 }
 
 
-function get_users_unconfirmed($cutofftime=999999999) {
+function get_users_unconfirmed($cutofftime=2000000000) {
     global $CFG;
     return get_records_sql("SELECT * 
                              FROM {$CFG->prefix}user 
index aaf6df54af0629e8149df56b14fd5174e822dedb..11c10bf3d19d2a0784e038d310ff2d4e976dfd0b 100644 (file)
@@ -1080,8 +1080,8 @@ function redirect($url, $message="", $delay=0) {
     die; 
 }
 
-function notify ($message) {
-    echo "<P align=center><B><FONT COLOR=#FF0000>$message</FONT></B></P>\n";
+function notify ($message, $color="red", $align="center") {
+    echo "<p align=\"$align\"><b><font color=\"$color\">$message</font></b></p>\n";
 }