From b61a7ee9b62c443c8b6e4428f6f357287d8c2783 Mon Sep 17 00:00:00 2001 From: Exile Date: Sun, 7 Sep 2014 18:56:37 +0400 Subject: [PATCH] New infopage script MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Переделка файла выводящего страницы с информацией. Долой динамическое подключение и костыли на проверку XSS. --- upload/attach_mod/posting_attachments.php | 27 ++-- upload/config.php | 6 +- upload/includes/init_bb.php | 2 +- upload/info.php | 71 +++++++++ upload/language/en/html/advert.html | 21 +-- .../language/en/html/copyright_holders.html | 20 +-- upload/language/en/html/not_found.html | 17 +-- upload/language/en/html/sidebar1.html | 2 +- upload/language/en/html/user_agreement.html | 27 +--- upload/language/en/main.php | 8 +- upload/language/ru/html/advert.html | 21 +-- .../language/ru/html/copyright_holders.html | 20 +-- upload/language/ru/html/not_found.html | 17 +-- upload/language/ru/html/sidebar1.html | 2 +- upload/language/ru/html/user_agreement.html | 27 +--- upload/language/ru/main.php | 8 +- upload/language/uk/html/advert.html | 21 +-- .../language/uk/html/copyright_holders.html | 20 +-- upload/language/uk/html/not_found.html | 17 +-- upload/language/uk/html/sidebar1.html | 2 +- upload/language/uk/html/user_agreement.html | 27 +--- upload/language/uk/main.php | 8 +- upload/misc.php | 144 ------------------ upload/templates/default/attach_rules.tpl | 24 --- 24 files changed, 128 insertions(+), 431 deletions(-) create mode 100644 upload/info.php delete mode 100644 upload/misc.php delete mode 100644 upload/templates/default/attach_rules.tpl diff --git a/upload/attach_mod/posting_attachments.php b/upload/attach_mod/posting_attachments.php index 60e91d161..f01bc0cd9 100644 --- a/upload/attach_mod/posting_attachments.php +++ b/upload/attach_mod/posting_attachments.php @@ -749,10 +749,7 @@ class attach_parent $s_hidden = ''; $s_hidden .= ''; - $u_rules_id = $forum_id; - $template->assign_vars(array( - 'RULES' => ''. $lang['ALLOWED_EXTENSIONS_AND_SIZES'] .'', 'ADD_ATTACH_HIDDEN_FIELDS' => $s_hidden, )); @@ -783,12 +780,11 @@ class attach_parent if ($this->add_attachment_body) { $template->assign_vars(array( - 'TPL_ADD_ATTACHMENT' => true, - 'FILE_COMMENT' => htmlspecialchars($this->file_comment), - 'FILESIZE' => $attach_config['max_filesize'], - 'FILENAME' => htmlspecialchars($this->filename), - - 'S_FORM_ENCTYPE' => 'enctype="multipart/form-data"', + 'TPL_ADD_ATTACHMENT' => true, + 'FILE_COMMENT' => htmlspecialchars($this->file_comment), + 'FILESIZE' => $attach_config['max_filesize'], + 'FILENAME' => htmlspecialchars($this->filename), + 'S_FORM_ENCTYPE' => 'enctype="multipart/form-data"', )); } @@ -810,13 +806,12 @@ class attach_parent } $template->assign_block_vars('attach_row', array( - 'FILE_NAME' => @htmlspecialchars($this->attachment_filename_list[$i]), - 'ATTACH_FILENAME' => @$this->attachment_list[$i], - 'FILE_COMMENT' => @htmlspecialchars($this->attachment_comment_list[$i]), - 'ATTACH_ID' => @$this->attachment_id_list[$i], - - 'U_VIEW_ATTACHMENT' => $download_link) - ); + 'FILE_NAME' => @htmlspecialchars($this->attachment_filename_list[$i]), + 'ATTACH_FILENAME' => @$this->attachment_list[$i], + 'FILE_COMMENT' => @htmlspecialchars($this->attachment_comment_list[$i]), + 'ATTACH_ID' => @$this->attachment_id_list[$i], + 'U_VIEW_ATTACHMENT' => $download_link, + )); // Thumbnail there ? And is the User Admin or Mod ? Then present the 'Delete Thumbnail' Button if (@intval($this->attachment_thumbnail_list[$i]) == 1 && ((isset($is_auth['auth_mod']) && $is_auth['auth_mod']) || IS_ADMIN)) diff --git a/upload/config.php b/upload/config.php index b1dd0ef9a..f231a7a29 100644 --- a/upload/config.php +++ b/upload/config.php @@ -606,9 +606,9 @@ $bb_cfg['trash_forum_id'] = 0; // (int) 7 $bb_cfg['first_logon_redirect_url'] = 'index.php'; $bb_cfg['terms_and_conditions_url'] = 'terms.php'; -$bb_cfg['user_agreement_url'] = 'misc.php?do=info&show=user_agreement'; -$bb_cfg['copyright_holders_url'] = 'misc.php?do=info&show=copyright_holders'; -$bb_cfg['advert_url'] = 'misc.php?do=info&show=advert'; +$bb_cfg['user_agreement_url'] = 'info.php?show=user_agreement'; +$bb_cfg['copyright_holders_url'] = 'info.php?show=copyright_holders'; +$bb_cfg['advert_url'] = 'info.php?show=advert'; // Captcha $bb_cfg['captcha'] = array( diff --git a/upload/includes/init_bb.php b/upload/includes/init_bb.php index 709cb2e9c..fd1ad7c66 100644 --- a/upload/includes/init_bb.php +++ b/upload/includes/init_bb.php @@ -3,7 +3,7 @@ if (!defined('BB_ROOT')) die(basename(__FILE__)); if (PHP_VERSION < '5.3') die('TorrentPier II requires PHP version 5.3+. Your PHP version '. PHP_VERSION); if (!defined('BB_SCRIPT')) define('BB_SCRIPT', 'undefined'); -if (!defined('BB_CFG_LOADED')) trigger_error('bb_cfg not loaded', E_USER_ERROR); +if (!defined('BB_CFG_LOADED')) trigger_error('File config.php not loaded', E_USER_ERROR); // Define some basic configuration arrays unset($stopwords, $synonyms_match, $synonyms_replace); diff --git a/upload/info.php b/upload/info.php new file mode 100644 index 000000000..1234e40f4 --- /dev/null +++ b/upload/info.php @@ -0,0 +1,71 @@ +session_start(); + +global $lang; + +$info = array(); +$html_dir = LANG_DIR . 'html/'; +$req_mode = !empty($_REQUEST['show']) ? (string) $_REQUEST['show'] : 'not_found'; + +switch ($req_mode) +{ + case 'advert': + $info['title'] = $lang['ADVERT']; + $info['src'] = 'advert.html'; + break; + + case 'copyright_holders': + $info['title'] = $lang['COPYRIGHT_HOLDERS']; + $info['src'] = 'copyright_holders.html'; + break; + + case 'not_found': + $info['title'] = $lang['NOT_FOUND']; + $info['src'] = 'not_found.html'; + break; + + case 'user_agreement': + $info['title'] = $lang['USER_AGREEMENT']; + $info['src'] = 'user_agreement.html'; + break; + + default: + bb_simple_die('Invalid request'); +} + +$require = file_exists($html_dir . $info['src']) ? $html_dir . $info['src'] : $html_dir . 'not_found.html'; + +?> + + + + + + + + +
+
+
+ +
+ +
+
+

