From 718ad19f475e12197328cacf90aef2aa83db7db9 Mon Sep 17 00:00:00 2001 From: moodler Date: Mon, 21 Apr 2003 07:21:33 +0000 Subject: [PATCH] trying to fix up old file permissions --- lib/db/mysql.php | 13 ++++++++++++- lib/db/postgres7.php | 11 +++++++++++ version.php | 4 ++-- 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/lib/db/mysql.php b/lib/db/mysql.php index 6bf079213a..5e82e17671 100644 --- a/lib/db/mysql.php +++ b/lib/db/mysql.php @@ -252,7 +252,8 @@ function main_upgrade($oldversion=0) { } if ($oldversion < 2003012200) { - execute_sql(" ALTER TABLE `log_display` CHANGE `module` `module` VARCHAR( 20 ) NOT NULL "); + // execute_sql(" ALTER TABLE `log_display` CHANGE `module` `module` VARCHAR( 20 ) NOT NULL "); + // Commented out - see below where it's done properly } if ($oldversion < 2003032500) { @@ -275,6 +276,16 @@ function main_upgrade($oldversion=0) { table_column("course_modules", "", "visible", "integer", "1", "unsigned", "1", "not null", "score"); } + if ($oldversion < 2003042104) { // Try to update permissions of all files + if ($files = get_directory_list($CFG->dataroot)) { + echo "Attempting to update permissions for all files... ignore any errors."; + foreach ($files as $file) { + echo "$CFG->dataroot/$file
"; + @chown("$CFG->dataroot/$file", $CFG->directorypermissions); + } + } + } + return true; } diff --git a/lib/db/postgres7.php b/lib/db/postgres7.php index b1d74d63c9..9538f881df 100644 --- a/lib/db/postgres7.php +++ b/lib/db/postgres7.php @@ -50,6 +50,17 @@ function main_upgrade($oldversion=0) { if ($oldversion < 2003041400) { table_column("course_modules", "", "visible", "integer", "1", "unsigned", "1", "not null", "score"); } + + if ($oldversion < 2003042104) { // Try to update permissions of all files + if ($files = get_directory_list($CFG->dataroot)) { + echo "Attempting to update permissions for all files... ignore any errors."; + foreach ($files as $file) { + echo "$CFG->dataroot/$file
"; + @chown("$CFG->dataroot/$file", $CFG->directorypermissions); + } + } + } + return true; } diff --git a/version.php b/version.php index 428cef39dc..efb6c3ff65 100644 --- a/version.php +++ b/version.php @@ -5,7 +5,7 @@ // database to determine whether upgrades should // be performed (see lib/db/*.php) -$version = 2003042100; // The current version is a date (YYYYMMDDXX) +$version = 2003042104; // The current version is a date (YYYYMMDDXX) -$release = "1.0.9 - development"; // User-friendly version number +$release = "1.0.9 development"; // User-friendly version number -- 2.39.5