Browse code

Session aufräumen, Weiterleitungs-Ziel darf nicht leer sein, Status der DOmain abfragen

Bernd Wurst authored on08/02/2018 15:21:23
Showing4 changed files
... ...
@@ -80,12 +80,12 @@ function get_server_by_id($id) {
80 80
 function redirect($target)
81 81
 {
82 82
   global $debugmode;
83
+  if ($target == '') {
84
+      $target = $_SERVER['REQUEST_URI'];
85
+  }
83 86
   if (! $debugmode) {
84 87
     header("Location: {$target}");
85 88
   } else {
86
-      if ($target == '') {
87
-          $target = $_SERVER['REQUEST_URI'];
88
-      }
89 89
       if (strpos($target, '?') === false) {
90 90
         print 'REDIRECT: '.internal_link($target, $target);
91 91
       } else {
... ...
@@ -48,5 +48,11 @@ if ($dom->status == 'pretransfer') {
48 48
 api_register_domain($dom->fqdn, $authinfo);
49 49
 
50 50
 success_msg('Die Registrierung wurde in Auftrag gegeben. Der Domain-Status sollte sich in den nächsten Minuten entsprechend ändern.');
51
+
52
+unset($_SESSION['domains_domainreg_owner']);
53
+unset($_SESSION['domains_domainreg_admin_c']);
54
+unset($_SESSION['domains_domainreg_detach']);
55
+unset($_SESSION['domains_domainreg_domainname']);
56
+
51 57
 redirect('domains');
52 58
 
... ...
@@ -28,6 +28,16 @@ if ($_SESSION['role'] & ROLE_CUSTOMER)
28 28
 else
29 29
   $user_domains = get_domain_list($_SESSION['userinfo']['customerno'], $_SESSION['userinfo']['uid']);
30 30
 
31
+// Session-Variablen aufräumen
32
+unset($_SESSION['domains_detail_domainname']);
33
+unset($_SESSION['domains_detail_owner']);
34
+unset($_SESSION['domains_detail_admin_c']);
35
+unset($_SESSION['domains_detail_detach']);
36
+unset($_SESSION['domains_domainreg_owner']);
37
+unset($_SESSION['domains_domainreg_admin_c']);
38
+unset($_SESSION['domains_domainreg_detach']);
39
+unset($_SESSION['domains_domainreg_domainname']);
40
+
31 41
 title("Domains");
32 42
 
33 43
 output('<p>In Ihrem Account werden die folgenden Domains verwaltet:</p>');
... ...
@@ -103,7 +103,7 @@ function api_upload_domain($fqdn)
103 103
 
104 104
 function api_register_domain($domainname, $authinfo=NULL) 
105 105
 {
106
-    $result = db_query("SELECT id,CONCAT_WS('.', domainname, tld) AS fqdn, owner, admin_c FROM kundendaten.domains WHERE CONCAT_WS('.', domainname, tld)=?", array($domainname));
106
+    $result = db_query("SELECT id,status,CONCAT_WS('.', domainname, tld) AS fqdn, owner, admin_c FROM kundendaten.domains WHERE CONCAT_WS('.', domainname, tld)=?", array($domainname));
107 107
     if ($result->rowCount() < 1) {
108 108
         system_failure("Unbekannte Domain");
109 109
     }