bernd commited on 2007-06-02 09:51:00
Zeige 2 geänderte Dateien mit 40 Einfügungen und 0 Löschungen.
git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@484 87cf0b9e-d624-0410-a070-f6ee81989793
| ... | ... |
@@ -0,0 +1,31 @@ |
| 1 |
+<?php |
|
| 2 |
+ |
|
| 3 |
+require_once('session/start.php');
|
|
| 4 |
+ |
|
| 5 |
+require_once('domains.php');
|
|
| 6 |
+require_once('jabberaccounts.php');
|
|
| 7 |
+ |
|
| 8 |
+require_role(ROLE_CUSTOMER); |
|
| 9 |
+ |
|
| 10 |
+$title = "Neues Jabber-Konto erstellen"; |
|
| 11 |
+ |
|
| 12 |
+DEBUG("GET: ".htmlentities(print_r($_GET, true))." / POST: ".htmlentities(print_r($_POST, true)));
|
|
| 13 |
+ |
|
| 14 |
+$account = get_jabberaccount_details($_GET['account']); |
|
| 15 |
+$account_string = $account['local'].'@'.$account['domain']; |
|
| 16 |
+ |
|
| 17 |
+output("<h3>Passwort für Jabber-Account ändern</h3>");
|
|
| 18 |
+ |
|
| 19 |
+output(html_form('jabber_chpass', 'save.php', 'action=chpass', '
|
|
| 20 |
+<table> |
|
| 21 |
+<tr><td>Account-Name:</td><td>'.$account_string.'</td></tr> |
|
| 22 |
+<tr><td>Passwort:</td><td><input type="password" name="newpass" value="" /></td></tr> |
|
| 23 |
+<tr><td>Wiederholung:</td><td><input type="password" name="newpass2" value="" /></td></tr> |
|
| 24 |
+</table> |
|
| 25 |
+<br /> |
|
| 26 |
+<input type="hidden" name="accountid" value="'.$account['id'].'" /> |
|
| 27 |
+<input type="submit" name="submit" value="Speichern" /> |
|
| 28 |
+')); |
|
| 29 |
+ |
|
| 30 |
+ |
|
| 31 |
+?> |
| ... | ... |
@@ -59,8 +59,17 @@ function create_jabber_account($local, $domain, $password) |
| 59 | 59 |
} |
| 60 | 60 |
} |
| 61 | 61 |
|
| 62 |
+ $domainquery = "domain={$domain}";
|
|
| 62 | 63 |
if ($domain == 0) |
| 63 | 64 |
$domain = 'NULL'; |
| 65 |
+ $domainquery = 'domain IS NULL'; |
|
| 66 |
+ $query = "SELECT id FROM jabber.accounts WHERE local='{$local}' AND {$domainquery}";
|
|
| 67 |
+ DEBUG($query); |
|
| 68 |
+ $result = mysql_query($query); |
|
| 69 |
+ if (mysql_num_rows($result) > 0) |
|
| 70 |
+ {
|
|
| 71 |
+ system_failure("Diesen Account gibt es bereits!");
|
|
| 72 |
+ } |
|
| 64 | 73 |
|
| 65 | 74 |
$query = "INSERT INTO jabber.accounts (customerno,local,domain,password) VALUES ({$customerno}, '{$local}', {$domain}, '{$password}');";
|
| 66 | 75 |
DEBUG($query); |
| 67 | 76 |