View file aiv2 AutoIndex/panel/user_remove.php

File size: 1.66Kb
<?php
include ('../config.php');
$page='user';
include ('session.php');
include ($config->real() . $config->header);
?>
<?php
if(isset($_GET) and isset($_GET['user']) and isset($_GET['confirm']) and $_GET['confirm']=='true'){
require($config->real().$config->user);
if(empty($_GET['user']))
{
$error='Username should be supplied!';
}
else if(!isset($globaladmin[$_GET['user']])){
$error='The supplied Username doesn\'t exist!';
}
else{
unset($globaladmin[$_GET['user']]);
$adminrawdata='<?php
$globaladmin=array(';
foreach($globaladmin as $adminname=>$admindata){
$adminrawdata.='\''.$adminname.'\'=>array(\'password\'=>\''.$admindata['password'].'\',\'rights\'=>\''.$admindata['rights'].'\'),';
}
$adminrawdata.=');
?>';
file_put_contents($config->real().$config->user,$adminrawdata);
header('Location: user.php');
die();
}}
?>
<?php
if($layout=='web'){?>
<div class="wrap">
<div style="float: left; width: 18%; margin-bottom: 5px;" class="container">
<?php include('sidebar.php'); ?>
</div>
<div style="float: right; width:80%;">
<?php
}?>
<div class="container"><div class="title">Remove User</div>
<?php if($layout=='web'){
echo '<div style="padding:5px;">';
}
if(isset($error)):?>
<div style="text-align: center;"><?php echo $error; ?></div>
<?php endif; ?>
Are you sure you want remove user &QUOT;<?php echo htmlspecialchars($_GET['user']); ?>&QUOT; ?<br />
<div style="text-align: center;"><a href="user_remove.php?confirm=true&user=<?php echo htmlspecialchars($_GET['user']); ?>">Yes</a> <a href="user.php">No</a></div>
</div>
<?php if($layout=='web'){
echo '</div></div></div>';
}
?>
<?php
include ($config->real() . $config->footer); ?>