[ ]

+
+ + \ No newline at end of file diff --git a/upload/language/en/html/advert.html b/upload/language/en/html/advert.html index 686c07b2e..80632ba56 100644 --- a/upload/language/en/html/advert.html +++ b/upload/language/en/html/advert.html @@ -1,17 +1,4 @@ -ADVERTISING ON THE SITE - -
-
- ADVERTISING ON THE SITE -
- -
-

Advertising on ">

-

For advertising please contact:

-
-
-
-

[ Close ]

-
\ No newline at end of file +
+

Advertising on ">

+

For advertising please contact:

+
\ No newline at end of file diff --git a/upload/language/en/html/copyright_holders.html b/upload/language/en/html/copyright_holders.html index 80c231eab..3c75a7380 100644 --- a/upload/language/en/html/copyright_holders.html +++ b/upload/language/en/html/copyright_holders.html @@ -1,18 +1,6 @@ -INFORMATION FOR COPYRIGHT HOLDERS - -
-
- INFORMATION FOR COPYRIGHT HOLDERS -
- -
-

Information for copyright holders.

+

INFORMATION FOR COPYRIGHT HOLDERS

If you are the copyright of any material link (or links) which is available on this site, and would not want to spread this information by users without your consent, we will be happy to assist you by removing the appropriate links.

