11
11
$password = sha1($_POST['passwd']."salt");
12
12
//If there is a $_POST that indicates that the add userscript should be run.
14
$handle = @fopen($_FILES["image"]["tmp_name"]);
14
$tmpFile = $_FILES["image"]["tmp_name"];
15
$handle = fopen($tmpFile,"r");
16
$fileSize = $_FILES['image']['size'];
19
//echo $_FILES["image"]["tmp_name"];
20
$output = $content = fread($handle, filesize($tmpFile));
21
$output = base64_encode ($output);
17
25
while (($buffer = fgets($handle, 4096)) !== false) {
18
$buffer = str_replace("&", "&", $buffer);
19
$buffer = str_replace("<", "<", $buffer);
20
$buffer = str_replace(">", ">", $buffer);
26
//$buffer = str_replace("&", "&", $buffer);
27
//$buffer = str_replace("<", "<", $buffer);
28
//$buffer = str_replace(">", ">", $buffer);
21
29
$output .= $buffer;
23
31
if (!feof($handle)) {
24
32
$output .= "Error: unexpected fgets() fail\n";
29
40
if (isset($_SESSION['userType']) && $_POST['isSuperUser'] == true && $_SESSION['userType'] == 1) {
30
41
$query = "INSERT INTO Users (
82
97
<h1> Create a new user </h1>
84
<form action="./adduser.php" method="POST">
99
<form action="./adduser.php" method="POST"enctype="multipart/form-data">
85
100
<table border="0">
87
102
if(isset($_SESSION['userType']) && $_SESSION['userType'] == 1 ) {