From b476b503c55092f42232808aa3a14db07f2c7090 Mon Sep 17 00:00:00 2001 From: dougk_ff7 Date: Mon, 13 Aug 2001 20:54:01 +0000 Subject: [PATCH] Added user deleting, as well as a few minor changes. git-svn-id: file:///svn/phpbb/trunk@857 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/admin/admin_users.php | 50 +++++++++++++++++--- phpBB/language/lang_english.php | 3 ++ phpBB/templates/PSO/admin/user_edit_body.tpl | 16 ++----- 3 files changed, 50 insertions(+), 19 deletions(-) diff --git a/phpBB/admin/admin_users.php b/phpBB/admin/admin_users.php index 82c629bead..17df57da05 100644 --- a/phpBB/admin/admin_users.php +++ b/phpBB/admin/admin_users.php @@ -153,11 +153,8 @@ if ( isset($HTTP_GET_VARS['submit']) ) { "ALLOW_AVATAR" => $board_config['allow_avatar_upload'], "AVATAR" => ($user_avatar != "") ? "\"\"" : "", "AVATAR_SIZE" => $board_config['avatar_filesize'], - "LANGUAGE_SELECT" => language_select(stripslashes($user_lang), $phpbb_root_path . "language/"), - "THEME_SELECT" => theme_select($user_theme), "TIMEZONE_SELECT" => tz_select($user_timezone), "DATE_FORMAT" => stripslashes($user_dateformat), - "TEMPLATE_SELECT" => template_select(stripslashes($user_template), $phpbb_root_path . "templates"), "HTML_STATUS" => $html_status, "BBCODE_STATUS" => $bbcode_status, "SMILIES_STATUS" => $smilies_status, @@ -215,6 +212,9 @@ if ( isset($HTTP_GET_VARS['submit']) ) { "L_HTML_IS" => $lang['HTML'] . " " . $lang['is'], "L_BBCODE_IS" => $lang['BBCode'] . " " . $lang['is'], "L_SMILIES_ARE" => $lang['Smilies'] . " " . $lang['are'], + + "L_DELETE_USER" => $lang['User_delete'], + "L_DELETE_USER_EXPLAIN" => $lang['User_delete_explain'], "S_ALLOW_AVATAR_UPLOAD" => $board_config['allow_avatar_upload'], "S_ALLOW_AVATAR_LOCAL" => $board_config['allow_avatar_local'], @@ -614,10 +614,45 @@ else if($HTTP_POST_VARS[submit] && $HTTP_POST_VARS['user_id']) if(!$error) { - $sql = "UPDATE " . USERS_TABLE . " - SET " . $username_sql . $passwd_sql . "user_email = '$email', user_icq = '$icq', user_website = '$website', user_occ = '$occupation', user_from = '$location', user_interests = '$interests', user_sig = '$signature', user_viewemail = $viewemail, user_aim = '$aim', user_yim = '$yim', user_msnm = '$msn', user_attachsig = $attachsig, user_allowsmile = $allowsmilies, user_allowhtml = $allowhtml, user_allowbbcode = $allowbbcode, user_allow_viewonline = $allowviewonline, user_notify_pm = $notifypm, user_timezone = $user_timezone, user_dateformat = '$user_dateformat', user_lang = '$user_lang', user_active = '1', user_actkey = '$user_actkey'" . $avatar_sql . " - WHERE user_id = $user_id"; - if($result = $db->sql_query($sql)) + if( $HTTP_POST_VARS['deleteuser'] ) + { + $sql = "UPDATE " . POSTS_TABLE . " + SET poster_id = '-1' + WHERE poster_id = $user_id"; + if( $result = $db->sql_query($sql) ) + { + $sql = "UPDATE " . TOPICS_TABLE . " + SET topic_poster = '-1' + WHERE topic_poster = $user_id"; + if( $result = $db->sql_query($sql) ) + { + $sql = "DELETE FROM " . USERS_TABLE . " + WHERE user_id = $user_id"; + if( $result = $db->sql_query($sql) ) + { + message_die(GENERL_MESSAGE, $lang['User_deleted']); + } + else + { + message_die(GENERAL_ERROR, "Could not update users table", "", __LINE__, __FILE__, $sql); + } + } + else + { + message_die(GENERAL_ERROR, "Could not update topics table", "", __LINE__, __FILE__, $sql); + } + } + else + { + message_die(GENERAL_ERROR, "Could not update posts table", "", __LINE__, __FILE__, $sql); + } + } + else + { + $sql = "UPDATE " . USERS_TABLE . " + SET " . $username_sql . $passwd_sql . "user_email = '$email', user_icq = '$icq', user_website = '$website', user_occ = '$occupation', user_from = '$location', user_interests = '$interests', user_sig = '$signature', user_viewemail = $viewemail, user_aim = '$aim', user_yim = '$yim', user_msnm = '$msn', user_attachsig = $attachsig, user_allowsmile = $allowsmilies, user_allowhtml = $allowhtml, user_allowbbcode = $allowbbcode, user_allow_viewonline = $allowviewonline, user_notify_pm = $notifypm, user_timezone = $user_timezone, user_dateformat = '$user_dateformat', user_lang = '$user_lang', user_active = '1', user_actkey = '$user_actkey'" . $avatar_sql . " + WHERE poster_id = $user_id"; + if($result = $db->sql_query($sql)) { message_die(GENERAL_MESSAGE, $lang['Profile_updated']); } @@ -625,6 +660,7 @@ else if($HTTP_POST_VARS[submit] && $HTTP_POST_VARS['user_id']) { message_die(GENERAL_ERROR, "Could not update users table", "", __LINE__, __FILE__, $sql); } + } } else { diff --git a/phpBB/language/lang_english.php b/phpBB/language/lang_english.php index 6572772efb..567f6c150c 100755 --- a/phpBB/language/lang_english.php +++ b/phpBB/language/lang_english.php @@ -782,6 +782,9 @@ $lang['Emotion'] = "Emotion"; // User Management $lang['User_admin'] = "Administration"; $lang['User_admin_explain'] = "Here you can change your user's information. Do not abuse this power.
Deleting users is not provided here, nor is changing admin status.
Use the banning and user permission pages respectively."; +$lang['User_delete'] = "Delete this user"; +$lang['User_delete_explain'] = "Click here to delete this user. This cannot be undone."; +$lang['User_deleted'] = "User was successfully ddeleted."; // // End diff --git a/phpBB/templates/PSO/admin/user_edit_body.tpl b/phpBB/templates/PSO/admin/user_edit_body.tpl index 8dadf4fe3d..54d1902669 100644 --- a/phpBB/templates/PSO/admin/user_edit_body.tpl +++ b/phpBB/templates/PSO/admin/user_edit_body.tpl @@ -97,18 +97,6 @@ {L_ALWAYS_ALLOW_SMILIES}: {L_YES}   {L_NO} - - {L_BOARD_LANGUAGE}: - {LANGUAGE_SELECT} - - - {L_BOARD_THEME}: - {THEME_SELECT} - - - {L_BOARD_TEMPLATE}: - {TEMPLATE_SELECT} - {L_TIMEZONE}: {TIMEZONE_SELECT} @@ -152,6 +140,10 @@ + + {L_DELETE_USER}? + {L_DELETE_USER_EXPLAIN} + {S_HIDDEN_FIELDS}