@@ -44,8 +32,4 @@ which indicated to us the following information:

c) According to the Law on Copyright and Related Rights, a reference to any data (information message), by itself, is not subject to copyright law (although it may violate the "Agreement on the use of the website"). Thus, it is not necessary to send letters containing threats or demands, as not having a real reason.

-
-
-
-

[ Close ]

-
\ No newline at end of file + \ No newline at end of file diff --git a/upload/language/en/html/not_found.html b/upload/language/en/html/not_found.html index de4033a22..f85fbdf09 100644 --- a/upload/language/en/html/not_found.html +++ b/upload/language/en/html/not_found.html @@ -1,14 +1,3 @@ -
-
- File not found -
- -
-

File not found

-
-
-
-

[ Close ]

-
\ No newline at end of file +
+

File not found

+
\ No newline at end of file diff --git a/upload/language/en/html/sidebar1.html b/upload/language/en/html/sidebar1.html index 97fbfb098..4bbf9e940 100644 --- a/upload/language/en/html/sidebar1.html +++ b/upload/language/en/html/sidebar1.html @@ -12,7 +12,7 @@

FAQ

diff --git a/upload/language/en/html/user_agreement.html b/upload/language/en/html/user_agreement.html index 786415569..eccce4738 100644 --- a/upload/language/en/html/user_agreement.html +++ b/upload/language/en/html/user_agreement.html @@ -1,25 +1,10 @@ - -USER AGREEMENT - -
-
- USER AGREEMENT -
- - - -

-

USER AGREEMENT

+

USER AGREEMENT

-

ABOUT SITE

+

ABOUT SITE

Internet - resource (website) "> (hereinafter - Resource) is an internet site that allows users to share information with each other via bit-torrent, as well as in free form, and provides a means to monitor the integrity of information transmitted (via hash-files).

@@ -96,10 +81,4 @@

-
- -
-
-

[ Close ]

-
- \ No newline at end of file +
\ No newline at end of file diff --git a/upload/language/en/main.php b/upload/language/en/main.php index 646f3df32..0e69c1acf 100644 --- a/upload/language/en/main.php +++ b/upload/language/en/main.php @@ -657,6 +657,7 @@ $lang['USER_AGREEMENT_AGREE'] = 'I have read and agree to the User agreement abo $lang['COPYRIGHT_HOLDERS'] = 'For copyright holders'; $lang['ADVERT'] = 'Advertise on this site'; +$lang['NOT_FOUND'] = 'File not found'; // Visual confirmation system strings $lang['CONFIRM_CODE_WRONG'] = 'The confirmation code you entered was incorrect'; @@ -1032,13 +1033,6 @@ $lang['DIRECTORY_DOES_NOT_EXIST'] = 'The Directory \'%s\' does not exist or Coul $lang['DIRECTORY_IS_NOT_A_DIR'] = 'Please check if \'%s\' is a directory.'; // replace %s with directory $lang['DIRECTORY_NOT_WRITEABLE'] = 'Directory \'%s\' is not writeable. You\'ll have to create the upload path and chmod it to 777 (or change the owner to you httpd-servers owner) to upload files.
If you have only plain FTP-access change the \'Attribute\' of the directory to rwxrwxrwx.'; // replace %s with directory -// Attach Rules Window -$lang['RULES_PAGE'] = 'Attachment Rules'; -$lang['ATTACH_RULES_TITLE'] = 'Allowed Extension Groups and their Sizes'; -$lang['GROUP_RULE_HEADER'] = '%s -> Maximum Upload Size: %s'; // Replace first %s with Extension Group, second one with the Size STRING -$lang['ALLOWED_EXTENSIONS_AND_SIZES'] = 'Allowed Extensions and Sizes'; -$lang['NOTE_USER_EMPTY_GROUP_PERMISSIONS'] = 'NOTE:
You are normally allowed to attach files within this Forum,
but since no Extension Group is allowed to be attached here,
you are unable to attach anything. If you try,
you will receive an Error Message.
'; - // Quota Variables $lang['UPLOAD_QUOTA'] = 'Upload Quota'; $lang['PM_QUOTA'] = 'PM Quota'; diff --git a/upload/language/ru/html/advert.html b/upload/language/ru/html/advert.html index 6dc7c9ec9..ffe7795b7 100644 --- a/upload/language/ru/html/advert.html +++ b/upload/language/ru/html/advert.html @@ -1,17 +1,4 @@ -РЕКЛАМА НА САЙТЕ - -
-
- РЕКЛАМА НА САЙТЕ -
- -
-

