From 8199e3f09a344e4f50fb9ac85de6fe8ff24dc237 Mon Sep 17 00:00:00 2001 From: moodler Date: Fri, 20 Feb 2004 09:02:27 +0000 Subject: [PATCH] New user field called "emailstop" ... to stop emails. I had to do it ... this is driving me nuts with some people on moodle.org --- backup/backuplib.php | 1 + backup/restorelib.php | 3 +++ lib/db/mysql.php | 4 ++++ lib/db/mysql.sql | 1 + lib/db/postgres7.php | 4 ++++ lib/db/postgres7.sql | 1 + version.php | 2 +- 7 files changed, 15 insertions(+), 1 deletion(-) diff --git a/backup/backuplib.php b/backup/backuplib.php index f6793f484a..4bfa38d3ad 100644 --- a/backup/backuplib.php +++ b/backup/backuplib.php @@ -712,6 +712,7 @@ fwrite ($bf,full_tag("FIRSTNAME",4,false,$user_data->firstname)); fwrite ($bf,full_tag("LASTNAME",4,false,$user_data->lastname)); fwrite ($bf,full_tag("EMAIL",4,false,$user_data->email)); + fwrite ($bf,full_tag("EMAILSTOP",4,false,$user_data->emailstop)); fwrite ($bf,full_tag("ICQ",4,false,$user_data->icq)); fwrite ($bf,full_tag("PHONE1",4,false,$user_data->phone1)); fwrite ($bf,full_tag("PHONE2",4,false,$user_data->phone2)); diff --git a/backup/restorelib.php b/backup/restorelib.php index 8b7b2789f1..cc4e88540a 100644 --- a/backup/restorelib.php +++ b/backup/restorelib.php @@ -2029,6 +2029,9 @@ case "EMAIL": $this->info->tempuser->email = $this->getContents(); break; + case "EMAILSTOP": + $this->info->tempuser->emailstop = $this->getContents(); + break; case "ICQ": $this->info->tempuser->icq = $this->getContents(); break; diff --git a/lib/db/mysql.php b/lib/db/mysql.php index 37c0b4e44b..87e2fda7c1 100644 --- a/lib/db/mysql.php +++ b/lib/db/mysql.php @@ -699,6 +699,10 @@ function main_upgrade($oldversion=0) { } } + if ($oldversion < 2004022000) { + table_column("user", "", "emailstop", "integer", "1", "unsigned", "0", "not null", "email"); + } + return $result; } diff --git a/lib/db/mysql.sql b/lib/db/mysql.sql index 1796177c53..0e971daa42 100644 --- a/lib/db/mysql.sql +++ b/lib/db/mysql.sql @@ -309,6 +309,7 @@ CREATE TABLE `prefix_user` ( `firstname` varchar(20) NOT NULL default '', `lastname` varchar(20) NOT NULL default '', `email` varchar(100) NOT NULL default '', + `emailstop` tinyint(1) unsigned NOT NULL default '0', `icq` varchar(15) default NULL, `phone1` varchar(20) default NULL, `phone2` varchar(20) default NULL, diff --git a/lib/db/postgres7.php b/lib/db/postgres7.php index b64886165f..5ad03d1a9f 100644 --- a/lib/db/postgres7.php +++ b/lib/db/postgres7.php @@ -444,6 +444,10 @@ function main_upgrade($oldversion=0) { } } + if ($oldversion < 2004022000) { + table_column("user", "", "emailstop", "integer", "1", "unsigned", "0", "not null", "email"); + } + return $result; } diff --git a/lib/db/postgres7.sql b/lib/db/postgres7.sql index 5b1c9e7933..5741ad8702 100644 --- a/lib/db/postgres7.sql +++ b/lib/db/postgres7.sql @@ -199,6 +199,7 @@ CREATE TABLE prefix_user ( firstname varchar(20) NOT NULL default '', lastname varchar(20) NOT NULL default '', email varchar(100) NOT NULL default '', + emailstop integer NOT NULL default '0', icq varchar(15) default NULL, phone1 varchar(20) default NULL, phone2 varchar(20) default NULL, diff --git a/version.php b/version.php index 5904ad0af3..b0144b4441 100644 --- a/version.php +++ b/version.php @@ -5,7 +5,7 @@ // database to determine whether upgrades should // be performed (see lib/db/*.php) -$version = 2004021700; // The current version is a date (YYYYMMDDXX) +$version = 2004022000; // The current version is a date (YYYYMMDDXX) $release = "1.2 development"; // User-friendly version number -- 2.39.5