<script>
tb = parent.AfianHandler['allTabs']['<?echo 
$_GET['tabid'];?>'];
<?
if ($_SESSION['username'] == "admin") {


/* no item selected */
if ($_POST['itemlist'] == "") {
	iframeAlert($lang->get("Empty file list."));
	echo "parent.AdmUsersEndAction(tb);</script>";
	exit();
}

/* checking input */
$split = explode("|", $str->fromHTML($_POST['itemlist']));
for ($i = 0 ; $i < sizeof($split) ; $i++) {
	if ($split[$i] != "") {
		$items[] = $split[$i];
	}
}



	foreach ($items as $uid) {
		$uname = $auth->id2username($uid);
		if ($uid != "1") {
		
			if ($auth->delUser($uid)) {
				$log->act("0", "user deletion", $uname. " (".$uid.")");
				$iframeAlertMsg[] = $lang->get("User \"%1\" deleted", array($uname));
				?>
			if (tb != undefined) {
			tb.removeItem('<?echo $str->safeJS($uid);?>');
			}
				<?
			} else {
				$log->act("1", "user deletion", $uname. " (".$uid.")");
				$iframeAlertMsg[] = $lang->get("Failed to delete user \"%1\"", $uname);
			}
		
		} else {
			$iframeAlertMsg[] = $lang->get("You cannot delete user \"admin\"");
		}
		
	}



}
?>

parent.AdmUsersEndAction(tb);
<?iframeAlert($iframeAlertMsg);?>
</script>