Размещение рекламы на ">

-

По вопросам размещения рекламы обращайтесь по адресу:

-
-
-
-

[ Закрыть ]

-
\ No newline at end of file +
+

Размещение рекламы на ">

+

По вопросам размещения рекламы обращайтесь по адресу:

+
\ No newline at end of file diff --git a/upload/language/ru/html/copyright_holders.html b/upload/language/ru/html/copyright_holders.html index 94081a47c..ebd5972d5 100644 --- a/upload/language/ru/html/copyright_holders.html +++ b/upload/language/ru/html/copyright_holders.html @@ -1,18 +1,6 @@ -ИНФОРМАЦИЯ ДЛЯ ПРАВООБЛАДАТЕЛЕЙ - -
-
- ИНФОРМАЦИЯ ДЛЯ ПРАВООБЛАДАТЕЛЕЙ -
- -
-

Информация для правообладателей.

+

ИНФОРМАЦИЯ ДЛЯ ПРАВООБЛАДАТЕЛЕЙ

Если Вы являетесь правообладателем какого-либо материала, ссылка (либо ссылки) на который размещена на этом сайте, и не хотели бы чтобы данная информация распространялась пользователями без Вашего на то согласия, то мы будем рады оказать Вам содействие, удалив соответствующие ссылки.

@@ -44,8 +32,4 @@

в) Согласно закону об Авторском и Смежном правах, ссылка на любые данные (информационное сообщение), сама по себе, не является объектом авторского права (хотя может нарушать "соглашение об использовании сайта"). Таким образом, не стоит присылать письма содержащие угрозы либо требования, как не имеющие под собой реальных оснований.

-
-
-
-

[ Закрыть ]

-
\ No newline at end of file + \ No newline at end of file diff --git a/upload/language/ru/html/not_found.html b/upload/language/ru/html/not_found.html index 3b7cccafc..38f036f45 100644 --- a/upload/language/ru/html/not_found.html +++ b/upload/language/ru/html/not_found.html @@ -1,14 +1,3 @@ -
-
- Файл не найден -
- -
-

Файл не найден

-
-
-
-

[ Закрыть ]

-
\ No newline at end of file +
+

Файл не найден

+
\ No newline at end of file diff --git a/upload/language/ru/html/sidebar1.html b/upload/language/ru/html/sidebar1.html index c18211e39..e876107be 100644 --- a/upload/language/ru/html/sidebar1.html +++ b/upload/language/ru/html/sidebar1.html @@ -12,7 +12,7 @@

FAQ

diff --git a/upload/language/ru/html/user_agreement.html b/upload/language/ru/html/user_agreement.html index db0cec8d1..d68f7df4b 100644 --- a/upload/language/ru/html/user_agreement.html +++ b/upload/language/ru/html/user_agreement.html @@ -1,25 +1,10 @@ - -ПОЛЬЗОВАТЕЛЬСКОЕ СОГЛАШЕНИЕ - -
-
- ПОЛЬЗОВАТЕЛЬСКОЕ СОГЛАШЕНИЕ -
- - - -

-

ПОЛЬЗОВАТЕЛЬСКОЕ СОГЛАШЕНИЕ

+

ПОЛЬЗОВАТЕЛЬСКОЕ СОГЛАШЕНИЕ

-

О САЙТЕ

+

О САЙТЕ

