aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/acp
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes/acp')
-rw-r--r--phpBB/includes/acp/acp_attachments.php193
-rw-r--r--phpBB/includes/acp/acp_board.php14
-rw-r--r--phpBB/includes/acp/acp_groups.php1
-rw-r--r--phpBB/includes/acp/acp_inactive.php1
-rw-r--r--phpBB/includes/acp/acp_logs.php2
-rw-r--r--phpBB/includes/acp/acp_main.php18
-rw-r--r--phpBB/includes/acp/acp_profile.php26
-rw-r--r--phpBB/includes/acp/acp_prune.php2
-rw-r--r--phpBB/includes/acp/acp_update.php60
-rw-r--r--phpBB/includes/acp/acp_users.php39
10 files changed, 200 insertions, 156 deletions
diff --git a/phpBB/includes/acp/acp_attachments.php b/phpBB/includes/acp/acp_attachments.php
index e710260b35..958a6456c2 100644
--- a/phpBB/includes/acp/acp_attachments.php
+++ b/phpBB/includes/acp/acp_attachments.php
@@ -20,14 +20,37 @@ if (!defined('IN_PHPBB'))
*/
class acp_attachments
{
- var $u_action;
- var $new_config;
+ /** @var \phpbb\db\driver\driver */
+ protected $db;
+
+ /** @var \phpbb\config\config */
+ protected $config;
+
+ /** @var ContainerBuilder */
+ protected $phpbb_container;
+
+ /** @var \phpbb\template\template */
+ protected $template;
+
+ /** @var \phpbb\user */
+ protected $user;
+
+ public $id;
+ public $u_action;
+ protected $new_config;
function main($id, $mode)
{
global $db, $user, $auth, $template, $cache, $phpbb_container;
global $config, $phpbb_admin_path, $phpbb_root_path, $phpEx;
+ $this->id = $id;
+ $this->db = $db;
+ $this->config = $config;
+ $this->template = $template;
+ $this->user = $user;
+ $this->phpbb_container = $phpbb_container;
+
$user->add_lang(array('posting', 'viewtopic', 'acp/attachments'));
$error = $notify = array();
@@ -1082,9 +1105,26 @@ class acp_attachments
}
}
+ if ($action == 'stats')
+ {
+ $this->handle_stats_resync();
+ }
+
+ $stats_error = $this->check_stats_accuracy();
+
+ if ($stats_error)
+ {
+ $error[] = $stats_error;
+
+ // Show option to resync stats
+ $this->template->assign_vars(array(
+ 'S_ACTION_OPTIONS' => $auth->acl_get('a_board'),
+ ));
+ }
+
$template->assign_vars(array(
- 'S_MANAGE' => true)
- );
+ 'S_MANAGE' => true,
+ ));
$start = request_var('start', 0);
@@ -1107,66 +1147,11 @@ class acp_attachments
$attachments_per_page = (int) $config['topics_per_page'];
- // Handle files stats resync
- $action = request_var('action', '');
- $resync_files_stats = false;
- if ($action && $action = 'stats')
- {
- if (!confirm_box(true))
- {
- confirm_box(false, $user->lang['RESYNC_FILES_STATS_CONFIRM'], build_hidden_fields(array(
- 'i' => $id,
- 'mode' => $mode,
- 'action' => $action,
- )));
- }
- else
- {
- $resync_files_stats = true;
- add_log('admin', 'LOG_RESYNC_FILES_STATS');
- }
- }
-
- // Check if files stats are accurate
- $sql = 'SELECT COUNT(attach_id) as num_files
- FROM ' . ATTACHMENTS_TABLE . '
- WHERE is_orphan = 0';
- $result = $db->sql_query($sql, 600);
- $num_files_real = (int) $db->sql_fetchfield('num_files');
- if ($resync_files_stats === true)
- {
- set_config('num_files', $num_files_real, true);
- }
- $db->sql_freeresult($result);
-
- $sql = 'SELECT SUM(filesize) as upload_dir_size
- FROM ' . ATTACHMENTS_TABLE . '
- WHERE is_orphan = 0';
- $result = $db->sql_query($sql, 600);
- $total_size_real = (float) $db->sql_fetchfield('upload_dir_size');
- if ($resync_files_stats === true)
- {
- set_config('upload_dir_size', $total_size_real, true);
- }
- $db->sql_freeresult($result);
-
- // Get current files stats
- $num_files = (int) $config['num_files'];
- $total_size = (float) $config['upload_dir_size'];
-
- // Issue warning message if files stats are inaccurate
- if (($num_files != $num_files_real) || ($total_size != $total_size_real))
- {
- $error[] = $user->lang('FILES_STATS_WRONG', (int) $num_files_real, get_formatted_filesize($total_size_real));
-
- $template->assign_vars(array(
- 'S_ACTION_OPTIONS' => ($auth->acl_get('a_board')) ? true : false,
- 'U_ACTION' => $this->u_action,)
- );
- }
+ $stats = $this->get_attachment_stats($limit_filetime);
+ $num_files = $stats['num_files'];
+ $total_size = $stats['upload_dir_size'];
// Make sure $start is set to the last page if it exceeds the amount
-
$pagination = $phpbb_container->get('pagination');
$start = $pagination->validate_start($start, $attachments_per_page, $num_files);
@@ -1222,7 +1207,6 @@ class acp_attachments
'TOTAL_FILES' => $num_files,
'TOTAL_SIZE' => get_formatted_filesize($total_size),
- 'S_ON_PAGE' => $pagination->on_page($base_url, $num_files, $attachments_per_page, $start),
'S_LIMIT_DAYS' => $s_limit_days,
'S_SORT_KEY' => $s_sort_key,
'S_SORT_DIR' => $s_sort_dir)
@@ -1284,6 +1268,89 @@ class acp_attachments
}
/**
+ * Get attachment file count and size of upload directory
+ *
+ * @param $limit string Additional limit for WHERE clause to filter stats by.
+ * @return array Returns array with stats: num_files and upload_dir_size
+ */
+ public function get_attachment_stats($limit = '')
+ {
+ $sql = 'SELECT COUNT(a.attach_id) AS num_files, SUM(a.filesize) AS upload_dir_size
+ FROM ' . ATTACHMENTS_TABLE . " a
+ WHERE a.is_orphan = 0
+ $limit";
+ $result = $this->db->sql_query($sql);
+ $row = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+
+ return array(
+ 'num_files' => (int) $row['num_files'],
+ 'upload_dir_size' => (float) $row['upload_dir_size'],
+ );
+ }
+
+ /**
+ * Set config attachment stat values
+ *
+ * @param $stats array Array of config key => value pairs to set.
+ * @return null
+ */
+ public function set_attachment_stats($stats)
+ {
+ foreach ($stats as $key => $value)
+ {
+ $this->config->set($key, $value, true);
+ }
+ }
+
+ /**
+ * Check accuracy of attachment statistics.
+ *
+ * @param $resync bool Resync stats if they're incorrect.
+ * @return bool|string Returns false if stats are correct or error message
+ * otherwise.
+ */
+ public function check_stats_accuracy()
+ {
+ // Get fresh stats.
+ $stats = $this->get_attachment_stats();
+
+ // Get current files stats
+ $num_files = (int) $this->config['num_files'];
+ $total_size = (float) $this->config['upload_dir_size'];
+
+ if (($num_files != $stats['num_files']) || ($total_size != $stats['upload_dir_size']))
+ {
+ return $this->user->lang('FILES_STATS_WRONG', (int) $stats['num_files'], get_formatted_filesize($stats['upload_dir_size']));
+ }
+ return false;
+ }
+
+ /**
+ * Handle stats resync.
+ *
+ * @return null
+ */
+ public function handle_stats_resync()
+ {
+ if (!confirm_box(true))
+ {
+ confirm_box(false, $this->user->lang['RESYNC_FILES_STATS_CONFIRM'], build_hidden_fields(array(
+ 'i' => $this->id,
+ 'mode' => 'manage',
+ 'action' => 'stats',
+ )));
+ }
+ else
+ {
+ $this->set_attachment_stats($this->get_attachment_stats());
+ $log = $this->phpbb_container->get('log');
+ $log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_RESYNC_FILES_STATS');
+ }
+
+ }
+
+ /**
* Build Select for category items
*/
function category_select($select_name, $group_id = false, $key = '')
diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php
index 10fbde8c9b..2c0eb95cd5 100644
--- a/phpBB/includes/acp/acp_board.php
+++ b/phpBB/includes/acp/acp_board.php
@@ -28,7 +28,7 @@ class acp_board
{
global $db, $user, $auth, $template;
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
- global $cache, $phpbb_container;
+ global $cache, $phpbb_container, $phpbb_dispatcher;
$user->add_lang('acp/board');
@@ -456,6 +456,18 @@ class acp_board
break;
}
+ /**
+ * Event to add and/or modify acp_board configurations
+ *
+ * @event core.acp_board_config_edit_add
+ * @var array display_vars Array of config values to display and process
+ * @var string mode Mode of the config page we are displaying
+ * @var boolean submit Do we display the form or process the submission
+ * @since 3.1.0-a4
+ */
+ $vars = array('display_vars', 'mode', 'submit');
+ extract($phpbb_dispatcher->trigger_event('core.acp_board_config_edit_add', compact($vars)));
+
if (isset($display_vars['lang']))
{
$user->add_lang($display_vars['lang']);
diff --git a/phpBB/includes/acp/acp_groups.php b/phpBB/includes/acp/acp_groups.php
index ec78e0b32b..7ecedcf51e 100644
--- a/phpBB/includes/acp/acp_groups.php
+++ b/phpBB/includes/acp/acp_groups.php
@@ -727,7 +727,6 @@ class acp_groups
'S_GROUP_SPECIAL' => ($group_row['group_type'] == GROUP_SPECIAL) ? true : false,
'S_ACTION_OPTIONS' => $s_action_options,
- 'S_ON_PAGE' => $pagination->on_page($base_url, $total_members, $config['topics_per_page'], $start),
'GROUP_NAME' => ($group_row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $group_row['group_name']] : $group_row['group_name'],
'U_ACTION' => $this->u_action . "&g=$group_id",
diff --git a/phpBB/includes/acp/acp_inactive.php b/phpBB/includes/acp/acp_inactive.php
index 305ba9ac69..140815f06a 100644
--- a/phpBB/includes/acp/acp_inactive.php
+++ b/phpBB/includes/acp/acp_inactive.php
@@ -295,7 +295,6 @@ class acp_inactive
'S_LIMIT_DAYS' => $s_limit_days,
'S_SORT_KEY' => $s_sort_key,
'S_SORT_DIR' => $s_sort_dir,
- 'S_ON_PAGE' => $pagination->on_page($base_url, $inactive_count, $per_page, $start),
'USERS_PER_PAGE' => $per_page,
'U_ACTION' => $this->u_action . "&$u_sort_param&users_per_page=$per_page&start=$start",
diff --git a/phpBB/includes/acp/acp_logs.php b/phpBB/includes/acp/acp_logs.php
index 0ffea2737b..10852e3a68 100644
--- a/phpBB/includes/acp/acp_logs.php
+++ b/phpBB/includes/acp/acp_logs.php
@@ -138,8 +138,6 @@ class acp_logs
'L_EXPLAIN' => $l_title_explain,
'U_ACTION' => $this->u_action . "&$u_sort_param$keywords_param&start=$start",
- 'S_ON_PAGE' => $pagination->on_page($base_url, $log_count, $config['topics_per_page'], $start),
-
'S_LIMIT_DAYS' => $s_limit_days,
'S_SORT_KEY' => $s_sort_key,
'S_SORT_DIR' => $s_sort_dir,
diff --git a/phpBB/includes/acp/acp_main.php b/phpBB/includes/acp/acp_main.php
index f01cba0bcc..fd45027b49 100644
--- a/phpBB/includes/acp/acp_main.php
+++ b/phpBB/includes/acp/acp_main.php
@@ -25,7 +25,7 @@ class acp_main
function main($id, $mode)
{
global $config, $db, $cache, $user, $auth, $template, $request;
- global $phpbb_root_path, $phpbb_admin_path, $phpEx;
+ global $phpbb_root_path, $phpbb_admin_path, $phpEx, $phpbb_container;
// Show restore permissions notice
if ($user->data['user_perm_from'] && $auth->acl_get('a_switchperm'))
@@ -432,17 +432,19 @@ class acp_main
));
}
- $latest_version_info = false;
- if (($latest_version_info = obtain_latest_version_info(request_var('versioncheck_force', false))) === false)
+ $version_helper = $phpbb_container->get('version_helper');
+ try
{
- $template->assign_var('S_VERSIONCHECK_FAIL', true);
+ $recheck = $request->variable('versioncheck_force', false);
+ $updates_available = $version_helper->get_suggested_updates($recheck);
+
+ $template->assign_var('S_VERSION_UP_TO_DATE', empty($updates_available));
}
- else
+ catch (\RuntimeException $e)
{
- $latest_version_info = explode("\n", $latest_version_info);
-
$template->assign_vars(array(
- 'S_VERSION_UP_TO_DATE' => phpbb_version_compare(trim($latest_version_info[0]), $config['version'], '<='),
+ 'S_VERSIONCHECK_FAIL' => true,
+ 'VERSIONCHECK_FAIL_REASON' => ($e->getMessage() !== $user->lang('VERSIONCHECK_FAIL')) ? $e->getMessage() : '',
));
}
diff --git a/phpBB/includes/acp/acp_profile.php b/phpBB/includes/acp/acp_profile.php
index 3a5298fb58..4d316d84e4 100644
--- a/phpBB/includes/acp/acp_profile.php
+++ b/phpBB/includes/acp/acp_profile.php
@@ -386,6 +386,9 @@ class acp_profile
'field_show_on_pm' => 0,
'field_show_on_vt' => 0,
'field_show_on_ml' => 0,
+ 'field_is_contact' => 0,
+ 'field_contact_desc'=> '',
+ 'field_contact_url' => '',
'lang_name' => utf8_normalize_nfc(request_var('field_ident', '', true)),
'lang_explain' => '',
'lang_default_value'=> '')
@@ -396,7 +399,7 @@ class acp_profile
// $exclude contains the data we gather in each step
$exclude = array(
- 1 => array('field_ident', 'lang_name', 'lang_explain', 'field_option_none', 'field_show_on_reg', 'field_show_on_pm', 'field_show_on_vt', 'field_show_on_ml', 'field_required', 'field_show_novalue', 'field_hide', 'field_show_profile', 'field_no_view'),
+ 1 => array('field_ident', 'lang_name', 'lang_explain', 'field_option_none', 'field_show_on_reg', 'field_show_on_pm', 'field_show_on_vt', 'field_show_on_ml', 'field_required', 'field_show_novalue', 'field_hide', 'field_show_profile', 'field_no_view', 'field_is_contact', 'field_contact_desc', 'field_contact_url'),
2 => array('field_length', 'field_maxlen', 'field_minlen', 'field_validation', 'field_novalue', 'field_default_value'),
3 => array('l_lang_name', 'l_lang_explain', 'l_lang_default_value', 'l_lang_options')
);
@@ -411,21 +414,24 @@ class acp_profile
'field_show_on_ml',
'field_show_profile',
'field_hide',
+ 'field_is_contact',
);
$options = $profile_field->prepare_options_form($exclude, $visibility_ary);
$cp->vars['field_ident'] = ($action == 'create' && $step == 1) ? utf8_clean_string(request_var('field_ident', $field_row['field_ident'], true)) : request_var('field_ident', $field_row['field_ident']);
- $cp->vars['lang_name'] = utf8_normalize_nfc(request_var('lang_name', $field_row['lang_name'], true));
- $cp->vars['lang_explain'] = utf8_normalize_nfc(request_var('lang_explain', $field_row['lang_explain'], true));
- $cp->vars['lang_default_value'] = utf8_normalize_nfc(request_var('lang_default_value', $field_row['lang_default_value'], true));
+ $cp->vars['lang_name'] = $request->variable('lang_name', $field_row['lang_name'], true);
+ $cp->vars['lang_explain'] = $request->variable('lang_explain', $field_row['lang_explain'], true);
+ $cp->vars['lang_default_value'] = $request->variable('lang_default_value', $field_row['lang_default_value'], true);
+ $cp->vars['field_contact_desc'] = $request->variable('field_contact_desc', $field_row['field_contact_desc'], true);
+ $cp->vars['field_contact_url'] = $request->variable('field_contact_url', $field_row['field_contact_url'], true);
foreach ($visibility_ary as $val)
{
- $cp->vars[$val] = ($submit || $save) ? request_var($val, 0) : $field_row[$val];
+ $cp->vars[$val] = ($submit || $save) ? $request->variable($val, 0) : $field_row[$val];
}
- $cp->vars['field_no_view'] = request_var('field_no_view', (int) $field_row['field_no_view']);
+ $cp->vars['field_no_view'] = $request->variable('field_no_view', (int) $field_row['field_no_view']);
// If the user has submitted a form with options (i.e. dropdown field)
if ($options)
@@ -626,6 +632,9 @@ class acp_profile
'S_FIELD_HIDE' => ($cp->vars['field_hide']) ? true : false,
'S_SHOW_PROFILE' => ($cp->vars['field_show_profile']) ? true : false,
'S_FIELD_NO_VIEW' => ($cp->vars['field_no_view']) ? true : false,
+ 'S_FIELD_CONTACT' => $cp->vars['field_is_contact'],
+ 'FIELD_CONTACT_DESC'=> $cp->vars['field_contact_desc'],
+ 'FIELD_CONTACT_URL' => $cp->vars['field_contact_url'],
'L_LANG_SPECIFIC' => sprintf($user->lang['LANG_SPECIFIC_OPTIONS'], $config['default_lang']),
'FIELD_TYPE' => $profile_field->get_name(),
@@ -886,7 +895,10 @@ class acp_profile
'field_show_on_ml' => $cp->vars['field_show_on_ml'],
'field_hide' => $cp->vars['field_hide'],
'field_show_profile' => $cp->vars['field_show_profile'],
- 'field_no_view' => $cp->vars['field_no_view']
+ 'field_no_view' => $cp->vars['field_no_view'],
+ 'field_is_contact' => $cp->vars['field_is_contact'],
+ 'field_contact_desc' => $cp->vars['field_contact_desc'],
+ 'field_contact_url' => $cp->vars['field_contact_url'],
);
if ($action == 'create')
diff --git a/phpBB/includes/acp/acp_prune.php b/phpBB/includes/acp/acp_prune.php
index 5d9080b55b..0f9ca9bab3 100644
--- a/phpBB/includes/acp/acp_prune.php
+++ b/phpBB/includes/acp/acp_prune.php
@@ -388,7 +388,6 @@ class acp_prune
{
$username = request_var('username', '', true);
$email = request_var('email', '');
- $website = request_var('website', '');
$active_select = request_var('active_select', 'lt');
$count_select = request_var('count_select', 'eq');
@@ -438,7 +437,6 @@ class acp_prune
$where_sql = '';
$where_sql .= ($username) ? ' AND username_clean ' . $db->sql_like_expression(str_replace('*', $db->any_char, utf8_clean_string($username))) : '';
$where_sql .= ($email) ? ' AND user_email ' . $db->sql_like_expression(str_replace('*', $db->any_char, $email)) . ' ' : '';
- $where_sql .= ($website) ? ' AND user_website ' . $db->sql_like_expression(str_replace('*', $db->any_char, $website)) . ' ' : '';
$where_sql .= $joined_sql;
$where_sql .= ($count) ? " AND user_posts " . $key_match[$count_select] . ' ' . (int) $count . ' ' : '';
diff --git a/phpBB/includes/acp/acp_update.php b/phpBB/includes/acp/acp_update.php
index 6b5407067d..e50409bd37 100644
--- a/phpBB/includes/acp/acp_update.php
+++ b/phpBB/includes/acp/acp_update.php
@@ -24,64 +24,42 @@ class acp_update
function main($id, $mode)
{
- global $config, $db, $user, $auth, $template, $cache;
- global $phpbb_root_path, $phpbb_admin_path, $phpEx;
+ global $config, $user, $template, $request;
+ global $phpbb_root_path, $phpEx, $phpbb_container;
$user->add_lang('install');
$this->tpl_name = 'acp_update';
$this->page_title = 'ACP_VERSION_CHECK';
- // Get current and latest version
- $errstr = '';
- $errno = 0;
-
- $info = obtain_latest_version_info(request_var('versioncheck_force', false));
-
- if (empty($info))
+ $version_helper = $phpbb_container->get('version_helper');
+ try
{
- trigger_error('VERSIONCHECK_FAIL', E_USER_WARNING);
+ $recheck = $request->variable('versioncheck_force', false);
+ $updates_available = $version_helper->get_suggested_updates($recheck);
}
+ catch (\RuntimeException $e)
+ {
+ $template->assign_var('S_VERSIONCHECK_FAIL', true);
- $info = explode("\n", $info);
- $latest_version = trim($info[0]);
-
- $announcement_url = trim($info[1]);
- $announcement_url = (strpos($announcement_url, '&amp;') === false) ? str_replace('&', '&amp;', $announcement_url) : $announcement_url;
- $update_link = append_sid($phpbb_root_path . 'install/index.' . $phpEx, 'mode=update');
+ $updates_available = array();
+ }
- // next feature release
- $next_feature_version = $next_feature_announcement_url = false;
- if (isset($info[2]) && trim($info[2]) !== '')
+ foreach ($updates_available as $branch => $version_data)
{
- $next_feature_version = trim($info[2]);
- $next_feature_announcement_url = trim($info[3]);
+ $template->assign_block_vars('updates_available', $version_data);
}
- // Determine automatic update...
- $sql = 'SELECT config_value
- FROM ' . CONFIG_TABLE . "
- WHERE config_name = 'version_update_from'";
- $result = $db->sql_query($sql);
- $version_update_from = (string) $db->sql_fetchfield('config_value');
- $db->sql_freeresult($result);
-
- $current_version = (!empty($version_update_from)) ? $version_update_from : $config['version'];
+ $update_link = append_sid($phpbb_root_path . 'install/index.' . $phpEx, 'mode=update');
$template->assign_vars(array(
- 'S_UP_TO_DATE' => phpbb_version_compare($latest_version, $config['version'], '<='),
- 'S_UP_TO_DATE_AUTO' => phpbb_version_compare($latest_version, $current_version, '<='),
- 'S_VERSION_CHECK' => true,
- 'U_ACTION' => $this->u_action,
- 'U_VERSIONCHECK_FORCE' => append_sid($this->u_action . '&amp;versioncheck_force=1'),
+ 'S_UP_TO_DATE' => empty($updates_available),
+ 'U_ACTION' => $this->u_action,
+ 'U_VERSIONCHECK_FORCE' => append_sid($this->u_action . '&amp;versioncheck_force=1'),
- 'LATEST_VERSION' => $latest_version,
- 'CURRENT_VERSION' => $config['version'],
- 'AUTO_VERSION' => $version_update_from,
- 'NEXT_FEATURE_VERSION' => $next_feature_version,
+ 'CURRENT_VERSION' => $config['version'],
- 'UPDATE_INSTRUCTIONS' => sprintf($user->lang['UPDATE_INSTRUCTIONS'], $announcement_url, $update_link),
- 'UPGRADE_INSTRUCTIONS' => $next_feature_version ? $user->lang('UPGRADE_INSTRUCTIONS', $next_feature_version, $next_feature_announcement_url) : false,
+ 'UPDATE_INSTRUCTIONS' => sprintf($user->lang['UPDATE_INSTRUCTIONS'], $update_link),
));
}
}
diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php
index fbff6a73da..3e03efd4d7 100644
--- a/phpBB/includes/acp/acp_users.php
+++ b/phpBB/includes/acp/acp_users.php
@@ -37,7 +37,6 @@ class acp_users
$user->add_lang(array('posting', 'ucp', 'acp/users'));
$this->tpl_name = 'acp_users';
- $this->page_title = 'ACP_USER_' . strtoupper($mode);
$error = array();
$username = utf8_normalize_nfc(request_var('username', '', true));
@@ -159,6 +158,8 @@ class acp_users
trigger_error($user->lang['NOT_MANAGE_FOUNDER'] . adm_back_link($this->u_action), E_USER_WARNING);
}
+ $this->page_title = $user_row['username'] . ' :: ' . $user->lang('ACP_USER_' . strtoupper($mode));
+
switch ($mode)
{
case 'overview':
@@ -173,8 +174,7 @@ class acp_users
if ($submit)
{
- // You can't delete the founder
- if ($delete && $user_row['user_type'] != USER_FOUNDER)
+ if ($delete)
{
if (!$auth->acl_get('a_userdel'))
{
@@ -187,6 +187,12 @@ class acp_users
trigger_error($user->lang['CANNOT_REMOVE_ANONYMOUS'] . adm_back_link($this->u_action . '&amp;u=' . $user_id), E_USER_WARNING);
}
+ // Founders can not be deleted.
+ if ($user_row['user_type'] == USER_FOUNDER)
+ {
+ trigger_error($user->lang['CANNOT_REMOVE_FOUNDER'] . adm_back_link($this->u_action . '&amp;u=' . $user_id), E_USER_WARNING);
+ }
+
if ($user_id == $user->data['user_id'])
{
trigger_error($user->lang['CANNOT_REMOVE_YOURSELF'] . adm_back_link($this->u_action . '&amp;u=' . $user_id), E_USER_WARNING);
@@ -1174,7 +1180,6 @@ class acp_users
$template->assign_vars(array(
'S_FEEDBACK' => true,
- 'S_ON_PAGE' => $pagination->on_page($base_url, $log_count, $config['topics_per_page'], $start),
'S_LIMIT_DAYS' => $s_limit_days,
'S_SORT_KEY' => $s_sort_key,
@@ -1361,12 +1366,7 @@ class acp_users
$user_row['iso_lang_id'] = $row['lang_id'];
$data = array(
- 'icq' => request_var('icq', $user_row['user_icq']),
- 'aim' => request_var('aim', $user_row['user_aim']),
- 'msn' => request_var('msn', $user_row['user_msnm']),
- 'yim' => request_var('yim', $user_row['user_yim']),
'jabber' => utf8_normalize_nfc(request_var('jabber', $user_row['user_jabber'], true)),
- 'website' => request_var('website', $user_row['user_website']),
'bday_day' => 0,
'bday_month' => 0,
'bday_year' => 0,
@@ -1386,18 +1386,9 @@ class acp_users
if ($submit)
{
$error = validate_data($data, array(
- 'icq' => array(
- array('string', true, 3, 15),
- array('match', true, '#^[0-9]+$#i')),
- 'aim' => array('string', true, 3, 255),
- 'msn' => array('string', true, 5, 255),
'jabber' => array(
array('string', true, 5, 255),
array('jabber')),
- 'yim' => array('string', true, 5, 255),
- 'website' => array(
- array('string', true, 12, 255),
- array('match', true, '#^http[s]?://(.*?\.)*?[a-z0-9\-]+\.[a-z]{2,4}#i')),
'bday_day' => array('num', true, 1, 31),
'bday_month' => array('num', true, 1, 12),
'bday_year' => array('num', true, 1901, gmdate('Y', time())),
@@ -1419,12 +1410,7 @@ class acp_users
if (!sizeof($error))
{
$sql_ary = array(
- 'user_icq' => $data['icq'],
- 'user_aim' => $data['aim'],
- 'user_msnm' => $data['msn'],
- 'user_yim' => $data['yim'],
'user_jabber' => $data['jabber'],
- 'user_website' => $data['website'],
'user_birthday' => $data['user_birthday'],
);
@@ -1468,13 +1454,7 @@ class acp_users
unset($now);
$template->assign_vars(array(
- 'ICQ' => $data['icq'],
- 'YIM' => $data['yim'],
- 'AIM' => $data['aim'],
- 'MSN' => $data['msn'],
'JABBER' => $data['jabber'],
- 'WEBSITE' => $data['website'],
-
'S_BIRTHDAY_DAY_OPTIONS' => $s_birthday_day_options,
'S_BIRTHDAY_MONTH_OPTIONS' => $s_birthday_month_options,
'S_BIRTHDAY_YEAR_OPTIONS' => $s_birthday_year_options,
@@ -2130,7 +2110,6 @@ class acp_users
$template->assign_vars(array(
'S_ATTACHMENTS' => true,
- 'S_ON_PAGE' => $pagination->on_page($base_url, $num_attachments, $config['topics_per_page'], $start),
'S_SORT_KEY' => $s_sort_key,
'S_SORT_DIR' => $s_sort_dir,
));