From 417b6f5f0ae5608020c017309e0563dfaf033863 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Wed, 30 Nov 2005 17:54:42 +0000 Subject: [PATCH] - decreasing my linecount a bit. ;) - please note that you are no longer able to administrate your board correctly if you are updating your cvs copy. git-svn-id: file:///svn/phpbb/trunk@5316 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/adm/admin_attachments.php | 1740 ------------------------------- phpBB/adm/admin_bbcodes.php | 440 -------- phpBB/adm/admin_board.php | 517 --------- phpBB/adm/admin_bots.php | 394 ------- phpBB/adm/admin_icons.php | 776 -------------- phpBB/adm/admin_jabber.php | 212 ---- phpBB/adm/admin_language.php | 1039 ------------------ phpBB/adm/admin_phpinfo.php | 85 -- phpBB/adm/admin_viewlogs.php | 253 ----- phpBB/adm/admin_words.php | 200 ---- 10 files changed, 5656 deletions(-) delete mode 100644 phpBB/adm/admin_attachments.php delete mode 100644 phpBB/adm/admin_bbcodes.php delete mode 100644 phpBB/adm/admin_board.php delete mode 100644 phpBB/adm/admin_bots.php delete mode 100644 phpBB/adm/admin_icons.php delete mode 100644 phpBB/adm/admin_jabber.php delete mode 100644 phpBB/adm/admin_language.php delete mode 100644 phpBB/adm/admin_phpinfo.php delete mode 100644 phpBB/adm/admin_viewlogs.php delete mode 100644 phpBB/adm/admin_words.php diff --git a/phpBB/adm/admin_attachments.php b/phpBB/adm/admin_attachments.php deleted file mode 100644 index 1b538593bc..0000000000 --- a/phpBB/adm/admin_attachments.php +++ /dev/null @@ -1,1740 +0,0 @@ -acl_get('a_attach')) ? "$filename$SID&mode=attach" : ''; - $module['POST']['ATTACHMENTS'] = ($auth->acl_get('a_attach')) ? "$filename$SID&mode=ext_groups" : ''; - - return; -} - -define('IN_PHPBB', 1); -// Include files -$phpbb_root_path = './../'; -$phpEx = substr(strrchr(__FILE__, '.'), 1); -require('pagestart.' . $phpEx); -include($phpbb_root_path . 'includes/functions_posting.' . $phpEx); - -$user->add_lang(array('posting', 'viewtopic')); - -if (!$auth->acl_get('a_attach')) -{ - trigger_error($user->lang['NO_ADMIN']); -} - -$mode = request_var('mode', ''); -$submit = (isset($_POST['submit'])) ? true : false; - -$error = $notify = array(); - -switch ($mode) -{ - case 'attach': - $l_title = 'ATTACHMENT_SETTINGS'; - break; - - case 'extensions': - $l_title = 'MANAGE_EXTENSIONS'; - break; - - case 'ext_groups': - $l_title = 'EXTENSION_GROUPS_TITLE'; - break; - - case 'orphan': - $l_title = 'ORPHAN_ATTACHMENTS'; - break; - - default: - trigger_error('NO_MODE'); -} - -if ($mode == 'attach') -{ - $config_sizes = array('max_filesize' => 'size', 'attachment_quota' => 'quota_size', 'max_filesize_pm' => 'pm_size'); - foreach ($config_sizes as $cfg_key => $var) - { - $$var = request_var($var, ''); - } - - // Pull all config data - $sql = 'SELECT * - FROM ' . CONFIG_TABLE; - $result = $db->sql_query($sql); - - while ($row = $db->sql_fetchrow($result)) - { - $config_name = $row['config_name']; - $config_value = $row['config_value']; - - $default_config[$config_name] = $config_value; - $new[$config_name] = request_var($config_name, $default_config[$config_name]); - - foreach ($config_sizes as $cfg_key => $var) - { - if (empty($$var) && !$submit && $config_name == $cfg_key) - { - $$var = (intval($default_config[$config_name]) >= 1048576) ? 'mb' : ((intval($default_config[$config_name]) >= 1024) ? 'kb' : 'b'); - } - - if (!$submit && $config_name == $cfg_key) - { - $new[$config_name] = ($new[$config_name] >= 1048576) ? round($new[$config_name] / 1048576 * 100) / 100 : (($new[$config_name] >= 1024) ? round($new[$config_name] / 1024 * 100) / 100 : $new[$config_name]); - } - - if ($submit && $config_name == $cfg_key) - { - $old = $new[$config_name]; - $new[$config_name] = ($$var == 'kb') ? round($new[$config_name] * 1024) : (($$var == 'mb') ? round($new[$config_name] * 1048576) : $new[$config_name]); - } - } - - if ($submit) - { - set_config($config_name, $new[$config_name]); - - if (in_array($config_name, array('max_filesize', 'attachment_quota', 'max_filesize_pm'))) - { - $new[$config_name] = $old; - } - } - } - - perform_site_list(); - - if ($submit) - { - add_log('admin', 'LOG_' . strtoupper($mode) . '_CONFIG'); - - // Check Settings - test_upload($error, $new['upload_path'], false); - - if (!sizeof($error)) - { - trigger_error($user->lang['CONFIG_UPDATED']); - } - } -} - -adm_page_header($user->lang[$l_title]); - - -if ($submit && $mode == 'extensions') -{ - // Change Extensions ? - $extension_change_list = (isset($_POST['extension_change_list'])) ? array_map('intval', $_POST['extension_change_list']) : array(); - $group_select_list = (isset($_POST['group_select'])) ? array_map('intval', $_POST['group_select']) : array(); - - // Generate correct Change List - $extensions = array(); - - for ($i = 0; $i < count($extension_change_list); $i++) - { - $extensions[$extension_change_list[$i]]['group_id'] = $group_select_list[$i]; - } - - $sql = 'SELECT * - FROM ' . EXTENSIONS_TABLE . ' - ORDER BY extension_id'; - $result = $db->sql_query($sql); - - while ($row = $db->sql_fetchrow($result)) - { - if ($row['group_id'] != $extensions[$row['extension_id']]['group_id']) - { - $sql = 'UPDATE ' . EXTENSIONS_TABLE . ' - SET group_id = ' . (int) $extensions[$row['extension_id']]['group_id'] . ' - WHERE extension_id = ' . $row['extension_id']; - $db->sql_query($sql); - add_log('admin', 'LOG_ATTACH_EXT_UPDATE', $row['extension']); - } - } - $db->sql_freeresult($result); - - // Delete Extension ? - $extension_id_list = (isset($_POST['extension_id_list'])) ? array_map('intval', $_POST['extension_id_list']) : array(); - - if (sizeof($extension_id_list)) - { - $sql = 'SELECT extension - FROM ' . EXTENSIONS_TABLE . ' - WHERE extension_id IN (' . implode(', ', $extension_id_list) . ')'; - $result = $db->sql_query($sql); - - $extension_list = ''; - while ($row = $db->sql_fetchrow($result)) - { - $extension_list .= ($extension_list == '') ? $row['extension'] : ', ' . $row['extension']; - } - $db->sql_freeresult($result); - - $sql = 'DELETE - FROM ' . EXTENSIONS_TABLE . ' - WHERE extension_id IN (' . implode(', ', $extension_id_list) . ')'; - $db->sql_query($sql); - - add_log('admin', 'LOG_ATTACH_EXT_DEL', $extension_list); - } - - // Add Extension ? - $add_extension = strtolower(request_var('add_extension', '')); - $add_extension_group = request_var('add_group_select', 0); - $add = (isset($_POST['add_extension_check'])) ? true : false; - - if ($add_extension != '' && $add) - { - if (!sizeof($error)) - { - $sql = 'SELECT extension_id - FROM ' . EXTENSIONS_TABLE . " - WHERE extension = '" . $db->sql_escape($add_extension) . "'"; - $result = $db->sql_query($sql); - - if ($row = $db->sql_fetchrow($result)) - { - $error[] = sprintf($user->lang['EXTENSION_EXIST'], $add_extension); - } - $db->sql_freeresult($result); - - if (!sizeof($error)) - { - $sql_ary = array( - 'group_id' => $add_extension_group, - 'extension' => $add_extension - ); - - $db->sql_query('INSERT INTO ' . EXTENSIONS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary)); - add_log('admin', 'LOG_ATTACH_EXT_ADD', $add_extension); - } - } - } - - if (!sizeof($error)) - { - $notify[] = $user->lang['EXTENSIONS_UPDATED']; - } - - $cache->destroy('extensions'); -} - - -if ($submit && $mode == 'ext_groups') -{ - $action = request_var('action', ''); - $group_id = request_var('g', 0); - - if ($action != 'add' && $action != 'edit') - { - trigger_error('WRONG_MODE'); - } - - if (!$group_id && $action == 'edit') - { - trigger_error('NO_EXT_GROUP_SPECIFIED'); - } - - if ($group_id) - { - $sql = 'SELECT * FROM ' . EXTENSION_GROUPS_TABLE . " - WHERE group_id = $group_id"; - $result = $db->sql_query($sql); - $ext_row = $db->sql_fetchrow($result); - $db->sql_freeresult($result); - } - else - { - $ext_row = array(); - } - - $group_name = request_var('group_name', ''); - $new_group_name = ($action == 'add') ? $group_name : (($ext_row['group_name'] != $group_name) ? $group_name : ''); - - if (!$group_name) - { - $error[] = $user->lang['NO_EXT_GROUP_NAME']; - } - - // Check New Group Name - if ($new_group_name) - { - $sql = 'SELECT group_id - FROM ' . EXTENSION_GROUPS_TABLE . " - WHERE LOWER(group_name) = '" . $db->sql_escape(strtolower($new_group_name)) . "'"; - $result = $db->sql_query($sql); - if ($db->sql_fetchrow($result)) - { - $error[] = sprintf($user->lang['EXTENSION_GROUP_EXIST'], $new_group_name); - } - $db->sql_freeresult($result); - } - - if (!sizeof($error)) - { - // Ok, build the update/insert array - $upload_icon = request_var('upload_icon', 'no_image'); - $size_select = request_var('size_select', 'b'); - $forum_select = request_var('forum_select', false); - $allowed_forums = isset($_POST['allowed_forums']) ? array_map('intval', array_values($_POST['allowed_forums'])) : array(); - $allow_in_pm = isset($_POST['allow_in_pm']) ? true : false; - $max_filesize = request_var('max_filesize', 0); - $max_filesize = ($size_select == 'kb') ? round($max_filesize * 1024) : (($size_select == 'mb') ? round($max_filesize * 1048576) : $max_filesize); - - if ($max_filesize == $config['max_filesize']) - { - $max_filesize = 0; - } - - if (!sizeof($allowed_forums)) - { - $forum_select = false; - } - - $group_ary = array( - 'group_name' => $group_name, - 'cat_id' => request_var('special_category', ATTACHMENT_CATEGORY_NONE), - 'allow_group' => (isset($_POST['allow_group'])) ? 1 : 0, - 'download_mode' => request_var('download_mode', INLINE_LINK), - 'upload_icon' => ($upload_icon == 'no_image') ? '' : $upload_icon, - 'max_filesize' => $max_filesize, - 'allowed_forums'=> ($forum_select) ? serialize($allowed_forums) : '', - 'allow_in_pm' => ($allow_in_pm) ? 1 : 0 - ); - - $sql = ($action == 'add') ? 'INSERT INTO ' . EXTENSION_GROUPS_TABLE . ' ' : 'UPDATE ' . EXTENSION_GROUPS_TABLE . ' SET '; - $sql .= $db->sql_build_array((($action == 'add') ? 'INSERT' : 'UPDATE'), $group_ary); - $sql .= ($action == 'edit') ? " WHERE group_id = $group_id" : ''; - - $db->sql_query($sql); - - if ($action == 'add') - { - $group_id = $db->sql_nextid(); - } - - add_log('admin', 'LOG_ATTACH_EXTGROUP_' . strtoupper($action), $group_name); - } - - $extension_list = isset($_REQUEST['extensions']) ? array_map('intval', array_values($_REQUEST['extensions'])) : array(); - - if ($action == 'edit' && sizeof($extension_list)) - { - $sql = 'UPDATE ' . EXTENSIONS_TABLE . " - SET group_id = 0 - WHERE group_id = $group_id"; - $db->sql_query($sql); - } - - if (sizeof($extension_list)) - { - $sql = 'UPDATE ' . EXTENSIONS_TABLE . " - SET group_id = $group_id - WHERE extension_id IN (" . implode(', ', $extension_list) . ")"; - $db->sql_query($sql); - } - - rewrite_extensions(); - - if (!sizeof($error)) - { - $notify[] = $user->lang['SUCCESS_EXTENSION_GROUP_' . strtoupper($action)]; - } -} - -?> - -

lang[$l_title]; ?>

- -

lang[$l_title . '_EXPLAIN']; ?>