Интернет - ресурс (сайт) "> (в дальнейшем - Ресурс) является интернет-сайтом, позволяющим пользователям обмениваться друг с другом информацией по протоколу бит-торрент, а также в свободной форме, и предоставляющим средства для контроля целостности передаваемой информации (посредством hash-файлов).

@@ -96,10 +81,4 @@

-
- -
-
-

[ Закрыть ]

-
- \ No newline at end of file +
\ No newline at end of file diff --git a/upload/language/ru/main.php b/upload/language/ru/main.php index 1cea65c84..53305a3bb 100644 --- a/upload/language/ru/main.php +++ b/upload/language/ru/main.php @@ -657,6 +657,7 @@ $lang['USER_AGREEMENT_AGREE'] = 'Я прочел ПОЛЬЗОВАТЕЛЬСКО $lang['COPYRIGHT_HOLDERS'] = 'Для правообладателей'; $lang['ADVERT'] = 'Реклама на сайте'; +$lang['NOT_FOUND'] = 'Файл не найден'; // Visual confirmation system strings $lang['CONFIRM_CODE_WRONG'] = 'Вы ввели неверный код подтверждения'; @@ -1032,13 +1033,6 @@ $lang['DIRECTORY_DOES_NOT_EXIST'] = 'Директория \'%s\' не сущес $lang['DIRECTORY_IS_NOT_A_DIR'] = 'Пожалуйста, проверьте является ли \'%s\' директорией.'; // replace %s with directory $lang['DIRECTORY_NOT_WRITEABLE'] = 'Директория \'%s\' недоступна для записи. Вам нужно создать директорию для закачек и выполнить chmod 777 (или изменить владельца httpd-servers) для закачки фалов на сервер.
Если у вас только FTP доступ к серверу измените \'Атрибуты\' директории на rwxrwxrwx.'; // replace %s with directory -// Attach Rules Window -$lang['RULES_PAGE'] = 'Правила вложений'; -$lang['ATTACH_RULES_TITLE'] = 'Разрешенные группы расширений и их размер'; -$lang['GROUP_RULE_HEADER'] = '%s -> Максимальный общий размер: %s'; // Replace first %s with Extension Group, second one with the Size STRING -$lang['ALLOWED_EXTENSIONS_AND_SIZES'] = 'Разрешенные расширения и их размер'; -$lang['NOTE_USER_EMPTY_GROUP_PERMISSIONS'] = 'ВНИМАНИЕ:
Вы можете отправлять вложения в этот форум,
но, так как ни одной группе расширений не разрешено быть вложенной здесь,
вы не можете ничего отправить. Если вы попытаетесь,
то получите сообщение об ошибке.
'; - // Quota Variables $lang['UPLOAD_QUOTA'] = 'Квота'; $lang['PM_QUOTA'] = 'Квота ЛС'; diff --git a/upload/language/uk/html/advert.html b/upload/language/uk/html/advert.html index 42c1fd934..6485d4c47 100644 --- a/upload/language/uk/html/advert.html +++ b/upload/language/uk/html/advert.html @@ -1,17 +1,4 @@ -РЕКЛАМА НА САЙТІ - -
-
- РЕКЛАМА НА САЙТІ -
- -
-

Розміщення реклами на ">

-

З питань розміщення реклами звертайтесь за адресою:

-
-
-
-

[ Закрити ]

-
\ No newline at end of file +
+

Розміщення реклами на ">

+

З питань розміщення реклами звертайтесь за адресою:

+
\ No newline at end of file diff --git a/upload/language/uk/html/copyright_holders.html b/upload/language/uk/html/copyright_holders.html index d85df34ef..decc63cf4 100644 --- a/upload/language/uk/html/copyright_holders.html +++ b/upload/language/uk/html/copyright_holders.html @@ -1,18 +1,6 @@ -ІНФОРМАЦІЯ ДЛЯ ПРАВОВЛАСНИКІВ - -
-
- ІНФОРМАЦІЯ ДЛЯ ПРАВОВЛАСНИКІВ -
- -
-

Інформація для правовласників.

+

ІНФОРМАЦІЯ ДЛЯ ПРАВОВЛАСНИКІВ

