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"]);
15
if(!isset($_FILES["image"]["tmp_name"])){
16
$tmpFile = $_FILES["image"]["tmp_name"];
17
$handle = fopen($tmpFile,"r");
18
$fileSize = $_FILES['image']['size'];
21
//echo $_FILES["image"]["tmp_name"];
22
$output = $content = fread($handle, filesize($tmpFile));
23
$output = base64_encode ($output);
17
28
while (($buffer = fgets($handle, 4096)) !== false) {
18
$buffer = str_replace("&", "&", $buffer);
19
$buffer = str_replace("<", "<", $buffer);
20
$buffer = str_replace(">", ">", $buffer);
29
//$buffer = str_replace("&", "&", $buffer);
30
//$buffer = str_replace("<", "<", $buffer);
31
//$buffer = str_replace(">", ">", $buffer);
21
32
$output .= $buffer;
23
34
if (!feof($handle)) {
24
35
$output .= "Error: unexpected fgets() fail\n";
29
43
if (isset($_SESSION['userType']) && $_POST['isSuperUser'] == true && $_SESSION['userType'] == 1) {
30
44
$query = "INSERT INTO Users (
82
100
<h1> Create a new user </h1>
84
<form action="./adduser.php" method="POST">
102
<form action="./adduser.php" method="POST"enctype="multipart/form-data">
85
103
<table border="0">
87
105
if(isset($_SESSION['userType']) && $_SESSION['userType'] == 1 ) {