-
Notifications
You must be signed in to change notification settings - Fork 0
/
createuser.php
88 lines (72 loc) · 1.64 KB
/
createuser.php
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<!DOCTYPE html>
<html>
<head>
<link rel = "stylesheet" href = "/portal/style.css?v=<?=time();?>">
<style>
/* form {border: 3px solid #f1f1f1;} */
button {
background-color: #bc8ad4;
color: white;
padding: 14px 20px;
margin: 8px 0;
border: none;
cursor: pointer;
width: 50%;
}
button:hover {
opacity: 0.8;
}
.container {
padding: 16px;
}
input[type=text], input[type=password] {
width: 50%;
padding: 12px 20px;
margin: 8px 0;
display: inline-block;
border: 1px solid #ccc;
box-sizing: border-box;
}
</style>
<title>DMG Portal - Create User</title>
</head>
<body>
<?php
include 'topbar.php';
$username = $_COOKIE[DMGuser];
session_start();
$_SESSION['ref'] = "createuser.php";
include 'db_connect.php';
$result = $conn_users->query("SELECT role FROM USER_LIST WHERE usern = '".$username."'");
foreach($result as $value){
if($value['role'] != 'admin'){
header("location:main.php");
}
}
?>
<div class="bulk">
<h2> New User Form </h2>
<form method="post" action="newuserscript.php" id="loginform">
<div class="container">
<label for="New_username">Username: </label><br>
<input type="text" name="New_username" required>
<br>
<label for="New_password">Password: </label><br>
<input type="password" id = "New_password" name="New_password" required>
<br>
First Name:<br>
<input type="text" name="n_first" required>
<br>
Surname:<br>
<input type="text" name="n_surn" required>
<br>
Email Address:<br>
<input type="text" name="n_email" required>
<br><br>
<button type="submit" value="Submit">Add User</button>
</div>
<input type='hidden' name='approval' value='Yes'>
</form>
</div>
</body>
</html>