bernd commited on 2009-02-27 11:35:16
Zeige 3 geänderte Dateien mit 14 Einfügungen und 8 Löschungen.
git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@1272 87cf0b9e-d624-0410-a070-f6ee81989793
... | ... |
@@ -7,6 +7,8 @@ require_once('mailaccounts.php'); |
7 | 7 |
|
8 | 8 |
require_role(ROLE_SYSTEMUSER); |
9 | 9 |
|
10 |
+global $config; |
|
11 |
+ |
|
10 | 12 |
$user = $_SESSION['userinfo']; |
11 | 13 |
|
12 | 14 |
$title = "E-Mail-Accounts"; |
... | ... |
@@ -84,7 +86,7 @@ elseif (isset($_GET['action']) && $_GET['action'] == 'create') |
84 | 86 |
<tr> |
85 | 87 |
<td>Benutzername:</td> |
86 | 88 |
<td><input type="text" id="user" name="user" />@<select name="domain" size="1"> |
87 |
- <option value="schokokeks.org">schokokeks.org</option> |
|
89 |
+ <option value="'.$config['masterdomain'].'">'.$config['masterdomain'].'</option> |
|
88 | 90 |
'.$options.' |
89 | 91 |
</select></td> |
90 | 92 |
</tr> |
... | ... |
@@ -155,7 +157,7 @@ elseif (isset($_GET['edit'])) |
155 | 157 |
<tr><th>Einstellung:</th><th>alter Wert:</th><th>neuer Wert:</th><th> </th></tr> |
156 | 158 |
<tr><td>Benutzername:</td><td><input type="text" id="old_account" name="old_account" value="'.$account['account'].'" readonly="readonly" style="background-color: #C0C0C0;" /></td> |
157 | 159 |
<td><input type="text" id="user" name="user" value="'.$username.'" />@<select name="domain" id="domain" size="1"> |
158 |
- <option value="schokokeks.org">schokokeks.org</option> |
|
160 |
+ <option value="'.$config['masterdomain'].'">'.$config['masterdomain'].'</option> |
|
159 | 161 |
'; |
160 | 162 |
$domains = get_domain_list($user['customerno'], $user['uid']); |
161 | 163 |
if (count($domains) > 0) |
... | ... |
@@ -11,8 +11,9 @@ require_once('common.php'); |
11 | 11 |
|
12 | 12 |
function mailaccounts($uid) |
13 | 13 |
{ |
14 |
+ global $config; |
|
14 | 15 |
$uid = (int) $uid; |
15 |
- $result = db_query("SELECT m.id,concat_ws('@',`m`.`local`,if(isnull(`m`.`domain`),_utf8'schokokeks.org',`d`.`domainname`)) AS `account`, `m`.`password` AS `cryptpass`,`m`.`maildir` AS `maildir`,aktiv from (`mail`.`mailaccounts` `m` left join `mail`.`v_domains` `d` on((`d`.`id` = `m`.`domain`))) WHERE m.uid=$uid"); |
|
16 |
+ $result = db_query("SELECT m.id,concat_ws('@',`m`.`local`,if(isnull(`m`.`domain`),'{$config['masterdomain']}',`d`.`domainname`)) AS `account`, `m`.`password` AS `cryptpass`,`m`.`maildir` AS `maildir`,aktiv from (`mail`.`mailaccounts` `m` left join `mail`.`v_domains` `d` on((`d`.`id` = `m`.`domain`))) WHERE m.uid=$uid"); |
|
16 | 17 |
DEBUG("Found ".@mysql_num_rows($result)." rows!"); |
17 | 18 |
$accounts = array(); |
18 | 19 |
if (@mysql_num_rows($result) > 0) |
... | ... |
@@ -23,8 +24,9 @@ function mailaccounts($uid) |
23 | 24 |
|
24 | 25 |
function get_mailaccount($id) |
25 | 26 |
{ |
27 |
+ global $config; |
|
26 | 28 |
$uid = (int) $uid; |
27 |
- $result = db_query("SELECT concat_ws('@',`m`.`local`,if(isnull(`m`.`domain`),_utf8'schokokeks.org',`d`.`domainname`)) AS `account`, `m`.`password` AS `cryptpass`,`m`.`maildir` AS `maildir`,aktiv from (`mail`.`mailaccounts` `m` left join `mail`.`v_domains` `d` on((`d`.`id` = `m`.`domain`))) WHERE m.id=$id"); |
|
29 |
+ $result = db_query("SELECT concat_ws('@',`m`.`local`,if(isnull(`m`.`domain`),'{$config['masterdomain']}',`d`.`domainname`)) AS `account`, `m`.`password` AS `cryptpass`,`m`.`maildir` AS `maildir`,aktiv from (`mail`.`mailaccounts` `m` left join `mail`.`v_domains` `d` on((`d`.`id` = `m`.`domain`))) WHERE m.id=$id"); |
|
28 | 30 |
DEBUG("Found ".mysql_num_rows($result)." rows!"); |
29 | 31 |
$acc = mysql_fetch_object($result); |
30 | 32 |
$ret = array('account' => $acc->account, 'mailbox' => $acc->maildir, 'enabled' => ($acc->aktiv == 1)); |
... | ... |
@@ -134,6 +136,7 @@ function delete_mailaccount($id) |
134 | 136 |
|
135 | 137 |
function check_valid($acc) |
136 | 138 |
{ |
139 |
+ global $config; |
|
137 | 140 |
$user = $_SESSION['userinfo']; |
138 | 141 |
DEBUG("Account-data: ".print_r($acc, true)); |
139 | 142 |
DEBUG("User-data: ".print_r($user, true)); |
... | ... |
@@ -148,7 +151,7 @@ function check_valid($acc) |
148 | 151 |
if ($acc['account'] == '' || strpos($acc['account'], '@') == 0) |
149 | 152 |
return "Es wurde kein Benutzername angegeben!"; |
150 | 153 |
if (strpos($acc['account'], '@') === false) |
151 |
- return "Es wurde kein Domain-Teil im Account-Name angegeben. Account-Namen müssen einen Domain-Teil enthalten. Im Zweifel versuchen Sie »@schokokeks.org«."; |
|
154 |
+ return "Es wurde kein Domain-Teil im Account-Name angegeben. Account-Namen müssen einen Domain-Teil enthalten. Im Zweifel versuchen Sie »@{$config['masterdomain']}«."; |
|
152 | 155 |
|
153 | 156 |
list($local, $domain) = explode('@', $acc['account'], 2); |
154 | 157 |
verify_input_username($local); |
... | ... |
@@ -159,11 +162,11 @@ function check_valid($acc) |
159 | 162 |
|
160 | 163 |
if (array_search($domain, $domains) === false) |
161 | 164 |
{ |
162 |
- if ($domain == "schokokeks.org") |
|
165 |
+ if ($domain == $config['masterdomain']) |
|
163 | 166 |
{ |
164 | 167 |
if (substr($local, 0, strlen($user['username'])) != $user['username'] || ($acc['account'][strlen($user['username'])] != '-' && $acc['account'][strlen($user['username'])] != '@')) |
165 | 168 |
{ |
166 |
- return "Sie haben »@schokokeks.org« als Domain-Teil angegeben, aber der Benutzer-Teil beginnt nicht mit Ihrem Benutzername!"; |
|
169 |
+ return "Sie haben »@{$config['masterdomain']}« als Domain-Teil angegeben, aber der Benutzer-Teil beginnt nicht mit Ihrem Benutzername!"; |
|
167 | 170 |
} |
168 | 171 |
} |
169 | 172 |
else |
... | ... |
@@ -119,6 +119,7 @@ function domainselect($selected = NULL, $selectattribute = '') |
119 | 119 |
|
120 | 120 |
function save_vmail_account($account) |
121 | 121 |
{ |
122 |
+ global $config; |
|
122 | 123 |
$uid = (int) $_SESSION['userinfo']['uid']; |
123 | 124 |
$id = $account['id']; |
124 | 125 |
if ($id != NULL) |
... | ... |
@@ -240,7 +241,7 @@ function save_vmail_account($account) |
240 | 241 |
if ($account['password'] != 'NULL') |
241 | 242 |
{ |
242 | 243 |
# notify the vmail subsystem of this new account |
243 |
- mail('vmail@schokokeks.org', 'command', "user={$account['local']}\nhost={$domainname}", "X-schokokeks-org-message: command"); |
|
244 |
+ mail('vmail@'.$config['vmail_server'], 'command', "user={$account['local']}\nhost={$domainname}", "X-schokokeks-org-message: command"); |
|
244 | 245 |
} |
245 | 246 |
} |
246 | 247 |
|
247 | 248 |