bye bye forbidden extensions... we have a deny,allow rule for extensions, forbidden extensions are therefore a little bit redundant.

git-svn-id: file:///svn/phpbb/trunk@4400 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen 2003-08-13 16:56:01 +00:00
parent e46f4cb505
commit c0551af851
6 changed files with 8 additions and 63 deletions

View file

@ -250,23 +250,16 @@ if ($submit && $mode == 'extensions')
{ {
if (!count($error)) if (!count($error))
{ {
$extension_check = array(EXTENSIONS_TABLE => 'EXTENSION_EXIST', FORBIDDEN_EXTENSIONS_TABLE => 'CANNOT_ADD_FORBIDDEN_EXTENSION'); $sql = 'SELECT extension_id
FROM ' . EXTENSIONS_TABLE . "
WHERE extension = '$add_extension'";
$result = $db->sql_query($sql);
foreach ($extension_check as $table => $error_msg) if ($row = $db->sql_fetchrow($result))
{ {
$sql = "SELECT extension $error[] = sprintf($user->lang['EXTENSION_EXIST'], $add_extension);
FROM $table";
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
{
if ($row['extension'] == $add_extension)
{
$error[] = sprintf($user->lang[$error_msg], $add_extension);
}
}
$db->sql_freeresult($result);
} }
$db->sql_freeresult($result);
if (!count($error)) if (!count($error))
{ {

View file

@ -144,7 +144,6 @@ define('CONFIG_TABLE', $table_prefix.'config');
define('CONFIRM_TABLE', $table_prefix.'confirm'); define('CONFIRM_TABLE', $table_prefix.'confirm');
define('DISALLOW_TABLE', $table_prefix.'disallow'); // define('DISALLOW_TABLE', $table_prefix.'disallow'); //
define('EXTENSIONS_TABLE', $table_prefix.'extensions'); define('EXTENSIONS_TABLE', $table_prefix.'extensions');
define('FORBIDDEN_EXTENSIONS_TABLE', $table_prefix.'forbidden_extensions');
define('EXTENSION_GROUPS_TABLE', $table_prefix.'extension_groups'); define('EXTENSION_GROUPS_TABLE', $table_prefix.'extension_groups');
define('FORUMS_TABLE', $table_prefix.'forums'); define('FORUMS_TABLE', $table_prefix.'forums');
define('FORUMS_TRACK_TABLE', $table_prefix.'forums_marking'); define('FORUMS_TRACK_TABLE', $table_prefix.'forums_marking');

View file

@ -216,23 +216,6 @@ CREATE TRIGGER phpbb_extension_groups_trig
NEW.group_id = GEN_ID(phpbb_extension_groups_gen, 1)| NEW.group_id = GEN_ID(phpbb_extension_groups_gen, 1)|
END; END;
# Table: 'phpbb_forbidden_extensions'
CREATE TABLE phpbb_forbidden_extensions (
extension_id INTEGER NOT NULL,
extension VARCHAR(100) NOT NULL,
PRIMARY KEY (extension_id)
);
CREATE GENERATOR phpbb_forbidden_extensions_gen;
SET GENERATOR phpbb_forbidden_extensions_gen TO 0;
CREATE TRIGGER phpbb_forbidden_extensions_trig
FOR phpbb_forbidden_extensions BEFORE INSERT
AS BEGIN
IF (NEW.extension_id IS NULL) THEN
NEW.extension_id = GEN_ID(phpbb_forbidden_extensions_gen, 1)|
END;
# Table: 'phpbb_forums' # Table: 'phpbb_forums'
CREATE TABLE phpbb_forums ( CREATE TABLE phpbb_forums (
forum_id SMALLINT NOT NULL, forum_id SMALLINT NOT NULL,

View file

@ -141,13 +141,6 @@ CREATE TABLE phpbb_extension_groups (
PRIMARY KEY (group_id) PRIMARY KEY (group_id)
); );
# Table: 'phpbb_forbidden_extensions'
CREATE TABLE phpbb_forbidden_extensions (
extension_id mediumint(8) UNSIGNED NOT NULL auto_increment,
extension varchar(100) NOT NULL,
PRIMARY KEY (extension_id)
);
# Table: 'phpbb_forums' # Table: 'phpbb_forums'
CREATE TABLE phpbb_forums ( CREATE TABLE phpbb_forums (
forum_id smallint(5) UNSIGNED NOT NULL auto_increment, forum_id smallint(5) UNSIGNED NOT NULL auto_increment,

View file

@ -481,22 +481,6 @@ INSERT INTO phpbb_reports_reasons (reason_id, reason_priority, reason_name, reas
# MSSQL IDENTITY phpbb_reports_reasons OFF # # MSSQL IDENTITY phpbb_reports_reasons OFF #
# MSSQL IDENTITY phpbb_forbidden_extensions ON #
# -- forbidden_extensions
INSERT INTO phpbb_forbidden_extensions (extension_id, extension) VALUES (1, 'php');
INSERT INTO phpbb_forbidden_extensions (extension_id, extension) VALUES (2, 'php3');
INSERT INTO phpbb_forbidden_extensions (extension_id, extension) VALUES (3, 'php4');
INSERT INTO phpbb_forbidden_extensions (extension_id, extension) VALUES (4, 'phtml');
INSERT INTO phpbb_forbidden_extensions (extension_id, extension) VALUES (5, 'pl');
INSERT INTO phpbb_forbidden_extensions (extension_id, extension) VALUES (6, 'asp');
INSERT INTO phpbb_forbidden_extensions (extension_id, extension) VALUES (7, 'cgi');
INSERT INTO phpbb_forbidden_extensions (extension_id, extension) VALUES (8, 'aspx');
# MSSQL IDENTITY phpbb_forbidden_extensions OFF #
# MSSQL IDENTITY phpbb_extension_groups ON # # MSSQL IDENTITY phpbb_extension_groups ON #
# -- extension_groups # -- extension_groups

View file

@ -130,13 +130,6 @@ CREATE TABLE phpbb_extension_groups (
PRIMARY KEY (group_id) PRIMARY KEY (group_id)
); );
-- Table: 'phpbb_forbidden_extensions'
CREATE TABLE phpbb_forbidden_extensions (
extension_id INTEGER NOT NULL,
extension VARCHAR(100) NOT NULL,
PRIMARY KEY (extension_id)
);
-- Table: 'phpbb_forums' -- Table: 'phpbb_forums'
CREATE TABLE phpbb_forums ( CREATE TABLE phpbb_forums (
forum_id INTEGER NOT NULL, forum_id INTEGER NOT NULL,