- - 0))) : array(); - $add_files = (isset($_POST['add'])) ? array_keys(request_var('add', array('' => 0))) : array(); - $post_ids = request_var('post_id', 0); - - foreach ($delete_files as $delete) - { - phpbb_unlink($delete); - phpbb_unlink($delete, 'thumbnail'); - } - - if (sizeof($delete_files)) - { - add_log('admin', sprintf($user->lang['LOG_ATTACH_ORPHAN_DEL'], implode(', ', $delete_files))); - $notify[] = sprintf($user->lang['LOG_ATTACH_ORPHAN_DEL'], implode(', ', $delete_files)); - } - - $upload_list = array(); - foreach ($add_files as $file) - { - if (!in_array($file, $delete_files) && $post_ids[$file]) - { - $upload_list[$post_ids[$file]] = $file; - } - } - unset($add_files); - - if (sizeof($upload_list)) - { -?> -

lang['UPLOADING_FILES']; ?>

-sql_query($sql); - - $forum_names = array(); - while ($row = $db->sql_fetchrow($result)) - { - $forum_names[$row['forum_id']] = $row['forum_name']; - } - $db->sql_freeresult($result); - - $sql = 'SELECT forum_id, topic_id, post_id - FROM ' . POSTS_TABLE . ' - WHERE post_id IN (' . implode(', ', array_keys($upload_list)) . ')'; - $result = $db->sql_query($sql); - - while ($row = $db->sql_fetchrow($result)) - { - echo sprintf($user->lang['UPLOADING_FILE_TO'], $upload_list[$row['post_id']], $row['post_id']) . '
'; - if (!$auth->acl_gets('f_attach', 'u_attach', $row['forum_id'])) - { - echo '' . sprintf($user->lang['UPLOAD_DENIED_FORUM'], $forum_names[$row['forum_id']]) . '

'; - } - else - { - upload_file($row['post_id'], $row['topic_id'], $row['forum_id'], $config['upload_path'], $upload_list[$row['post_id']]); - } - } - unset($message_parser); - } -} - - -if (sizeof($error)) -{ -?> - -

lang['WARNING']; ?>

- -

', $error); ?>

- - - -

lang['NOTIFY']; ?>

- -

', $notify); ?>

- -'; -foreach ($modes as $_mode) -{ - $s_select_mode .= ''; -} -$s_select_mode .= ''; -?> -
"> - - - - - -
 
- 0 - ORDER BY cat_id'; - $result = $db->sql_query($sql); - - $s_assigned_groups = array(); - while ($row = $db->sql_fetchrow($result)) - { - $s_assigned_groups[$row['cat_id']][] = $row['group_name']; - } - $db->sql_freeresult($result); - - $display_inlined_yes = ($new['img_display_inlined']) ? 'checked="checked"' : ''; - $display_inlined_no = (!$new['img_display_inlined']) ? 'checked="checked"' : ''; - - $create_thumbnail_yes = ($new['img_create_thumbnail']) ? 'checked="checked"' : ''; - $create_thumbnail_no = (!$new['img_create_thumbnail']) ? 'checked="checked"' : ''; - - $secure_downloads_yes = ($new['secure_downloads']) ? 'checked="checked"' : ''; - $secure_downloads_no = (!$new['secure_downloads']) ? 'checked="checked"' : ''; - - $secure_allow_deny_yes = ($new['secure_allow_deny']) ? 'checked="checked"' : ''; - $secure_allow_deny_no = (!$new['secure_allow_deny']) ? 'checked="checked"' : ''; - - $secure_allow_empty_referer_yes = ($new['secure_allow_empty_referer']) ? 'checked="checked"' : ''; - $secure_allow_empty_referer_no = (!$new['secure_allow_empty_referer']) ? 'checked="checked"' : ''; - -?> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
lang[$l_title]; ?>
lang['UPLOAD_DIR']; ?>:
lang['UPLOAD_DIR_EXPLAIN']; ?>
lang['DISPLAY_ORDER']; ?>:
lang['DISPLAY_ORDER_EXPLAIN']; ?>
/> lang['DESCENDING']; ?>   /> lang['ASCENDING']; ?>
lang['ATTACH_QUOTA']; ?>:
lang['ATTACH_QUOTA_EXPLAIN']; ?>
lang['ATTACH_MAX_FILESIZE']; ?>:
lang['ATTACH_MAX_FILESIZE_EXPLAIN']; ?>
lang['ATTACH_MAX_PM_FILESIZE']; ?>:
lang['ATTACH_MAX_PM_FILESIZE_EXPLAIN']; ?>
lang['MAX_ATTACHMENTS'] ?>:
lang['MAX_ATTACHMENTS_PM'] ?>:
lang['SECURE_DOWNLOADS']; ?>:
lang['SECURE_DOWNLOADS_EXPLAIN']; ?>
/> lang['YES']; ?>   /> lang['NO']; ?>
lang['SECURE_ALLOW_DENY']; ?>:
lang['SECURE_ALLOW_DENY_EXPLAIN']; ?>
/> lang['ORDER_ALLOW_DENY']; ?>   /> lang['ORDER_DENY_ALLOW']; ?>
lang['SECURE_EMPTY_REFERER']; ?>:
lang['SECURE_EMPTY_REFERER_EXPLAIN']; ?>
/> lang['YES']; ?>   /> lang['NO']; ?>
lang['SETTINGS_CAT_IMAGES']; ?>
lang['ASSIGNED_GROUP']; ?>: lang['NONE']); ?>
lang['DISPLAY_INLINED']; ?>:
lang['DISPLAY_INLINED_EXPLAIN']; ?>
/> lang['YES']; ?>   /> lang['NO']; ?>
lang['CREATE_THUMBNAIL']; ?>:
lang['CREATE_THUMBNAIL_EXPLAIN']; ?>
/> lang['YES']; ?>   /> lang['NO']; ?>
lang['MIN_THUMB_FILESIZE']; ?>:
lang['MIN_THUMB_FILESIZE_EXPLAIN']; ?>
lang['BYTES']; ?>
lang['IMAGICK_PATH']; ?>:
lang['IMAGICK_PATH_EXPLAIN']; ?>
  [ ">lang['SEARCH_IMAGICK']; ?> ]
lang['MAX_IMAGE_SIZE']; ?>:
lang['MAX_IMAGE_SIZE_EXPLAIN']; ?>
px X px
lang['IMAGE_LINK_SIZE']; ?>:
lang['IMAGE_LINK_SIZE_EXPLAIN']; ?>
px X px
  
-sql_query($sql); - - $defined_ips = ''; - $ips = array(); - - while ($row = $db->sql_fetchrow($result)) - { - $value = ($row['site_ip']) ? $row['site_ip'] : $row['site_hostname']; - if ($value) - { - $defined_ips .= '' . $value . ''; - $ips[$row['site_id']] = $value; - } - } - $db->sql_freeresult($result); - - if (!$new['secure_downloads']) - { -?> -
- - - - -
lang['SECURE_DOWNLOAD_NOTICE']; ?>
- - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
lang['DEFINE_' . $allow_deny . '_IPS']; ?>
lang['DOWNLOAD_ADD_IPS_EXPLAIN']; ?>
lang['IP_HOSTNAME']; ?>:
lang['EXCLUDE_FROM_' . $allow_deny . '_IP']; ?>:
lang['EXCLUDE_ENTERED_IP']; ?>
lang['YES']; ?>   lang['NO']; ?>
   
lang['REMOVE_' . $allow_deny . '_IPS']; ?>
lang['DOWNLOAD_REMOVE_IPS_EXPLAIN']; ?>
lang['IP_HOSTNAME']; ?>:
 
lang['NO_IPS_DEFINED']; ?>
- $user->lang['NONE'], - ATTACHMENT_CATEGORY_IMAGE => $user->lang['CAT_IMAGES'], - ATTACHMENT_CATEGORY_WM => $user->lang['CAT_WM_FILES'], - ATTACHMENT_CATEGORY_RM => $user->lang['CAT_RM_FILES'] - ); - - - $action = request_var('action', 'show'); - $group_id = request_var('g', 0); - $action = (isset($_POST['add'])) ? 'add' : $action; - $action = (($action == 'add' || $action == 'edit') && $submit && !sizeof($error)) ? 'show' : $action; - - if (isset($_POST['select_mode'])) - { - $action = 'show'; - } - - if ($action == 'delete') - { - $confirm = (isset($_POST['confirm'])) ? true : false; - $cancel = (isset($_POST['cancel'])) ? true : false; - - if (!$cancel && !$confirm) - { - adm_page_confirm($user->lang['CONFIRM'], $user->lang['CONFIRM_OPERATION']); - } - else if ($confirm && !$cancel) - { - $sql = 'SELECT group_name - FROM ' . EXTENSION_GROUPS_TABLE . " - WHERE group_id = $group_id"; - $result = $db->sql_query($sql); - $group_name = $db->sql_fetchfield('group_name', 0, $result); - $db->sql_freeresult($result); - - $sql = 'DELETE - FROM ' . EXTENSION_GROUPS_TABLE . " - WHERE group_id = $group_id"; - $db->sql_query($sql); - - // Set corresponding Extensions to a pending Group - $sql = 'UPDATE ' . EXTENSIONS_TABLE . " - SET group_id = 0 - WHERE group_id = $group_id"; - $db->sql_query($sql); - - add_log('admin', 'LOG_ATTACH_EXTGROUP_DEL', $group_name); - - rewrite_extensions(); - - trigger_error('EXTENSION_GROUP_DELETED'); - } - else - { - $action = 'show'; - } - } - - switch ($action) - { - case 'edit': - - if (!$group_id) - { - trigger_error('NO_EXTENSION_GROUP'); - } - - $sql = 'SELECT * FROM ' . EXTENSION_GROUPS_TABLE . " - WHERE group_id = $group_id"; - $result = $db->sql_query($sql); - extract($db->sql_fetchrow($result)); - $db->sql_freeresult($result); - - $forum_ids = (!$allowed_forums) ? array() : unserialize(trim($allowed_forums)); - - case 'add': - - if ($action == 'add') - { - $group_name = request_var('group_name', ''); - $cat_id = 0; - $allow_group = 1; - $allow_in_pm = 1; - $download_mode = 1; - $upload_icon = ''; - $max_filesize = 0; - $forum_ids = array(); - } - - $extensions = array(); - - $sql = 'SELECT * FROM ' . EXTENSIONS_TABLE . " - WHERE group_id = $group_id OR group_id = 0 - ORDER BY extension"; - $result = $db->sql_query($sql); - $extensions = $db->sql_fetchrowset($result); - $db->sql_freeresult($result); - - $img_path = $config['upload_icons_path']; - - $imglist = filelist($phpbb_root_path . $img_path); - $imglist = array_values($imglist); - $imglist = $imglist[0]; - - $filename_list = ''; - foreach ($imglist as $key => $img) - { - $filename_list .= ''; - } - - if ($max_filesize == 0) - { - $max_filesize = (int) $config['max_filesize']; - } - - $size_format = ($max_filesize >= 1048576) ? 'mb' : (($max_filesize >= 1024) ? 'kb' : 'b'); - - $max_filesize = ($max_filesize >= 1048576) ? round($max_filesize / 1048576 * 100) / 100 : (($max_filesize >= 1024) ? round($max_filesize / 1024 * 100) / 100 : $max_filesize); - - $s_allowed = ($allow_group) ? ' checked="checked"' : ''; - $s_in_pm_allowed = ($allow_in_pm) ? ' checked="checked"' : ''; - - $filename_list = ''; - $no_image_select = false; - foreach ($imglist as $key => $img) - { - if (!$upload_icon) - { - $no_image_select = true; - $selected = ''; - } - else - { - $selected = ($upload_icon == $img) ? ' selected="selected"' : ''; - } - - $filename_list .= ''; - } - - // Show Edit Screen -?> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
lang[strtoupper($action) . '_EXTENSION_GROUP']; ?>
lang['GROUP_NAME']; ?>:
lang['SPECIAL_CATEGORY']; ?>:
lang['SPECIAL_CATEGORY_EXPLAIN']; ?>
lang['ALLOWED']; ?>: />
lang['ALLOW_IN_PM']; ?>: />
lang['DOWNLOAD_MODE']; ?>:
lang['DOWNLOAD_MODE_EXPLAIN']; ?>
lang['UPLOAD_ICON']; ?>: - - - - - -
  
-
lang['MAX_EXTGROUP_FILESIZE']; ?>:
- - -
lang['ASSIGNED_EXTENSIONS']; ?>:
»  
  $row) - { - if ($row['group_id'] == $group_id && $group_id) - { - echo ($i) ? ', ' . $row['extension'] : $row['extension']; - $i++; - } - } - ?>
 
[ lang['GO_TO_EXTENSIONS']; ?> ]
-
lang['ALLOWED_FORUMS']; ?>:
lang['ALLOWED_FORUMS_EXPLAIN']; ?>
/> lang['ALLOW_ALL_FORUMS']; ?>   /> lang['ALLOW_SELECTED_FORUMS']; ?>

-
  
-sql_query($sql); - - rewrite_extensions(); - - case 'show': - - $sql = 'SELECT * - FROM ' . EXTENSION_GROUPS_TABLE . ' - ORDER BY allow_group DESC, group_name'; - $result = $db->sql_query($sql); - -?> - - - - - - - - -sql_fetchrow($result)) - { - $row_class = ($row_class == 'row1') ? 'row2' : 'row1'; - - if ($row['allow_group'] == 0 && $act_deact == 'deactivate') - { -?> - - - - - - - - - - - - - - - -sql_freeresult($result); - -?> - -
lang['EXTENSION_GROUP']; ?>lang['SPECIAL_CATEGORY']; ?>lang['OPTIONS']; ?>
">">lang[strtoupper($act_deact)]; ?>">lang['EDIT']; ?>">lang['DELETE']; ?>
lang['CREATE_GROUP']; ?>:
- - - - - - - - - - - - - - - - - - - - - - -sql_query($sql); - - if ($row = $db->sql_fetchrow($result)) - { - $old_group_id = $row['group_id']; - do - { - $current_group_id = $row['group_id']; - if ($old_group_id != $current_group_id) - { -?> - - - - - - - - - - -sql_fetchrow($result)); - } -?> - - - -
 lang['EXTENSION']; ?>  lang['EXTENSION_GROUP']; ?>  lang['ADD_EXTENSION']; ?> 
 lang['EXTENSION']; ?>  lang['EXTENSION_GROUP']; ?>  lang['DELETE']; ?> 
  
- - - - -sql_query($sql); - - while ($row = $db->sql_fetchrow($result)) - { - unset($attach_filelist[$row['physical_filename']]); - } - $db->sql_freeresult($result); - -?> - - - - - - - - - - -= 1048576) ? $user->lang['MB'] : ( ($filesize >= 1024) ? $user->lang['KB'] : $user->lang['BYTES'] ); - $filesize = ($filesize >= 1048576) ? round((round($filesize / 1048576 * 100) / 100), 2) : (($filesize >= 1024) ? round((round($filesize / 1024 * 100) / 100), 2) : $filesize); -?> - - - - - - - - - - - - - -
 lang['FILENAME']; ?>  lang['FILESIZE']; ?>  lang['ATTACH_POST_ID']; ?>  lang['ATTACH_TO_POST']; ?>  lang['DELETE']; ?> 
ID:
  lang['MARK_ALL']; ?> :: lang['UNMARK_ALL']; ?>lang['MARK_ALL']; ?> :: lang['UNMARK_ALL']; ?>
- - - - -
- - $user->lang['NONE'], - ATTACHMENT_CATEGORY_IMAGE => $user->lang['CAT_IMAGES'], - ATTACHMENT_CATEGORY_WM => $user->lang['CAT_WM_FILES'], - ATTACHMENT_CATEGORY_RM => $user->lang['CAT_RM_FILES'] - ); - - if ($group_id) - { - $sql = 'SELECT cat_id - FROM ' . EXTENSION_GROUPS_TABLE . ' - WHERE group_id = ' . (int) $group_id; - $result = $db->sql_query($sql); - - $cat_type = (!($row = $db->sql_fetchrow($result))) ? ATTACHMENT_CATEGORY_NONE : $row['cat_id']; - - $db->sql_freeresult($result); - } - else - { - $cat_type = ATTACHMENT_CATEGORY_NONE; - } - - $group_select = ''; - - return $group_select; -} - -// Extension group select -function group_select($select_name, $default_group = false) -{ - global $db, $user; - - $group_select = ''; - - return $group_select; -} - -// Build select for download modes -function download_select($select_name, $group_id = false) -{ - global $db, $user; - - $types = array( - INLINE_LINK => $user->lang['MODE_INLINE'], - PHYSICAL_LINK => $user->lang['MODE_PHYSICAL'] - ); - - if ($group_id) - { - $sql = "SELECT download_mode - FROM " . EXTENSION_GROUPS_TABLE . " - WHERE group_id = " . (int) $group_id; - $result = $db->sql_query($sql); - - $download_mode = (!($row = $db->sql_fetchrow($result))) ? INLINE_LINK : $row['download_mode']; - - $db->sql_freeresult($result); - } - else - { - $download_mode = INLINE_LINK; - } - - $group_select = ''; - - return $group_select; -} - -// Upload already uploaded file... huh? are you kidding? -function upload_file($post_id, $topic_id, $forum_id, $upload_dir, $filename) -{ - global $message_parser, $db, $user, $phpbb_root_path; - - $message_parser->attachment_data = array(); - - $message_parser->filename_data['filecomment'] = ''; - $message_parser->filename_data['filename'] = $phpbb_root_path . $upload_dir . '/' . basename($filename); - - $filedata = upload_attachment('local', $forum_id, true, $phpbb_root_path . $upload_dir . '/' . basename($filename)); - - if ($filedata['post_attach'] && !sizeof($filedata['error'])) - { - $message_parser->attachment_data = array( - 'post_msg_id' => $post_id, - 'poster_id' => $user->data['user_id'], - 'topic_id' => $topic_id, - 'in_message' => 0, - 'physical_filename' => $filedata['physical_filename'], - 'real_filename' => $filedata['real_filename'], - 'comment' => $message_parser->filename_data['filecomment'], - 'extension' => $filedata['extension'], - 'mimetype' => $filedata['mimetype'], - 'filesize' => $filedata['filesize'], - 'filetime' => $filedata['filetime'], - 'thumbnail' => $filedata['thumbnail'] - ); - - $message_parser->filename_data['filecomment'] = ''; - $filedata['post_attach'] = FALSE; - - // Submit Attachment - $attach_sql = $message_parser->attachment_data; - - $db->sql_transaction(); - - $sql = 'INSERT INTO ' . ATTACHMENTS_TABLE . ' ' . $db->sql_build_array('INSERT', $attach_sql); - $db->sql_query($sql); - - $sql = 'UPDATE ' . POSTS_TABLE . " - SET post_attachment = 1 - WHERE post_id = $post_id"; - $db->sql_query($sql); - - $sql = 'UPDATE ' . TOPICS_TABLE . " - SET topic_attachment = 1 - WHERE topic_id = $topic_id"; - $db->sql_query($sql); - - $db->sql_transaction('commit'); - - add_log('admin', sprintf($user->lang['LOG_ATTACH_FILEUPLOAD'], $post_id, $filename)); - echo '' . $user->lang['SUCCESSFULLY_UPLOADED'] . '

'; - } - else if (sizeof($filedata['error'])) - { - echo '' . sprintf($user->lang['ADMIN_UPLOAD_ERROR'], implode("
\t", $filedata['error'])) . '


'; - } -} - -// Search Imagick -function search_imagemagick() -{ - $imagick = ''; - - $exe = ((defined('PHP_OS')) && (preg_match('#win#i', PHP_OS))) ? '.exe' : ''; - - if (empty($_ENV['MAGICK_HOME'])) - { - $locations = array('C:/WINDOWS/', 'C:/WINNT/', 'C:/WINDOWS/SYSTEM/', 'C:/WINNT/SYSTEM/', 'C:/WINDOWS/SYSTEM32/', 'C:/WINNT/SYSTEM32/', '/usr/bin/', '/usr/sbin/', '/usr/local/bin/', '/usr/local/sbin/', '/opt/', '/usr/imagemagick/', '/usr/bin/imagemagick/'); - - foreach ($locations as $location) - { - if (@is_readable($location . 'mogrify' . $exe) && @filesize($location . 'mogrify' . $exe) > 3000) - { - $imagick = str_replace('\\', '/', $location); - continue; - } - } - } - else - { - $imagick = str_replace('\\', '/', $_ENV['MAGICK_HOME']); - } - - return $imagick; -} - -// Test Settings -function test_upload(&$error, $upload_dir, $create_directory = false) -{ - global $user, $phpbb_root_path; - - // Does the target directory exist, is it a directory and writeable. - if ($create_directory) - { - if (!file_exists($phpbb_root_path . $upload_dir)) - { - @mkdir($phpbb_root_path . $upload_dir, 0777); - @chmod($phpbb_root_path . $upload_dir, 0777); - } - } - - if (!file_exists($phpbb_root_path . $upload_dir)) - { - $error[] = sprintf($user->lang['NO_UPLOAD_DIR'], $upload_dir); - return; - } - - if (!is_dir($phpbb_root_path . $upload_dir)) - { - $error[] = sprintf($user->lang['UPLOAD_NOT_DIR'], $upload_dir); - return; - } - - if (!is_writable($phpbb_root_path . $upload_dir)) - { - $error[] = sprintf($user->lang['NO_WRITE_UPLOAD'], $upload_dir); - return; - } -} - -function perform_site_list() -{ - global $db, $user; - - if (isset($_REQUEST['securesubmit'])) - { - // Grab the list of entries - $ips = request_var('ips', ''); - $ip_list = array_unique(explode("\n", $ips)); - $ip_list_log = implode(', ', $ip_list); - - $ip_exclude = (!empty($_POST['ipexclude'])) ? 1 : 0; - - $iplist = array(); - $hostlist = array(); - - foreach ($ip_list as $item) - { - if (preg_match('#^([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})[ ]*\-[ ]*([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$#', trim($item), $ip_range_explode)) - { - // Don't ask about all this, just don't ask ... ! - $ip_1_counter = $ip_range_explode[1]; - $ip_1_end = $ip_range_explode[5]; - - while ($ip_1_counter <= $ip_1_end) - { - $ip_2_counter = ($ip_1_counter == $ip_range_explode[1]) ? $ip_range_explode[2] : 0; - $ip_2_end = ($ip_1_counter < $ip_1_end) ? 254 : $ip_range_explode[6]; - - if ($ip_2_counter == 0 && $ip_2_end == 254) - { - $ip_2_counter = 256; - $ip_2_fragment = 256; - - $iplist[] = "'$ip_1_counter.*'"; - } - - while ($ip_2_counter <= $ip_2_end) - { - $ip_3_counter = ($ip_2_counter == $ip_range_explode[2] && $ip_1_counter == $ip_range_explode[1]) ? $ip_range_explode[3] : 0; - $ip_3_end = ($ip_2_counter < $ip_2_end || $ip_1_counter < $ip_1_end) ? 254 : $ip_range_explode[7]; - - if ($ip_3_counter == 0 && $ip_3_end == 254) - { - $ip_3_counter = 256; - $ip_3_fragment = 256; - - $iplist[] = "'$ip_1_counter.$ip_2_counter.*'"; - } - - while ($ip_3_counter <= $ip_3_end) - { - $ip_4_counter = ($ip_3_counter == $ip_range_explode[3] && $ip_2_counter == $ip_range_explode[2] && $ip_1_counter == $ip_range_explode[1]) ? $ip_range_explode[4] : 0; - $ip_4_end = ($ip_3_counter < $ip_3_end || $ip_2_counter < $ip_2_end) ? 254 : $ip_range_explode[8]; - - if ($ip_4_counter == 0 && $ip_4_end == 254) - { - $ip_4_counter = 256; - $ip_4_fragment = 256; - - $iplist[] = "'$ip_1_counter.$ip_2_counter.$ip_3_counter.*'"; - } - - while ($ip_4_counter <= $ip_4_end) - { - $iplist[] = "'$ip_1_counter.$ip_2_counter.$ip_3_counter.$ip_4_counter'"; - $ip_4_counter++; - } - $ip_3_counter++; - } - $ip_2_counter++; - } - $ip_1_counter++; - } - } - else if (preg_match('#^([0-9]{1,3})\.([0-9\*]{1,3})\.([0-9\*]{1,3})\.([0-9\*]{1,3})$#', trim($item)) || preg_match('#^[a-f0-9:]+\*?$#i', trim($item))) - { - $iplist[] = "'" . trim($item) . "'"; - } - else if (preg_match('#^([\w\-_]\.?){2,}$#is', trim($item))) - { - $hostlist[] = "'" . trim($item) . "'"; - } - else if (preg_match("#^([a-z0-9\-\*\._/]+?)$#is", trim($item))) - { - $hostlist[] = "'" . trim($item) . "'"; - } - } - - $sql = 'SELECT site_ip, site_hostname - FROM ' . SITELIST_TABLE . " - WHERE ip_exclude = $ip_exclude"; - $result = $db->sql_query($sql); - - if ($row = $db->sql_fetchrow($result)) - { - $iplist_tmp = array(); - $hostlist_tmp = array(); - do - { - if ($row['site_ip']) - { - $iplist_tmp[] = "'" . $row['site_ip'] . "'"; - } - else if ($row['site_hostname']) - { - $hostlist_tmp[] = "'" . $row['site_hostname'] . "'"; - } - break; - } - while ($row = $db->sql_fetchrow($result)); - - $iplist = array_unique(array_diff($iplist, $iplist_tmp)); - $hostlist = array_unique(array_diff($hostlist, $hostlist_tmp)); - unset($iplist_tmp); - unset($hostlist_tmp); - } - - if (sizeof($iplist)) - { - foreach ($iplist as $ip_entry) - { - $sql = 'INSERT INTO ' . SITELIST_TABLE . " (site_ip, ip_exclude) - VALUES ($ip_entry, $ip_exclude)"; - $db->sql_query($sql); - } - } - - if (sizeof($hostlist)) - { - foreach ($hostlist as $host_entry) - { - $sql = 'INSERT INTO ' . SITELIST_TABLE . " (site_hostname, ip_exclude) - VALUES ($host_entry, $ip_exclude)"; - $db->sql_query($sql); - } - } - - if (!empty($ip_list_log)) - { - // Update log - $log_entry = ($ip_exclude) ? 'LOG_DOWNLOAD_EXCLUDE_IP' : 'LOG_DOWNLOAD_IP'; - add_log('admin', $log_entry, $ip_list_log); - } - - trigger_error($user->lang['SECURE_DOWNLOAD_UPDATE_SUCCESS']); - } - else if (isset($_POST['unsecuresubmit'])) - { - $unip_sql = implode(', ', array_map('intval', $_POST['unip'])); - - if ($unip_sql != '') - { - $l_unip_list = ''; - - // Grab details of ips for logging information later - $sql = 'SELECT site_ip, site_hostname - FROM ' . SITELIST_TABLE . " - WHERE site_id IN ($unip_sql)"; - $result = $db->sql_query($sql); - - while ($row = $db->sql_fetchrow($result)) - { - $l_unip_list .= (($l_unip_list != '') ? ', ' : '') . (($row['site_ip']) ? $row['site_ip'] : $row['site_hostname']); - } - - $sql = 'DELETE FROM ' . SITELIST_TABLE . " - WHERE site_id IN ($unip_sql)"; - $db->sql_query($sql); - - add_log('admin', 'LOG_DOWNLOAD_REMOVE_IP', $l_unip_list); - } - - trigger_error($user->lang['SECURE_DOWNLOAD_UPDATE_SUCCESS']); - } -} - -// Re-Write extensions cache file -function rewrite_extensions() -{ - global $db, $cache; - - $sql = 'SELECT e.extension, g.* - FROM ' . EXTENSIONS_TABLE . ' e, ' . EXTENSION_GROUPS_TABLE . ' g - WHERE e.group_id = g.group_id - AND g.allow_group = 1'; - $result = $db->sql_query($sql); - - $extensions = array(); - while ($row = $db->sql_fetchrow($result)) - { - $extension = $row['extension']; - - $extensions[$extension]['display_cat'] = (int) $row['cat_id']; - $extensions[$extension]['download_mode']= (int) $row['download_mode']; - $extensions[$extension]['upload_icon'] = (string) $row['upload_icon']; - $extensions[$extension]['max_filesize'] = (int) $row['max_filesize']; - - $allowed_forums = ($row['allowed_forums']) ? unserialize(trim($row['allowed_forums'])) : array(); - - if ($row['allow_in_pm']) - { - $allowed_forums = array_merge($allowed_forums, array(0)); - } - - // Store allowed extensions forum wise - $extensions['_allowed_'][$extension] = (!sizeof($allowed_forums)) ? 0 : $allowed_forums; - } - $db->sql_freeresult($result); - - $cache->destroy('extensions'); - $cache->put('extensions', $extensions); -} - -?> \ No newline at end of file diff --git a/phpBB/adm/admin_bbcodes.php b/phpBB/adm/admin_bbcodes.php deleted file mode 100644 index 782191de87..0000000000 --- a/phpBB/adm/admin_bbcodes.php +++ /dev/null @@ -1,440 +0,0 @@ -acl_get('a_bbcode')) - { - return; - } - - $module['POST']['BBCODES'] = basename(__FILE__) . $SID; - return; -} - -define('IN_PHPBB', 1); - -// Include files -$phpbb_root_path = '../'; -$phpEx = substr(strrchr(__FILE__, '.'), 1); -require('pagestart.' . $phpEx); - -// Do we have general permissions? -if (!$auth->acl_get('a_bbcode')) -{ - trigger_error('NO_ADMIN'); -} - -// Set up general vars -$mode = request_var('mode', ''); -$bbcode_id = request_var('bbcode', 0); - -// Set up mode-specific vars -switch ($mode) -{ - case 'add': - $bbcode_match = $bbcode_tpl = ''; - break; - - case 'edit': - $sql = 'SELECT bbcode_match, bbcode_tpl - FROM ' . BBCODES_TABLE . ' - WHERE bbcode_id = ' . $bbcode_id; - $result = $db->sql_query($sql); - if (!$row = $db->sql_fetchrow($result)) - { - trigger_error('BBCODE_NOT_EXIST'); - } - $db->sql_freeresult($result); - - $bbcode_match = $row['bbcode_match']; - $bbcode_tpl = htmlspecialchars($row['bbcode_tpl']); - break; - - case 'modify': - $sql = 'SELECT bbcode_id - FROM ' . BBCODES_TABLE . ' - WHERE bbcode_id = ' . $bbcode_id; - $result = $db->sql_query($sql); - if (!$row = $db->sql_fetchrow($result)) - { - trigger_error('BBCODE_NOT_EXIST'); - } - $db->sql_freeresult($result); - - // No break here - - case 'create': - $bbcode_match = htmlspecialchars(stripslashes($_POST['bbcode_match'])); - $bbcode_tpl = stripslashes($_POST['bbcode_tpl']); - break; -} - -// Do major work -switch ($mode) -{ - case 'edit': - case 'add': - adm_page_header($user->lang['BBCODES']); - -?> - -

lang['BBCODES'] ?>

- -

lang['BBCODES_EXPLAIN'] ?>

- -
"> - - - - -
- - - - - - - - - - -
lang['BBCODE_USAGE'] ?>
lang['BBCODE_USAGE_EXPLAIN'] ?>
lang['EXAMPLES'] ?>

lang['BBCODE_USAGE_EXAMPLE'] ?>
- -
- - - - - -
- - - - - - - - - - - - - -
lang['HTML_REPLACEMENT'] ?>
lang['HTML_REPLACEMENT_EXPLAIN'] ?>
lang['EXAMPLES'] ?>

lang['HTML_REPLACEMENT_EXAMPLE'] ?>
- -
- - - - - -
- - - - - - - - - - -lang['tokens'] as $token => $token_explain) - { - ?> - - - -
lang['TOKENS'] ?>
lang['TOKENS_EXPLAIN'] ?>
lang['TOKEN'] ?>lang['TOKEN_DEFINITION'] ?>
{}
-
- -lang['BBCODES']); - - $data = build_regexp($bbcode_match, $bbcode_tpl); - - $sql_ary = array( - 'bbcode_tag' => $data['bbcode_tag'], - 'bbcode_match' => $bbcode_match, - 'bbcode_tpl' => $bbcode_tpl, - 'first_pass_match' => $data['first_pass_match'], - 'first_pass_replace' => $data['first_pass_replace'], - 'second_pass_match' => $data['second_pass_match'], - 'second_pass_replace' => $data['second_pass_replace'] - ); - - if ($mode == 'create') - { - /* TODO: look for SQL incompatibilities - // NOTE: I'm sure there was another simpler (and obvious) way of finding a suitable bbcode_id - $sql = 'SELECT b1.bbcode_id - FROM ' . BBCODES_TABLE . ' b1, ' . BBCODES_TABLE . ' b2 - WHERE b2.bbcode_id > b1.bbcode_id - GROUP BY b1.bbcode_id - HAVING MIN(b2.bbcode_id) > b1.bbcode_id + 1 - ORDER BY b1.bbcode_id ASC'; - $result = $db->sql_query_limit($sql, 1); - $row = $db->sql_fetchrow($result); - $db->sql_freeresult($result); -*/ - $sql = 'SELECT MAX(bbcode_id) as bbcode_id - FROM ' . BBCODES_TABLE; - $result = $db->sql_query($sql); - $row = $db->sql_fetchrow($result); - $db->sql_freeresult($result); - - if ($row) - { - $bbcode_id = $row['bbcode_id'] + 1; - } - else - { - $sql = 'SELECT MIN(bbcode_id) AS min_id, MAX(bbcode_id) AS max_id - FROM ' . BBCODES_TABLE; - $result = $db->sql_query($sql); - $row = $db->sql_fetchrow($result); - $db->sql_freeresult($result); - - if (empty($row['min_id']) || $row['min_id'] >= NUM_CORE_BBCODES) - { - $bbcode_id = NUM_CORE_BBCODES + 1; - } - else - { - $bbcode_id = $row['max_id'] + 1; - } - } - - if ($bbcode_id > 31) - { - trigger_error('TOO_MANY_BBCODES'); - } - - $sql_ary['bbcode_id'] = (int) $bbcode_id; - - $db->sql_query('INSERT INTO ' . BBCODES_TABLE . $db->sql_build_array('INSERT', $sql_ary)); - $lang = 'BBCODE_ADDED'; - $log_action = 'LOG_BBCODE_ADD'; - } - else - { - $db->sql_query('UPDATE ' . BBCODES_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . ' WHERE bbcode_id = ' . $bbcode_id); - $lang = 'BBCODE_EDITED'; - $log_action = 'LOG_BBCODE_EDIT'; - } - - add_log('admin', $log_action, $data['bbcode_tag']); - - trigger_error($lang); - break; - - case 'delete': - $sql = 'SELECT bbcode_tag - FROM ' . BBCODES_TABLE . " - WHERE bbcode_id = $bbcode_id"; - $result = $db->sql_query($sql); - - if ($row = $db->sql_fetchrow($result)) - { - $db->sql_query('DELETE FROM ' . BBCODES_TABLE . " WHERE bbcode_id = $bbcode_id"); - add_log('admin', 'LOG_BBCODE_DELETE', $row['bbcode_tag']); - } - $db->sql_freeresult($result); - - // No break here - - default: - - adm_page_header($user->lang['BBCODES']); - -?> - -

lang['BBCODES'] ?>

- -

lang['BBCODES_EXPLAIN'] ?>

- - -
- - - -
- - - - sql_query($sql); - - $row_class = ''; - while ($row = $db->sql_fetchrow($result)) - { - $row_class = ($row_class == 'row1') ? 'row2' : 'row1'; -?> - - - - -sql_freeresult($result); - -?> - - - - -
lang['BBCODE_TAG'] ?>lang['ACTION'] ?>
lang['EDIT'] ?> | lang['DELETE'] ?>
- - array( - '!([a-z0-9]+://)?([^?].*?[^ \t\n\r<"]*)!ie' => "(('\$1') ? '\$1\$2' : 'http://\$2')" - ), - 'LOCAL_URL' => array( - '!([^:]+/[^ \t\n\r<"]*)!' => '$1' - ), - 'EMAIL' => array( - '!([a-z0-9]+[a-z0-9\-\._]*@(?:(?:[0-9]{1,3}\.){3,5}[0-9]{1,3}|[a-z0-9]+[a-z0-9\-\._]*\.[a-z]+))!i' => '$1' - ), - 'TEXT' => array( - '!(.*?)!es' => "str_replace('\\\"', '"', str_replace('\\'', ''', '\$1'))" - ), - 'COLOR' => array( - '!([a-z]+|#[0-9abcdef]+!i' => '$1' - ), - 'NUMBER' => array( - '!([0-9]+)!' => '$1' - ) - ); - - if (preg_match_all('/\{(' . implode('|', array_keys($tokens)) . ')[0-9]*\}/i', $msg_bbcode, $m)) - { - $pad = 0; - $modifiers = 'i'; - - foreach ($m[0] as $n => $token) - { - $token_type = $m[1][$n]; - - reset($tokens[$token_type]); - list($match, $replace) = each($tokens[$token_type]); - - // Pad backreference numbers from tokens - if (preg_match_all('/(? $bbcode_tag, - 'first_pass_match' => $fp_match, - 'first_pass_replace' => $fp_replace, - 'second_pass_match' => $sp_match, - 'second_pass_replace' => $sp_replace - ); -} -// End Functions -// ----------------------------- - -?> \ No newline at end of file diff --git a/phpBB/adm/admin_board.php b/phpBB/adm/admin_board.php deleted file mode 100644 index 9554e31f25..0000000000 --- a/phpBB/adm/admin_board.php +++ /dev/null @@ -1,517 +0,0 @@ -acl_get('a_server')) ? "$filename$SID&mode=auth" : ''; - $module['GENERAL']['AVATAR_SETTINGS'] = ($auth->acl_get('a_board')) ? "$filename$SID&mode=avatar" : ''; - $module['GENERAL']['BOARD_DEFAULTS'] = ($auth->acl_get('a_defaults')) ? "$filename$SID&mode=default" : ''; - $module['GENERAL']['BOARD_SETTINGS'] = ($auth->acl_get('a_board')) ? "$filename$SID&mode=setting" : ''; - $module['GENERAL']['COOKIE_SETTINGS'] = ($auth->acl_get('a_cookies')) ? "$filename$SID&mode=cookie" : ''; - $module['GENERAL']['EMAIL_SETTINGS'] = ($auth->acl_get('a_server')) ? "$filename$SID&mode=email" : ''; - $module['GENERAL']['LOAD_SETTINGS'] = ($auth->acl_get('a_server')) ? "$filename$SID&mode=load" : ''; - $module['GENERAL']['SERVER_SETTINGS'] = ($auth->acl_get('a_server')) ? "$filename$SID&mode=server" : ''; - $module['GENERAL']['MESSAGE_SETTINGS'] = ($auth->acl_get('a_defaults')) ? "$filename$SID&mode=message" : ''; - return; -} - -define('IN_PHPBB', 1); -// Load default header -$phpbb_root_path = '../'; -$phpEx = substr(strrchr(__FILE__, '.'), 1); -require('pagestart.' . $phpEx); - -// Get mode -$mode = request_var('mode', ''); -$action = request_var('action', ''); -$submit = (isset($_POST['submit'])) ? true : false; - -// Set config vars -$display_vars = array( - 'cookie' => array( - 'auth' => 'a_cookies', - 'title' => 'COOKIE_SETTINGS', - 'vars' => array( - 'cookie_domain' => array('lang' => 'COOKIE_DOMAIN', 'type' => 'text::255', 'explain' => false), - 'cookie_name' => array('lang' => 'COOKIE_NAME', 'type' => 'text::16', 'explain' => false), - 'cookie_path' => array('lang' => 'COOKIE_PATH', 'type' => 'text::255', 'explain' => false), - 'cookie_secure' => array('lang' => 'COOKIE_SECURE', 'type' => 'radio:disabled_enabled', 'explain' => true) - ) - ), - 'avatar' => array( - 'auth' => 'a_board', - 'title' => 'AVATAR_SETTINGS', - 'vars' => array( - 'avatar_min_height' => false, 'avatar_min_width' => false, 'avatar_max_height' => false, 'avatar_max_width' => false, - - 'allow_avatar_local' => array('lang' => 'ALLOW_LOCAL', 'type' => 'radio:yes_no', 'explain' => false), - 'allow_avatar_remote' => array('lang' => 'ALLOW_REMOTE', 'type' => 'radio:yes_no', 'explain' => true), - 'allow_avatar_upload' => array('lang' => 'ALLOW_UPLOAD', 'type' => 'radio:yes_no', 'explain' => false), - 'avatar_filesize' => array('lang' => 'MAX_FILESIZE', 'type' => 'text:4:10', 'explain' => true, 'append' => ' ' . $user->lang['BYTES']), - 'avatar_min' => array('lang' => 'MIN_AVATAR_SIZE', 'type' => 'dimension:3:4', 'explain' => true), - 'avatar_max' => array('lang' => 'MAX_AVATAR_SIZE', 'type' => 'dimension:3:4', 'explain' => true), - 'avatar_path' => array('lang' => 'AVATAR_STORAGE_PATH', 'type' => 'text:20:255', 'explain' => true), - 'avatar_gallery_path' => array('lang' => 'AVATAR_GALLERY_PATH', 'type' => 'text:20:255', 'explain' => true) - ) - ), - 'email' => array( - 'auth' => 'a_server', - 'title' => 'EMAIL_SETTINGS', - 'vars' => array( - 'email_enable' => array('lang' => 'ENABLE_EMAIL', 'type' => 'radio:enabled_disabled', 'explain' => true), - 'board_email_form' => array('lang' => 'BOARD_EMAIL_FORM', 'type' => 'radio:enabled_disabled', 'explain' => true), - 'board_hide_emails' => array('lang' => 'BOARD_HIDE_EMAILS', 'type' => 'radio:enabled_disabled', 'explain' => true), - 'email_function_name' => array('lang' => 'EMAIL_FUNCTION_NAME', 'type' => 'text:20:50', 'explain' => true), - 'email_package_size' => array('lang' => 'EMAIL_PACKAGE_SIZE', 'type' => 'text:5:5', 'explain' => true), - 'board_contact' => array('lang' => 'CONTACT_EMAIL', 'type' => 'text:25:100', 'explain' => true), - 'board_email' => array('lang' => 'ADMIN_EMAIL', 'type' => 'text:25:100', 'explain' => true), - 'board_email_sig' => array('lang' => 'EMAIL_SIG', 'type' => 'textarea:5:30', 'explain' => true), - 'smtp_delivery' => array('lang' => 'USE_SMTP', 'type' => 'radio:yes_no', 'explain' => true), - 'smtp_host' => array('lang' => 'SMTP_SERVER', 'type' => 'text:25:50', 'explain' => false), - 'smtp_port' => array('lang' => 'SMTP_PORT', 'type' => 'text:4:5', 'explain' => true), - 'smtp_auth_method' => array('lang' => 'SMTP_AUTH_METHOD', 'type' => 'select', 'options' => 'mail_auth_select(\'{VALUE}\')', 'explain' => true), - 'smtp_username' => array('lang' => 'SMTP_USERNAME', 'type' => 'text:25:255', 'explain' => true), - 'smtp_password' => array('lang' => 'SMTP_PASSWORD', 'type' => 'password:25:255', 'explain' => true) - ) - ), - 'load' => array( - 'auth' => 'a_server', - 'title' => 'SERVER_SETTINGS', - 'vars' => array( - 'limit_load' => array('lang' => 'LIMIT_LOAD', 'type' => 'text:4:4', 'explain' => true), - 'session_length' => array('lang' => 'SESSION_LENGTH', 'type' => 'text:5:5', 'explain' => true), - 'active_sessions' => array('lang' => 'LIMIT_SESSIONS', 'type' => 'text:4:4', 'explain' => true), - 'load_db_track' => array('lang' => 'YES_POST_MARKING', 'type' => 'radio:yes_no', 'explain' => true), - 'load_db_lastread' => array('lang' => 'YES_READ_MARKING', 'type' => 'radio:yes_no', 'explain' => true), - 'load_online' => array('lang' => 'YES_ONLINE', 'type' => 'radio:yes_no', 'explain' => true), - 'load_online_guests'=> array('lang' => 'YES_ONLINE_GUESTS', 'type' => 'radio:yes_no', 'explain' => true), - 'load_onlinetrack' => array('lang' => 'YES_ONLINE_TRACK', 'type' => 'radio:yes_no', 'explain' => true), - 'load_online_time' => array('lang' => 'ONLINE_LENGTH', 'type' => 'text:4:3', 'explain' => true), - 'load_birthdays' => array('lang' => 'YES_BIRTHDAYS', 'type' => 'radio:yes_no', 'explain' => false), - 'load_moderators' => array('lang' => 'YES_MODERATORS', 'type' => 'radio:yes_no', 'explain' => false), - 'load_jumpbox' => array('lang' => 'YES_JUMPBOX', 'type' => 'radio:yes_no', 'explain' => false), - 'load_search' => array('lang' => 'YES_SEARCH', 'type' => 'radio:yes_no', 'explain' => true), - 'search_interval' => array('lang' => 'SEARCH_INTERVAL', 'type' => 'text:3:4', 'explain' => true), - 'min_search_chars' => array('lang' => 'MIN_SEARCH_CHARS', 'type' => 'text:3:3', 'explain' => true), - 'max_search_chars' => array('lang' => 'MAX_SEARCH_CHARS', 'type' => 'text:3:3', 'explain' => true), - 'load_search_upd' => array('lang' => 'YES_SEARCH_UPDATE', 'type' => 'radio:yes_no', 'explain' => true), -// 'load_search_phr' => array('lang' => 'YES_SEARCH_PHRASE', 'type' => 'radio:yes_no', 'explain' => true), - 'load_tplcompile' => array('lang' => 'RECOMPILE_TEMPLATES', 'type' => 'radio:yes_no', 'explain' => true) - ) - ), - 'default' => array( - 'auth' => 'a_defaults', - 'title' => 'BOARD_DEFAULTS', - 'vars' => array( - 'default_style' => array('lang' => 'DEFAULT_STYLE', 'type' => 'select', 'options' => 'style_select(\'{VALUE}\', true)', 'explain' => false), - 'override_user_style' => array('lang' => 'OVERRIDE_STYLE', 'type' => 'radio:yes_no', 'explain' => true), - 'default_lang' => array('lang' => 'DEFAULT_LANGUAGE', 'type' => 'select', 'options' => 'language_select(\'{VALUE}\')', 'explain' => false), - 'default_dateformat' => array('lang' => 'DEFAULT_DATE_FORMAT', 'type' => 'text::255', 'explain' => true), - 'board_timezone' => array('lang' => 'SYSTEM_TIMEZONE', 'type' => 'select', 'options' => 'tz_select(\'{VALUE}\')', 'explain' => false), - 'board_dst' => array('lang' => 'SYSTEM_DST', 'type' => 'radio:yes_no', 'explain' => false), - 'allow_privmsg' => array('lang' => 'BOARD_PM', 'type' => 'radio:yes_no', 'explain' => true), - 'allow_topic_notify' => array('lang' => 'ALLOW_TOPIC_NOTIFY', 'type' => 'radio:yes_no', 'explain' => false), - 'allow_forum_notify' => array('lang' => 'ALLOW_FORUM_NOTIFY', 'type' => 'radio:yes_no', 'explain' => false), - 'allow_namechange' => array('lang' => 'ALLOW_NAME_CHANGE', 'type' => 'radio:yes_no', 'explain' => false), - 'allow_attachments' => array('lang' => 'ALLOW_ATTACHMENTS', 'type' => 'radio:yes_no', 'explain' => false), - 'allow_html' => array('lang' => 'ALLOW_HTML', 'type' => 'radio:yes_no', 'explain' => false), - 'allow_html_tags' => array('lang' => 'ALLOWED_TAGS', 'type' => 'text:30:255', 'explain' => true), - 'allow_bbcode' => array('lang' => 'ALLOW_BBCODE', 'type' => 'radio:yes_no', 'explain' => false), - 'allow_smilies' => array('lang' => 'ALLOW_SMILIES', 'type' => 'radio:yes_no', 'explain' => false), - 'allow_sig' => array('lang' => 'ALLOW_SIG', 'type' => 'radio:yes_no', 'explain' => false), - 'max_sig_chars' => array('lang' => 'MAX_SIG_LENGTH', 'type' => 'text:5:4', 'explain' => true), - 'allow_nocensors' => array('lang' => 'ALLOW_NO_CENSORS', 'type' => 'radio:yes_no', 'explain' => true), - 'allow_bookmarks' => array('lang' => 'ALLOW_BOOKMARKS', 'type' => 'radio:yes_no', 'explain' => true) - ) - ), - 'message' => array( - 'auth' => 'a_defaults', - 'title' => 'MESSAGE_SETTINGS', - 'lang' => 'ucp', - 'vars' => array( - 'pm_max_boxes' => array('lang' => 'BOXES_MAX', 'type' => 'text:4:4', 'explain' => true), - 'pm_max_msgs' => array('lang' => 'BOXES_LIMIT', 'type' => 'text:4:4', 'explain' => true), - 'full_folder_action' => array('lang' => 'FULL_FOLDER_ACTION', 'type' => 'select', 'options' => 'full_folder_select(\'{VALUE}\')', 'explain' => true), - 'pm_edit_time' => array('lang' => 'PM_EDIT_TIME', 'type' => 'text:3:3', 'explain' => true), - 'allow_mass_pm' => array('lang' => 'ALLOW_MASS_PM', 'type' => 'radio:yes_no', 'explain' => false), - 'auth_html_pm' => array('lang' => 'ALLOW_HTML_PM', 'type' => 'radio:yes_no', 'explain' => false), - 'auth_bbcode_pm' => array('lang' => 'ALLOW_BBCODE_PM', 'type' => 'radio:yes_no', 'explain' => false), - 'auth_smilies_pm' => array('lang' => 'ALLOW_SMILIES_PM', 'type' => 'radio:yes_no', 'explain' => false), - 'allow_pm_attach' => array('lang' => 'ALLOW_PM_ATTACHMENTS', 'type' => 'radio:yes_no', 'explain' => false), - 'auth_download_pm' => array('lang' => 'ALLOW_DOWNLOAD_PM', 'type' => 'radio:yes_no', 'explain' => false), - 'auth_report_pm' => array('lang' => 'ALLOW_REPORT_PM', 'type' => 'radio:yes_no', 'explain' => false), - 'print_pm' => array('lang' => 'ALLOW_PRINT_PM', 'type' => 'radio:yes_no', 'explain' => false), - 'email_pm' => array('lang' => 'ALLOW_EMAIL_PM', 'type' => 'radio:yes_no', 'explain' => false), - 'forward_pm' => array('lang' => 'ALLOW_FORWARD_PM', 'type' => 'radio:yes_no', 'explain' => false), - 'auth_img_pm' => array('lang' => 'ALLOW_IMG_PM', 'type' => 'radio:yes_no', 'explain' => false), - 'auth_flash_pm' => array('lang' => 'ALLOW_FLASH_PM', 'type' => 'radio:yes_no', 'explain' => false), - 'enable_pm_icons' => array('lang' => 'ENABLE_PM_ICONS', 'type' => 'radio:yes_no', 'explain' => false) - ) - ), - 'server' => array( - 'auth' => 'a_server', - 'title' => 'SERVER_SETTINGS', - 'vars' => array( - 'server_name' => array('lang' => 'SERVER_NAME', 'type' => 'text:40:255', 'explain' => true), - 'server_port' => array('lang' => 'SERVER_PORT', 'type' => 'text:5:5', 'explain' => true), - 'script_path' => array('lang' => 'SCRIPT_PATH', 'type' => 'text::255', 'explain' => true), - 'ip_check' => array('lang' => 'IP_VALID', 'type' => 'custom', 'options' => 'select_ip_check(\'{VALUE}\')', 'explain' => true), - 'browser_check' => array('lang' => 'BROWSER_VALID', 'type' => 'radio:yes_no', 'explain' => true), - 'gzip_compress' => array('lang' => 'ENABLE_GZIP', 'type' => 'radio:yes_no', 'explain' => false), - 'smilies_path' => array('lang' => 'SMILIES_PATH', 'type' => 'text:20:255', 'explain' => true), - 'icons_path' => array('lang' => 'ICONS_PATH', 'type' => 'text:20:255', 'explain' => true), - 'upload_icons_path' => array('lang' => 'UPLOAD_ICONS_PATH', 'type' => 'text:20:255', 'explain' => true), - 'ranks_path' => array('lang' => 'RANKS_PATH', 'type' => 'text:20:255', 'explain' => true) - ) - ), - 'setting' => array( - 'auth' => 'a_board', - 'title' => 'BOARD_SETTINGS', - 'vars' => array( - 'board_disable_msg' => false, 'max_name_chars' => false, 'max_pass_chars' => false, 'bump_type' => false, - - 'sitename' => array('lang' => 'SITE_NAME', 'type' => 'text:40:255', 'explain' => false), - 'site_desc' => array('lang' => 'SITE_DESC', 'type' => 'text:40:255', 'explain' => false), - 'board_disable' => array('lang' => 'DISABLE_BOARD', 'type' => 'custom', 'options' => 'board_disable(\'{VALUE}\')', 'explain' => true), - 'require_activation'=> array('lang' => 'ACC_ACTIVATION', 'type' => 'custom', 'options' => 'select_acc_activation(\'{VALUE}\')', 'explain' => true), - 'allow_autologin' => array('lang' => 'ALLOW_AUTOLOGIN', 'type' => 'radio:yes_no', 'explain' => true), - 'max_autologin_time'=> array('lang' => 'AUTOLOGIN_LENGTH', 'type' => 'text:3:3', 'explain' => true), - 'coppa_enable' => array('lang' => 'ENABLE_COPPA', 'type' => 'radio:yes_no', 'explain' => true), - 'coppa_fax' => array('lang' => 'COPPA_FAX', 'type' => 'text:25:100', 'explain' => false), - 'coppa_mail' => array('lang' => 'COPPA_MAIL', 'type' => 'textarea:5:40', 'explain' => true), - 'enable_confirm' => array('lang' => 'VISUAL_CONFIRM', 'type' => 'radio:yes_no', 'explain' => true), - 'max_reg_attempts' => array('lang' => 'REG_LIMIT', 'type' => 'text:4:4', 'explain' => true), - 'min_name_chars' => array('lang' => 'USERNAME_LENGTH', 'type' => 'custom', 'options' => 'username_length(\'{VALUE}\')', 'explain' => true), - 'allow_name_chars' => array('lang' => 'USERNAME_CHARS', 'type' => 'select', 'options' => 'select_username_chars(\'{VALUE}\')', 'explain' => true), - 'min_pass_chars' => array('lang' => 'PASSWORD_LENGTH', 'type' => 'custom', 'options' => 'password_length(\'{VALUE}\')', 'explain' => true), - 'pass_complex' => array('lang' => 'PASSWORD_TYPE', 'type' => 'select', 'options' => 'select_password_chars(\'{VALUE}\')', 'explain' => true), - 'chg_passforce' => array('lang' => 'FORCE_PASS_CHANGE', 'type' => 'text:3:3', 'explain' => true), - 'save_passwd' => array('lang' => 'SAVE_PASSWORDS', 'type' => 'text:2:2', 'explain' => true), - 'max_login_attempts'=> array('lang' => 'LOGIN_LIMIT', 'type' => 'text:4:4', 'explain' => true), - 'allow_emailreuse' => array('lang' => 'ALLOW_EMAIL_REUSE', 'type' => 'radio:yes_no', 'explain' => true), - 'edit_time' => array('lang' => 'EDIT_TIME', 'type' => 'text:3:3', 'explain' => true), - 'display_last_edited' => array('lang' => 'DISPLAY_LAST_EDITED', 'type' => 'radio:yes_no', 'explain' => true), - 'flood_interval' => array('lang' => 'FLOOD_INTERVAL', 'type' => 'text:3:4', 'explain' => true), - 'bump_interval' => array('lang' => 'BUMP_INTERVAL', 'type' => 'custom', 'options' => 'bump_interval(\'{VALUE}\')', 'explain' => true), - 'topics_per_page' => array('lang' => 'TOPICS_PER_PAGE', 'type' => 'text:3:4', 'explain' => false), - 'posts_per_page' => array('lang' => 'POSTS_PER_PAGE', 'type' => 'text:3:4', 'explain' => false), - 'hot_threshold' => array('lang' => 'HOT_THRESHOLD', 'type' => 'text:3:4', 'explain' => false), - 'max_poll_options' => array('lang' => 'MAX_POLL_OPTIONS', 'type' => 'text:4:4', 'explain' => false), - 'max_post_chars' => array('lang' => 'CHAR_LIMIT', 'type' => 'text:4:6', 'explain' => true), - 'max_post_smilies' => array('lang' => 'SMILIES_LIMIT', 'type' => 'text:4:4', 'explain' => true), - 'max_quote_depth' => array('lang' => 'QUOTE_DEPTH_LIMIT', 'type' => 'text:4:4', 'explain' => true) - ) - ), - 'auth' => array( - 'auth' => 'a_server', - 'title' => 'AUTH_SETTINGS', - 'vars' => array( - 'auth_method' => array('lang' => 'AUTH_METHOD', 'type' => 'select', 'options' => 'select_auth_method(\'{VALUE}\')', 'explain' => false) - ) - ) -); - -if (!in_array($mode, array_keys($display_vars))) -{ - return; -} - -// Perform the current mode -$display_vars = $display_vars[$mode]; - -// Check permissions -if (!$auth->acl_get($display_vars['auth'])) -{ - trigger_error($user->lang['NO_ADMIN']); -} - -if (isset($display_vars['lang'])) -{ - $user->add_lang($display_vars['lang']); -} - -$new = $config; -$cfg_array = (isset($_REQUEST['config'])) ? request_var('config', array('' => '')) : $new; - -// We go through the display_vars to make sure no one is trying to set variables he/she is not allowed to... -foreach ($display_vars['vars'] as $config_name => $null) -{ - if (!isset($cfg_array[$config_name])) - { - continue; - } - - $config_value = $cfg_array[$config_name]; - $new[$config_name] = $config_value; - - if ($config_name == 'email_function_name') - { - $new['email_function_name'] = (empty($new['email_function_name']) || !function_exists($new['email_function_name'])) ? 'mail' : str_replace(array('(', ')'), array('', ''), trim($new['email_function_name'])); - } - - if ($submit) - { - set_config($config_name, $config_value); - } -} - -if ($submit) -{ - add_log('admin', 'LOG_' . strtoupper($mode) . '_CONFIG'); - - trigger_error($user->lang['CONFIG_UPDATED']); -} - -adm_page_header($user->lang[$display_vars['title']]); - -?> - -

lang[$display_vars['title']]; ?>

- -

lang[$display_vars['title'] . '_EXPLAIN']; ?>

- -
" method="post"> - - - - $vars) -{ - if (!is_array($vars)) - { - continue; - } - - $type = explode(':', $vars['type']); - -?> - - - - - - - - - - -
lang[$display_vars['title']]; ?>
lang[$vars['lang']]; ?>: ' . $user->lang[$vars['lang'] . '_EXPLAIN'] . '' : ''; ?>
  
- -' . ucfirst($method) . ''; - } - - return $auth_select; -} - -function mail_auth_select($selected_method) -{ - global $user; - - $auth_methods = array('PLAIN', 'LOGIN', 'CRAM-MD5', 'DIGEST-MD5', 'POP-BEFORE-SMTP'); - $s_smtp_auth_options = ''; - - foreach ($auth_methods as $method) - { - $s_smtp_auth_options .= ''; - } - - return $s_smtp_auth_options; -} - -function full_folder_select($value) -{ - global $user; - - return ''; -} - -function select_ip_check($value) -{ - global $user; - - $ip_all = ($value == 4) ? ' checked="checked"' : ''; - $ip_classc = ($value == 3) ? ' checked="checked"' : ''; - $ip_classb = ($value == 2) ? ' checked="checked"' : ''; - $ip_none = ($value == 0) ? ' checked="checked"' : ''; - - $options = << {$user->lang['ALL']}   {$user->lang['CLASS_C']}   {$user->lang['CLASS_B']}   {$user->lang['NONE']}   -EOT; - - return $options; -} - -function select_acc_activation($value) -{ - global $user, $config; - - $activation_none = ($value == USER_ACTIVATION_NONE) ? ' checked="checked"' : ''; - $activation_user = ($value == USER_ACTIVATION_SELF) ? ' checked="checked"' : ''; - $activation_admin = ($value == USER_ACTIVATION_ADMIN) ? ' checked="checked"' : ''; - $activation_disable = ($value == USER_ACTIVATION_DISABLE) ? ' checked="checked"' : ''; - - $options = ' ' . $user->lang['ACC_NONE']; - - if ($config['email_enable']) - { - $options .= '   ' . $user->lang['ACC_USER']; - $options .= '   ' . $user->lang['ACC_ADMIN']; - } - $options .= '   ' . $user->lang['ACC_DISABLE']; - - return $options; -} - -function username_length($value) -{ - global $new, $user; - - return ' ' . $user->lang['MIN_CHARS'] . '   ' . $user->lang['MAX_CHARS']; -} - -function select_username_chars($selected_value) -{ - global $user; - - $user_char_ary = array('USERNAME_CHARS_ANY' => '.*', 'USERNAME_ALPHA_ONLY' => '[\w]+', 'USERNAME_ALPHA_SPACERS' => '[\w_\+\. \-\[\]]+'); - $user_char_options = ''; - foreach ($user_char_ary as $lang => $value) - { - $selected = ($selected_value == $value) ? ' selected="selected"' : ''; - $user_char_options .= ''; - } - - return $user_char_options; -} - -function password_length($value) -{ - global $new, $user; - - return ' ' . $user->lang['MIN_CHARS'] . '   ' . $user->lang['MAX_CHARS']; -} - -function select_password_chars($selected_value) -{ - global $user; - - $pass_type_ary = array('PASS_TYPE_ANY' => '.*', 'PASS_TYPE_CASE' => '[a-zA-Z]', 'PASS_TYPE_ALPHA' => '[a-zA-Z0-9]', 'PASS_TYPE_SYMBOL' => '[a-zA-Z\W]'); - $pass_char_options = ''; - foreach ($pass_type_ary as $lang => $value) - { - $selected = ($selected_value == $value) ? ' selected="selected"' : ''; - $pass_char_options .= ''; - } - - return $pass_char_options; -} - -function bump_interval($value) -{ - global $new, $user; - - $s_bump_type = ''; - $types = array('m' => 'MINUTES', 'h' => 'HOURS', 'd' => 'DAYS'); - foreach ($types as $type => $lang) - { - $selected = ($new['bump_type'] == $type) ? 'selected="selected" ' : ''; - $s_bump_type .= ''; - } - - return ' '; -} - -function board_disable($value) -{ - global $new, $user; - - $board_disable_yes = ($value) ? ' checked="checked"' : ''; - $board_disable_no = (!$value) ? ' checked="checked"' : ''; - - return ' ' . $user->lang['YES'] . '   ' . $user->lang['NO'] . '
'; -} - -?> \ No newline at end of file diff --git a/phpBB/adm/admin_bots.php b/phpBB/adm/admin_bots.php deleted file mode 100644 index 92292ad0fc..0000000000 --- a/phpBB/adm/admin_bots.php +++ /dev/null @@ -1,394 +0,0 @@ -acl_get('a_server')) - { - return; - } - - $module['USER']['BOTS'] = basename(__FILE__) . $SID; - - return; -} - -define('IN_PHPBB', 1); -// Include files -$phpbb_root_path = '../'; -$phpEx = substr(strrchr(__FILE__, '.'), 1); -require('pagestart.' . $phpEx); - -// Do we have permission? -if (!$auth->acl_get('a_server')) -{ - trigger_error($user->lang['NO_ADMIN']); -} - -// Set various vars -$submit = (isset($_POST['submit'])) ? true : false; -$action = request_var('action', ''); -$mark = request_var('mark', 0); -$id = request_var('id', 0); - -if (isset($_POST['add'])) -{ - $action = 'add'; -} - -$error = array(); - -// User wants to do something, how inconsiderate of them! -switch ($action) -{ - case 'activate': - if ($id || $mark) - { - $id = ($id) ? " = $id" : ' IN (' . implode(', ', $mark) . ')'; - $sql = 'UPDATE ' . BOTS_TABLE . " - SET bot_active = 1 - WHERE bot_id $id"; - $db->sql_query($sql); - } - - $cache->destroy('bots'); - break; - - case 'deactivate': - if ($id || $mark) - { - $id = ($id) ? " = $id" : ' IN (' . implode(', ', $mark) . ')'; - $sql = 'UPDATE ' . BOTS_TABLE . " - SET bot_active = 0 - WHERE bot_id $id"; - $db->sql_query($sql); - } - - $cache->destroy('bots'); - break; - - case 'delete': - if ($id || $mark) - { - // We need to delete the relevant user, usergroup and bot entries ... - $id = ($id) ? " = $id" : ' IN (' . implode(', ', $mark) . ')'; - $sql = 'SELECT bot_name, user_id - FROM ' . BOTS_TABLE . " - WHERE bot_id $id"; - $result = $db->sql_query($sql); - - $user_id_ary = $bot_name_ary = array(); - while ($row = $db->sql_fetchrow($result)) - { - $user_id_ary[] = (int) $row['user_id']; - $bot_name_ary[] = $row['bot_name']; - } - $db->sql_freeresult($result); - - $db->sql_transaction(); - - $sql = 'DELETE FROM ' . BOTS_TABLE . " - WHERE bot_id $id"; - $db->sql_query($sql); - - foreach (array(USERS_TABLE, USER_GROUP_TABLE) as $table) - { - $sql = "DELETE FROM $table - WHERE user_id IN (" . implode(', ', $user_id_ary) . ')'; - $db->sql_query($sql); - } - - $db->sql_transaction('commit'); - - $cache->destroy('bots'); - - add_log('admin', 'LOG_BOT_DELETE', implode(', ', $bot_name_ary)); - trigger_error($user->lang['BOT_DELETED']); - } - break; - - case 'edit': - case 'add': - $bot_name = request_var('bot_name', ''); - $bot_agent = request_var('bot_agent', ''); - $bot_ip = request_var('bot_ip', ''); - $bot_active = request_var('bot_active', true); - $bot_lang = request_var('bot_lang', $config['default_lang']); - $bot_style = request_var('bot_style' , $config['default_style']); - - if ($submit) - { - if (!$bot_agent && !$bot_ip) - { - $error[] = $user->lang['ERR_BOT_NO_MATCHES']; - } - - if ($bot_ip && !preg_match('#^[\d\.,:]+$#', $bot_ip)) - { - if (!$ip_list = gethostbynamel($bot_ip)) - { - $error[] = $user->lang['ERR_BOT_NO_IP']; - } - else - { - $bot_ip = implode(',', $ip_list); - } - } - $bot_ip = str_replace(' ', '', $bot_ip); - - if (!sizeof($error)) - { - $db->sql_transaction(); - - // New bot? Create a new user and group entry - if ($action == 'add') - { - $sql = 'SELECT group_id, group_colour - FROM ' . GROUPS_TABLE . " - WHERE group_name = 'BOTS' - AND group_type = " . GROUP_SPECIAL; - $result = $db->sql_query($sql); - - if (!extract($db->sql_fetchrow($result))) - { - trigger_error($user->lang['NO_GROUP']); - } - $db->sql_freeresult($result); - - $sql = 'INSERT INTO ' . USERS_TABLE . ' ' . $db->sql_build_array('INSERT', array( - 'group_id' => (int) $group_id, - 'username' => (string) $bot_name, - 'user_type' => (int) USER_IGNORE, - 'user_colour' => (string) $group_colour, - 'user_lang' => (string) $bot_lang, - 'user_style' => (int) $bot_style, - 'user_options' => 0) - ); - $db->sql_query($sql); - - $user_id = $db->sql_nextid(); - - // Add to Bots usergroup - $sql = 'INSERT INTO ' . USER_GROUP_TABLE . ' ' . $db->sql_build_array('INSERT', array( - 'user_id' => $user_id, - 'group_id' => $group_id) - ); - $db->sql_query($sql); - - $sql = 'INSERT INTO ' . BOTS_TABLE . ' ' . $db->sql_build_array('INSERT', array( - 'user_id' => (int) $user_id, - 'bot_name' => (string) $bot_name, - 'bot_active' => (int) $bot_active, - 'bot_agent' => (string) $bot_agent, - 'bot_ip' => (string) $bot_ip,) - ); - - $log = 'ADDED'; - } - else - { - $sql = 'SELECT user_id - FROM ' . BOTS_TABLE . " - WHERE bot_id = $id"; - $result = $db->sql_query($sql); - - if (!extract($db->sql_fetchrow($result))) - { - trigger_error($user->lang['NO_BOT']); - } - - $sql = 'UPDATE ' . USERS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', array( - 'user_style' => (int) $bot_style, - 'user_lang' => (string) $bot_lang,) - ) . " WHERE user_id = $user_id"; - $db->sql_query($sql); - - $sql = 'UPDATE ' . BOTS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', array( - 'bot_name' => (string) $bot_name, - 'bot_active' => (int) $bot_active, - 'bot_agent' => (string) $bot_agent, - 'bot_ip' => (string) $bot_ip,) - ) . " WHERE bot_id = $id"; - - $log = 'UPDATED'; - } - $db->sql_query($sql); - - $db->sql_transaction('commit'); - - $cache->destroy('bots'); - - add_log('admin', 'LOG_BOT_' . $log, $bot_name); - trigger_error($user->lang['BOT_' . $log]); - } - } - else if ($id) - { - $sql = 'SELECT b.*, u.user_lang, u.user_style - FROM ' . BOTS_TABLE . ' b, ' . USERS_TABLE . " u - WHERE b.bot_id = $id - AND u.user_id = b.user_id"; - $result = $db->sql_query($sql); - - if (!extract($db->sql_fetchrow($result))) - { - trigger_error($user->lang['NO_BOT']); - } - $db->sql_freeresult($result); - - $bot_lang = $user_lang; - $bot_style = $user_style; - } - - $s_active_options = ''; - foreach (array('0' => 'NO', '1' => 'YES') as $value => $lang) - { - $selected = ($bot_active == $value) ? ' selected="selected"' : ''; - $s_active_options .= ''; - } - - $style_select = style_select($bot_style, true); - $lang_select = language_select($bot_lang); - - $l_title = ($action == 'edit') ? 'EDIT' : 'ADD'; - - // Output relevant page - adm_page_header($user->lang['BOT_' . $l_title]); - -?> - -

lang['BOT_' . $l_title]; ?>

- -

lang['BOT_EDIT_EXPLAIN']; ?>

- -
"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
lang['BOT_' . $l_title]; ?>
', $error); ?>
lang['BOT_NAME']; ?>:
lang['BOT_NAME_EXPLAIN']; ?>
lang['BOT_STYLE']; ?>:
lang['BOT_STYLE_EXPLAIN']; ?>
lang['BOT_LANG']; ?>:
lang['BOT_LANG_EXPLAIN']; ?>
lang['BOT_ACTIVE']; ?>:
lang['BOT_AGENT']; ?>:
lang['BOT_AGENT_EXPLAIN']; ?>
lang['BOT_IP']; ?>:
lang['BOT_IP_EXPLAIN']; ?>
  
- -lang['BOTS']); - -?> - -

lang['BOTS']; ?>

- -

lang['BOTS_EXPLAIN']; ?>

- -
"> - - - - - - - 'BOT_ACTIVATE', 'deactivate' => 'BOT_DEACTIVATE', 'delete' => 'DELETE') as $value => $lang) -{ - $s_options .= ''; -} - -$sql = 'SELECT b.bot_id, b.bot_name, b.bot_active, u.user_lastvisit - FROM ' . BOTS_TABLE . ' b, ' . USERS_TABLE . ' u - WHERE u.user_id = b.user_id - ORDER BY u.user_lastvisit DESC'; -$result = $db->sql_query($sql); - -$row_class = ''; -while ($row = $db->sql_fetchrow($result)) -{ - $row_class = ($row_class == 'row1') ? 'row2' : 'row1'; - - $active_lang = (!$row['bot_active']) ? 'BOT_ACTIVATE' : 'BOT_DEACTIVATE'; - $active_value = (!$row['bot_active']) ? 'activate' : 'deactivate'; - $id = $row['bot_id']; - -?> - - - - - - - - -sql_freeresult($result); - -?> - - - -
lang['BOT_NAME']; ?>lang['BOT_LAST_VISIT']; ?>lang['OPTIONS']; ?>lang['MARK']; ?>
 format_date($row['user_lastvisit']) : $user->lang['BOT_NEVER']; ?>  ">lang[$active_lang]; ?>  ">lang['EDIT']; ?>  ">lang['DELETE']; ?> 
- - - - -
- \ No newline at end of file diff --git a/phpBB/adm/admin_icons.php b/phpBB/adm/admin_icons.php deleted file mode 100644 index bc400e8a18..0000000000 --- a/phpBB/adm/admin_icons.php +++ /dev/null @@ -1,776 +0,0 @@ -acl_get('a_icons')) - { - return; - } - - $filename = basename(__FILE__); - $module['POST']['SMILIES'] = "$filename$SID&mode=smilies"; - $module['POST']['ICONS'] = "$filename$SID&mode=icons"; - - return; -} - -define('IN_PHPBB', 1); -// Include files -$phpbb_root_path = './../'; -$phpEx = substr(strrchr(__FILE__, '.'), 1); -require('pagestart.' . $phpEx); - -// Do we have general permissions? -if (!$auth->acl_get('a_icons')) -{ - trigger_error($user->lang['NO_ADMIN']); -} - -// Grab some basic parameters -$mode = request_var('mode', ''); -$action = request_var('action', ''); -$action = (isset($_POST['add'])) ? 'add' : $action; -$action = (isset($_POST['edit'])) ? 'edit' : $action; -$id = request_var('id', 0); - -// What are we working on? -switch ($mode) -{ - case 'smilies': - $table = SMILIES_TABLE; - $lang = 'SMILIES'; - $fields = 'smiley'; - $img_path = $config['smilies_path']; - break; - - case 'icons': - $table = ICONS_TABLE; - $lang = 'ICONS'; - $fields = 'icons'; - $img_path = $config['icons_path']; - break; -} - -// Clear some arrays -$_images = $_paks = array(); -$notice = ''; - - -// Grab file list of paks and images -if ($action == 'edit' || $action == 'add' || $action == 'import') -{ - $imglist = filelist($phpbb_root_path . $img_path, ''); - - foreach ($imglist as $path => $img_ary) - { - foreach ($img_ary as $img) - { - $img_size = @getimagesize($phpbb_root_path . $img_path . '/' . $path . $img); - - $_images[$path.$img]['file'] = $path.$img; - $_images[$path.$img]['width'] = $img_size[0]; - $_images[$path.$img]['height'] = $img_size[1]; - } - } - unset($imglist); - - $dir = @opendir($phpbb_root_path . $img_path); - while ($file = @readdir($dir)) - { - if (is_file($phpbb_root_path . $img_path . '/' . $file) && preg_match('#\.pak$#i', $file)) - { - $_paks[] = $file; - } - } - @closedir($dir); -} - - -// What shall we do today? Oops, I believe that's trademarked ... -switch ($action) -{ - case 'edit': - unset($_images); - $_images = array(); - - case 'add': - - $order_list = ''; - - $sql = "SELECT * - FROM $table - ORDER BY {$fields}_order " . (($id || $action == 'add') ? 'DESC' : 'ASC'); - $result = $db->sql_query($sql); - - if ($row = $db->sql_fetchrow($result)) - { - do - { - if ($action == 'add') - { - unset($_images[$row[$fields . '_url']]); - } - - if ($row[$fields . '_id'] == $id) - { - $after = TRUE; - $data[$row[$fields . '_url']] = $row; - } - else - { - if ($action == 'edit' && !$id) - { - $data[$row[$fields . '_url']] = $row; - } - - $selected = ''; - if (!empty($after)) - { - $selected = ' selected="selected"'; - $after = FALSE; - } - - $after_txt = ($mode == 'smilies') ? $row['code'] : $row['icons_url']; - $order_list = '' . $order_list; - } - } - while ($row = $db->sql_fetchrow($result)); - } - $db->sql_freeresult($result); - - $order_list = '' . $order_list; - - if ($action == 'add') - { - $data = $_images; - } - - $colspan = (($mode == 'smilies') ? '7' : '5'); - $colspan += ($id) ? 1 : 0; - $colspan += ($action == 'add') ? 2 : 0; - - adm_page_header($user->lang[$lang]); - -?> - -

lang[$lang]; ?>

- -

lang[$lang .'_EXPLAIN']; ?>

- -
"> - - - - - - - - - - - - - - - - - - - - - - $img_row) - { - $row_class = (($row % 2) == 0) ? 'row1' : 'row2'; -?> - - - - - - - - - - - - - - - - - - -
lang[$lang . '_CONFIG'] ?>
lang[$lang . '_URL'] ?>lang[$lang . '_LOCATION'] ?>lang[$lang . '_CODE'] ?>lang[$lang . '_EMOTION'] ?>lang[$lang . '_WIDTH'] ?>lang[$lang . '_HEIGHT'] ?>lang['DISPLAY_ON_POSTING'] ?>lang[$lang . '_ORDER'] ?>lang['ADD'] ?>
[] /> -
- $image, - $fields . '_width' => $image_width[$image], - $fields . '_height' => $image_height[$image], - 'display_on_posting'=> (isset($image_display_on_posting[$image])) ? 1 : 0, - ); - - if ($mode == 'smilies') - { - $img_sql = array_merge($img_sql, array( - 'emotion' => $image_emotion[$image], - 'code' => $image_code[$image]) - ); - } - - if (!empty($image_order[$image])) - { - $img_sql = array_merge($img_sql, array( - $fields . '_order' => $image_order[$image] . '.5') - ); - } - - if ($action == 'modify') - { - $sql = "UPDATE $table - SET " . $db->sql_build_array('UPDATE', $img_sql) . " - WHERE {$fields}_id = " . $image_id[$image]; - $db->sql_query($sql); - } - else - { - $sql = "INSERT INTO $table " . $db->sql_build_array('INSERT', $img_sql); - $db->sql_query($sql); - } - - $update = FALSE; - - if ($action == 'modify' && !empty($image_order[$image])) - { - $update = TRUE; - - $result = $db->sql_query("SELECT {$fields}_order - FROM $table - WHERE {$fields}_id = " . $image_id[$image]); - $order_old = $db->sql_fetchfield($fields . '_order', 0, $result); - - if ($order_old == $image_order[$image]) - { - $update = FALSE; - } - - if ($order_old > $image_order[$image]) - { - $sign = '+'; - $where = $fields . '_order >= ' . $image_order[$image] . " AND {$fields}_order < $order_old"; - } - else if ($order_old < $image_order[$image]) - { - $sign = '-'; - $where = "{$fields}_order > $order_old AND {$fields}_order < " . $image_order[$image]; - $sql[$fields . '_order'] = $image_order[$image] - 1; - } - } - - if ($update) - { - $sql = "UPDATE $table - SET {$fields}_order = {$fields}_order $sign 1 - WHERE $where"; - $db->sql_query($sql); - } - - } - } - - $cache->destroy('icons'); - - if ($action == 'modify') - { - trigger_error($user->lang[$lang . '_EDITED']); - } - else - { - trigger_error($user->lang[$lang . '_ADDED']); - } - - break; - - case 'import': - - $pak = request_var('pak', ''); - $current = request_var('current', ''); - - if ($pak != '') - { - $order = 0; - - // The user has already selected a smilies_pak file - if ($current == 'delete') - { - $db->sql_query("TRUNCATE $table"); - - switch ($mode) - { - case 'smilies': - break; - - case 'icons': - // Reset all icon_ids - $db->sql_query('UPDATE ' . TOPICS_TABLE . ' - SET icon_id = 0'); - $db->sql_query('UPDATE ' . POSTS_TABLE . ' - SET icon_id = 0'); - break; - } - } - else - { - $cur_img = array(); - - $field_sql = ($mode == 'smilies') ? 'code' : 'icons_url'; - $result = $db->sql_query("SELECT $field_sql FROM $table"); - - while ($row = $db->sql_fetchrow($result)) - { - ++$order; - $cur_img[$row[$field_sql]] = 1; - } - $db->sql_freeresult($result); - } - - if (!($pak_ary = @file($phpbb_root_path . $img_path . '/' . $pak))) - { - trigger_error('Could not read pak file', E_USER_ERROR); - } - - foreach ($pak_ary as $pak_entry) - { - $data = array(); - if (preg_match_all("#'(.*?)', #", $pak_entry, $data)) - { - if ((sizeof($data[1]) != 3 && $mode == 'icons') || - (sizeof($data[1]) != 5 && $mode == 'smilies')) - { - trigger_error($user->lang['WRONG_PAK_TYPE']); - } - - $img = stripslashes($data[1][0]); - $width = stripslashes($data[1][1]); - $height = stripslashes($data[1][2]); - if (isset($data[1][3]) && isset($data[1][4])) - { - $emotion = stripslashes($data[1][3]); - $code = htmlentities(stripslashes($data[1][4])); - } - - if ($current == 'replace' && - (($mode == 'smilies' && !empty($cur_img[$code])) || - ($mode == 'icons' && !empty($cur_img[$img])))) - { - $replace_sql = ($mode == 'smilies') ? $code : $img; - $sql = array( - $fields . '_url' => $img, - $fields . '_height' => (int) $height, - $fields . '_width' => (int) $width, - ); - if ($mode == 'smilies') - { - $sql = array_merge($sql, array( - 'emotion' => $emotion - )); - } - - $db->sql_query("UPDATE $table SET " . $db->sql_build_array('UPDATE', $sql) . " - WHERE $field_sql = '" . $db->sql_escape($replace_sql) . "'"); - } - else - { - ++$order; - - $sql = array( - $fields . '_url' => $img, - $fields . '_height' => (int) $height, - $fields . '_width' => (int) $width, - $fields . '_order' => (int) $order, - ); - - if ($mode == 'smilies') - { - $sql = array_merge($sql, array( - 'code' => $code, - 'emotion' => $emotion - )); - } - $db->sql_query("INSERT INTO $table " . $db->sql_build_array('INSERT', $sql)); - } - - } - } - - $cache->destroy('icons'); - trigger_error($user->lang[$lang . '_IMPORT_SUCCESS']); - } - else - { - $pak_options = ''; - - foreach ($_paks as $pak) - { - $pak_options .= ''; - } - - adm_page_header($user->lang[$lang]); - -?> -

lang[$lang] ?>

- -

lang[$lang .'_EXPLAIN'] ?>

- -
- - - - - - - - - - - - - - - - - - - - - -
lang[$lang . '_IMPORT'] ?>
lang['NO_' . $lang . '_PAK']; ?>
lang['SELECT_PACKAGE'] ?>
lang['CURRENT_' . $lang] ?>
lang['CURRENT_' . $lang . '_EXPLAIN'] ?>
lang['KEEP_ALL'] ?>    lang['REPLACE_MATCHES'] ?>    lang['DELETE_ALL'] ?> 
-lang['EXPORT_' . $lang]); - trigger_error(sprintf($user->lang['EXPORT_' . $lang . '_EXPLAIN'], '', '')); - break; - - case 'send': - - $sql = "SELECT * - FROM $table - ORDER BY {$fields}_order"; - $result = $db->sql_query($sql); - - $pak = ''; - while ($row = $db->sql_fetchrow($result)) - { - $pak .= "'" . addslashes($row[$fields . '_url']) . "', "; - $pak .= "'" . addslashes($row[$fields . '_height']) . "', "; - $pak .= "'" . addslashes($row[$fields . '_width']) . "', "; - if ($mode == 'smilies') - { - $pak .= "'" . addslashes($row['emotion']) . "', "; - $pak .= "'" . addslashes($row['code']) . "', "; - } - $pak .= "\n"; - } - $db->sql_freeresult($result); - - if ($pak != '') - { - $db->sql_close(); - - header('Content-Type: text/x-delimtext; name="' . $fields . '.pak"'); - header('Content-disposition: attachment; filename=' . $fields . '.pak"'); - echo $pak; - exit; - } - else - { - trigger_error($user->lang['NO_' . $fields . '_EXPORT']); - } - break; - - case 'delete': - - $db->sql_query("DELETE FROM $table - WHERE {$fields}_id = $id"); - - switch ($mode) - { - case 'smilies': - break; - - case 'icons': - // Reset appropriate icon_ids - $db->sql_query('UPDATE ' . TOPICS_TABLE . " - SET icon_id = 0 - WHERE icon_id = $id"); - $db->sql_query('UPDATE ' . POSTS_TABLE . " - SET icon_id = 0 - WHERE icon_id = $id"); - break; - } - - $notice = $user->lang[$lang . '_DELETED']; - - case 'move_up': - case 'move_down': - - if ($action != 'delete') - { - $image_order = intval($_GET['order']); - $order_total = $image_order * 2 + (($action == 'move_up') ? -1 : 1); - - $sql = 'UPDATE ' . $table . ' - SET ' . $fields . "_order = $order_total - " . $fields . '_order - WHERE ' . $fields . "_order IN ($image_order, " . (($action == 'move_up') ? $image_order - 1 : $image_order + 1) . ')'; - $db->sql_query($sql); - - $cache->destroy('icons'); - - } - // No break; here, display the smilies admin back - - default: - - // By default, check that image_order is valid and fix it if necessary - $sql = "SELECT {$fields}_id AS order_id, {$fields}_order AS fields_order - FROM $table - ORDER BY {$fields}_order"; - $result = $db->sql_query($sql); - - if ($row = $db->sql_fetchrow($result)) - { - $order = 0; - do - { - ++$order; - if ($row['fields_order'] != $order) - { - $db->sql_query("UPDATE $table - SET {$fields}_order = $order - WHERE {$fields}_id = " . $row['order_id']); - } - } - while ($row = $db->sql_fetchrow($result)); - } - $db->sql_freeresult($result); - - // Output the page - adm_page_header($user->lang[$lang]); - -?> - -

lang[$lang]; ?>

- -

lang[$lang .'_EXPLAIN']; ?>

- - - - - -
- - - - - - - -
   lang['IMPORT_' . $lang]; ?> | lang['EXPORT_' . $lang]; ?>
- - - - - - - - - - -sql_query($sql); - - while ($row = $db->sql_fetchrow($result)) - { - if (!$spacer && !$row['display_on_posting']) - { - $spacer = TRUE; -?> - - - - - - - - - - - - - -sql_freeresult($result); - -?> - - - -
lang[$lang]; ?>lang['CODE']; ?>lang['EMOTION']; ?>lang['ACTION']; ?>lang['REORDER']; ?>
lang[$lang . '_NOT_DISPLAYED'] ?>
<?php echo $alt_text; ?>">lang['EDIT']; ?> | ">lang['DELETE']; ?>">lang['MOVE_UP']; ?>
">lang['MOVE_DOWN']; ?>
 
-
-
- - \ No newline at end of file diff --git a/phpBB/adm/admin_jabber.php b/phpBB/adm/admin_jabber.php deleted file mode 100644 index 4ae0fc583c..0000000000 --- a/phpBB/adm/admin_jabber.php +++ /dev/null @@ -1,212 +0,0 @@ -acl_get('a_server')) - { - return; - } - - $module['GENERAL']['IM'] = basename(__FILE__) . $SID; - - return; -} - -define('IN_PHPBB', 1); -// Include files -$phpbb_root_path = '../'; -$phpEx = substr(strrchr(__FILE__, '.'), 1); -require('pagestart.' . $phpEx); -include($phpbb_root_path . 'includes/functions_jabber.'.$phpEx); - -// Do we have general permissions? -if (!$auth->acl_get('a_server')) -{ - trigger_error($user->lang['NO_ADMIN']); -} - -// Grab some basic parameters -$submit = (isset($_POST['submit'])) ? true : false; - -$jab_enable = request_var('jab_enable', $config['jab_enable']); -$jab_host = request_var('jab_host', $config['jab_host']); -$jab_port = request_var('jab_port', $config['jab_port']); -$jab_username = request_var('jab_username', $config['jab_username']); -$jab_password = request_var('jab_password', $config['jab_password']); -$jab_resource = request_var('jab_resource', $config['jab_resource']); - -$jabber = new jabber(); -$error = array(); - -// Setup the basis vars for jabber connection -$jabber->server = $jab_host; -$jabber->port = ($jab_port) ? $jab_port : 5222; -$jabber->username = $jab_username; -$jabber->password = $jab_password; -$jabber->resource = $jab_resource; - -// Are changing (or initialising) a new host or username? If so run some checks and -// try to create account if it doesn't exist -if ($jab_enable) -{ - if ($jab_host != $config['jab_host'] || $jab_username != $config['jab_username']) - { - if (!$jabber->Connect()) - { - trigger_error('Could not connect to Jabber server', E_USER_ERROR); - } - - // First we'll try to authorise using this account, if that fails we'll - // try to create it. - if (!($result = $jabber->SendAuth())) - { - if (($result = $jabber->AccountRegistration($config['board_email'], $config['sitename'])) <> 2) - { - - $error[] = ($result == 1) ? $user->lang['ERR_JAB_USERNAME'] : sprintf($user->lang['ERR_JAB_REGISTER'], $result); - } - else - { - $message = $user->lang['JAB_REGISTERED']; - $log = 'JAB_REGISTER'; - } - } - else - { - $message = $user->lang['JAB_CHANGED']; - $log = 'JAB_CHANGED'; - } - - sleep(1); - $jabber->Disconnect(); - } - else if ($jab_password != $config['jab_password']) - { - if (!$jabber->Connect()) - { - trigger_error('Could not connect to Jabber server', E_USER_ERROR); - } - - if (!$jabber->SendAuth()) - { - trigger_error('Could not authorise on Jabber server', E_USER_ERROR); - } - $jabber->SendPresence(NULL, NULL, 'online'); - - if (($result = $jabber->ChangePassword($jab_password)) <> 2) - { - $error[] = ($result == 1) ? $user->lang['ERR_JAB_PASSCHG'] : sprintf($user->lang['ERR_JAB_PASSFAIL'], $result); - } - else - { - $message = $user->lang['JAB_PASS_CHANGED']; - $log = 'JAB_PASSCHG'; - } - - sleep(1); - $jabber->Disconnect(); - } -} - -// Pull relevant config data -$sql = 'SELECT * - FROM ' . CONFIG_TABLE . " - WHERE config_name LIKE 'jab_%'"; -$result = $db->sql_query($sql); - -while ($row = $db->sql_fetchrow($result)) -{ - $config_name = $row['config_name']; - $config_value = $row['config_value']; - - $default_config[$config_name] = $config_value; - $new[$config_name] = (isset($_POST[$config_name])) ? request_var($config_name, '') : $default_config[$config_name]; - - if ($submit && !sizeof($error)) - { - set_config($config_name, $new[$config_name]); - } -} - -if ($submit && !sizeof($error)) -{ - add_log('admin', 'LOG_' . $log); - trigger_error($message); -} - - - -// Output the page -adm_page_header($user->lang['IM']); - -$jab_enable_yes = ($new['jab_enable']) ? 'checked="checked"' : ''; -$jab_enable_no = (!$new['jab_enable']) ? 'checked="checked"' : ''; - -?> -

lang['IM']; ?>

- -

lang['IM_EXPLAIN']; ?>

- -
"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
lang['IM']; ?>
', $error); ?>
lang['JAB_ENABLE']; ?>:
lang['JAB_ENABLE_EXPLAIN']; ?>
/>lang['ENABLED']; ?>    />lang['DISABLED']; ?>
lang['JAB_SERVER']; ?>:
lang['JAB_SERVER_EXPLAIN'], '', ''); ?>
lang['JAB_PORT']; ?>:
lang['JAB_PORT_EXPLAIN']; ?>
lang['JAB_USERNAME']; ?>:
lang['JAB_USERNAME_EXPLAIN']; ?>
lang['JAB_PASSWORD']; ?>:
lang['JAB_RESOURCE']; ?>:
lang['JAB_RESOURCE_EXPLAIN']; ?>
  
- - \ No newline at end of file diff --git a/phpBB/adm/admin_language.php b/phpBB/adm/admin_language.php deleted file mode 100644 index 725472a440..0000000000 --- a/phpBB/adm/admin_language.php +++ /dev/null @@ -1,1039 +0,0 @@ -acl_get('a_server')) - { - return; - } - - $module['LANGUAGE']['LANGUAGE_PACKS'] = basename(__FILE__) . "$SID&mode=manage"; - - return; -} - -define('IN_PHPBB', 1); -// Include files -$phpbb_root_path = '../'; -$phpEx = substr(strrchr(__FILE__, '.'), 1); -require('pagestart.' . $phpEx); -include($phpbb_root_path . 'includes/functions_user.'.$phpEx); - -// Do we have general permissions? -if (!$auth->acl_get('a_server')) -{ - trigger_error('NO_ADMIN'); -} - -// Check and set some common vars -$mode = request_var('mode', ''); -$confirm = (isset($_POST['confirm'])) ? true : false; -$cancel = (isset($_POST['cancel'])) ? true : false; -$action = request_var('action', ''); - -$action = (isset($_POST['update_details'])) ? 'update_details' : $action; -$action = (isset($_POST['download_file'])) ? 'download_file' : $action; -$action = (isset($_POST['submit_file'])) ? 'submit_file' : $action; -$action = (isset($_POST['remove_store'])) ? 'details' : $action; - -$lang_id = request_var('id', 0); -$cur_file = request_var('cur_file', 'common'); - -if (is_array($cur_file)) -{ - list($cur_file, ) = array_keys($cur_file); -} - -$cur_file = (strpos($cur_file, 'email/') !== false) ? 'email/' . basename($cur_file) : basename($cur_file) . '.' . $phpEx; -$safe_mode = (@ini_get('safe_mode') || @strtolower(ini_get('safe_mode')) == 'on') ? true : false; - -$language_files = array('common', 'groups', 'mcp', 'memberlist', 'posting', 'search', 'ucp', 'viewforum', 'viewtopic', 'admin', 'help_bbcode', 'help_faq'); - -$language_file_header = 'sql_query($sql); - $row = $db->sql_fetchrow($result); - $db->sql_freeresult($result); - - $sql_ary['lang_english_name'] = request_var('lang_english_name', $row['lang_english_name']); - $sql_ary['lang_local_name'] = request_var('lang_local_name', $row['lang_local_name']); - $sql_ary['lang_author'] = request_var('lang_author', $row['lang_author']); - - $db->sql_query('UPDATE ' . LANG_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . ' - WHERE lang_id = ' . $lang_id); - - add_log('admin', 'LOG_UPDATE_LANG_DETAILS', $sql_ary['lang_english_name']); - - trigger_error('LANGUAGE_DETAILS_UPDATED'); - break; - - case 'submit_file': - case 'download_file': - - if (!$lang_id) - { - trigger_error('NO_LANGUAGE_PACK_DEFINED'); - } - - if (!$cur_file) - { - trigger_error('NO_FILE_SELECTED'); - } - - $sql = 'SELECT * FROM ' . LANG_TABLE . " - WHERE lang_id = $lang_id"; - $result = $db->sql_query($sql); - $row = $db->sql_fetchrow($result); - $db->sql_freeresult($result); - - if (!$safe_mode) - { - $mkdir_ary = array('language', 'language/' . $row['lang_iso']); - if (strpos($cur_file, 'email/') !== false) - { - $mkdir_ary[] = 'language/' . $row['lang_iso'] . '/email'; - } - - foreach ($mkdir_ary as $dir) - { - $dir = $phpbb_root_path . 'store/' . $dir; - - if (!is_dir($dir)) - { - if (!@mkdir($dir, 0777)) - { - trigger_error("Could not create directory $dir"); - } - @chmod($dir, 0777); - } - } - } - - $filename = get_filename($row['lang_iso'], $cur_file, true); - $fp = fopen($filename, 'wb'); - - if (strpos($cur_file, 'email/') !== false) - { - fwrite($fp, (STRIP) ? stripslashes($_POST['entry']) : $_POST['entry']); - } - else if (strpos($cur_file, 'help_') === 0) - { - $header = str_replace(array('{FILENAME}', '{LANG_NAME}', '{CHANGED}', '{AUTHOR}'), array($cur_file, $row['lang_english_name'], date('Y-m-d', time()), $row['lang_author']), $language_file_header); - $header .= '$help = array(' . "\n"; - fwrite($fp, $header); - - foreach ($_POST['entry'] as $key => $value) - { - if (!is_array($value)) - { - } - else - { - $entry = "\tarray(\n"; - - foreach ($value as $_key => $_value) - { - $_value = (STRIP) ? stripslashes($_value) : $_value; - $entry .= "\t\t" . (int) $_key . "\t=> '" . str_replace("'", "\\'", $_value) . "',\n"; - } - - $entry .= "\t),\n"; - } - - fwrite($fp, $entry); - } - - $footer = ");\n\n?>"; - fwrite($fp, $footer); - } - else - { - $header = str_replace(array('{FILENAME}', '{LANG_NAME}', '{CHANGED}', '{AUTHOR}'), array($cur_file, $row['lang_english_name'], date('Y-m-d', time()), $row['lang_author']), $language_file_header); - $header .= ' -/** -* DO NOT CHANGE -*/ -if (empty($lang) || !is_array($lang)) -{ - $lang = array(); -} - -$lang += array( -'; - fwrite($fp, $header); - - foreach ($_POST['entry'] as $key => $value) - { - if (!is_array($value)) - { - $value = (STRIP) ? stripslashes($value) : $value; - $entry = "\t'" . $key . "'\t=> '" . str_replace("'", "\\'", $value) . "',\n"; - } - else - { - $entry = "\n\t'" . $key . "'\t=> array(\n"; - - foreach ($value as $_key => $_value) - { - $_value = (STRIP) ? stripslashes($_value) : $_value; - $entry .= "\t\t'" . $_key . "'\t=> '" . str_replace("'", "\\'", $_value) . "',\n"; - } - - $entry .= "\t),\n\n"; - } - - fwrite($fp, $entry); - } - - $footer = ");\n\n?>"; - fwrite($fp, $footer); - } - - fclose($fp); - - if ($action == 'download_file') - { - $name = basename($cur_file); - - header('Pragma: no-cache'); - header('Content-Type: application/octetstream; name="' . $name . '"'); - header('Content-disposition: attachment; filename=' . $name); - - $fp = fopen($filename, 'rb'); - while ($buffer = fread($fp, 1024)) - { - echo $buffer; - } - fclose($fp); - - exit; - } - - $action = 'details'; - - case 'details': - adm_page_header($user->lang['LANGUAGE_PACK_DETAILS']); - - if (!$lang_id) - { - trigger_error('NO_LANGUAGE_PACK_DEFINED'); - } - - $sql = 'SELECT * FROM ' . LANG_TABLE . ' - WHERE lang_id = ' . $lang_id; - $result = $db->sql_query($sql); - $lang_entries = $db->sql_fetchrow($result); - $db->sql_freeresult($result); - - $lang_iso = $lang_entries['lang_iso']; - $missing_vars = $missing_files = array(); - - $email_templates = filelist($phpbb_root_path . 'language/' . $config['default_lang'], 'email', 'txt'); - $email_templates = $email_templates['email/']; - - if (!in_array(str_replace(".{$phpEx}", '', $cur_file), $language_files) && !in_array(basename($cur_file), $email_templates)) - { - trigger_error('WRONG_LANGUAGE_FILE'); - } - - if (isset($_POST['remove_store'])) - { - if (!$safe_mode) - { - @unlink(get_filename($lang_iso, $cur_file)); - } - else - { - @unlink(get_filename($lang_iso, $cur_file, true)); - } - } - -?> -

lang['LANGUAGE_PACK_DETAILS']; ?>

- -
"> - - - - - - - - - - - - - - - - - - - - - - - -
lang['LANG_ENGLISH_NAME']; ?>:
lang['LANG_LOCAL_NAME']; ?>:
lang['LANG_ISO_CODE']; ?>:
lang['LANG_AUTHOR']; ?>:
-

-
- -

lang['THOSE_MISSING_LANG_FILES'], $lang_entries['lang_local_name']); ?>

- -

', $missing_files); ?>

- -

- -

lang['MISSING_LANG_VARIABLES']; ?>

- -

lang['THOSE_MISSING_LANG_VARIABLES'], $lang_entries['lang_local_name']); ?>

- -
"> - - - - - - $vars) - { -?> - - - - - - - - -
lang['LANGUAGE_KEY']; ?>lang['LANGUAGE_VARIABLE']; ?>
]" value="lang['SELECT']; ?>" class="btnmain" />
-

-
-' . $user->lang['LANGUAGE_FILES'] . ''; - foreach ($language_files as $file) - { - if (strpos($file, 'help_') === 0) - { - continue; - } - - $prefix = (file_exists(get_filename($lang_iso, $file . '.' . $phpEx, true))) ? '* ' : ''; - - $selected = ($cur_file == $file . '.' . $phpEx) ? ' selected="selected"' : ''; - $s_lang_options .= ''; - } - - $s_lang_options .= ''; - foreach ($language_files as $file) - { - if (strpos($file, 'help_') !== 0) - { - continue; - } - - $prefix = (file_exists(get_filename($lang_iso, $file . '.' . $phpEx, true))) ? '* ' : ''; - - $selected = ($cur_file == $file . '.' . $phpEx) ? ' selected="selected"' : ''; - $s_lang_options .= ''; - } - - $s_lang_options .= ''; - foreach ($email_templates as $file) - { - $prefix = (file_exists(get_filename($lang_iso, "email/{$file}", true))) ? '* ' : ''; - - $selected = ($cur_file == 'email/' . $file) ? ' selected="selected"' : ''; - $s_lang_options .= ''; - } - - // Get Language Entries - if saved within store folder, we take this one (with the option to remove it) - $lang = array(); - $is_email_file = (strpos($cur_file, 'email/') !== false) ? true : false; - $is_help_file = (strpos($cur_file, 'help_') === 0) ? true : false; - $file_from_store = (file_exists(get_filename($lang_iso, $cur_file, true))) ? true : false; - - if (!$file_from_store && !file_exists(get_filename($lang_iso, $cur_file))) - { - $print_message = sprintf($user->lang['MISSING_LANGUAGE_FILE'], $cur_file); - } - else - { - if ($is_email_file) - { - $lang = implode('', file(get_filename($lang_iso, $cur_file, $file_from_store))); - } - else - { - include(get_filename($lang_iso, $cur_file, $file_from_store)); - - if ($is_help_file) - { - $lang = $help; - unset($help); - } - } - $print_message = $cur_file; - } - - // Normal language pack entries -?> - -

lang['LANGUAGE_ENTRIES']; ?>

- -

lang['LANGUAGE_ENTRIES_EXPLAIN']; ?>

- -
"> - - - - -
-  
-
- - - - - - - - - - - - - - - - - - - - - - - -
lang['FILE_CONTENTS']; ?>
lang['LANGUAGE_KEY']; ?>lang['LANGUAGE_VARIABLE']; ?>
' . $user->lang['FILE_FROM_STORAGE'] . '' : ''); ?>  
  
-

-
-sql_query($sql); - $row = $db->sql_fetchrow($result); - $db->sql_freeresult($result); - - if ($row['lang_iso'] == $config['default_lang']) - { - trigger_error('NO_REMOVE_DEFAULT_LANG'); - } - - $db->sql_query('DELETE FROM ' . LANG_TABLE . ' WHERE lang_id = ' . $lang_id); - $sql = 'UPDATE ' . USERS_TABLE . " - SET user_lang = '{$config['default_lang']}' - WHERE user_lang = '{$row['lang_iso']}'"; - $db->sql_query($sql); - - add_log('admin', 'LOG_DELETE_LANGUAGE_PACK', $row['lang_english_name']); - - trigger_error(sprintf($user->lang['LANGUAGE_PACK_DELETED'], $row['lang_english_name'])); - - break; - - case 'install': - $lang_iso = request_var('iso', ''); - $lang_iso = basename($lang_iso); - - if (!$lang_iso || !file_exists("{$phpbb_root_path}language/$lang_iso/iso.txt")) - { - trigger_error('LANGUAGE_PACK_NOT_EXIST'); - } - - $file = file("{$phpbb_root_path}language/$lang_iso/iso.txt"); - $lang_pack = array(); - - $lang_pack = array( - 'iso' => htmlspecialchars($lang_iso), - 'name' => trim(htmlspecialchars($file[0])), - 'local_name'=> trim(htmlspecialchars($file[1])), - 'author' => trim(htmlspecialchars($file[2])) - ); - unset($file); - - $sql = 'SELECT lang_iso FROM ' . LANG_TABLE . " - WHERE lang_iso = '" . $db->sql_escape($lang_iso) . "'"; - $result = $db->sql_query($sql); - if ($row = $db->sql_fetchrow($result)) - { - trigger_error('LANGUAGE_PACK_ALREADY_INSTALLED'); - } - $db->sql_freeresult($result); - - if (!$lang_pack['name'] || !$lang_pack['local_name']) - { - trigger_error('INVALID_LANGUAGE_PACK'); - } - - // Add language pack - $sql_ary = array( - 'lang_iso' => $lang_pack['iso'], - 'lang_dir' => $lang_pack['iso'], - 'lang_english_name' => $lang_pack['name'], - 'lang_local_name' => $lang_pack['local_name'], - 'lang_author' => $lang_pack['author'] - ); - - $db->sql_query('INSERT INTO ' . LANG_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary)); - - add_log('admin', 'LOG_LANGUAGE_PACK_INSTALLED', $lang_pack['name']); - - trigger_error(sprintf($user->lang['LANGUAGE_PACK_INSTALLED'], $lang_pack['name'])); - - break; - - case 'download': - - if (!$lang_id) - { - trigger_error('NO_LANGUAGE_PACK_DEFINED'); - } - - $sql = 'SELECT * FROM ' . LANG_TABLE . ' - WHERE lang_id = ' . $lang_id; - $result = $db->sql_query($sql); - $row = $db->sql_fetchrow($result); - $db->sql_freeresult($result); - - $use_method = request_var('use_method', ''); - $methods = array('tar'); - - foreach (array('tar.gz' => 'zlib', 'tar.bz2' => 'bz2', 'zip' => 'zlib') as $type => $module) - { - if (!@extension_loaded($module)) - { - break; - } - $methods[] = $type; - } - - if (!in_array($use_method, $methods)) - { - $use_method = ''; - } - - // Let the user decide in which format he wants to have the pack - if (!$use_method) - { - adm_page_header($user->lang['SELECT_DOWNLOAD_FORMAT']); - -?> -

lang['SELECT_DOWNLOAD_FORMAT']; ?>

- -
"> - - - - - - - - - -
lang['DOWNLOAD_AS']; ?> -
- ' . $method . ' '; - } -?> -
-
-

-add_custom_file('store/langfile_' . $row['lang_iso'] . '_' . $file . '.' . $phpEx, $src_path . $file . '.' . $phpEx); - } - else - { - $compress->add_file('store/' . $src_path . $file . '.' . $phpEx, 'store/'); - } - } - else - { - $compress->add_file($src_path . $file . '.' . $phpEx); - } - } - - foreach ($email_templates as $file) - { - if (file_exists(get_filename($row['lang_iso'], 'email/' . $file, 'store'))) - { - if ($safe_mode) - { - $compress->add_custom_file('store/langfile_' . $row['lang_iso'] . '_email_' . $file, $src_path . 'email/' . $file); - } - else - { - $compress->add_file('store/' . $src_path . 'email/' . $file, 'store/'); - } - } - else - { - $compress->add_file($src_path . 'email/' . $file); - } - } - - // Write ISO File - $iso_src = strtr($row['lang_english_name'], array_flip(get_html_translation_table(HTML_ENTITIES))) . "\n"; - $iso_src .= strtr($row['lang_local_name'], array_flip(get_html_translation_table(HTML_ENTITIES))) . "\n"; - $iso_src .= strtr($row['lang_author'], array_flip(get_html_translation_table(HTML_ENTITIES))); - $compress->add_data($iso_src, 'language/' . $row['lang_iso'] . '/iso.txt'); - - // index.html files - $compress->add_data('', 'language/' . $row['lang_iso'] . '/index.html'); - $compress->add_data('', 'language/' . $row['lang_iso'] . '/email/index.html'); - $compress->close(); - - $compress->download('lang_pack_' . $row['lang_iso']); - @unlink($phpbb_root_path . 'store/lang_pack_' . $row['lang_iso'] . '.' . $use_method); - exit; - - break; - - default: - // Output list of language packs - adm_page_header($user->lang['LANGUAGE_PACKS']); -?> -

lang['LANGUAGE_PACKS']; ?>

- -

lang['LANGUAGE_PACKS_EXPLAIN']; ?>

- - - - - - - - - - - - -sql_query($sql); - - $lang_count = array(); - while ($row = $db->sql_fetchrow($result)) - { - $lang_count[$row['user_lang']] = $row['lang_count']; - } - $db->sql_freeresult($result); - - $sql = 'SELECT * - FROM ' . LANG_TABLE; - $result = $db->sql_query($sql); - - $installed = array(); - $row_class = ''; - while ($row = $db->sql_fetchrow($result)) - { - $installed[] = $row['lang_iso']; - $row_class = ($row_class != 'row1') ? 'row1' : 'row2'; - $tagstyle = ($row['lang_iso'] == $config['default_lang']) ? '*' : ''; - -?> - - - - - - - -sql_freeresult($result); - -?> - - - - $file, - 'name' => trim($iso[0]), - 'local_name'=> trim($iso[1]), - 'author' => trim($iso[2]) - ); - } - } - } - } - } - unset($installed); - @closedir($dp); - - if (sizeof($new_ary)) - { - $row_class = ''; - foreach ($new_ary as $iso => $lang_ary) - { - $row_class = ($row_class != 'row1') ? 'row1' : 'row2'; - -?> - - - - - - - - - - - -
lang['LANGUAGE_PACK_NAME']; ?>lang['LANGUAGE_PACK_LOCALNAME']; ?>lang['LANGUAGE_PACK_ISO']; ?>lang['LANGUAGE_PACK_USED_BY']; ?>lang['OPTIONS']; ?>
lang['INSTALLED_LANGUAGE_PACKS']; ?>
">  ">lang['DOWNLOAD']; ?> | ">lang['DELETE']; ?>
lang['UNINSTALLED_LANGUAGE_PACKS']; ?>
">lang['INSTALL']; ?>
lang['NO_UNINSTALLED_LANGUAGE_PACKS']; ?>
-

- $value) - { -?> - - - - -   - - $_value) - { -?> - - - - - - - - $value) - { -?> - - - - -   - - $_value) - { -?> - - - - - - - - \ No newline at end of file diff --git a/phpBB/adm/admin_phpinfo.php b/phpBB/adm/admin_phpinfo.php deleted file mode 100644 index 5893d31562..0000000000 --- a/phpBB/adm/admin_phpinfo.php +++ /dev/null @@ -1,85 +0,0 @@ -acl_get('a_server')) ? basename(__FILE__) . $SID : ''; - return; -} - -define('IN_PHPBB', 1); -// Load default header -$phpbb_root_path = '../'; -$phpEx = substr(strrchr(__FILE__, '.'), 1); -require('pagestart.' . $phpEx); - - -// Check permissions -if (!$auth->acl_get('a_server')) -{ - trigger_error($user->lang['NO_ADMIN']); -} - -ob_start(); -phpinfo(INFO_GENERAL | INFO_CONFIGURATION | INFO_MODULES | INFO_VARIABLES); -$phpinfo = ob_get_contents(); -ob_end_clean(); - -// Get used layout -$layout = (preg_match('#bgcolor#i', $phpinfo)) ? 'old' : 'new'; - -// Here we play around a little with the PHP Info HTML to try and stylise -// it along phpBB's lines ... hopefully without breaking anything. The idea -// for this was nabbed from the PHP annotated manual -preg_match_all('#]*>(.*)#siU', $phpinfo, $output); - -switch ($layout) -{ - case 'old': - $output = preg_replace('#(.*?)(.*?)#s', '
\2\1
', $output); - $output = preg_replace('#(.*?)#', '\1', $output); - $output = preg_replace('##', '', $output); - $output = preg_replace('##', '', $output); - $output = preg_replace('#valign="middle"#', '', $output); - $output = preg_replace('##', '', $output); - $output = preg_replace('##', '', $output); - $output = preg_replace('#

#i', '

', $output); - $output = preg_replace('#

#i', '

', $output); - break; - case 'new': - $output = preg_replace('#(.*?)(.*?)#s', '
\2\1
', $output); - $output = preg_replace('##', '', $output); - $output = preg_replace('#class="e"#', 'class="row1" nowrap="nowrap"', $output); - $output = preg_replace('#class="v"#', 'class="row2"', $output); - $output = preg_replace('# class="h"#', '', $output); - $output = preg_replace('#
#', '', $output); - preg_match_all('#
(.*)
#siU', $output, $output); - $output = $output[1][0]; - break; -} - -adm_page_header($user->lang['PHP_INFO']); - -echo '

' . $user->lang['PHP_INFO'] . '

'; -echo '

' . $user->lang['PHP_INFO_EXPLAIN'] . '

'; -echo $output; - -adm_page_footer(); - -?> \ No newline at end of file diff --git a/phpBB/adm/admin_viewlogs.php b/phpBB/adm/admin_viewlogs.php deleted file mode 100644 index f1043d2d99..0000000000 --- a/phpBB/adm/admin_viewlogs.php +++ /dev/null @@ -1,253 +0,0 @@ -acl_get('a_')) - { - return; - } - - $filename = basename(__FILE__); - $module['LOG']['ADMIN_LOGS'] = $filename . "$SID&mode=admin"; - $module['LOG']['MOD_LOGS'] = $filename . "$SID&mode=mod"; - $module['LOG']['CRITICAL_LOGS'] = $filename . "$SID&mode=critical"; - - return; -} - -define('IN_PHPBB', 1); -// Include files -$phpbb_root_path = '../'; -$phpEx = substr(strrchr(__FILE__, '.'), 1); -require('pagestart.' . $phpEx); - -// Do we have styles admin permissions? -if (!$auth->acl_get('a_')) -{ - trigger_error($user->lang['NO_ADMIN']); -} - -// Set some variables -$mode = request_var('mode', 'admin'); -$forum_id = request_var('f', 0); -$start = request_var('start', 0); -$deletemark = (isset($_POST['delmarked'])) ? true : false; -$deleteall = (isset($_POST['delall'])) ? true : false; -$marked = request_var('mark', array(0)); - -// Sort keys -$sort_days = request_var('st', 0); -$sort_key = request_var('sk', 't'); -$sort_dir = request_var('sd', 'd'); - -// Define some vars depending on which logs we're looking at -$log_type = ($mode == 'admin') ? LOG_ADMIN : (($mode == 'mod') ? LOG_MOD : LOG_CRITICAL); - -$user->add_lang('mcp'); - -// Delete entries if requested and able -if (($deletemark || $deleteall) && $auth->acl_get('a_clearlogs')) -{ - $where_sql = ''; - if ($deletemark && $marked) - { - $sql_in = array(); - foreach ($marked as $mark) - { - $sql_in[] = $mark; - } - $where_sql = ' AND log_id IN (' . implode(', ', $sql_in) . ')'; - unset($sql_in); - } - - $sql = 'DELETE FROM ' . LOG_TABLE . " - WHERE log_type = $log_type - $where_sql"; - $db->sql_query($sql); - - add_log('admin', 'LOG_' . strtoupper($mode) . '_CLEAR'); -} - -// Sorting -$limit_days = array(0 => $user->lang['ALL_ENTRIES'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 364 => $user->lang['1_YEAR']); -$sort_by_text = array('u' => $user->lang['SORT_USERNAME'], 't' => $user->lang['SORT_DATE'], 'i' => $user->lang['SORT_IP'], 'o' => $user->lang['SORT_ACTION']); -$sort_by_sql = array('u' => 'l.user_id', 't' => 'l.log_time', 'i' => 'l.log_ip', 'o' => 'l.log_operation'); - -$s_limit_days = $s_sort_key = $s_sort_dir = $u_sort_param = ''; -gen_sort_selects($limit_days, $sort_by_text, $sort_days, $sort_key, $sort_dir, $s_limit_days, $s_sort_key, $s_sort_dir, $u_sort_param); - -// Define where and sort sql for use in displaying logs -$sql_where = ($sort_days) ? (time() - ($sort_days * 86400)) : 0; -$sql_sort = $sort_by_sql[$sort_key] . ' ' . (($sort_dir == 'd') ? 'DESC' : 'ASC'); - -$l_title = $user->lang[strtoupper($mode) . '_LOGS']; -$l_title_explain = $user->lang[strtoupper($mode) . '_LOGS_EXPLAIN']; - -// Output page -adm_page_header($l_title); - -?> - -

- -

- -
"> -' . $user->lang['ALL_FORUMS'] . '' . make_forum_select($forum_id); - -?> - - - - -
lang['SELECT_FORUM']; ?>:
- - - - - - - -
  - -
- - - - - - - - - - - - - - - - - - - - -acl_get('a_clearlogs')) - { - -?> - - - - - - - - -
lang['DISPLAY_LOG']; ?>:   lang['SORT_BY']; ?>:  
lang['USERNAME']; ?>lang['IP']; ?>lang['TIME']; ?>lang['ACTION']; ?>lang['MARK']; ?>
format_date($log_data[$i]['time']); ?>' . $user->lang['LOGVIEW_' . strtoupper($check)] . ''; - } - } - - if (sizeof($data)) - { - echo '
» [ ' . implode(' | ', $data) . ' ]'; - } -?> -
   
lang['NO_ENTRIES']; ?>
- - - - - - -
 acl_get('a_clearlogs')) - { - - -?>lang['MARK_ALL']; ?> :: lang['UNMARK_ALL']; ?> 

- - - - \ No newline at end of file diff --git a/phpBB/adm/admin_words.php b/phpBB/adm/admin_words.php deleted file mode 100644 index 7f5324592f..0000000000 --- a/phpBB/adm/admin_words.php +++ /dev/null @@ -1,200 +0,0 @@ -acl_get('a_words')) - { - return; - } - - $module['POST']['WORD_CENSOR'] = basename(__FILE__) . $SID; - return; -} - -define('IN_PHPBB', 1); -// Include files -$phpbb_root_path = './../'; -$phpEx = substr(strrchr(__FILE__, '.'), 1); -require('pagestart.' . $phpEx); - -// Do we have forum admin permissions? -if (!$auth->acl_get('a_words')) -{ - trigger_error($user->lang['NO_ADMIN']); -} - -$mode = request_var('mode', ''); -$mode = (isset($_POST['add'])) ? 'add' : ((isset($_POST['save'])) ? 'save' : $mode); - -$s_hidden_fields = ''; -$word_info = array(); - -switch ($mode) -{ - case 'edit': - $word_id = request_var('id', 0); - - if (!$word_id) - { - trigger_error($user->lang['NO_WORD']); - } - - $sql = 'SELECT * - FROM ' . WORDS_TABLE . " - WHERE word_id = $word_id"; - $result = $db->sql_query_limit($sql, 1); - - $word_info = $db->sql_fetchrow($result); - $db->sql_freeresult($result); - - $s_hidden_fields .= ''; - - case 'add': - - adm_page_header($user->lang['WORDS_TITLE']); -?> - -

lang['WORDS_TITLE']; ?>

- -

lang['WORDS_EXPLAIN']; ?>

- -
"> - - - - - - - - - - - - - - -
lang['EDIT_WORD']; ?>
lang['WORD']; ?>:
lang['REPLACEMENT']; ?>:
- -lang['ENTER_WORD']); - } - - $sql = ($word_id) ? "UPDATE " . WORDS_TABLE . " SET word = '" . $db->sql_escape($word) . "', replacement = '" . $db->sql_escape($replacement) . "' WHERE word_id = $word_id" : "INSERT INTO " . WORDS_TABLE . " (word, replacement) VALUES ('" . $db->sql_escape($word) . "', '" . $db->sql_escape($replacement) . "')"; - $db->sql_query($sql); - - $cache->destroy('word_censors'); - - $log_action = ($word_id) ? 'LOG_EDIT_WORD' : 'LOG_ADD_WORD'; - add_log('admin', $log_action, $word); - - $message = ($word_id) ? $user->lang['WORD_UPDATED'] : $user->lang['WORD_ADDED']; - trigger_error($message); - break; - - case 'delete': - - $word_id = request_var('id', 0); - - if (!$word_id) - { - trigger_error($user->lang['NO_WORD']); - } - - $sql = 'SELECT word - FROM ' . WORDS_TABLE . " - WHERE word_id = $word_id"; - $result = $db->sql_query($sql); - $deleted_word = $db->sql_fetchfield('word', 0, $result); - $db->sql_freeresult($result); - - $sql = 'DELETE FROM ' . WORDS_TABLE . " - WHERE word_id = $word_id"; - $db->sql_query($sql); - - $cache->destroy('word_censors'); - - add_log('admin', 'LOG_DELETE_WORD', $deleted_word); - - $message = $user->lang['WORD_REMOVE']; - trigger_error($message); - - break; - - default: - - adm_page_header($user->lang['WORDS_TITLE']); -?> - -

lang['WORDS_TITLE']; ?>

- -

lang['WORDS_EXPLAIN']; ?>

- -
- - - - - - -sql_query($sql); - - $row_class = ''; - if ($row = $db->sql_fetchrow($result)) - { - do - { - $row_class = ($row_class == 'row1') ? 'row2' : 'row1'; - -?> - - - - - - -sql_fetchrow($result)); - } - $db->sql_freeresult($result); - -?> - - - -
lang['WORD']; ?>lang['REPLACEMENT']; ?>lang['ACTION']; ?>
 ">lang['EDIT']; ?>  ">lang['DELETE']; ?> 
- - \ No newline at end of file