aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/install
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2008-11-26 19:58:35 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2008-11-26 19:58:35 +0000
commitfb77cdd0513994dca478c06a3c9ac5912da07872 (patch)
tree722500e2be300938c98f48fe8c2546db24cce96d /phpBB/install
parent63b089f6535cf53ec8bec87decf56caab30bd0ad (diff)
downloadforums-fb77cdd0513994dca478c06a3c9ac5912da07872.tar
forums-fb77cdd0513994dca478c06a3c9ac5912da07872.tar.gz
forums-fb77cdd0513994dca478c06a3c9ac5912da07872.tar.bz2
forums-fb77cdd0513994dca478c06a3c9ac5912da07872.tar.xz
forums-fb77cdd0513994dca478c06a3c9ac5912da07872.zip
Better handling and finer control for custom profile fields visibility options. (Patch by Highway of Life)
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9127 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/install')
-rw-r--r--phpBB/install/database_update.php52
-rw-r--r--phpBB/install/schemas/firebird_schema.sql1
-rw-r--r--phpBB/install/schemas/mssql_schema.sql1
-rw-r--r--phpBB/install/schemas/mysql_40_schema.sql1
-rw-r--r--phpBB/install/schemas/mysql_41_schema.sql1
-rw-r--r--phpBB/install/schemas/oracle_schema.sql1
-rw-r--r--phpBB/install/schemas/postgres_schema.sql3
-rw-r--r--phpBB/install/schemas/sqlite_schema.sql3
8 files changed, 60 insertions, 3 deletions
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index 48fd4e3ad2..b5839f517a 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -548,6 +548,15 @@ $database_update_info = array(
// No changes from 3.0.3-RC1 to 3.0.3
'3.0.3-RC1' => array(),
+
+ // Changes from 3.0.3 to 3.0.4-RC1
+ '3.0.3' => array(
+ 'add_columns' => array(
+ PROFILE_FIELDS_TABLE => array(
+ 'field_show_profile' => array('BOOL', 0),
+ ),
+ ),
+ ),
);
// Determine mapping database type
@@ -1948,6 +1957,47 @@ function change_database_data(&$no_updates, $version)
$no_updates = false;
break;
+
+ // Changes from 3.0.3 to 3.0.4-RC1
+ case '3.0.3':
+ // Update the Custom Profile Fields based on previous settings to the new format
+ $sql = 'SELECT field_id, field_required, field_show_on_reg, field_hide
+ FROM ' . PROFILE_FIELDS_TABLE;
+ $result = _sql($sql, $errored, $error_ary);
+
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $sql_ary = array(
+ 'field_required' => 0,
+ 'field_show_on_reg' => 0,
+ 'field_hide' => 0,
+ 'field_show_profile'=> 0,
+ );
+
+ if ($row['field_required'])
+ {
+ $sql_ary['field_required'] = $sql_ary['field_show_on_reg'] = $sql_ary['field_show_profile'] = 1;
+ }
+ else if ($row['field_show_on_reg'])
+ {
+ $sql_ary['field_show_on_reg'] = $sql_ary['field_show_profile'] = 1;
+ }
+ else if ($row['field_hide'])
+ {
+ // Only administrators and moderators can see this CPF, if the view is enabled, they can see it, otherwise just admins in the acp_users module
+ $sql_ary['field_hide'] = 1;
+ }
+ else
+ {
+ // equivelant to "none", which is the "Display in user control panel" option
+ $sql_ary['field_show_profile'] = 1;
+ }
+
+ _sql('UPDATE ' . PROFILE_FIELDS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . ' WHERE field_id = ' . $row['field_id'], $errored, $error_ary);
+ }
+
+ $no_updates = false;
+ break;
}
}
@@ -3082,4 +3132,4 @@ function utf8_new_clean_string($text)
return trim($text);
}
-?> \ No newline at end of file
+?>
diff --git a/phpBB/install/schemas/firebird_schema.sql b/phpBB/install/schemas/firebird_schema.sql
index e3e2e43723..8ac371b9ed 100644
--- a/phpBB/install/schemas/firebird_schema.sql
+++ b/phpBB/install/schemas/firebird_schema.sql
@@ -786,6 +786,7 @@ CREATE TABLE phpbb_profile_fields (
field_validation VARCHAR(20) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
field_required INTEGER DEFAULT 0 NOT NULL,
field_show_on_reg INTEGER DEFAULT 0 NOT NULL,
+ field_show_profile INTEGER DEFAULT 0 NOT NULL,
field_hide INTEGER DEFAULT 0 NOT NULL,
field_no_view INTEGER DEFAULT 0 NOT NULL,
field_active INTEGER DEFAULT 0 NOT NULL,
diff --git a/phpBB/install/schemas/mssql_schema.sql b/phpBB/install/schemas/mssql_schema.sql
index 3a3d3fcbd4..445a0eda08 100644
--- a/phpBB/install/schemas/mssql_schema.sql
+++ b/phpBB/install/schemas/mssql_schema.sql
@@ -942,6 +942,7 @@ CREATE TABLE [phpbb_profile_fields] (
[field_validation] [varchar] (20) DEFAULT ('') NOT NULL ,
[field_required] [int] DEFAULT (0) NOT NULL ,
[field_show_on_reg] [int] DEFAULT (0) NOT NULL ,
+ [field_show_profile] [int] DEFAULT (0) NOT NULL ,
[field_hide] [int] DEFAULT (0) NOT NULL ,
[field_no_view] [int] DEFAULT (0) NOT NULL ,
[field_active] [int] DEFAULT (0) NOT NULL ,
diff --git a/phpBB/install/schemas/mysql_40_schema.sql b/phpBB/install/schemas/mysql_40_schema.sql
index 01d8efa921..b4830a977c 100644
--- a/phpBB/install/schemas/mysql_40_schema.sql
+++ b/phpBB/install/schemas/mysql_40_schema.sql
@@ -550,6 +550,7 @@ CREATE TABLE phpbb_profile_fields (
field_validation varbinary(60) DEFAULT '' NOT NULL,
field_required tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
field_show_on_reg tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ field_show_profile tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
field_hide tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
field_no_view tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
field_active tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
diff --git a/phpBB/install/schemas/mysql_41_schema.sql b/phpBB/install/schemas/mysql_41_schema.sql
index 0119e4ce9d..e546c66f0a 100644
--- a/phpBB/install/schemas/mysql_41_schema.sql
+++ b/phpBB/install/schemas/mysql_41_schema.sql
@@ -550,6 +550,7 @@ CREATE TABLE phpbb_profile_fields (
field_validation varchar(20) DEFAULT '' NOT NULL,
field_required tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
field_show_on_reg tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ field_show_profile tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
field_hide tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
field_no_view tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
field_active tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
diff --git a/phpBB/install/schemas/oracle_schema.sql b/phpBB/install/schemas/oracle_schema.sql
index c9b138b8d8..85a0526071 100644
--- a/phpBB/install/schemas/oracle_schema.sql
+++ b/phpBB/install/schemas/oracle_schema.sql
@@ -1056,6 +1056,7 @@ CREATE TABLE phpbb_profile_fields (
field_validation varchar2(60) DEFAULT '' ,
field_required number(1) DEFAULT '0' NOT NULL,
field_show_on_reg number(1) DEFAULT '0' NOT NULL,
+ field_show_profile number(1) DEFAULT '0' NOT NULL,
field_hide number(1) DEFAULT '0' NOT NULL,
field_no_view number(1) DEFAULT '0' NOT NULL,
field_active number(1) DEFAULT '0' NOT NULL,
diff --git a/phpBB/install/schemas/postgres_schema.sql b/phpBB/install/schemas/postgres_schema.sql
index 32f3f0cd4a..cb9a30b423 100644
--- a/phpBB/install/schemas/postgres_schema.sql
+++ b/phpBB/install/schemas/postgres_schema.sql
@@ -737,6 +737,7 @@ CREATE TABLE phpbb_profile_fields (
field_validation varchar(20) DEFAULT '' NOT NULL,
field_required INT2 DEFAULT '0' NOT NULL CHECK (field_required >= 0),
field_show_on_reg INT2 DEFAULT '0' NOT NULL CHECK (field_show_on_reg >= 0),
+ field_show_profile INT2 DEFAULT '0' NOT NULL CHECK (field_show_profile >= 0),
field_hide INT2 DEFAULT '0' NOT NULL CHECK (field_hide >= 0),
field_no_view INT2 DEFAULT '0' NOT NULL CHECK (field_no_view >= 0),
field_active INT2 DEFAULT '0' NOT NULL CHECK (field_active >= 0),
@@ -1274,4 +1275,4 @@ CREATE TABLE phpbb_zebra (
-COMMIT; \ No newline at end of file
+COMMIT;
diff --git a/phpBB/install/schemas/sqlite_schema.sql b/phpBB/install/schemas/sqlite_schema.sql
index 8033b2d583..725c09169e 100644
--- a/phpBB/install/schemas/sqlite_schema.sql
+++ b/phpBB/install/schemas/sqlite_schema.sql
@@ -533,6 +533,7 @@ CREATE TABLE phpbb_profile_fields (
field_validation varchar(20) NOT NULL DEFAULT '',
field_required INTEGER UNSIGNED NOT NULL DEFAULT '0',
field_show_on_reg INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ field_show_profile INTEGER UNSIGNED NOT NULL DEFAULT '0',
field_hide INTEGER UNSIGNED NOT NULL DEFAULT '0',
field_no_view INTEGER UNSIGNED NOT NULL DEFAULT '0',
field_active INTEGER UNSIGNED NOT NULL DEFAULT '0',
@@ -968,4 +969,4 @@ CREATE TABLE phpbb_zebra (
-COMMIT; \ No newline at end of file
+COMMIT;