From 99988d1a87ce612d1751b67cc867c9438580f962 Mon Sep 17 00:00:00 2001 From: moodler Date: Mon, 23 Dec 2002 14:19:45 +0000 Subject: [PATCH] This version installs smoothly for me on PostgreSQL --- admin/index.php | 17 ++++++++++------- admin/site.html | 3 ++- admin/user.php | 2 ++ lib/datalib.php | 8 ++++---- lib/weblib.php | 4 ++-- 5 files changed, 20 insertions(+), 14 deletions(-) diff --git a/admin/index.php b/admin/index.php index dcff806264..4163934700 100644 --- a/admin/index.php +++ b/admin/index.php @@ -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"); @@ -67,12 +67,12 @@ $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 { @@ -152,7 +152,7 @@ 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; @@ -163,7 +163,8 @@ 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 "
"; } else { $db->debug=false; notify("Upgrading $module->name from $currmodule->version to $module->version FAILED!"); @@ -179,13 +180,15 @@ $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 "
"; } else { error("$module->name module could not be added to the module list!"); } diff --git a/admin/site.html b/admin/site.html index d27a5d3933..ed94e5db5f 100644 --- a/admin/site.html +++ b/admin/site.html @@ -14,7 +14,8 @@

:


- +
+
diff --git a/admin/user.php b/admin/user.php index 4749cd64f5..593a239b9f 100644 --- a/admin/user.php +++ b/admin/user.php @@ -6,6 +6,8 @@ $recordsperpage = 30; + $db->debug = true; + optional_variable($newuser, ""); optional_variable($delete, ""); optional_variable($confirm, ""); diff --git a/lib/datalib.php b/lib/datalib.php index 34bdc11684..69d8eb50d2 100644 --- a/lib/datalib.php +++ b/lib/datalib.php @@ -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 diff --git a/lib/weblib.php b/lib/weblib.php index aaf6df54af..11c10bf3d1 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -1080,8 +1080,8 @@ function redirect($url, $message="", $delay=0) { die; } -function notify ($message) { - echo "

$message

\n"; +function notify ($message, $color="red", $align="center") { + echo "

$message

\n"; } -- 2.39.5