bernd commited on 2007-11-20 10:54:27
Zeige 3 geänderte Dateien mit 40 Einfügungen und 1 Löschungen.
git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@792 87cf0b9e-d624-0410-a070-f6ee81989793
| ... | ... |
@@ -20,7 +20,7 @@ output('<h3>E-Mail-Accounts</h3>
|
| 20 | 20 |
output('<tr>
|
| 21 | 21 |
<td>'.internal_link('edit.php', $account['local'].'@'.$account['domain'], 'id='.$account['id']).'</td>
|
| 22 | 22 |
<td>'.$action.'</td> |
| 23 |
- <td><a href="delete.php?account='.$account['id'].'">löschen</a></td></tr>'); |
|
| 23 |
+ <td><a href="save.php?action=delete&id='.$account['id'].'">löschen</a></td></tr>'); |
|
| 24 | 24 |
} |
| 25 | 25 |
output('</table>
|
| 26 | 26 |
<p><a href="edit.php">Neuen Account anlegen</a></p> |
| ... | ... |
@@ -39,6 +39,39 @@ if ($_GET['action'] == 'edit') |
| 39 | 39 |
|
| 40 | 40 |
if (! ($debugmode || we_have_an_error())) |
| 41 | 41 |
header('Location: accounts.php');
|
| 42 |
+} |
|
| 43 |
+elseif ($_GET['action'] == 'delete') |
|
| 44 |
+{
|
|
| 45 |
+ $title = "E-mail-Adresse löschen"; |
|
| 46 |
+ $section = 'vmail_vmail'; |
|
| 47 |
+ |
|
| 48 |
+ $account = get_account_details( (int) $_GET['id'] ); |
|
| 49 |
+ |
|
| 50 |
+ $domain = NULL; |
|
| 51 |
+ $domains = get_vmail_domains(); |
|
| 52 |
+ foreach ($domains as $dom) |
|
| 53 |
+ if ($dom->id == $account['domain']) |
|
| 54 |
+ {
|
|
| 55 |
+ $domain = $dom->domainname; |
|
| 56 |
+ break; |
|
| 57 |
+ } |
|
| 58 |
+ $account_string = $account['local'] . "@" . $domain; |
|
| 59 |
+ $sure = user_is_sure(); |
|
| 60 |
+ if ($sure === NULL) |
|
| 61 |
+ {
|
|
| 62 |
+ are_you_sure("action=delete&id={$account['id']}", "Möchten Sie die E-Mail-Adresse »{$account_string}« wirklich löschen?");
|
|
| 63 |
+ } |
|
| 64 |
+ elseif ($sure === true) |
|
| 65 |
+ {
|
|
| 66 |
+ delete_account($account['id']); |
|
| 67 |
+ if (! $debugmode) |
|
| 68 |
+ header("Location: accounts.php");
|
|
| 69 |
+ } |
|
| 70 |
+ elseif ($sure === false) |
|
| 71 |
+ {
|
|
| 72 |
+ if (! $debugmode) |
|
| 73 |
+ header("Location: accounts.php");
|
|
| 74 |
+ } |
|
| 42 | 75 |
|
| 43 | 76 |
} |
| 44 | 77 |
else |
| 45 | 78 |