root/EMS/newuser.php

Revision 2, 1.2 kB (checked in by evilbunny, 2 years ago)

Initial import

Line 
1 <?
2     require_once("common.php");
3
4     if($_SESSION['_config']['access'] < 90)
5     {
6         header("location: login.php");
7         exit;
8     }
9
10     if($_POST['process'])
11     {
12         $fp = @fsockopen($hostname, $hostport);
13         if(!$fp)
14             die("Please contact your system administrator as the server has gone missing.");
15         $username = trim($_POST['username']);
16         $secret = trim($_POST['secret']);
17         fputs($fp, "adduser|$username|$secret\n");
18         fclose($fp);
19         header("location: users.php");
20         exit;
21     }
22
23     include_once("header.php");
24 ?>
25 <div class="bodytext" style="padding:12px;" align="justify">
26     <p>Please enter the username and shared secret below for a new user account.</p>
27     <form method="post" action="<?=$_SERVER['REQUEST_URI']?>">
28         <label for="username" style="width:75px;float:left;clear:left;">Username:</label> <input type="text" name="username" value="<?=$_POST['username']?>"><br />
29         <label for="secret" style="width:75px;float:left;clear:left;">Secret:</label> <input type="text" name="secret" value="<?=$_POST['secret']?>"><br />
30         <label for="process" style="width:75px;float:left;clear:left;">&nbsp;</label> <input type="submit" value="Add"><br />
31         <input type="hidden" name="process" value="1">
32     </form>
33 </div>
34 <? include_once("footer.php"); ?>
35
Note: See TracBrowser for help on using the browser.