-
Notifications
You must be signed in to change notification settings - Fork 3
/
adminalias.php
122 lines (120 loc) · 5.16 KB
/
adminalias.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<?php
include_once dirname(__FILE__) . '/config/variables.php';
include_once dirname(__FILE__) . '/config/authpostmaster.php';
include_once dirname(__FILE__) . '/config/functions.php';
include_once dirname(__FILE__) . '/config/httpheaders.php';
?>
<!DOCTYPE HTML>
<html lang="en">
<head>
<title><?php echo _('Exim4U') . ': ' . _('Manage Users'); ?></title>
<meta charset="utf-8" />
<link rel="stylesheet" href="css/bootstrap.min.css" />
<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/scripts.js"></script>
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<?php include dirname(__FILE__) . '/config/header.php'; ?>
<div class="navbar">
<div class="navbar-inner">
<ul id="menu" class="nav">
<li><a href="adminaliasadd.php"><?php echo _('Add Alias'); ?></a></li>
<?php $query = "SELECT user_id,realname,smtp FROM users
WHERE domain_id='{$_SESSION['domain_id']}' AND type='catch'";
$result = $db->query($query);
if (!$result->numRows()) {
print '<li><a href="admincatchalladd.php">'
. _('Add Catchall')
. '</a></li>';
}
?>
<li><a href="admin.php"><?php echo _('Main Menu'); ?></a></li>
<li><a href="logout.php"><?php echo _('Logout'); ?></a></li>
</ul>
</div>
</div>
<table>
<tr>
<th></th>
<th><?php echo _('Alias'); ?></th>
<th><?php echo _('Target address'); ?></th>
<th><?php echo _('Forwards to..'); ?></th>
<th><?php echo _('Admin'); ?></th>
</tr>
<?php
if ($result->numRows()) {
$row = $result->fetchRow();
print '<tr><td>'
. '<a href="adminaliasdelete.php?user_id='
. $row['user_id']
. '&localpart='
. $row['localpart']
. '">'
. '<img class="trash" src="images/trashcan.gif" title="'
. _("Delete alias ")
. $row['localpart']
. '"></a></td>';
print '<td>'
. '<a href="admincatchall.php?user_id='
. $row['user_id']
. '">'
. $row['realname']
. '</a></td>';
print '<td>*</td>';
print '<td>' . $row['smtp'] . '</td>';
print '<td class="check">';
print '</tr>';
}
$query = "SELECT user_id,localpart,smtp,realname,type,admin
FROM users
WHERE domain_id='{$_SESSION['domain_id']}' AND type='alias'
ORDER BY localpart;";
$result = $db->query($query);
if ($result->numRows()) {
while ($row = $result->fetchRow()) {
print '<tr><td>'
. '<a href="adminaliasdelete.php?user_id='
. $row['user_id']
. '&localpart='
. $row['localpart']
. '"><img class="trash"src="images/trashcan.gif" title="'
. _('Delete alias ')
. $row['localpart']
. '"></a></td>';
print '<td>';
print '<a href="adminaliaschange.php?user_id='
. $row['user_id']
. '">'
. $row['realname']
. '</a></td>';
print '<td>' . $row['localpart'] . '</td>';
print '<td>' . $row['smtp'] . '</td>';
print '<td class="check">';
if ($row['admin'] == "1") {
print '<img class="check" src="images/check.gif" title="'
. $row['realname'] . _(' is an administrator')
. '">';
}
print '</tr>';
}
}
?>
<tr>
<td colspan="5">
<b><?php echo _('Note'); ?>:</b>
<?php
echo _('You can only have one catchall per domain.')
. '<br />'
. _('It will catch and forward all email that does not get delivered to a specific mailbox.');
?>
</td>
</tr>
</table>
</div>
</body>
</html>