bernd commited on 2009-10-01 03:32:52
Zeige 5 geänderte Dateien mit 70 Einfügungen und 0 Löschungen.
git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@1486 87cf0b9e-d624-0410-a070-f6ee81989793
| ... | ... |
@@ -125,4 +125,13 @@ function delete_jabber_account($id) |
| 125 | 125 |
logger(LOG_INFO, "modules/jabber/include/jabberaccounts", "jabber", "deleted account »{$id}«");
|
| 126 | 126 |
} |
| 127 | 127 |
|
| 128 |
+ |
|
| 129 |
+function new_jabber_domain($id) |
|
| 130 |
+{
|
|
| 131 |
+ $d = new Domain( (int) $id ); |
|
| 132 |
+ $d->ensure_customerdomain(); |
|
| 133 |
+ db_query("UPDATE kundendaten.domains SET jabber=2 WHERE jabber=0 AND id={$d->id} LIMIT 1");
|
|
| 134 |
+} |
|
| 135 |
+ |
|
| 136 |
+ |
|
| 128 | 137 |
?> |
| ... | ... |
@@ -0,0 +1,53 @@ |
| 1 |
+<?php |
|
| 2 |
+ |
|
| 3 |
+require_once('session/start.php');
|
|
| 4 |
+ |
|
| 5 |
+require_once('class/domain.php');
|
|
| 6 |
+require_once('jabberaccounts.php');
|
|
| 7 |
+ |
|
| 8 |
+require_role(ROLE_CUSTOMER); |
|
| 9 |
+ |
|
| 10 |
+$section = 'jabber_accounts'; |
|
| 11 |
+$title = "Domain für Jabber freischalten"; |
|
| 12 |
+output("<h3>Eigene Domain für Jabber-Nutzung freischalten</h3>");
|
|
| 13 |
+ |
|
| 14 |
+ |
|
| 15 |
+$domains = get_domain_list((int) $_SESSION['customerinfo']['customerno']); |
|
| 16 |
+DEBUG($domains); |
|
| 17 |
+ |
|
| 18 |
+if (! count($domains)) {
|
|
| 19 |
+ system_failure("Sie haben gar keine eigenen Domains.");
|
|
| 20 |
+} |
|
| 21 |
+ |
|
| 22 |
+$pending_domains = array(); |
|
| 23 |
+$available_domains = array(); |
|
| 24 |
+ |
|
| 25 |
+foreach ($domains AS $d) {
|
|
| 26 |
+ if ($d->jabber == 0) |
|
| 27 |
+ $available_domains[$d->id] = $d->domainname.'.'.$d->tld; |
|
| 28 |
+ if ($d->jabber == 2) |
|
| 29 |
+ $pending_domains[] = $d->fqdn; |
|
| 30 |
+} |
|
| 31 |
+ |
|
| 32 |
+ |
|
| 33 |
+$pending = ''; |
|
| 34 |
+if (count($pending_domains) > 0) {
|
|
| 35 |
+ $pending = '<h3>Wartend auf Freischaltung</h3> |
|
| 36 |
+<p>Folgende Domains sind bereits eingetragen und werden in der kommenden Nacht im Jabber-Server registriert:</p> |
|
| 37 |
+<ul>'; |
|
| 38 |
+ foreach($pending_domains AS $d) |
|
| 39 |
+ $pending .= '<li>'.$d.'</li>'; |
|
| 40 |
+ $pending .= '</ul>'; |
|
| 41 |
+} |
|
| 42 |
+ |
|
| 43 |
+ |
|
| 44 |
+output('<p>Sie können hier eine Ihrer eigenen Domains für Jabber-Nutzung freischalten. Da dafür ein Neustart des Jabber-Servers nötig ist, können Sie die Domain erst ab dem darauffolgenden Tag für eigene Jabber-Accounts nutzen.</p>
|
|
| 45 |
+ |
|
| 46 |
+'.html_form('jabber_new_domain', 'save', 'action=newdomain', '
|
|
| 47 |
+<p>Domain wählen: '.html_select('domain', $available_domains).'</p>
|
|
| 48 |
+<input type="submit" name="submit" value="Freischalten" /> |
|
| 49 |
+ |
|
| 50 |
+').$pending); |
|
| 51 |
+ |
|
| 52 |
+ |
|
| 53 |
+?> |
| ... | ... |
@@ -71,6 +71,12 @@ elseif ($_GET['action'] == 'delete') |
| 71 | 71 |
} |
| 72 | 72 |
|
| 73 | 73 |
} |
| 74 |
+elseif ($_GET['action'] == 'newdomain') |
|
| 75 |
+{
|
|
| 76 |
+ check_form_token('jabber_new_domain');
|
|
| 77 |
+ new_jabber_domain( $_REQUEST['domain'] ); |
|
| 78 |
+ header("Location: accounts");
|
|
| 79 |
+} |
|
| 74 | 80 |
else |
| 75 | 81 |
system_failure("Unimplemented action");
|
| 76 | 82 |
|
| 77 | 83 |