Якщо Ви є правовласником якого-небудь матеріалу, посилання (або посилання) на якe розміщено на цьому сайті, і не хотіли б щоб дана інформація розповсюджувалася користувачами без Вашої на те згоди, то ми будемо сприяти Вам, видаливши відповідні посилання.

@@ -44,8 +32,4 @@

в) Згідно закону про Авторське і Суміжне права, посилання на будь-які дані (інформаційне повідомлення), саме по собі, не є об'єктом авторського права (хоча може порушувати "угоду про використання сайту"). Таким чином, не варто присилати листи, що містять погрози або вимоги, як що не мають під собою реальних підстав.

-
-
-
-

[ Закрити ]

-
\ No newline at end of file + \ No newline at end of file diff --git a/upload/language/uk/html/not_found.html b/upload/language/uk/html/not_found.html index 5aac9b3b5..1526bd68d 100644 --- a/upload/language/uk/html/not_found.html +++ b/upload/language/uk/html/not_found.html @@ -1,14 +1,3 @@ -
-
- Файл не знайдено -
- -
-

Файл не знайдено

-
-
-
-

[ Закрити ]

-
\ No newline at end of file +
+

Файл не знайдено

+
\ No newline at end of file diff --git a/upload/language/uk/html/sidebar1.html b/upload/language/uk/html/sidebar1.html index 491dd1431..74b9a1053 100644 --- a/upload/language/uk/html/sidebar1.html +++ b/upload/language/uk/html/sidebar1.html @@ -12,7 +12,7 @@

FAQ

diff --git a/upload/language/uk/html/user_agreement.html b/upload/language/uk/html/user_agreement.html index 36ec9f14a..e597bdbce 100644 --- a/upload/language/uk/html/user_agreement.html +++ b/upload/language/uk/html/user_agreement.html @@ -1,25 +1,10 @@ - -УГОДА - -
-
- УГОДА -
- - - -

-

УГОДА

+

УГОДА

-

ПРО САЙТ

+

ПРО САЙТ

Інтернет - ресурс (сайт) "> (надалі - Ресурс) є інтернет-сайтом, що дозволяє користувачам обмінюватися один з одним інформацією по протоколу біт-торрент, а також у вільній формі, що надає засоби для контролю цілісності інформації, що передається (за допомогою hash-файлів).

@@ -96,10 +81,4 @@

-
- -
-
-

[ Закрити ]

