1<?php
2  include_once dirname(__FILE__) . '/config/variables.php';
3  include_once dirname(__FILE__) . '/config/authpostmaster.php';
4  include_once dirname(__FILE__) . '/config/functions.php';
5  include_once dirname(__FILE__) . '/config/httpheaders.php';
6?>
7<!DOCTYPE html>
8<html>
9  <head>
10    <title><?php echo _('Virtual Exim') . ': ' . _('Manage Users'); ?></title>
11    <link rel="stylesheet" href="style.css" type="text/css">
12  </head>
13  <body>
14    <?php include dirname(__FILE__) . '/config/header.php'; ?>
15    <div id="Menu">
16      <a href="adminaliasadd.php"><?php echo _('Add Alias'); ?></a></br>
17      <?php $query = "SELECT user_id,realname,smtp,localpart FROM users
18        WHERE domain_id=:domain_id AND type='catch'";
19        $sth = $dbh->prepare($query);
20        $sth->execute(array(':domain_id'=>$_SESSION['domain_id']));
21        if (!$sth->rowCount()) {
22          print '<a href="admincatchalladd.php">'
23            . _('Add Catchall')
24            . '</a></br>';
25        }
26      ?>
27      <a href="admin.php"><?php echo _('Main Menu'); ?></a><br>
28      <br><a href="logout.php"><?php echo _('Logout'); ?></a><br>
29    </div>
30    <div id="Content">
31    <table align="center">
32      <tr>
33        <th>&nbsp;</th>
34        <th><?php echo _('Alias'); ?></th>
35        <th><?php echo _('Target address'); ?></th>
36        <th><?php echo _('Forwards to..'); ?></th>
37        <th><?php echo _('Admin'); ?></th>
38      </tr>
39      <?php
40        if ($sth->rowCount()) {
41          $row = $sth->fetch();
42          print '<tr><td align="center">'
43            . '<a href="adminaliasdelete.php?user_id='
44            . $row['user_id']
45            . '&amp;localpart='
46            . $row['localpart']
47            . '">'
48            . '<img class="trash" src="images/trashcan.gif" title="'
49            . _("Delete alias ")
50            . $row['localpart']
51            . '"></a></td>';
52          print '<td>'
53            . '<a href="admincatchall.php?user_id='
54            . $row['user_id']
55            . '">'
56            . $row['realname']
57            . '</a></td>';
58          print '<td>*</td>';
59          print '<td>' . $row['smtp'] . '</td>';
60          print '<td class="check">';
61          print '</tr>';
62        }
63        $query = "SELECT user_id,localpart,smtp,realname,type,admin,enabled
64          FROM users
65          WHERE domain_id=:domain_id AND type='alias'
66		  ORDER BY localpart;";
67        $sth = $dbh->prepare($query);
68        $sth->execute(array(':domain_id'=>$_SESSION['domain_id']));
69        if ($sth->rowCount()) {
70          while ($row = $sth->fetch()) {
71            if($row['enabled']==="0") print '<tr class="disabled">'; else print '<tr>';
72            print '<td align="center">'
73              . '<a href="adminaliasdelete.php?user_id='
74              . $row['user_id']
75              . '&amp;localpart='
76              . $row['localpart']
77              . '"><img class="trash" src="images/trashcan.gif" title="'
78              . _('Delete alias ')
79              . $row['localpart']
80              .  '"></a></td>';
81            print '<td>';
82            print '<a href="adminaliaschange.php?user_id='
83              . $row['user_id']
84              . '">'
85              . $row['realname']
86              . '</a></td>';
87            print '<td>' . $row['localpart'] . '</td>';
88            print '<td>' . $row['smtp'] . '</td>';
89            print '<td class="check">';
90            if ($row['admin'] == "1") {
91            print '<img class="check" src="images/check.gif" title="'
92              . $row['realname'] . _(' is an administrator')
93              . '">';
94            }
95            print '</tr>';
96          }
97        }
98      ?>
99      <tr>
100        <td colspan="4" class="padbefore">
101          <b><?php echo _('Note'); ?>:</b>
102          <?php
103            echo _('You can only have one catchall per domain.')
104            . '<br />'
105            . _('It will catch and forward all email that does not get delivered to a specific mailbox.');
106          ?>
107        </td>
108      </tr>
109    </table>
110    </div>
111  </body>
112</html>
113
114<!-- Layout and CSS tricks obtained from http://www.bluerobot.com/web/layouts/ -->
115