mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-30 21:40:43 +02:00
Mainly user pruning var casing
git-svn-id: file:///svn/phpbb/trunk@4373 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -44,7 +44,7 @@ if (!$auth->acl_get('a_userdel'))
|
||||
}
|
||||
|
||||
// Set mode
|
||||
$mode = (isset($_REQUEST['mode'])) ? $_REQUEST['mode'] : '';
|
||||
$mode = (isset($_REQUEST['mode'])) ? htmlspecialchars($_REQUEST['mode']) : '';
|
||||
|
||||
// Do prune
|
||||
if (isset($_POST['prune']))
|
||||
@@ -112,8 +112,8 @@ if (isset($_POST['prune']))
|
||||
$where_sql .= ($active) ? " AND user_lastvisit " . $key_match[$active_select] . " " . gmmktime(0, 0, 0, $active[1], intval($active[2]), intval($active[0])) : '';
|
||||
}
|
||||
|
||||
$sql = "SELECT username, user_id FROM " . USERS_TABLE . "
|
||||
WHERE user_id <> " . ANONYMOUS . "
|
||||
$sql = 'SELECT username, user_id FROM ' . USERS_TABLE . '
|
||||
WHERE user_id <> ' . ANONYMOUS . "
|
||||
$where_sql";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
@@ -141,51 +141,50 @@ if (isset($_POST['prune']))
|
||||
{
|
||||
if (!empty($_POST['deleteposts']))
|
||||
{
|
||||
$l_admin_log = 'log_prune_user_del_del';
|
||||
|
||||
//
|
||||
// Call unified post deletion routine?
|
||||
//
|
||||
|
||||
$l_log = 'LOG_PRUNE_USER_DEL_DEL';
|
||||
}
|
||||
else
|
||||
{
|
||||
$l_admin_log = 'log_prune_user_del_anon';
|
||||
|
||||
for($i = 0; $i < sizeof($user_ids); $i++)
|
||||
{
|
||||
$sql = "UPDATE " . POSTS_TABLE . "
|
||||
SET poster_id = " . ANONYMOUS . ", post_username = '" . $usernames[$i] . "'
|
||||
$sql = 'UPDATE ' . POSTS_TABLE . '
|
||||
SET poster_id = ' . ANONYMOUS . ", post_username = '" . $usernames[$i] . "'
|
||||
WHERE user_id = " . $userids[$i];
|
||||
// $db->sql_query($sql);
|
||||
}
|
||||
|
||||
$l_log = 'LOG_PRUNE_USER_DEL_ANON';
|
||||
}
|
||||
|
||||
$sql = "DELETE FROM " . USERS_TABLE;
|
||||
$sql = 'DELETE FROM ' . USERS_TABLE;
|
||||
}
|
||||
else if (!empty($_POST['deactivate']))
|
||||
{
|
||||
$l_admin_log = 'log_prune_user_deac';
|
||||
$sql = 'UPDATE ' . USERS_TABLE . "
|
||||
SET user_active = 0";
|
||||
|
||||
$sql = "UPDATE " . USERS_TABLE . " SET user_active = 0";
|
||||
$l_log = 'LOG_PRUNE_USER_DEAC';
|
||||
}
|
||||
$sql .= " WHERE user_id <> " . ANONYMOUS . "
|
||||
|
||||
$sql .= ' WHERE user_id <> ' . ANONYMOUS . "
|
||||
$where_sql";
|
||||
// $db->sql_query($sql);
|
||||
|
||||
add_log('admin', $l_admin_log, implode(', ', $usernames));
|
||||
add_log('admin', $l_log, implode(', ', $usernames));
|
||||
|
||||
unset($user_ids);
|
||||
unset($usernames);
|
||||
}
|
||||
|
||||
message_die(MESSAGE, $user->lang['Success_user_prune']);
|
||||
trigger_error($user->lang['SUCCESS_USER_PRUNE']);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
//
|
||||
//
|
||||
$find_count = array('lt' => $user->lang['Less_than'], 'eq' => $user->lang['Equal_to'], 'gt' => $user->lang['More_than']);
|
||||
|
||||
// Front end
|
||||
$find_count = array('lt' => $user->lang['LESS_THAN'], 'eq' => $user->lang['EQUAL_TO'], 'gt' => $user->lang['MORE_THAN']);
|
||||
$s_find_count = '';
|
||||
foreach ($find_count as $key => $value)
|
||||
{
|
||||
@@ -193,7 +192,7 @@ foreach ($find_count as $key => $value)
|
||||
$s_find_count .= '<option value="' . $key . '"' . $selected . '>' . $value . '</option>';
|
||||
}
|
||||
|
||||
$find_time = array('lt' => $user->lang['Before'], 'gt' => $user->lang['After']);
|
||||
$find_time = array('lt' => $user->lang['BEFORE'], 'gt' => $user->lang['AFTER']);
|
||||
$s_find_join_time = '';
|
||||
foreach ($find_time as $key => $value)
|
||||
{
|
||||
@@ -208,48 +207,52 @@ foreach ($find_time as $key => $value)
|
||||
//
|
||||
//
|
||||
//
|
||||
adm_page_header($user->lang['Prune_users']);
|
||||
adm_page_header($user->lang['PRUNE_USERS']);
|
||||
|
||||
?>
|
||||
|
||||
<h1><?php echo $user->lang['Prune_users']; ?></h1>
|
||||
<h1><?php echo $user->lang['PRUNE_USERS']; ?></h1>
|
||||
|
||||
<p><?php echo $user->lang['Prune_users_explain']; ?></p>
|
||||
<p><?php echo $user->lang['PRUNE_USERS_EXPLAIN']; ?></p>
|
||||
|
||||
<form method="post" name="post" action="<?php echo "admin_prune_users.$phpEx$SID"; ?>"><table class="bg" width="80%" cellspacing="1" cellpadding="4" border="0" align="center">
|
||||
<form method="post" name="post" action="<?php echo "admin_prune_users.$phpEx$SID"; ?>"><table class="bg" width="95%" cellspacing="1" cellpadding="4" border="0" align="center">
|
||||
<tr>
|
||||
<th colspan="2"><?php echo $user->lang['Prune_users']; ?></th>
|
||||
<th colspan="2"><?php echo $user->lang['PRUNE_USERS']; ?></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['USERNAME']; ?>: </td>
|
||||
<td class="row1" width="40%"><b><?php echo $user->lang['USERNAME']; ?>: </b></td>
|
||||
<td class="row2"><input class="post" type="text" name="username" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['Email']; ?>: </td>
|
||||
<td class="row1"><b><?php echo $user->lang['EMAIL']; ?>: </b></td>
|
||||
<td class="row2"><input class="post" type="text" name="email" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['Joined']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Joined_explain']; ?></span></td>
|
||||
<td class="row1"><b><?php echo $user->lang['JOINED']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['Joined_explain']; ?></span></td>
|
||||
<td class="row2"><select name="joined_select"><?php echo $s_find_join_time; ?></select> <input class="post" type="text" name="joined" maxlength="10" size="10" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['Last_active']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Last_active_explain']; ?></span></td>
|
||||
<td class="row1"><b><?php echo $user->lang['LAST_ACTIVE']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['Last_active_explain']; ?></span></td>
|
||||
<td class="row2"><select name="active_select"><?php echo $s_find_active_time; ?></select> <input class="post" type="text" name="active" maxlength="10" size="10" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['Posts']; ?>: </td>
|
||||
<td class="row1"><b><?php echo $user->lang['POSTS']; ?>: </b></td>
|
||||
<td class="row2"><select name="count_select"><?php echo $s_find_count; ?></select> <input class="post" type="text" name="count" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['Prune_users']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Select_users_explain']; ?></span></td>
|
||||
<td class="row1"><b><?php echo $user->lang['PRUNE_USERS']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['SELECT_USERS_EXPLAIN']; ?></span></td>
|
||||
<td class="row2"><textarea name="users" cols="40" rows="5"></textarea></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['Delete_user_posts']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Delete_user_posts_explain']; ?></span></td>
|
||||
<td class="row2"><input type="radio" name="deleteposts" value="1" /> <?php echo $user->lang['Yes']; ?> <input type="radio" name="deleteposts" value="0" checked="checked" /> <?php echo $user->lang['No']; ?></td>
|
||||
<td class="row1"><b><?php echo $user->lang['DELETE_USER_POSTS']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['DELETE_USER_POSTS_EXPLAIN']; ?></span></td>
|
||||
<td class="row2"><input type="radio" name="deleteposts" value="1" /> <?php echo $user->lang['YES']; ?> <input type="radio" name="deleteposts" value="0" checked="checked" /> <?php echo $user->lang['NO']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="cat" colspan="2" align="center"><input class="btnlite" type="submit" name="delete" value="<?php echo $user->lang['Prune_users']; ?>" /> <input class="btnlite" type="submit" name="deactivate" value="<?php echo $user->lang['Deactivate']; ?>" /> <input type="submit" name="usersubmit" value="<?php echo $user->lang['Find_username']; ?>" class="btnlite" onClick="window.open('<?php echo "../search.$phpEx$SID&mode=searchuser&field=users"; ?>', '_phpbbsearch', 'HEIGHT=500,resizable=yes,scrollbars=yes,WIDTH=650');return false;" /><input type="hidden" name="prune" value="1" /></td>
|
||||
<td class="row1"><b><?php echo $user->lang['DEACTIVATE_DELETE']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['DEACTIVATE_DELETE_EXPLAIN']; ?></span></td>
|
||||
<td class="row2"><input type="radio" name="action" value="delete" /> <?php echo $user->lang['DELETE_USERS']; ?> <input type="radio" name="action" value="deactivate" checked="checked" /> <?php echo $user->lang['DEACTIVATE']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="cat" colspan="2" align="center"><input class="btnlite" type="submit" name="update" value="<?php echo $user->lang['SUBMIT']; ?>" /> <input type="submit" name="usersubmit" value="<?php echo $user->lang['FIND_USERNAME']; ?>" class="btnlite" onClick="window.open('<?php echo "../search.$phpEx$SID&mode=searchuser&field=users"; ?>', '_phpbbsearch', 'HEIGHT=500,resizable=yes,scrollbars=yes,WIDTH=650');return false;" /><input type="hidden" name="prune" value="1" /></td>
|
||||
</tr>
|
||||
</table></form>
|
||||
|
||||
|
Reference in New Issue
Block a user