root/EMS/newrealm.php

Revision 2, 1.6 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     $realm = trim($_REQUEST['realm']);
11     $secret = trim($_REQUEST['secret']);
12     $ipranges = trim(str_replace("\n", '|', $_REQUEST['ipranges']));
13
14     if($_POST['process'])
15     {
16         $fp = @fsockopen($hostname, $hostport);
17         if(!$fp)
18             die("Please contact your system administrator as the server has gone missing.");
19         fputs($fp, "addrealm|$realm|$secret|$ipranges\n");
20         fclose($fp);
21         header("location: realms.php");
22         exit;
23     }
24
25     $ipranges = trim(str_replace('|', "\n", $_REQUEST['ipranges']));
26
27     include_once("header.php");
28 ?>
29 <div class="bodytext" style="padding:12px;" align="justify">
30     <p>Please enter the realm, shared secret and valid IP ranges below.</p>
31     <form method="post" action="<?=$_SERVER['REQUEST_URI']?>">
32         <label for="realm" style="width:75px;float:left;clear:left;">Realm:</label> <input type="text" name="realm" value="<?=$realm?>"><br />
33         <label for="secret" style="width:75px;float:left;clear:left;">Secret:</label> <input type="text" name="secret" value="<?=$secret?>"><br />
34         <label for="IP Ranges" style="width:75px;float:left;clear:left;">IP Ranges:</label> <textarea name="ipranges" style="width:170px;height:200px;"><?=$ipranges?></textarea><br />
35         <label for="process" style="width:75px;float:left;clear:left;">&nbsp;</label> <input type="submit" value="Add"><br />
36         <input type="hidden" name="process" value="1">
37         <p>Please enter 1 valid CIDR range per line, eg 127.0.0.0/8 or 192.168.1.1/32</p>
38     </form>
39 </div>
40 <? include_once("footer.php"); ?>
41
Note: See TracBrowser for help on using the browser.