-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaccess-change.php
More file actions
54 lines (48 loc) · 1.22 KB
/
access-change.php
File metadata and controls
54 lines (48 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
session_start();
include 'system.php';
page_header();
if(isset($_SESSION['is_logged'])===true && $_SESSION['user_info']['type']==3){
if(isset($_POST['submit'])){
db_init();
$id = (int)$_POST['id'];
$active = $_POST['active'];
$sql = "UPDATE users SET active = $active WHERE id = $id" ;
$retval = run_mysql_query( $sql );
if(! $retval )
{
die('Could not delete data: ' . mysql_error());
}
echo "<article><br /><img src='img/button_ok.png' width='16' heigh='16' /> <span style='bottom:4px; position:relative;'>Data deleted successfully!</span><br /><br /><a href='access_change.php'>Back</a></article>";
mysql_close();
}else{
?>
<article>
<header>
<hgroup>
<h2 class="display_color">Change Access</h2>
</hgroup>
</header><br />
<p>
<form method="post" action="<?php $_PHP_SELF ?>">
<input name="id" type="text" id="id" placeholder="User ID"><br /><br />
<select name="active" id="active">
<option selected value="0">Deny</option>
<option selected value="1">Allow</option>
</select>
<br /><br />
<input name="submit" type="submit" id="submit" value="Change Access">
</form>
</P>
<footer>
<a href='admin.php'>Back</a>
</footer>
</article>
<?php
}
}else{
header('Location: index.php');
exit;
}
page_footer();
?>