summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKjartan Mannes <kjartan@2.no-reply.drupal.org>2002-04-29 15:50:19 +0000
committerKjartan Mannes <kjartan@2.no-reply.drupal.org>2002-04-29 15:50:19 +0000
commitf38860ffb3f96808e431b23f864f24ccb9f1e313 (patch)
tree950b136cc38c7b15b23a9c2f9830f5dfae4ae9fe
parent5c6122b4cef676f672fe874a8c5de453d3ab937b (diff)
downloadbrdo-f38860ffb3f96808e431b23f864f24ccb9f1e313.tar.gz
brdo-f38860ffb3f96808e431b23f864f24ccb9f1e313.tar.bz2
- updated the updates.
-rw-r--r--update.php18
1 files changed, 10 insertions, 8 deletions
diff --git a/update.php b/update.php
index 8a2b7da3d..5cc6d7867 100644
--- a/update.php
+++ b/update.php
@@ -1,6 +1,4 @@
<?php
-include_once "includes/common.inc";
-
/*
** USAGE:
**
@@ -9,17 +7,22 @@ include_once "includes/common.inc";
**
** NOTES:
**
-** - If you upgrade from Drupal 3.00, you have to update your watchdog
-** table manually before executing/starting this script. Simply do:
+** - If you have any troubles running the updates you might have to run
+** these queries manually:
**
** ALTER TABLE watchdog CHANGE user uid int(10) DEFAULT '0' NOT NULL;
** ALTER TABLE watchdog CHANGE id wid int(5) DEFAULT '0' NOT NULL auto_increment;
** CREATE TABLE system (filename varchar(255) NOT NULL default '', name varchar(255) NOT NULL default '', type varchar(255) NOT NULL default '', description varchar(255) NOT NULL default '', status int(2) NOT NULL default '0', PRIMARY KEY (filename));
+** CREATE TABLE permission (rid INT UNSIGNED NOT NULL, perm TEXT, tid INT UNSIGNED NOT NULL, KEY (rid));
+** INSERT INTO permission (rid, perm) SELECT rid, perm FROM role;
+** ALTER TABLE users ADD rid INT UNSIGNED NOT NULL;
**
** You'll also have to by-pass the access check near the bottom such
** that you can gain access to the form: search for "user_access()".
*/
+include_once "includes/common.inc";
+
if (!get_cfg_var("safe_mode")) {
set_time_limit(180);
}
@@ -427,7 +430,7 @@ function update_29() {
$result = db_query("SELECT rid, name FROM role");
while ($role = db_fetch_object($result)) {
- db_query("UPDATE users SET rid = ".$role->rid." WHERE role = '".$role->name."'");
+ update_sql("UPDATE users SET rid = ". $role->rid ." WHERE role = '". $role->name ."'");
}
update_sql("ALTER TABLE users DROP role");
@@ -440,7 +443,7 @@ function update_29() {
function update_sql($sql) {
global $edit;
- print nl2br(check_output($sql)) ." ";
+ print nl2br(htmlentities($sql)) ." ";
$result = db_query($sql);
if ($result) {
print "<font color=\"green\">OK</font>\n";
@@ -493,12 +496,11 @@ function update_page() {
// make update form and output it.
$form .= form_select("Perform updates since", "start", (isset($selected) ? $selected : -1), $dates);
- $form .= form_select("Bail on errors", "bail", 0, array("Disabled", "Enabled"), "Don't forget to backup your database before performing an update.");
+ $form .= form_select("Stop on errors", "bail", 0, array("Disabled", "Enabled"), "Don't forget to backup your database before performing an update.");
$form .= form_submit("Update");
print form($form);
break;
}
-
}
print "<html><h1>Drupal update</h1>";