aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/install
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/install')
-rw-r--r--phpBB/install/database_update.php65
-rw-r--r--phpBB/install/schemas/firebird_schema.sql6
-rw-r--r--phpBB/install/schemas/mssql_schema.sql10
-rw-r--r--phpBB/install/schemas/mysql_40_schema.sql6
-rw-r--r--phpBB/install/schemas/mysql_41_schema.sql6
-rw-r--r--phpBB/install/schemas/oracle_schema.sql6
-rw-r--r--phpBB/install/schemas/postgres_schema.sql4
-rw-r--r--phpBB/install/schemas/schema_data.sql1
-rw-r--r--phpBB/install/schemas/sqlite_schema.sql6
9 files changed, 105 insertions, 5 deletions
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index 362a379ec1..3b6c614deb 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -701,11 +701,21 @@ function database_update_info()
GROUPS_TABLE => array(
'group_skip_auth' => array('BOOL', 0, 'after' => 'group_founder_manage'),
),
+ PRIVMSGS_TABLE => array(
+ 'message_reported' => array('BOOL', 0),
+ ),
+ REPORTS_TABLE => array(
+ 'pm_id' => array('UINT', 0),
+ ),
),
'add_index' => array(
LOG_TABLE => array(
'log_time' => array('log_time'),
),
+ REPORTS_TABLE => array(
+ 'post_id' => array('post_id'),
+ 'pm_id' => array('pm_id'),
+ ),
),
),
);
@@ -1076,6 +1086,9 @@ function change_database_data(&$no_updates, $version)
// Entries for smiley pagination
set_config('smilies_per_page', '50');
+ // Entry for reporting PMs
+ set_config('allow_pm_report', '1');
+
include_once($phpbb_root_path . 'includes/acp/acp_modules.' . $phpEx);
$_module = new acp_modules();
@@ -1168,6 +1181,58 @@ function change_database_data(&$no_updates, $version)
}
$db->sql_freeresult($result);
+
+ // Also install the "PM Reports" module
+ $sql = 'SELECT module_id
+ FROM ' . MODULES_TABLE . "
+ WHERE module_class = 'mcp'
+ AND module_langname = 'MCP_REPORTS'
+ AND module_mode = ''
+ AND module_basename = ''";
+ $result = $db->sql_query($sql);
+
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $category_id = (int) $row['module_id'];
+
+ $modes = array(
+ 'pm_reports' => array('title' => 'MCP_PM_REPORTS_OPEN', 'auth' => 'aclf_m_report'),
+ 'pm_reports_closed' => array('title' => 'MCP_PM_REPORTS_CLOSED', 'auth' => 'aclf_m_report'),
+ 'pm_report_details' => array('title' => 'MCP_PM_REPORT_DETAILS', 'auth' => 'aclf_m_report'),
+ );
+
+ foreach ($modes as $mode => $data)
+ {
+ // Check if we actually need to add the module or if it is already added. ;)
+ $sql = 'SELECT *
+ FROM ' . MODULES_TABLE . "
+ WHERE module_class = 'mcp'
+ AND module_langname = '{$data['title']}'
+ AND module_mode = '$mode'
+ AND parent_id = {$category_id}";
+ $result2 = $db->sql_query($sql);
+ $row2 = $db->sql_fetchrow($result2);
+ $db->sql_freeresult($result2);
+
+ if (!$row2)
+ {
+ $module_data = array(
+ 'module_basename' => 'users',
+ 'module_enabled' => 1,
+ 'module_display' => 1,
+ 'parent_id' => $category_id,
+ 'module_class' => 'mcp',
+ 'module_langname' => $data['title'],
+ 'module_mode' => $mode,
+ 'module_auth' => $data['auth'],
+ );
+
+ $_module->update_module_data($module_data, true);
+ }
+ }
+ }
+ $db->sql_freeresult($result);
+
$_module->remove_cache_file();
// Add newly_registered group... but check if it already exists (we always supported running the updater on any schema)
diff --git a/phpBB/install/schemas/firebird_schema.sql b/phpBB/install/schemas/firebird_schema.sql
index 4bbc147df7..de1472f6fd 100644
--- a/phpBB/install/schemas/firebird_schema.sql
+++ b/phpBB/install/schemas/firebird_schema.sql
@@ -685,7 +685,8 @@ CREATE TABLE phpbb_privmsgs (
message_edit_time INTEGER DEFAULT 0 NOT NULL,
message_edit_count INTEGER DEFAULT 0 NOT NULL,
to_address BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
- bcc_address BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL
+ bcc_address BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
+ message_reported INTEGER DEFAULT 0 NOT NULL
);;
ALTER TABLE phpbb_privmsgs ADD PRIMARY KEY (msg_id);;
@@ -872,6 +873,7 @@ CREATE TABLE phpbb_reports (
report_id INTEGER NOT NULL,
reason_id INTEGER DEFAULT 0 NOT NULL,
post_id INTEGER DEFAULT 0 NOT NULL,
+ pm_id INTEGER DEFAULT 0 NOT NULL,
user_id INTEGER DEFAULT 0 NOT NULL,
user_notify INTEGER DEFAULT 0 NOT NULL,
report_closed INTEGER DEFAULT 0 NOT NULL,
@@ -881,6 +883,8 @@ CREATE TABLE phpbb_reports (
ALTER TABLE phpbb_reports ADD PRIMARY KEY (report_id);;
+CREATE INDEX phpbb_reports_post_id ON phpbb_reports(post_id);;
+CREATE INDEX phpbb_reports_pm_id ON phpbb_reports(pm_id);;
CREATE GENERATOR phpbb_reports_gen;;
SET GENERATOR phpbb_reports_gen TO 0;;
diff --git a/phpBB/install/schemas/mssql_schema.sql b/phpBB/install/schemas/mssql_schema.sql
index e2cc49e4d7..612b2b8d76 100644
--- a/phpBB/install/schemas/mssql_schema.sql
+++ b/phpBB/install/schemas/mssql_schema.sql
@@ -831,7 +831,8 @@ CREATE TABLE [phpbb_privmsgs] (
[message_edit_time] [int] DEFAULT (0) NOT NULL ,
[message_edit_count] [int] DEFAULT (0) NOT NULL ,
[to_address] [varchar] (4000) DEFAULT ('') NOT NULL ,
- [bcc_address] [varchar] (4000) DEFAULT ('') NOT NULL
+ [bcc_address] [varchar] (4000) DEFAULT ('') NOT NULL ,
+ [message_reported] [int] DEFAULT (0) NOT NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
@@ -1055,6 +1056,7 @@ CREATE TABLE [phpbb_reports] (
[report_id] [int] IDENTITY (1, 1) NOT NULL ,
[reason_id] [int] DEFAULT (0) NOT NULL ,
[post_id] [int] DEFAULT (0) NOT NULL ,
+ [pm_id] [int] DEFAULT (0) NOT NULL ,
[user_id] [int] DEFAULT (0) NOT NULL ,
[user_notify] [int] DEFAULT (0) NOT NULL ,
[report_closed] [int] DEFAULT (0) NOT NULL ,
@@ -1070,6 +1072,12 @@ ALTER TABLE [phpbb_reports] WITH NOCHECK ADD
) ON [PRIMARY]
GO
+CREATE INDEX [post_id] ON [phpbb_reports]([post_id]) ON [PRIMARY]
+GO
+
+CREATE INDEX [pm_id] ON [phpbb_reports]([pm_id]) ON [PRIMARY]
+GO
+
/*
Table: 'phpbb_reports_reasons'
diff --git a/phpBB/install/schemas/mysql_40_schema.sql b/phpBB/install/schemas/mysql_40_schema.sql
index 86c3e18e40..5934d2d173 100644
--- a/phpBB/install/schemas/mysql_40_schema.sql
+++ b/phpBB/install/schemas/mysql_40_schema.sql
@@ -486,6 +486,7 @@ CREATE TABLE phpbb_privmsgs (
message_edit_count smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
to_address blob NOT NULL,
bcc_address blob NOT NULL,
+ message_reported tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
PRIMARY KEY (msg_id),
KEY author_ip (author_ip),
KEY message_time (message_time),
@@ -609,12 +610,15 @@ CREATE TABLE phpbb_reports (
report_id mediumint(8) UNSIGNED NOT NULL auto_increment,
reason_id smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
post_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ pm_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
user_notify tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
report_closed tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
report_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
report_text mediumblob NOT NULL,
- PRIMARY KEY (report_id)
+ PRIMARY KEY (report_id),
+ KEY post_id (post_id),
+ KEY pm_id (pm_id)
);
diff --git a/phpBB/install/schemas/mysql_41_schema.sql b/phpBB/install/schemas/mysql_41_schema.sql
index 81ebb21f7d..2623202d4a 100644
--- a/phpBB/install/schemas/mysql_41_schema.sql
+++ b/phpBB/install/schemas/mysql_41_schema.sql
@@ -486,6 +486,7 @@ CREATE TABLE phpbb_privmsgs (
message_edit_count smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
to_address text NOT NULL,
bcc_address text NOT NULL,
+ message_reported tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
PRIMARY KEY (msg_id),
KEY author_ip (author_ip),
KEY message_time (message_time),
@@ -609,12 +610,15 @@ CREATE TABLE phpbb_reports (
report_id mediumint(8) UNSIGNED NOT NULL auto_increment,
reason_id smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
post_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ pm_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
user_notify tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
report_closed tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
report_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
report_text mediumtext NOT NULL,
- PRIMARY KEY (report_id)
+ PRIMARY KEY (report_id),
+ KEY post_id (post_id),
+ KEY pm_id (pm_id)
) CHARACTER SET `utf8` COLLATE `utf8_bin`;
diff --git a/phpBB/install/schemas/oracle_schema.sql b/phpBB/install/schemas/oracle_schema.sql
index 10452ca18c..05d25db87c 100644
--- a/phpBB/install/schemas/oracle_schema.sql
+++ b/phpBB/install/schemas/oracle_schema.sql
@@ -923,6 +923,7 @@ CREATE TABLE phpbb_privmsgs (
message_edit_count number(4) DEFAULT '0' NOT NULL,
to_address clob DEFAULT '' ,
bcc_address clob DEFAULT '' ,
+ message_reported number(1) DEFAULT '0' NOT NULL,
CONSTRAINT pk_phpbb_privmsgs PRIMARY KEY (msg_id)
)
/
@@ -1164,6 +1165,7 @@ CREATE TABLE phpbb_reports (
report_id number(8) NOT NULL,
reason_id number(4) DEFAULT '0' NOT NULL,
post_id number(8) DEFAULT '0' NOT NULL,
+ pm_id number(8) DEFAULT '0' NOT NULL,
user_id number(8) DEFAULT '0' NOT NULL,
user_notify number(1) DEFAULT '0' NOT NULL,
report_closed number(1) DEFAULT '0' NOT NULL,
@@ -1173,6 +1175,10 @@ CREATE TABLE phpbb_reports (
)
/
+CREATE INDEX phpbb_reports_post_id ON phpbb_reports (post_id)
+/
+CREATE INDEX phpbb_reports_pm_id ON phpbb_reports (pm_id)
+/
CREATE SEQUENCE phpbb_reports_seq
/
diff --git a/phpBB/install/schemas/postgres_schema.sql b/phpBB/install/schemas/postgres_schema.sql
index 3382cf4efc..bb4d839272 100644
--- a/phpBB/install/schemas/postgres_schema.sql
+++ b/phpBB/install/schemas/postgres_schema.sql
@@ -659,6 +659,7 @@ CREATE TABLE phpbb_privmsgs (
message_edit_count INT2 DEFAULT '0' NOT NULL CHECK (message_edit_count >= 0),
to_address varchar(4000) DEFAULT '' NOT NULL,
bcc_address varchar(4000) DEFAULT '' NOT NULL,
+ message_reported INT2 DEFAULT '0' NOT NULL CHECK (message_reported >= 0),
PRIMARY KEY (msg_id)
);
@@ -810,6 +811,7 @@ CREATE TABLE phpbb_reports (
report_id INT4 DEFAULT nextval('phpbb_reports_seq'),
reason_id INT2 DEFAULT '0' NOT NULL CHECK (reason_id >= 0),
post_id INT4 DEFAULT '0' NOT NULL CHECK (post_id >= 0),
+ pm_id INT4 DEFAULT '0' NOT NULL CHECK (pm_id >= 0),
user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0),
user_notify INT2 DEFAULT '0' NOT NULL CHECK (user_notify >= 0),
report_closed INT2 DEFAULT '0' NOT NULL CHECK (report_closed >= 0),
@@ -818,6 +820,8 @@ CREATE TABLE phpbb_reports (
PRIMARY KEY (report_id)
);
+CREATE INDEX phpbb_reports_post_id ON phpbb_reports (post_id);
+CREATE INDEX phpbb_reports_pm_id ON phpbb_reports (pm_id);
/*
Table: 'phpbb_reports_reasons'
diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql
index 8a83225b1b..3545fa9bc2 100644
--- a/phpBB/install/schemas/schema_data.sql
+++ b/phpBB/install/schemas/schema_data.sql
@@ -23,6 +23,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_name_chars',
INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_namechange', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_nocensors', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_pm_attach', '0');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_pm_report', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_post_flash', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_post_links', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_privmsg', '1');
diff --git a/phpBB/install/schemas/sqlite_schema.sql b/phpBB/install/schemas/sqlite_schema.sql
index 486c0a75a1..4ee981c667 100644
--- a/phpBB/install/schemas/sqlite_schema.sql
+++ b/phpBB/install/schemas/sqlite_schema.sql
@@ -471,7 +471,8 @@ CREATE TABLE phpbb_privmsgs (
message_edit_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
message_edit_count INTEGER UNSIGNED NOT NULL DEFAULT '0',
to_address text(65535) NOT NULL DEFAULT '',
- bcc_address text(65535) NOT NULL DEFAULT ''
+ bcc_address text(65535) NOT NULL DEFAULT '',
+ message_reported INTEGER UNSIGNED NOT NULL DEFAULT '0'
);
CREATE INDEX phpbb_privmsgs_author_ip ON phpbb_privmsgs (author_ip);
@@ -590,6 +591,7 @@ CREATE TABLE phpbb_reports (
report_id INTEGER PRIMARY KEY NOT NULL ,
reason_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
post_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ pm_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
user_notify INTEGER UNSIGNED NOT NULL DEFAULT '0',
report_closed INTEGER UNSIGNED NOT NULL DEFAULT '0',
@@ -597,6 +599,8 @@ CREATE TABLE phpbb_reports (
report_text mediumtext(16777215) NOT NULL DEFAULT ''
);
+CREATE INDEX phpbb_reports_post_id ON phpbb_reports (post_id);
+CREATE INDEX phpbb_reports_pm_id ON phpbb_reports (pm_id);
# Table: 'phpbb_reports_reasons'
CREATE TABLE phpbb_reports_reasons (