From d8609ba1c60803912c0b9de9c887290d7f6c5f90 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sun, 15 Feb 2004 09:03:20 +0000 Subject: [PATCH] added attachments to user acp fixed typo in stylesheet.css added a.th class to admin css git-svn-id: file:///svn/phpbb/trunk@4833 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/adm/admin_users.php | 142 +++++++++++++++++++- phpBB/adm/pagestart.php | 2 +- phpBB/adm/subSilver.css | 23 ++-- phpBB/language/en/lang_admin.php | 1 + phpBB/styles/subSilver/theme/stylesheet.css | 2 +- 5 files changed, 149 insertions(+), 21 deletions(-) diff --git a/phpBB/adm/admin_users.php b/phpBB/adm/admin_users.php index 9af3eccc6f..506c8452fd 100644 --- a/phpBB/adm/admin_users.php +++ b/phpBB/adm/admin_users.php @@ -849,7 +849,7 @@ if ($submit || $preview || $deleteall || $deletemark) WHERE user_id = $user_id"; $db->sql_query($sql); - $message = $user->lang['PROFILE_UPDATED'] . '

' . sprintf($user->lang['RETURN_UCP'], "", ''); + $message = $user->lang['PROFILE_UPDATED'] . '

' . sprintf($user->lang['RETURN_UCP'], "", ''); trigger_error($message); } @@ -860,6 +860,40 @@ if ($submit || $preview || $deleteall || $deletemark) case 'permissions': break; + + case 'attach': + + $delete_ids = isset($_REQUEST['attachment']) ? array_keys(array_map('intval', $_REQUEST['attachment'])) : array(); + + if ($deletemark && sizeof($delete_ids)) + { + if (!$cancel && !$confirm) + { + adm_page_confirm($user->lang['CONFIRM'], $user->lang['CONFIRM_OPERATION']); + } + else if (!$cancel) + { + $log_attachments = array(); + + $sql = 'SELECT real_filename + FROM ' . ATTACHMENTS_TABLE . ' + WHERE attach_id IN (' . implode(', ', $delete_ids) . ')'; + $result = $db->sql_query($sql); + while ($row = $db->sql_fetchrow($result)) + { + $log_attachments[] = $row['real_filename']; + } + $db->sql_freeresult($result); + + delete_attachments('attach', $delete_ids); + + add_log('admin', ((sizeof($delete_ids) == 1) ? 'ATTACHMENT_DELETED' : 'ATTACHMENTS_DELETED'), implode(', ', $log_attachments)); + $message = ((sizeof($delete_ids) == 1) ? $user->lang['ATTACHMENT_DELETED'] : $user->lang['ATTACHMENTS_DELETED']) . '

' . sprintf($user->lang['RETURN_UCP'], "", ''); + trigger_error($message); + } + } + + break; } } @@ -872,7 +906,7 @@ if ($username || $user_id) { // Generate overall "header" for user admin $form_options = ''; - $forms_ary = array('overview' => 'OVERVIEW', 'feedback' => 'FEEDBACK', 'profile' => 'PROFILE', 'prefs' => 'PREFS', 'avatar' => 'AVATAR', 'sig' => 'SIG', 'groups' => 'GROUP', 'perm' => 'PERM'); + $forms_ary = array('overview' => 'OVERVIEW', 'feedback' => 'FEEDBACK', 'profile' => 'PROFILE', 'prefs' => 'PREFS', 'avatar' => 'AVATAR', 'sig' => 'SIG', 'groups' => 'GROUP', 'perm' => 'PERM', 'attach' => 'ATTACH'); foreach ($forms_ary as $value => $lang) { @@ -882,6 +916,9 @@ if ($username || $user_id) $pagination = ''; + $colspan = ($action == 'attach') ? '6' : '2'; + $show_bottom = ($action == 'attach') ? false : true; + ?>