mirror of
https://github.com/phpbb/phpbb.git
synced 2025-02-23 11:28:33 +01:00
Added user deleting, as well as a few minor changes.
git-svn-id: file:///svn/phpbb/trunk@857 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
6719728834
commit
b476b503c5
@ -153,11 +153,8 @@ if ( isset($HTTP_GET_VARS['submit']) ) {
|
||||
"ALLOW_AVATAR" => $board_config['allow_avatar_upload'],
|
||||
"AVATAR" => ($user_avatar != "") ? "<img src=\"" . $board_config['avatar_path'] . "/" . stripslashes($user_avatar) . "\" alt=\"\" />" : "",
|
||||
"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
|
||||
{
|
||||
|
@ -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.<br />Deleting users is not provided here, nor is changing admin status. <br />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
|
||||
|
@ -97,18 +97,6 @@
|
||||
<td class="row1"><span class="gen">{L_ALWAYS_ALLOW_SMILIES}:</span></td>
|
||||
<td class="row2"><input type="radio" name="allowsmilies" value="1" {ALWAYS_ALLOW_SMILIES_YES} /> <span class="gen">{L_YES}</span> <input type="radio" name="allowsmilies" value="0" {ALWAYS_ALLOW_SMILIES_NO} /> <span class="gen">{L_NO}</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><span class="gen">{L_BOARD_LANGUAGE}:</span></td>
|
||||
<td class="row2">{LANGUAGE_SELECT}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><span class="gen">{L_BOARD_THEME}:</span></td>
|
||||
<td class="row2">{THEME_SELECT}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><span class="gen">{L_BOARD_TEMPLATE}:</span></td>
|
||||
<td class="row2">{TEMPLATE_SELECT}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><span class="gen">{L_TIMEZONE}:</span></td>
|
||||
<td class="row2">{TIMEZONE_SELECT}</td>
|
||||
@ -152,6 +140,10 @@
|
||||
</tr>
|
||||
<!-- END avatargallery -->
|
||||
<!-- END avatarblock -->
|
||||
<tr>
|
||||
<td class="row1"><span class="gen">{L_DELETE_USER}?</span></td>
|
||||
<td class="row2"><input type="checkbox" name="deleteuser">{L_DELETE_USER_EXPLAIN}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="cat" colspan="2" align="center">{S_HIDDEN_FIELDS}<input type="submit" name="submit" value="{L_SUBMIT}" /> <input type="reset" value="{L_RESET}" /></td>
|
||||
</tr>
|
||||
|
Loading…
x
Reference in New Issue
Block a user