root/EMS/aliases.php

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

Initial import

Line 
1 <?
2     require_once("common.php");
3
4     if($_SESSION['_config']['access'] <= 0)
5     {
6         header("location: login.php");
7         exit;
8     } else if($_SESSION['_config']['access'] < 90) {
9         $user = $_SESSION['_config']['username'];
10         $extrauri1 = '';
11         $extrauri2 = '?';
12     } else {
13         $user = trim($_GET['user']);
14         $extrauri1 = '?user='.$user;
15         $extrauri2 = '?user='.$user.'&';
16     }
17
18     include_once("header.php");
19 ?>
20 <p><a href="newalias.php<?=$extrauri1?>">New Alias</a></p>
21 <table border="0" width="80%" cols="5">
22 <tr><th>Alias</th><th>Delete</th></tr>
23 <?
24     $fp = @fsockopen($hostname, $hostport);
25     if($fp)
26     {
27         fputs($fp, "getalias|$user\n");
28         while(!feof($fp))
29         {
30             $line = trim(fgets($fp, 4096));
31             if($line == "")
32                 continue;
33             list($username, $alias) = explode('|', $line);
34             echo "<tr><td>$alias</td><td><a href='delalias.php${extrauri2}alias=$alias'>Delete</a></td>\n";
35         }
36         fclose($fp);
37     } else {
38         echo "<tr><td colspan='2'>Please contact your system administrator as the server has gone missing.</td></tr>";
39     }
40 ?>
41 </table>
42 <? include_once("footer.php"); ?>
43
Note: See TracBrowser for help on using the browser.