bernd commited on 2009-06-06 13:28:53
Zeige 2 geänderte Dateien mit 33 Einfügungen und 5 Löschungen.
git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@1392 87cf0b9e-d624-0410-a070-f6ee81989793
| ... | ... |
@@ -187,8 +187,12 @@ elseif (isset($_GET['edit'])) |
| 187 | 187 |
} |
| 188 | 188 |
else |
| 189 | 189 |
{
|
| 190 |
- output('<h3>IMAP-Accounts</h3>
|
|
| 191 |
-<p>Folgende POP3/IMAP-Konten sind eingerichtet:</p> |
|
| 190 |
+ output('<h3>IMAP-Accounts</h3>');
|
|
| 191 |
+ if (user_has_only_vmail_domains()) |
|
| 192 |
+ {
|
|
| 193 |
+ output('<div class="error"><strong>Achtung:</strong> Alle Ihre Domains sind auf Webinterface-Verwaltung konfiguriert. Sie können dennoch manuelle IMAP-Konten für Ihre speziellen Konfigurationen anlegen, in der Regel sollten Sie aber hier keine IMAP-Acccounts anlegen. Dies kann zu Fehlfunktionen führen.</div>');
|
|
| 194 |
+ } |
|
| 195 |
+ output('<p>Folgende POP3/IMAP-Konten sind eingerichtet:</p>
|
|
| 192 | 196 |
<table style="margin-bottom: 1em;"> |
| 193 | 197 |
<tr><th>Kontoname:</th><th>Mailbox-Pfad:</th><th>aktiv</th><th> </th></tr> |
| 194 | 198 |
'); |
| ... | ... |
@@ -204,9 +208,12 @@ else |
| 204 | 208 |
<td><b>'.($account['enabled'] ? 'Ja' : 'Nein').'</b></td> |
| 205 | 209 |
<td>'.internal_link("imap", "löschen", "action=delete&account=".$account['id']).'</td></tr>');
|
| 206 | 210 |
} |
| 207 |
- output('</table>
|
|
| 208 |
-<p>'.internal_link("imap", "Neuen Account anlegen", "action=create").'</p>
|
|
| 209 |
- |
|
| 211 |
+ output('</table>');
|
|
| 212 |
+ if (imap_on_vmail_domain()) |
|
| 213 |
+ {
|
|
| 214 |
+ output('<div class="error"><strong>Achtung:</strong> Es scheint als hätten Sie einen (manuellen) IMAP-Account mittels einer Domain angelegt, die für Webinterface-Verwaltung konfiguriert ist. Sollten Sie nicht genau wissen was Sie tun, ist das vermutlich falsch und wird zu Fehlfuntkionen führen.</div>');
|
|
| 215 |
+ } |
|
| 216 |
+ output('<p>'.internal_link("imap", "Neuen Account anlegen", "action=create").'</p>
|
|
| 210 | 217 |
'); |
| 211 | 218 |
} |
| 212 | 219 |
|
| ... | ... |
@@ -26,6 +26,8 @@ function get_mailaccount($id) |
| 26 | 26 |
$uid = (int) $uid; |
| 27 | 27 |
$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 | 28 |
DEBUG("Found ".mysql_num_rows($result)." rows!");
|
| 29 |
+ if (mysql_num_rows($result) != 1) |
|
| 30 |
+ system_failure('Dieser Mailaccount existiert nicht oder gehört Ihnen nicht');
|
|
| 29 | 31 |
$acc = mysql_fetch_object($result); |
| 30 | 32 |
$ret = array('account' => $acc->account, 'mailbox' => $acc->maildir, 'enabled' => ($acc->aktiv == 1));
|
| 31 | 33 |
DEBUG(print_r($ret, true)); |
| ... | ... |
@@ -174,5 +176,24 @@ function check_valid($acc) |
| 174 | 176 |
} |
| 175 | 177 |
|
| 176 | 178 |
|
| 179 |
+function imap_on_vmail_domain() |
|
| 180 |
+{
|
|
| 181 |
+ $uid = (int) $_SESSION['userinfo']['uid']; |
|
| 182 |
+ $result = db_query("SELECT m.id FROM mail.mailaccounts AS m INNER JOIN mail.virtual_mail_domains AS vd USING (domain) WHERE m.uid={$uid}");
|
|
| 183 |
+ if (mysql_num_rows($result) > 0) |
|
| 184 |
+ return true; |
|
| 185 |
+ return false; |
|
| 186 |
+} |
|
| 187 |
+ |
|
| 188 |
+function user_has_only_vmail_domains() |
|
| 189 |
+{
|
|
| 190 |
+ $uid = (int) $_SESSION['userinfo']['uid']; |
|
| 191 |
+ $result = db_query("SELECT d.id FROM mail.v_domains AS d LEFT JOIN mail.v_vmail_domains AS vd USING (domainname) WHERE vd.id IS NULL AND d.user={$uid}");
|
|
| 192 |
+ if (mysql_num_rows($result) == 0) |
|
| 193 |
+ return true; |
|
| 194 |
+ return false; |
|
| 195 |
+} |
|
| 196 |
+ |
|
| 197 |
+ |
|
| 177 | 198 |
|
| 178 | 199 |
?> |
| 179 | 200 |