{$lang['massusers_confirm']} HTML; echo " (" . count( $selected_users ) . ") $lang[massusers_confirm_1]

  "; foreach ( $selected_users as $userid ) { $userid = intval($userid); echo "\n"; } echo <<
HTML; echofooter(); exit(); } elseif ($_POST['action'] == "do_mass_delete") { $deleted = 0; foreach ( $selected_users as $id ) { $id = intval( $id ); if( $id == 1 ) { msg( "error", $lang['mass_error'], $lang['user_undel'], "?mod=editusers&action=list" ); } $row = $db->super_query( "SELECT user_id, user_group, name, foto FROM " . USERPREFIX . "_users WHERE user_id='$id'" ); if( ! $row['user_id'] ) msg( "error", $lang['mass_error'], $lang['user_undel'], "?mod=editusers&action=list" ); if ($member_id['user_group'] != 1 AND $row['user_group'] == 1 ) msg( "error", $lang['mass_error'], $lang['user_undel'], "?mod=editusers&action=list" ); $db->query( "DELETE FROM " . USERPREFIX . "_pm WHERE user_from = '{$row['name']}' AND folder = 'outbox'" ); $db->query( "delete FROM " . USERPREFIX . "_users WHERE user_id='$id'" ); $db->query( "delete FROM " . USERPREFIX . "_banned WHERE users_id='$id'" ); $db->query( "delete FROM " . USERPREFIX . "_pm WHERE user='$id'" ); @unlink( ROOT_DIR . "/uploads/fotos/" . $row['foto'] ); $deleted ++; } $cache->clear(); $cache->delete('banned.php' ); if( count( $selected_users ) == $deleted ) { msg( "info", $lang['massusers_head'], $lang['massusers_delok'], "?mod=editusers&action=list" ); } else { msg( "error", $lang['mass_error'], "$deleted $lang[mass_i] " . count( $selected_users ) . " $lang[massusers_confirm_2]", "?mod=editusers&action=list" ); } } elseif ($_POST['action'] == "mass_delete_comments") { echoheader( "options", $lang['mass_head'] ); echo <<
{$lang['massusers_confirm_3']} HTML; echo " (" . count( $selected_users ) . ") $lang[massusers_confirm_1]

  "; foreach ( $selected_users as $userid ) { $userid = intval($userid); echo "\n"; } echo <<
HTML; echofooter(); exit(); } elseif ($_POST['action'] == "do_mass_delete_comments") { foreach ( $selected_users as $id ) { $id = intval( $id ); $result = $db->query( "SELECT COUNT(*) as count, post_id FROM " . PREFIX . "_comments WHERE user_id='$id' AND is_register='1' GROUP BY post_id" ); while ( $row = $db->get_array( $result ) ) { $db->query( "UPDATE " . PREFIX . "_post set comm_num=comm_num-{$row['count']} where id='{$row['post_id']}'" ); } $db->free( $result ); $db->query( "UPDATE " . USERPREFIX . "_users set comm_num='0' WHERE user_id ='$id'" ); $db->query( "DELETE FROM " . PREFIX . "_comments WHERE user_id='$id' AND is_register='1'" ); } $cache->clear(); msg( "info", $lang['massusers_head_1'], $lang['massusers_comok'], "?mod=editusers&action=list" ); } elseif ($_POST['action'] == "mass_move_to_group") { echoheader( "options", $lang['mass_head'] ); echo <<
{$lang['massusers_confirm_4']} HTML; echo " (" . count( $selected_users ) . ") $lang[massusers_confirm_1]

{$lang['user_acc']} {$lang['user_gtlimit']} [?]

  "; foreach ( $selected_users as $userid ) { $userid = intval($userid); echo "\n"; } echo <<
HTML; echofooter(); exit(); } elseif ($_POST['action'] == "do_mass_move_to_group") { $editlevel = intval( $_POST['editlevel'] ); if ($member_id['user_group'] != 1 AND $editlevel < 2 ) msg( "error", $lang['mass_error'], $lang['admin_not_access'], "?mod=editusers&action=list" ); foreach ( $selected_users as $id ) { $id = intval( $id ); $row = $db->super_query( "SELECT user_group FROM " . USERPREFIX . "_users WHERE user_id='$id'" ); if ($member_id['user_group'] != 1 AND $row['user_group'] == 1 ) msg( "error", $lang['mass_error'], $lang['edit_not_admin'], "?mod=editusers&action=list" ); } $cache->clear(); msg( "info", $lang['massusers_head_2'], $lang['massusers_groupok']." ".$user_group[$editlevel]['group_name']."", "?mod=editusers&action=list" ); } elseif ($_POST['action'] == "mass_move_to_ban") { echoheader( "options", $lang['mass_head'] ); echo <<
{$lang['massusers_confirm_5']} HTML; echo " (" . count( $selected_users ) . ") $lang[massusers_confirm_1]

{$lang['ban_date']} [?]

{$lang['ban_descr']}


  "; foreach ( $selected_users as $userid ) { $userid = intval($userid); echo "\n"; } echo <<
HTML; echofooter(); exit(); } elseif ($_POST['action'] == "do_mass_move_to_ban") { include_once SYSTEM_DIR . '/classes/parse.class.php'; $parse = new ParseFilter( ); foreach ( $selected_users as $id ) { $id = intval( $id ); $row = $db->super_query( "SELECT user_group FROM " . USERPREFIX . "_users WHERE user_id='$id'" ); if ($member_id['user_group'] != 1 AND $row['user_group'] == 1 ) msg( "error", $lang['mass_error'], $lang['edit_not_admin'], "?mod=editusers&action=list" ); $banned_descr = $db->safesql( $parse->BB_Parse( $parse->process( $_POST['banned_descr'] ), false ) ); $this_time = time() + ($config['date_adjust'] * 60); $banned_date = intval( $_POST['banned_date'] ); $this_time = $banned_date ? $this_time + ($banned_date * 60 * 60 * 24) : 0; $row = $db->super_query( "SELECT users_id, days FROM " . USERPREFIX . "_banned WHERE users_id = '$id'" ); if( ! $row['users_id'] ) $db->query( "INSERT INTO " . USERPREFIX . "_banned (users_id, descr, date, days) values ('$id', '$banned_descr', '$this_time', '$banned_date')" ); else { if( $row['days'] != $banned_date ) $db->query( "UPDATE " . USERPREFIX . "_banned SET descr='$banned_descr', days='$banned_date', date='$this_time' WHERE users_id = '$id'" ); else $db->query( "UPDATE " . USERPREFIX . "_banned set descr='$banned_descr' WHERE users_id = '$id'" ); } $cache->delete('banned.php' ); $db->query( "UPDATE " . USERPREFIX . "_users SET banned='yes' WHERE user_id ='$id'" ); } $cache->clear(); msg( "info", $lang['massusers_head_3'], $lang['massusers_banok'], "?mod=editusers&action=list" ); } else { msg( "info", $lang['mass_noact'], $lang['mass_noact_1'], "?mod=editusers&action=list" ); } ?>