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 . '_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)) - { -?> -', $error); ?>
- - - -', $notify); ?>
- -'; -foreach ($modes as $_mode) -{ - $s_select_mode .= ''; -} -$s_select_mode .= ''; -?> - - -lang['BBCODES_EXPLAIN'] ?>
- - - -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_EXPLAIN'] ?>
- - - - - 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'] . '_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 = <<lang['BOT_EDIT_EXPLAIN']; ?>
- - - -lang['BOTS']); - -?> - -lang['BOTS_EXPLAIN']; ?>
- - - \ 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 .'_EXPLAIN']; ?>
- - - $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 .'_EXPLAIN'] ?>
- - -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 .'_EXPLAIN']; ?>
- - - - - - - - \ 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_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)); - } - } - -?> -', $missing_files); ?>
- -lang['THOSE_MISSING_LANG_VARIABLES'], $lang_entries['lang_local_name']); ?>
- - -' . $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_EXPLAIN']; ?>
- - -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['LANGUAGE_PACKS_EXPLAIN']; ?>
- -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']; ?> | -
(.*?)(.*?) | #s', '|||||
| |||||
(.*?)#', ' | |||||
\1', $output); - $output = preg_replace('# | #', ' | ', $output); - $output = preg_replace('# | #', ' | ', $output); - $output = preg_replace('#valign="middle"#', '', $output); - $output = preg_replace('# | |
(.*?)(.*?) | #s', '||
| #', ' | ', $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); - -?> - - - - - - - - - - \ 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['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']; ?> - - - - \ No newline at end of file |