Bernd Wurst commited on 2018-02-20 11:35:38
Zeige 4 geänderte Dateien mit 50 Einfügungen und 21 Löschungen.
| ... | ... |
@@ -28,11 +28,6 @@ if ($_SESSION['role'] & ROLE_CUSTOMER) |
| 28 | 28 |
else |
| 29 | 29 |
$user_domains = get_domain_list($_SESSION['userinfo']['customerno'], $_SESSION['userinfo']['uid']); |
| 30 | 30 |
|
| 31 |
-$useraccounts = array(); |
|
| 32 |
-if ($_SESSION['role'] & ROLE_CUSTOMER) {
|
|
| 33 |
- $useraccounts = list_useraccounts(); |
|
| 34 |
-} |
|
| 35 |
- |
|
| 36 | 31 |
title("Domains");
|
| 37 | 32 |
|
| 38 | 33 |
output('<p>In Ihrem Account werden die folgenden Domains verwaltet:</p>');
|
| ... | ... |
@@ -98,21 +93,7 @@ foreach ($user_domains as $domain) |
| 98 | 93 |
} elseif ($_SESSION['role'] & ROLE_CUSTOMER && $domain->mailserver_lock == 1) {
|
| 99 | 94 |
$domainname = internal_link('verify', $domainname, 'id='.$domain->id);
|
| 100 | 95 |
} |
| 101 |
- $domainuser = ''; |
|
| 102 |
- if ($_SESSION['role'] & ROLE_CUSTOMER && count($useraccounts) > 1) {
|
|
| 103 |
- // Mehrere User vorhanden |
|
| 104 |
- $username = ''; |
|
| 105 |
- foreach ($useraccounts as $u) {
|
|
| 106 |
- if ($u['uid'] == $domain->useraccount) {
|
|
| 107 |
- $username = $u['username']; |
|
| 108 |
- } |
|
| 109 |
- } |
|
| 110 |
- if (!$username) {
|
|
| 111 |
- $username = '<em>unbekannt</em>'; |
|
| 112 |
- } |
|
| 113 |
- $domainuser = '<p class="domain-user">Verfügbar für Benutzer <strong>'.$username.'</strong> '.internal_link('chguser', icon_edit().' Ändern', "id={$domain->id}").'</p>';
|
|
| 114 |
- } |
|
| 115 |
- output(" <div class=\"domain-item {$status} {$locked}\"><p class=\"domainname\">{$domainname}</p><p class=\"regdate\">{$regdate}</p>".$domainuser."<p class=\"domain-usage\">Verwendung: {$features}{$mailserver_lock}</p></div>\n");
|
|
| 96 |
+ output(" <div class=\"domain-item {$status} {$locked}\"><p class=\"domainname\">{$domainname}</p><p class=\"regdate\">{$regdate}</p><p class=\"domain-usage\">Verwendung: {$features}{$mailserver_lock}</p></div>\n");
|
|
| 116 | 97 |
} |
| 117 | 98 |
output('</div>');
|
| 118 | 99 |
output("<br />");
|
| ... | ... |
@@ -212,6 +212,24 @@ function list_useraccounts() |
| 212 | 212 |
} |
| 213 | 213 |
|
| 214 | 214 |
|
| 215 |
+function change_user($domain, $uid) |
|
| 216 |
+{
|
|
| 217 |
+ $domain = new Domain($domain); |
|
| 218 |
+ $domain->ensure_customerdomain(); |
|
| 219 |
+ $targetuser = NULL; |
|
| 220 |
+ $useraccounts = list_useraccounts(); |
|
| 221 |
+ foreach ($useraccounts as $u) {
|
|
| 222 |
+ if ($u['uid'] == $uid) {
|
|
| 223 |
+ $targetuser = $u['uid']; |
|
| 224 |
+ break; |
|
| 225 |
+ } |
|
| 226 |
+ } |
|
| 227 |
+ if (! $targetuser) {
|
|
| 228 |
+ system_failure("Ungültiger Useraccount!");
|
|
| 229 |
+ } |
|
| 230 |
+ db_query("UPDATE kundendaten.domains SET useraccount=? WHERE id=?", array($targetuser, $domain->id));
|
|
| 231 |
+} |
|
| 232 |
+ |
|
| 215 | 233 |
|
| 216 | 234 |
function get_domain_offer($domainname) |
| 217 | 235 |
{
|
| ... | ... |
@@ -62,6 +62,24 @@ if (isset($_GET['admin_c']) && $_GET['admin_c'] == 'none') {
|
| 62 | 62 |
|
| 63 | 63 |
title("Änderung der Domain {$dom->fqdn}");
|
| 64 | 64 |
$section = 'domains_domains'; |
| 65 |
+ |
|
| 66 |
+$useraccounts = list_useraccounts(); |
|
| 67 |
+if ($_SESSION['role'] & ROLE_CUSTOMER && count($useraccounts) > 1) {
|
|
| 68 |
+ // Mehrere User vorhanden |
|
| 69 |
+ $options = array(); |
|
| 70 |
+ foreach ($useraccounts as $u) {
|
|
| 71 |
+ $options[$u['uid']] = $u['username']; |
|
| 72 |
+ } |
|
| 73 |
+ if (!array_key_exists($dom->useraccount, $options)) {
|
|
| 74 |
+ $options[$dom->useraccount] = $dom->useraccount; |
|
| 75 |
+ } |
|
| 76 |
+ output('<h4>Zuständiges Benutzerkonto</h4>');
|
|
| 77 |
+ $form = '<p>Diese Domain nutzen im Benutzerkonto '.html_select('domainuser', $options, $dom->useraccount).' <input type="submit" name="submit" value="Änderung speichern"></p>';
|
|
| 78 |
+ output(html_form('update-user', 'update_save', 'action=chguser&id='.$dom->id, $form));
|
|
| 79 |
+} |
|
| 80 |
+ |
|
| 81 |
+ |
|
| 82 |
+output('<h4>Inhaberwechsel der Domain</h4>');
|
|
| 65 | 83 |
output('<p>Legen Sie hier einen neuen Inhaber für diese Domain fest.</p>');
|
| 66 | 84 |
|
| 67 | 85 |
$owner = get_contact($_SESSION['domains_update_owner']); |
| ... | ... |
@@ -98,7 +116,7 @@ if ($owner['id'] != $dom->owner || $admin_c['id'] != $dom->admin_c) {
|
| 98 | 116 |
<p>Mit Speichern dieser Änderungen führen Sie möglicherweise einen Inhaberwechsel bei der Domain '.$dom->fqdn.' aus. Inhaberwechsel sind bei einigen Domainendungen (z.B. com/net/org) zustimmungspflichtig vom alten und vom neuen Inhaber. Die Registrierungsstelle kann nach eigenem Ermessen diese Zustimmung per separater E-Mail einfordern. Wird diese Zustimmung nicht oder verspätet erteilt, kann eine Domain gesperrt werden. Dieser Vorgang wird nicht von '.config('company_name').' kontrolliert.</p>
|
| 99 | 117 |
<p>Sie sind ferner darüber informiert, dass die Adresse des Domaininhabers öffentlich abrufbar ist.</p>'; |
| 100 | 118 |
$form .= '<p><input type="submit" name="sumbit" value="Änderungen speichern und Domaininhaber ändern"></p>'; |
| 101 |
- output(html_form('domains_update', 'update_save', "id=".$dom->id, $form));
|
|
| 119 |
+ output(html_form('domains_update', 'update_save', "action=ownerchange&id=".$dom->id, $form));
|
|
| 102 | 120 |
} |
| 103 | 121 |
|
| 104 | 122 |
output('<p>'.internal_link('domains', 'Ohne Änderungen zurück').'</p>');
|
| ... | ... |
@@ -22,6 +22,17 @@ require_once('domains.php');
|
| 22 | 22 |
|
| 23 | 23 |
require_role(ROLE_CUSTOMER); |
| 24 | 24 |
|
| 25 |
+if (!isset($_REQUEST['action'])) {
|
|
| 26 |
+ system_failure("Falscher Aufruf");
|
|
| 27 |
+} |
|
| 28 |
+ |
|
| 29 |
+if ($_REQUEST['action'] == 'chguser') {
|
|
| 30 |
+ change_user((int)$_REQUEST['id'], $_REQUEST['domainuser']); |
|
| 31 |
+ redirect('update?id='.(int)$_REQUEST['id']);
|
|
| 32 |
+} |
|
| 33 |
+ |
|
| 34 |
+if ($_REQUEST['action'] == 'ownerchange') {
|
|
| 35 |
+ |
|
| 25 | 36 |
if (!(isset($_POST['accept']) && $_POST['accept'] == '1')) {
|
| 26 | 37 |
redirect('update?error=1');
|
| 27 | 38 |
} |
| ... | ... |
@@ -40,3 +51,4 @@ unset($_SESSION['domains_update_admin_c']); |
| 40 | 51 |
unset($_SESSION['domains_update_detach']); |
| 41 | 52 |
|
| 42 | 53 |
redirect('domains');
|
| 54 |
+} |
|
| 43 | 55 |