-
- \ No newline at end of file +
\ No newline at end of file diff --git a/upload/language/uk/main.php b/upload/language/uk/main.php index 5a60407c7..6ab1a2551 100644 --- a/upload/language/uk/main.php +++ b/upload/language/uk/main.php @@ -657,6 +657,7 @@ $lang['USER_AGREEMENT_AGREE'] = "Я прочитав УГОДУ і зобов'я $lang['COPYRIGHT_HOLDERS'] = 'Для правовласників'; $lang['ADVERT'] = 'Реклама на сайті'; +$lang['NOT_FOUND'] = 'Файл не знайдено'; // Visual confirmation system strings $lang['CONFIRM_CODE_WRONG'] = 'Ви ввели неправильний код підтвердження'; @@ -1032,13 +1033,6 @@ $lang['DIRECTORY_DOES_NOT_EXIST'] = 'Директорія \'%s\' не існує $lang['DIRECTORY_IS_NOT_A_DIR'] = 'будь Ласка, перевірте чи є \'%s\' директорією.'; // replace %s with directory $lang['DIRECTORY_NOT_WRITEABLE'] = 'Директорія \'%s\' недоступна для запису. Вам потрібно створити директорію для закачувань і виконати chmod 777 (або змінити власника httpd-servers) для закачування файлів на сервер.
Якщо у вас тільки FTP доступ до сервера змініть \'Атрибути\' директорії на rwxrwxrwx.'; // replace %s with directory -// Attach Rules Window -$lang['RULES_PAGE'] = 'Правила вкладень'; -$lang['ATTACH_RULES_TITLE'] = 'Дозволені групи розширень та їх розмір'; -$lang['GROUP_RULE_HEADER'] = '%s -> Максимальний загальний розмір: %s'; // Replace first %s with Extension Group, second one with the Size STRING -$lang['ALLOWED_EXTENSIONS_AND_SIZES'] = 'Дозволені розширення та їх розмір'; -$lang['NOTE_USER_EMPTY_GROUP_PERMISSIONS'] = 'УВАГА:
Ви можете відправляти вкладення в цей форум,
але, так як ні одній групі розширень не дозволено бути вкладеною тут,
ви не можете нічого відправити. Якщо ви спробуєте,
то отримаєте повідомлення про помилку.
'; - // Quota Variables $lang['UPLOAD_QUOTA'] = 'Розмір'; $lang['PM_QUOTA'] = 'Квота ОП'; diff --git a/upload/misc.php b/upload/misc.php deleted file mode 100644 index 172f2317f..000000000 --- a/upload/misc.php +++ /dev/null @@ -1,144 +0,0 @@ -session_start(); - -$do = request_var('do', ''); - -if ($do == 'attach_rules') -{ - if (!$forum_id = @intval(request_var('f', '')) OR !forum_exists($forum_id)) - { - bb_die('invalid forum_id'); - } - require(ATTACH_DIR .'attachment_mod.php'); - // Display the allowed Extension Groups and Upload Size - $auth = auth(AUTH_ALL, $forum_id, $userdata); - $_max_filesize = $attach_config['max_filesize']; - - if (!$auth['auth_attachments'] || !$auth['auth_view']) - { - bb_die('You are not allowed to call this file'); - } - - $sql = 'SELECT group_id, group_name, max_filesize, forum_permissions - FROM ' . BB_EXTENSION_GROUPS . ' - WHERE allow_group = 1 - ORDER BY group_name ASC'; - - if (!($result = DB()->sql_query($sql))) - { - bb_die('Could not query extension groups'); - } - - $allowed_filesize = array(); - $rows = DB()->sql_fetchrowset($result); - $num_rows = DB()->num_rows($result); - DB()->sql_freeresult($result); - - // Ok, only process those Groups allowed within this forum - $nothing = true; - for ($i = 0; $i < $num_rows; $i++) - { - $auth_cache = trim($rows[$i]['forum_permissions']); - - $permit = ((is_forum_authed($auth_cache, $forum_id)) || trim($rows[$i]['forum_permissions']) == ''); - - if ($permit) - { - $nothing = false; - $group_name = $rows[$i]['group_name']; - $f_size = intval(trim($rows[$i]['max_filesize'])); - $det_filesize = (!$f_size) ? $_max_filesize : $f_size; - - $max_filesize = (!$det_filesize) ? $lang['UNLIMITED'] : humn_size($det_filesize); - - $template->assign_block_vars('group_row', array( - 'GROUP_RULE_HEADER' => sprintf($lang['GROUP_RULE_HEADER'], $group_name, $max_filesize), - )); - - $sql = 'SELECT extension - FROM ' . BB_EXTENSIONS . " - WHERE group_id = " . (int) $rows[$i]['group_id'] . " - ORDER BY extension ASC"; - - if (!($result = DB()->sql_query($sql))) - { - bb_die('Could not query extensions'); - } - - $e_rows = DB()->sql_fetchrowset($result); - $e_num_rows = DB()->num_rows($result); - DB()->sql_freeresult($result); - - for ($j = 0; $j < $e_num_rows; $j++) - { - $template->assign_block_vars('group_row.extension_row', array( - 'EXTENSION' => $e_rows[$j]['extension'], - )); - } - } - } - - $template->assign_vars(array( - 'PAGE_TITLE' => $lang['ATTACH_RULES_TITLE'], - )); - - if ($nothing) - { - $template->assign_block_vars('switch_nothing', array()); - } - - print_page('attach_rules.tpl', 'simple'); -} -elseif ($do == 'info') -{ - $req_mode = (string) request_var('show', 'not_found'); - if(preg_match('/\//i', $req_mode)) - { - die('Include detected!'); - } - if(preg_match('/ - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
{L_ATTACH_RULES_TITLE}
{L_NOTE_USER_EMPTY_GROUP_PERMISSIONS}
-

{group_row.GROUP_RULE_HEADER}

-

- - {group_row.extension_row.EXTENSION}  - -

-
\ No newline at end of file