Browse code

Codingstyle PSR12 + array syntax

Hanno Böck authored on 30/10/2021 21:18:17
Showing 150 changed files
... ...
@@ -103,7 +103,7 @@ if ($_SESSION['role'] != ROLE_ANONYMOUS && isset($_REQUEST['record']) && isset($
103 103
             $role = find_role($uid, '', true);
104 104
             setup_session($role, $uid);
105 105
             DEBUG("Set Cookie!");
106
-            setcookie('CLIENTCERT_AUTOLOGIN', '1', array('expires'=>strtotime("+ 1 year"), 'path'=>'/', 'secure'=>true, 'httponly'=>true, 'samesite'=>'Lax'));
106
+            setcookie('CLIENTCERT_AUTOLOGIN', '1', ['expires'=>strtotime("+ 1 year"), 'path'=>'/', 'secure'=>true, 'httponly'=>true, 'samesite'=>'Lax']);
107 107
             $destination = 'go/index/index';
108 108
             if (check_path($ret[0]['startpage'])) {
109 109
                 $destination = $ret[0]['startpage'];
... ...
@@ -32,7 +32,7 @@ class DB extends PDO
32 32
         }
33 33
         $username = config('db_user', true);
34 34
         $password = config('db_pass', true);
35
-        parent::__construct($dsn, $username, $password, array(PDO::ATTR_TIMEOUT => "30"));
35
+        parent::__construct($dsn, $username, $password, [PDO::ATTR_TIMEOUT => "30"]);
36 36
     }
37 37
 
38 38
 
... ...
@@ -20,7 +20,7 @@ require_once('inc/debug.php');
20 20
 
21 21
 class Domain
22 22
 {
23
-    protected $data = array();
23
+    protected $data = [];
24 24
     public function __construct($init = null)
25 25
     {
26 26
         $this->setup();
... ...
@@ -61,7 +61,7 @@ class Domain
61 61
 
62 62
     public function loadByID($id)
63 63
     {
64
-        $res = db_query("SELECT * FROM kundendaten.domains WHERE id=?", array($id));
64
+        $res = db_query("SELECT * FROM kundendaten.domains WHERE id=?", [$id]);
65 65
         if ($res->rowCount() < 1) {
66 66
             return false;
67 67
         }
... ...
@@ -73,7 +73,7 @@ class Domain
73 73
     {
74 74
         $raw = $name;
75 75
         $utf8 = idn_to_utf8($raw, 0, INTL_IDNA_VARIANT_UTS46);
76
-        $res = db_query("SELECT * FROM kundendaten.domains WHERE CONCAT_WS('.', domainname, tld)=? OR CONCAT_WS('.', domainname, tld)=?", array($raw, $utf8));
76
+        $res = db_query("SELECT * FROM kundendaten.domains WHERE CONCAT_WS('.', domainname, tld)=? OR CONCAT_WS('.', domainname, tld)=?", [$raw, $utf8]);
77 77
         if ($res->rowCount() < 1) {
78 78
             return false;
79 79
         }
... ...
@@ -115,7 +115,7 @@ class Domain
115 115
 
116 116
     public function setup()
117 117
     {
118
-        $fields = array();
118
+        $fields = [];
119 119
         $res = db_query("DESCRIBE kundendaten.domains");
120 120
         while ($f = $res->fetch(PDO::FETCH_OBJ)) {
121 121
             $fields[$f->Field] = $f->Default;
... ...
@@ -163,8 +163,8 @@ function get_domain_list($customerno = null, $uid = null)
163 163
         $query .= " kunde={$customerno}";
164 164
     }
165 165
     $query .= " ORDER BY domainname,tld";
166
-    $result = db_query($query, array()); // FIXME Übergebe leeren array um die Warnung zu unterdrücken
167
-    $domains = array();
166
+    $result = db_query($query, []); // FIXME Übergebe leeren array um die Warnung zu unterdrücken
167
+    $domains = [];
168 168
     DEBUG('Result set is '.$result->rowCount()." rows.<br />\n");
169 169
     if ($result->rowCount() > 0) {
170 170
         while ($domain = $result->fetch(PDO::FETCH_OBJ)) {
... ...
@@ -184,7 +184,7 @@ function get_jabberable_domains()
184 184
 
185 185
     $domains = get_domain_list($customerno);
186 186
     DEBUG($domains);
187
-    $result = array( new Domain() );
187
+    $result = [ new Domain() ];
188 188
     $result[0]->id = 0;
189 189
     $result[0]->fqdn = config('masterdomain');
190 190
     foreach ($domains as $dom) {
... ...
@@ -15,7 +15,7 @@ Nevertheless, in case you use a significant part of this code, we ask (but not r
15 15
 */
16 16
 
17 17
 global $config;
18
-$config = array();
18
+$config = [];
19 19
 
20 20
 // either...
21 21
 $config['db_socket'] = '/var/run/mysqld/mysqld-sys.sock';
... ...
@@ -28,7 +28,7 @@ $config['db_user'] = 'username';
28 28
 $config['db_pass'] = 'password';
29 29
 
30 30
 
31
-$config['modules'] = array("index", "domains", "imap", "mysql", "jabber", "vhosts", "register", "systemuser", "su");
31
+$config['modules'] = ["index", "domains", "imap", "mysql", "jabber", "vhosts", "register", "systemuser", "su"];
32 32
 
33 33
 $config['enable_debug'] = true;
34 34
 $config['logging'] = LOG_ERR;
... ...
@@ -43,7 +43,7 @@ DEBUG($go);
43 43
 if (strstr($go, "..") or strstr($go, "./") or strstr($go, ":") or (! file_exists("modules/$go.php")) or (! is_file("modules/$go.php"))) {
44 44
     die("illegal command");
45 45
 }
46
-list($module, $page) = explode('/', $go, 2);
46
+[$module, $page] = explode('/', $go, 2);
47 47
 $page = str_replace('/', '-', $page);
48 48
 if (! in_array($module, config('modules'))) {
49 49
     die("inactive module");
... ...
@@ -28,7 +28,7 @@ function api_request($method, $input_data)
28 28
     curl_setopt($curl, CURLOPT_POST, 1);
29 29
     curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
30 30
     curl_setopt($curl, CURLOPT_POSTFIELDS, $json);
31
-    curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
31
+    curl_setopt($curl, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
32 32
     $result = curl_exec($curl);
33 33
     if ($result === false) {
34 34
         system_failure("API-Anfrage kaputt");
... ...
@@ -33,7 +33,7 @@ function config($key, $localonly = false)
33 33
     }
34 34
 
35 35
     if ($key == 'modules' && isset($_SESSION['restrict_modules'])) {
36
-        $modules = array();
36
+        $modules = [];
37 37
         foreach ($config['modules'] as $mod) {
38 38
             if (in_array($mod, $_SESSION['restrict_modules'])) {
39 39
                 $modules[] = $mod;
... ...
@@ -84,7 +84,7 @@ function have_role($role)
84 84
 function get_server_by_id($id)
85 85
 {
86 86
     $id = (int) $id;
87
-    $result = db_query("SELECT hostname FROM system.servers WHERE id=?", array($id));
87
+    $result = db_query("SELECT hostname FROM system.servers WHERE id=?", [$id]);
88 88
     $ret = $result->fetch();
89 89
     return $ret['hostname'];
90 90
 }
... ...
@@ -102,7 +102,7 @@ function redirect($target)
102 102
         if (strpos($target, '?') === false) {
103 103
             print 'REDIRECT: '.internal_link($target, $target);
104 104
         } else {
105
-            list($file, $qs) = explode('?', $target, 2);
105
+            [$file, $qs] = explode('?', $target, 2);
106 106
             print 'REDIRECT: '.internal_link($file, $target, $qs);
107 107
         }
108 108
     }
... ...
@@ -113,7 +113,7 @@ function redirect($target)
113 113
 function my_server_id()
114 114
 {
115 115
     $uid = (int) $_SESSION['userinfo']['uid'];
116
-    $result = db_query("SELECT server FROM system.useraccounts WHERE uid=?", array($uid));
116
+    $result = db_query("SELECT server FROM system.useraccounts WHERE uid=?", [$uid]);
117 117
     $r = $result->fetch();
118 118
     DEBUG($r);
119 119
     return $r['server'];
... ...
@@ -123,8 +123,8 @@ function my_server_id()
123 123
 function additional_servers()
124 124
 {
125 125
     $uid = (int) $_SESSION['userinfo']['uid'];
126
-    $result = db_query("SELECT server FROM system.user_server WHERE uid=?", array($uid));
127
-    $servers = array();
126
+    $result = db_query("SELECT server FROM system.user_server WHERE uid=?", [$uid]);
127
+    $servers = [];
128 128
     while ($s = $result->fetch()) {
129 129
         $servers[] = $s['server'];
130 130
     }
... ...
@@ -136,7 +136,7 @@ function additional_servers()
136 136
 function server_names()
137 137
 {
138 138
     $result = db_query("SELECT id, hostname FROM system.servers");
139
-    $servers = array();
139
+    $servers = [];
140 140
     while ($s = $result->fetch()) {
141 141
         $servers[$s['id']] = $s['hostname'];
142 142
     }
... ...
@@ -180,11 +180,11 @@ function logger($severity, $scriptname, $scope, $message)
180 180
         }
181 181
     }
182 182
 
183
-    $args = array(":user" => $user,
183
+    $args = [":user" => $user,
184 184
                 ":remote" => $_SERVER['REMOTE_ADDR'],
185 185
                 ":scriptname" => $scriptname,
186 186
                 ":scope" => $scope,
187
-                ":message" => $message);
187
+                ":message" => $message, ];
188 188
 
189 189
     db_query("INSERT INTO misc.scriptlog (remote, user,scriptname,scope,message) VALUES (:remote, :user, :scriptname, :scope, :message)", $args);
190 190
 }
... ...
@@ -195,7 +195,7 @@ function count_failed_logins()
195 195
         DEBUG("logging is disabled, no brute force check possible");
196 196
         return;
197 197
     }
198
-    $result = db_query("SELECT count(*) AS num FROM misc.scriptlog WHERE user IS NULL AND scriptname='session/start' AND scope='login' AND message LIKE 'wrong user data%' AND remote=:remote AND `timestamp` > NOW() - INTERVAL 10 MINUTE", array(":remote" => $_SERVER['REMOTE_ADDR']));
198
+    $result = db_query("SELECT count(*) AS num FROM misc.scriptlog WHERE user IS NULL AND scriptname='session/start' AND scope='login' AND message LIKE 'wrong user data%' AND remote=:remote AND `timestamp` > NOW() - INTERVAL 10 MINUTE", [":remote" => $_SERVER['REMOTE_ADDR']]);
199 199
     $data = $result->fetch();
200 200
     DEBUG('seen '.$data['num'].' failed logins from this address within 10 minutes');
201 201
     return $data['num'];
... ...
@@ -229,7 +229,7 @@ function footnote($explaination)
229 229
 {
230 230
     global $footnotes;
231 231
     if (!isset($footnotes) || !is_array($footnotes)) {
232
-        $footnotes = array();
232
+        $footnotes = [];
233 233
     }
234 234
     $fnid = array_search($explaination, $footnotes);
235 235
     DEBUG($footnotes);
... ...
@@ -334,7 +334,7 @@ function use_module($modname)
334 334
 {
335 335
     global $prefix, $needed_modules;
336 336
     if (! isset($needed_modules)) {
337
-        $needed_modules = array();
337
+        $needed_modules = [];
338 338
     }
339 339
     if (in_array($modname, $needed_modules)) {
340 340
         return;
... ...
@@ -359,7 +359,7 @@ function encode_querystring($querystring)
359 359
         $querystring = 'debug&'.$querystring;
360 360
     }
361 361
     $query = explode('&', $querystring);
362
-    $new_query = array();
362
+    $new_query = [];
363 363
     foreach ($query as $item) {
364 364
         if ($item != '') {
365 365
             $split = explode('=', $item, 2);
... ...
@@ -433,22 +433,22 @@ function html_select($name, $options, $default='', $free='')
433 433
 
434 434
 function html_datepicker($nameprefix, $timestamp)
435 435
 {
436
-    $valid_days = array( 1 =>  1,  2 =>  2,  3 =>  3,  4 =>  4,  5 =>  5,
436
+    $valid_days = [ 1 =>  1,  2 =>  2,  3 =>  3,  4 =>  4,  5 =>  5,
437 437
                        6 =>  6,  7 =>  7,  8 =>  8,  9 =>  9, 10 => 10,
438 438
                       11 => 11, 12 => 12, 13 => 13, 14 => 14, 15 => 15,
439 439
                       16 => 16, 17 => 17, 18 => 18, 19 => 19, 20 => 20,
440 440
                       21 => 21, 22 => 22, 23 => 23, 24 => 24, 25 => 25,
441 441
                       26 => 26, 27 => 27, 28 => 28, 29 => 29, 30 => 30,
442
-                      31 => 31);
443
-    $valid_months = array( 1 =>  1,  2 =>  2,  3 =>  3,  4 =>  4,  5 =>  5,
442
+                      31 => 31, ];
443
+    $valid_months = [ 1 =>  1,  2 =>  2,  3 =>  3,  4 =>  4,  5 =>  5,
444 444
                          6 =>  6,  7 =>  7,  8 =>  8,  9 =>  9, 10 => 10,
445
-                        11 => 11, 12 => 12);
445
+                        11 => 11, 12 => 12, ];
446 446
     $current_year = (int) date('Y');
447
-    $valid_years = array($current_year => $current_year,
447
+    $valid_years = [$current_year => $current_year,
448 448
                        $current_year+1 => $current_year+1,
449 449
                        $current_year+2 => $current_year+2,
450 450
                        $current_year+3 => $current_year+3,
451
-                       $current_year+4 => $current_year+4);
451
+                       $current_year+4 => $current_year+4, ];
452 452
 
453 453
     $selected_day = date('d', $timestamp);
454 454
     $selected_month = date('m', $timestamp);
... ...
@@ -463,7 +463,7 @@ function html_datepicker($nameprefix, $timestamp)
463 463
 function get_modules_info()
464 464
 {
465 465
     $modules = config('modules');
466
-    $modconfig = array();
466
+    $modconfig = [];
467 467
     foreach ($modules as $name) {
468 468
         $modconfig[$name] = null;
469 469
         if (file_exists('modules/'.$name.'/module.info')) {
... ...
@@ -31,7 +31,7 @@ function input_error($reason)
31 31
 {
32 32
     global $input_error;
33 33
     if (!isset($input_error)) {
34
-        $input_error = array();
34
+        $input_error = [];
35 35
     }
36 36
     array_push($input_error, $reason);
37 37
 }
... ...
@@ -39,7 +39,7 @@ function input_error($reason)
39 39
 function warning($msg)
40 40
 {
41 41
     if (!isset($_SESSION['warning'])) {
42
-        $_SESSION['warning'] = array();
42
+        $_SESSION['warning'] = [];
43 43
     }
44 44
     array_push($_SESSION['warning'], $msg);
45 45
     $backtrace = debug_backtrace();
... ...
@@ -49,7 +49,7 @@ function warning($msg)
49 49
 function success_msg($msg)
50 50
 {
51 51
     if (!isset($_SESSION['success_msg'])) {
52
-        $_SESSION['success_msg'] = array();
52
+        $_SESSION['success_msg'] = [];
53 53
     }
54 54
     array_push($_SESSION['success_msg'], $msg);
55 55
 }
... ...
@@ -116,7 +116,7 @@ function show_messages()
116 116
 function require_role($roles)
117 117
 {
118 118
     if (! is_array($roles)) {
119
-        $roles = array($roles);
119
+        $roles = [$roles];
120 120
     }
121 121
     $allow = false;
122 122
     foreach ($roles as $role) {
... ...
@@ -29,7 +29,7 @@ if (! defined('__JQUERY_INCLUDED')) {
29 29
 function javascript($file = null, $module = null)
30 30
 {
31 31
     global $go, $prefix;
32
-    list($mod, $page) = explode('/', $go, 2);
32
+    [$mod, $page] = explode('/', $go, 2);
33 33
     if (! $file) {
34 34
         $file = $page.'.js';
35 35
     }
... ...
@@ -18,7 +18,7 @@ require_once('inc/error.php');
18 18
 require_once('vendor/autoload.php');
19 19
 
20 20
 
21
-function strong_password($password, $user = array())
21
+function strong_password($password, $user = [])
22 22
 {
23 23
     $pwcheck = config('pwcheck');
24 24
     $result = null;
... ...
@@ -18,7 +18,7 @@ function show_page($path = null)
18 18
 {
19 19
     global $prefix, $go, $title, $headline, $output, $module, $page, $html_header, $footnotes;
20 20
 
21
-    $styles = array();
21
+    $styles = [];
22 22
     if (file_exists("modules/{$module}/style.css")) {
23 23
         $styles[] = "modules/{$module}/style.css";
24 24
     }
... ...
@@ -33,7 +33,7 @@ function show_page($path = null)
33 33
         $theme = 'default';
34 34
     }
35 35
     $theme_path = "themes/$theme/";
36
-    $candidates = array();
36
+    $candidates = [];
37 37
     if ($page) {
38 38
         $candidates[] = "{$theme_path}page-$module-$page.tpl.php";
39 39
     }
... ...
@@ -21,10 +21,10 @@ if (! defined("TOP_INCLUDED")) {
21 21
     require_once("inc/debug.php");
22 22
     global $prefix, $section;
23 23
 
24
-    $menuitem = array();
25
-    $weighted_menuitem = array();
24
+    $menuitem = [];
25
+    $weighted_menuitem = [];
26 26
 
27
-    $submenu = array();
27
+    $submenu = [];
28 28
 
29 29
     foreach (config('modules') as $module) {
30 30
         $menu = false;
... ...
@@ -44,15 +44,15 @@ if (! defined("TOP_INCLUDED")) {
44 44
             $weight = $menu[$key]["weight"];
45 45
             if (isset($menu[$key]['submenu'])) {
46 46
                 if (isset($submenu[$menu[$key]['submenu']][$weight])) {
47
-                    $submenu[$menu[$key]['submenu']][$weight] = array_merge($submenu[$menu[$key]['submenu']][$weight], array($key => $menu[$key]));
47
+                    $submenu[$menu[$key]['submenu']][$weight] = array_merge($submenu[$menu[$key]['submenu']][$weight], [$key => $menu[$key]]);
48 48
                 } else {
49
-                    $submenu[$menu[$key]['submenu']][$weight] = array($key => $menu[$key]);
49
+                    $submenu[$menu[$key]['submenu']][$weight] = [$key => $menu[$key]];
50 50
                 }
51 51
             } else {
52 52
                 if (array_key_exists($weight, $weighted_menuitem)) {
53
-                    $weighted_menuitem[$weight] = array_merge($weighted_menuitem[$weight], array($key => $menu[$key]));
53
+                    $weighted_menuitem[$weight] = array_merge($weighted_menuitem[$weight], [$key => $menu[$key]]);
54 54
                 } else {
55
-                    $weighted_menuitem[$weight] = array($key => $menu[$key]);
55
+                    $weighted_menuitem[$weight] = [$key => $menu[$key]];
56 56
                 }
57 57
             }
58 58
         }
... ...
@@ -37,7 +37,7 @@ if (! $data) {
37 37
 }
38 38
 
39 39
 $users = list_useraccounts();
40
-$userselect = array();
40
+$userselect = [];
41 41
 foreach ($users as $u) {
42 42
     $userselect[$u['uid']] = $u['username'].' / '.$u['name'];
43 43
 }
... ...
@@ -36,17 +36,17 @@ function get_domain_offer($domainname)
36 36
 
37 37
     $cid = (int) $_SESSION['customerinfo']['customerno'];
38 38
 
39
-    $result = db_query("SELECT id FROM kundendaten.domains WHERE domainname=:domainname AND tld=:tld", array("domainname" => $basename, "tld" => $tld));
39
+    $result = db_query("SELECT id FROM kundendaten.domains WHERE domainname=:domainname AND tld=:tld", ["domainname" => $basename, "tld" => $tld]);
40 40
     if ($result->rowCount() != 0) {
41 41
         warning('Diese Domain ist in unserem System bereits vorhanden und kann daher nicht noch einmal eingetragen werden.');
42 42
         return;
43 43
     }
44 44
 
45
-    $data = array("domainname" => $domainname, "basename" => $basename, "tld" => $tld);
45
+    $data = ["domainname" => $domainname, "basename" => $basename, "tld" => $tld];
46 46
 
47
-    $result = db_query("SELECT tld, gebuehr, setup FROM misc.domainpreise_kunde WHERE kunde=:cid AND tld=:tld AND ruecksprache='N'", array(":cid" => $cid, ":tld" => $tld));
47
+    $result = db_query("SELECT tld, gebuehr, setup FROM misc.domainpreise_kunde WHERE kunde=:cid AND tld=:tld AND ruecksprache='N'", [":cid" => $cid, ":tld" => $tld]);
48 48
     if ($result->rowCount() != 1) {
49
-        $result = db_query("SELECT tld, gebuehr, setup FROM misc.domainpreise WHERE tld=:tld AND ruecksprache='N'", array(":tld" => $tld));
49
+        $result = db_query("SELECT tld, gebuehr, setup FROM misc.domainpreise WHERE tld=:tld AND ruecksprache='N'", [":tld" => $tld]);
50 50
     }
51 51
     if ($result->rowCount() != 1) {
52 52
         warning('Die Endung »'.$tld.'« steht zur automatischen Eintragung nicht zur Verfügung.');
... ...
@@ -89,10 +89,10 @@ function register_domain($domainname, $uid)
89 89
         system_failure('Kein User gesetzt');
90 90
     }
91 91
 
92
-    $args = array(":cid" => $cid,
92
+    $args = [":cid" => $cid,
93 93
                 ":useraccount" => $useraccount,
94 94
                 ":basename" => $data['basename'],
95
-                ":tld" => $data['tld']);
95
+                ":tld" => $data['tld'], ];
96 96
     db_query("INSERT INTO kundendaten.domains (kunde, useraccount, domainname, tld, billing, registrierungsdatum, dns,webserver, mail) VALUES ".
97 97
            "(:cid, :useraccount, :basename, :tld, 'regular', NULL, 1, 1, 'auto') ", $args);
98 98
     $domid = db_insert_id();
... ...
@@ -107,8 +107,8 @@ function register_domain($domainname, $uid)
107 107
 function list_useraccounts()
108 108
 {
109 109
     $customerno = (int) $_SESSION['customerinfo']['customerno'];
110
-    $result = db_query("SELECT uid,username,name FROM system.useraccounts WHERE kunde=?", array($customerno));
111
-    $ret = array();
110
+    $result = db_query("SELECT uid,username,name FROM system.useraccounts WHERE kunde=?", [$customerno]);
111
+    $ret = [];
112 112
     while ($item = $result->fetch()) {
113 113
         $ret[] = $item;
114 114
     }
... ...
@@ -20,7 +20,7 @@ require_once('inc/api.php');
20 20
 
21 21
 function api_domain_available($domainname)
22 22
 {
23
-    $args = array("domainNames" => array($domainname));
23
+    $args = ["domainNames" => [$domainname]];
24 24
     $result = api_request('domainStatus', $args);
25 25
     $resp = $result["responses"][0];
26 26
     return ($resp["status"] == "available");
... ...
@@ -18,5 +18,5 @@ $role = $_SESSION['role'];
18 18
 
19 19
 
20 20
 if ($role & ROLE_CUSTOMER) {
21
-    $menu["adddomain_search"] = array("label" => "Domain hinzufügen", "file" => "search", "weight" => 0, "submenu" => "domains_domains");
21
+    $menu["adddomain_search"] = ["label" => "Domain hinzufügen", "file" => "search", "weight" => 0, "submenu" => "domains_domains"];
22 22
 }
... ...
@@ -2,5 +2,5 @@
2 2
 
3 3
 $role = $_SESSION['role'];
4 4
 if ($role & ROLE_SYSADMIN) {
5
-    $menu["buchhaltung_report"] = array("label" => "Report", "file" => "report", "weight" => -10);
5
+    $menu["buchhaltung_report"] = ["label" => "Report", "file" => "report", "weight" => -10];
6 6
 }
... ...
@@ -11,15 +11,15 @@ if (isset($_GET['year'])) {
11 11
 }
12 12
 
13 13
 $typeresult = db_query("SELECT id, description, investment FROM buchhaltung.types");
14
-$dataresult = db_query("SELECT id, date, description, invoice_id, direction, type, amount, tax_rate, gross FROM buchhaltung.transactions WHERE date BETWEEN :from and :to ORDER BY date", array(":from" => $year."-01-01", ":to" => $year."-12-31"));
14
+$dataresult = db_query("SELECT id, date, description, invoice_id, direction, type, amount, tax_rate, gross FROM buchhaltung.transactions WHERE date BETWEEN :from and :to ORDER BY date", [":from" => $year."-01-01", ":to" => $year."-12-31"]);
15 15
 
16
-$types = array();
17
-$data_by_type = array();
18
-$sum_by_type = array();
19
-$investment_types = array();
16
+$types = [];
17
+$data_by_type = [];
18
+$sum_by_type = [];
19
+$investment_types = [];
20 20
 while ($t = $typeresult->fetch()) {
21 21
     $types[$t['id']] = $t['description'];
22
-    $data_by_type[$t['id']] = array();
22
+    $data_by_type[$t['id']] = [];
23 23
     $sum_by_type[$t['id']] = 0.0;
24 24
     if ($t['investment'] == 1) {
25 25
         $investment_types[$t['id']] = $t;
... ...
@@ -35,9 +35,9 @@ output("Journal für $year (01.01.$year-31.12.$year, gruppiert nach Buchungskont
35 35
 
36 36
 DEBUG($types);
37 37
 DEBUG($investment_types);
38
-$net_by_type = array(0 => array(-1 => array(), 0 => array(), 19 => array()));
38
+$net_by_type = [0 => [-1 => [], 0 => [], 19 => []]];
39 39
 $umsatzsteuer = 0.0;
40
-$ustbetraege = array();
40
+$ustbetraege = [];
41 41
 $vorsteuer = 0.0;
42 42
 foreach ($types as $id => $t) {
43 43
     if (count($data_by_type[$id]) == 0 || $t=='Privatentnahme') {
... ...
@@ -8,10 +8,10 @@ $title = 'Report';
8 8
 $year = date("Y")-1;
9 9
 
10 10
 $typeresult = db_query("SELECT id, description FROM buchhaltung.types");
11
-$dataresult = db_query("SELECT id, date, description, invoice_id, direction, type, amount, tax_rate, gross FROM buchhaltung.transactions WHERE date BETWEEN :from and :to ORDER BY date", array(":from" => $year."-01-01", ":to" => $year."-12-31"));
11
+$dataresult = db_query("SELECT id, date, description, invoice_id, direction, type, amount, tax_rate, gross FROM buchhaltung.transactions WHERE date BETWEEN :from and :to ORDER BY date", [":from" => $year."-01-01", ":to" => $year."-12-31"]);
12 12
 
13
-$types = array();
14
-$data = array();
13
+$types = [];
14
+$data = [];
15 15
 while ($t = $typeresult->fetch()) {
16 16
     $types[$t['id']] = $t['description'];
17 17
 }
... ...
@@ -17,8 +17,8 @@ Nevertheless, in case you use a significant part of this code, we ask (but not r
17 17
 require_once('contacts.php');
18 18
 
19 19
 if (isset($_GET['q']) || isset($_GET['id'])) {
20
-    $result = array("status" => "notfound",
21
-                    "id" => null);
20
+    $result = ["status" => "notfound",
21
+                    "id" => null, ];
22 22
     $id = null;
23 23
     if (isset($_GET['q'])) {
24 24
         $id = search_pgp_key($_GET['q']);
... ...
@@ -22,7 +22,7 @@ javascript();
22 22
 require_once('session/start.php');
23 23
 
24 24
 
25
-require_role(array(ROLE_CUSTOMER));
25
+require_role([ROLE_CUSTOMER]);
26 26
 $section = 'contacts_list';
27 27
 
28 28
 $new = false;
... ...
@@ -21,7 +21,7 @@ require_once('inc/api.php');
21 21
 
22 22
 function contact_to_apicontact($c)
23 23
 {
24
-    $ac = array();
24
+    $ac = [];
25 25
     $ac['id'] = $c['nic_id'];
26 26
     $ac['handle'] = $c['nic_handle'];
27 27
     $ac['type'] = 'person';
... ...
@@ -65,13 +65,13 @@ function apicontact_to_contact($ac)
65 65
 
66 66
 function download_contact($nic_id)
67 67
 {
68
-    $data = array("contactId" => $nic_id);
68
+    $data = ["contactId" => $nic_id];
69 69
     $result = api_request('contactInfo', $data);
70 70
     if ($result['status'] != 'success') {
71 71
         system_failure("Abfrage nicht erfolgreich!");
72 72
     }
73 73
     $c = apicontact_to_contact($result['response']);
74
-    $result = db_query("SELECT id FROM kundendaten.contacts WHERE nic_id=?", array($nic_id));
74
+    $result = db_query("SELECT id FROM kundendaten.contacts WHERE nic_id=?", [$nic_id]);
75 75
     if ($result->rowCount() > 0) {
76 76
         $data = $result->fetch();
77 77
         $c['id'] = $data['id'];
... ...
@@ -87,15 +87,15 @@ function upload_contact($c)
87 87
     $ac = contact_to_apicontact($c);
88 88
     if ($ac['id'] || $ac['handle']) {
89 89
         // Update
90
-        $data = array("contact" => $ac,
91
-                "actingAs" => "designatedAgent");
90
+        $data = ["contact" => $ac,
91
+                "actingAs" => "designatedAgent", ];
92 92
         $result = api_request('contactUpdate', $data);
93 93
         if ($result['status'] != 'success') {
94 94
             system_failure("Es gab ein Problem beim Hochladen der Adresse zum Domainregistrar. Das sollte nicht sein!");
95 95
         }
96 96
     } else {
97 97
         // create
98
-        $data = array("contact" => $ac);
98
+        $data = ["contact" => $ac];
99 99
         $result = api_request('contactCreate', $data);
100 100
         if ($result['status'] == 'success') {
101 101
             $c['nic_handle'] = $result['response']['handle'];
... ...
@@ -17,7 +17,7 @@ Nevertheless, in case you use a significant part of this code, we ask (but not r
17 17
 require_once('inc/debug.php');
18 18
 require_once('inc/icons.php');
19 19
 require_once('inc/security.php');
20
-require_role(array(ROLE_CUSTOMER));
20
+require_role([ROLE_CUSTOMER]);
21 21
 require_once('class/domain.php');
22 22
 
23 23
 require_once('contactapi.php');
... ...
@@ -25,7 +25,7 @@ require_once('contactapi.php');
25 25
 
26 26
 function new_contact()
27 27
 {
28
-    return array("id" => null,
28
+    return ["id" => null,
29 29
         "state" => null,
30 30
         "lastchange" => time(),
31 31
         "nic_handle" => null,
... ...
@@ -43,7 +43,7 @@ function new_contact()
43 43
         "email" => null,
44 44
         "pgp_id" => null,
45 45
         "pgp_key" => null,
46
-        "customer" => $_SESSION['customerinfo']['customerno']);
46
+        "customer" => $_SESSION['customerinfo']['customerno'], ];
47 47
 }
48 48
 
49 49
 
... ...
@@ -53,9 +53,9 @@ function get_contact($id, $customer = null)
53 53
     if ($customer != null && have_role(ROLE_SYSADMIN)) {
54 54
         $c = $customer;
55 55
     }
56
-    $args = array(
56
+    $args = [
57 57
         "cid" => (int) $c,
58
-        "id" => (int) $id);
58
+        "id" => (int) $id, ];
59 59
     $result = db_query("SELECT id, state, lastchange, nic_id, nic_handle, salutation, company, name, address, zip, city, country, phone, mobile, fax, email, pgp_id, pgp_key FROM kundendaten.contacts WHERE id=:id AND customer=:cid", $args);
60 60
     if ($result->rowCount() == 0) {
61 61
         DEBUG("Soll Kontakt #".$id." laden, MySQL lieferte aber keine Daten");
... ...
@@ -68,8 +68,8 @@ function get_contact($id, $customer = null)
68 68
 function get_contacts()
69 69
 {
70 70
     $cid = (int) $_SESSION['customerinfo']['customerno'];
71
-    $result = db_query("SELECT id, state, lastchange, nic_id, nic_handle, salutation, company, name, address, zip, city, country, phone, mobile, fax, email, pgp_id, pgp_key FROM kundendaten.contacts WHERE (state<>'deleted' OR state IS NULL) AND customer=? ORDER BY COALESCE(company, name)", array($cid));
72
-    $ret = array();
71
+    $result = db_query("SELECT id, state, lastchange, nic_id, nic_handle, salutation, company, name, address, zip, city, country, phone, mobile, fax, email, pgp_id, pgp_key FROM kundendaten.contacts WHERE (state<>'deleted' OR state IS NULL) AND customer=? ORDER BY COALESCE(company, name)", [$cid]);
72
+    $ret = [];
73 73
     while ($contact = $result->fetch()) {
74 74
         $ret[$contact['id']] = $contact;
75 75
     }
... ...
@@ -81,7 +81,7 @@ function get_contacts()
81 81
 function is_domainholder($contactid)
82 82
 {
83 83
     $contactid = (int) $contactid;
84
-    $result = db_query("SELECT id FROM kundendaten.domains WHERE owner=? OR admin_c=?", array($contactid, $contactid));
84
+    $result = db_query("SELECT id FROM kundendaten.domains WHERE owner=? OR admin_c=?", [$contactid, $contactid]);
85 85
     if ($result->rowCount() > 0) {
86 86
         return true;
87 87
     }
... ...
@@ -91,7 +91,7 @@ function is_domainholder($contactid)
91 91
 function possible_domainholders()
92 92
 {
93 93
     $allcontacts = get_contacts();
94
-    $ret = array();
94
+    $ret = [];
95 95
     foreach ($allcontacts as $id => $c) {
96 96
         if (possible_domainholder($c)) {
97 97
             $ret[$id] = $c;
... ...
@@ -111,7 +111,7 @@ function possible_domainholder($c)
111 111
 function have_mailaddress($email)
112 112
 {
113 113
     $cid = (int) $_SESSION['customerinfo']['customerno'];
114
-    $result = db_query("SELECT id FROM kundendaten.contacts WHERE customer=? AND email=?", array($cid, $email));
114
+    $result = db_query("SELECT id FROM kundendaten.contacts WHERE customer=? AND email=?", [$cid, $email]);
115 115
     if ($result->rowCount() > 0) {
116 116
         return true;
117 117
     }
... ...
@@ -134,10 +134,10 @@ function set_kundenkontakt($typ, $id)
134 134
     } else {
135 135
         $id = (int) $id;
136 136
     }
137
-    $args = array(
137
+    $args = [
138 138
         "kunde" => (int) $_SESSION['customerinfo']['customerno'],
139
-        "contact" => $id
140
-        );
139
+        "contact" => $id,
140
+        ];
141 141
     $field = null;
142 142
     if ($typ == 'kunde') {
143 143
         $field = 'contact_kunde';
... ...
@@ -166,7 +166,7 @@ function sync_legacy_contactdata()
166 166
         $vorname = explode(' ', $kunde['name'], 2)[0];
167 167
         $nachname = explode(' ', $kunde['name'], 2)[1];
168 168
     }
169
-    $args = array("firma" => $kunde['company'],
169
+    $args = ["firma" => $kunde['company'],
170 170
             "anrede" => $kunde['salutation'],
171 171
             "vorname" => $vorname,
172 172
             "nachname" => $nachname,
... ...
@@ -180,25 +180,25 @@ function sync_legacy_contactdata()
180 180
             "email" => $kunde['email'],
181 181
             "pgp_id" => $kunde['pgp_id'],
182 182
             "pgp_key" => $kunde['pgp_key'],
183
-            "cid" => $cid);
183
+            "cid" => $cid, ];
184 184
     db_query("UPDATE kundendaten.kunden SET anrede=:anrede, firma=:firma, vorname=:vorname, nachname=:nachname, adresse=:adresse,
185 185
             plz=:plz, ort=:ort, land=:land, telefon=:telefon, mobile=:mobile, telefax=:telefax, email=:email, 
186 186
             pgp_id=:pgp_id, pgp_key=:pgp_key WHERE id=:cid", $args);
187 187
     if ($kundenkontakte['extern']) {
188 188
         $extern = get_contact($kundenkontakte['extern'])['email'];
189 189
         if ($extern) {
190
-            db_query("UPDATE kundendaten.kunden SET email_extern=? WHERE id=?", array($extern, $cid));
190
+            db_query("UPDATE kundendaten.kunden SET email_extern=? WHERE id=?", [$extern, $cid]);
191 191
         }
192 192
     }
193 193
     if ($kundenkontakte['rechnung']) {
194 194
         $kunde = get_contact($kundenkontakte['rechnung']);
195
-        $args = array("firma" => $kunde['company'],
195
+        $args = ["firma" => $kunde['company'],
196 196
                 "name" => $kunde['name'],
197 197
                 "adresse" => $kunde['address'],
198 198
                 "plz" => $kunde['zip'],
199 199
                 "ort" => $kunde['city'],
200 200
                 "email" => $kunde['email'],
201
-                "cid" => $cid);
201
+                "cid" => $cid, ];
202 202
         db_query("UPDATE kundendaten.kunden SET re_firma=:firma, re_name=:name, re_adresse=:adresse,
203 203
                 re_plz=:plz, re_ort=:ort, email_rechnung=:email WHERE id=:cid", $args);
204 204
     }
... ...
@@ -211,21 +211,21 @@ function get_kundenkontakte($customer = null)
211 211
     if ($customer and have_role(ROLE_SYSADMIN)) {
212 212
         $cid = (int) $customer;
213 213
     }
214
-    $result = db_query("SELECT contact_kunde, contact_extern, contact_rechnung, contact_dataprotection FROM kundendaten.kunden WHERE id=?", array($cid));
214
+    $result = db_query("SELECT contact_kunde, contact_extern, contact_rechnung, contact_dataprotection FROM kundendaten.kunden WHERE id=?", [$cid]);
215 215
     $res = $result->fetch();
216
-    $ret = array("kunde" => $res['contact_kunde'],
216
+    $ret = ["kunde" => $res['contact_kunde'],
217 217
                  "extern" => $res['contact_extern'],
218 218
                  "rechnung" => $res['contact_rechnung'],
219
-                 "dataprotection" => $res['contact_dataprotection']);
219
+                 "dataprotection" => $res['contact_dataprotection'], ];
220 220
     return $ret;
221 221
 }
222 222
 
223 223
 function save_emailaddress($id, $email)
224 224
 {
225 225
     // Speichert eine E-Mail-Adresse direkt, z.B. wenn diese schonmal geprüft wurde
226
-    $args = array("cid" => (int) $_SESSION['customerinfo']['customerno'],
226
+    $args = ["cid" => (int) $_SESSION['customerinfo']['customerno'],
227 227
         "id" => (int) $id,
228
-        "email" => $email);
228
+        "email" => $email, ];
229 229
     db_query("UPDATE kundendaten.contacts SET email=:email WHERE id=:id AND customer=:cid", $args);
230 230
 }
231 231
 
... ...
@@ -263,9 +263,9 @@ function send_emailchange_token($id, $email)
263 263
     if (! check_emailaddr($email)) {
264 264
         system_falure("Die E-Mail-Adresse scheint nicht gültig zu sein.");
265 265
     }
266
-    $args = array("id" => (int) $id,
266
+    $args = ["id" => (int) $id,
267 267
         "email" => $email,
268
-        "token" => random_string(20));
268
+        "token" => random_string(20), ];
269 269
 
270 270
     db_query("INSERT INTO kundendaten.mailaddress_token (token, expire, contact, email) VALUES (:token, NOW() + INTERVAL 1 DAY, :id, :email)", $args);
271 271
     DEBUG('Token erzeugt: '.print_r($args, true));
... ...
@@ -291,7 +291,7 @@ https://schokokeks.org
291 291
 function update_pending($contactid)
292 292
 {
293 293
     $contactid = (int) $contactid;
294
-    $result = db_query("SELECT email FROM kundendaten.mailaddress_token WHERE contact=?", array($contactid));
294
+    $result = db_query("SELECT email FROM kundendaten.mailaddress_token WHERE contact=?", [$contactid]);
295 295
     if ($result->rowCount() == 0) {
296 296
         return null;
297 297
     }
... ...
@@ -319,7 +319,7 @@ function delete_contact($id)
319 319
         $c['state'] = 'deleted';
320 320
         upload_contact($c);
321 321
     }
322
-    db_query("UPDATE kundendaten.contacts SET state='deleted' WHERE id=?", array($c['id']));
322
+    db_query("UPDATE kundendaten.contacts SET state='deleted' WHERE id=?", [$c['id']]);
323 323
 }
324 324
 
325 325
 
... ...
@@ -329,12 +329,12 @@ function search_pgp_key($search)
329 329
         # Keine Ausgabe weil diese Funktion im AJAX-Call verwendet wird
330 330
         return null;
331 331
     }
332
-    $output = array();
332
+    $output = [];
333 333
     $command = 'LC_ALL=C /usr/bin/timeout 10 /usr/bin/gpg --batch --with-colons --keyserver hkps://hkps.pool.sks-keyservers.net --search-key '.escapeshellarg($search);
334 334
     DEBUG($command);
335 335
     exec($command, $output);
336 336
     DEBUG($output);
337
-    $keys = array();
337
+    $keys = [];
338 338
     foreach ($output as $row) {
339 339
         if (substr($row, 0, 4) === 'pub:') {
340 340
             $parts = explode(':', $row);
... ...
@@ -359,7 +359,7 @@ function search_pgp_key($search)
359 359
 
360 360
 function fetch_pgp_key($pgp_id)
361 361
 {
362
-    $output = array();
362
+    $output = [];
363 363
     $ret = null;
364 364
     $command = '/usr/bin/timeout 10 /usr/bin/gpg --batch --keyserver hkps://hkps.pool.sks-keyservers.net --no-auto-check-trustdb --trust-model=always --recv-key '.escapeshellarg($pgp_id);
365 365
     DEBUG($command);
... ...
@@ -406,8 +406,8 @@ function test_pgp_key($pgp_id)
406 406
 function domainlist_by_contact($c)
407 407
 {
408 408
     $cid = (int) $_SESSION['customerinfo']['customerno'];
409
-    $result = db_query("SELECT id FROM kundendaten.domains WHERE (owner=? OR admin_c=?) AND kunde=?", array($c['id'], $c['id'], $cid));
410
-    $ret = array();
409
+    $result = db_query("SELECT id FROM kundendaten.domains WHERE (owner=? OR admin_c=?) AND kunde=?", [$c['id'], $c['id'], $cid]);
410
+    $ret = [];
411 411
     while ($domain = $result->fetch()) {
412 412
         $ret[] = new Domain((int) $domain['id']);
413 413
     }
... ...
@@ -430,7 +430,7 @@ function contact_as_string($contact)
430 430
     if ($new_email) {
431 431
         $email = "<strike>$email</strike><br/>".filter_output_html($new_email).footnote('Die E-Mail-Adresse wurde noch nicht bestätigt');
432 432
     }
433
-    $email = implode("<br>\n", array_filter(array($email, filter_output_html($contact['phone']), filter_output_html($contact['fax']), filter_output_html($contact['mobile']))));
433
+    $email = implode("<br>\n", array_filter([$email, filter_output_html($contact['phone']), filter_output_html($contact['fax']), filter_output_html($contact['mobile'])]));
434 434
     $pgp = '';
435 435
     if ($contact['pgp_id']) {
436 436
         $pgpid = $contact['pgp_id'];
... ...
@@ -20,7 +20,7 @@ require_once("contacts.php");
20 20
 function verify_mail_token($token)
21 21
 {
22 22
     db_query("DELETE FROM kundendaten.mailaddress_token WHERE expire<NOW()");
23
-    $args = array(":token" => $token);
23
+    $args = [":token" => $token];
24 24
     $result = db_query("SELECT contact, email FROM kundendaten.mailaddress_token WHERE token=:token AND expire>NOW()", $args);
25 25
     if ($result->rowCount() > 0) {
26 26
         $line = $result->fetch();
... ...
@@ -41,8 +41,8 @@ function update_mailaddress($daten)
41 41
         system_failure('Es ist eine ungültige Adresse hinterlegt. So wird das nichts. Bitte die Änderung von vorne machen.');
42 42
     }
43 43
 
44
-    $args = array(':contact' => $contact,
45
-                  ':email' => $email);
44
+    $args = [':contact' => $contact,
45
+                  ':email' => $email, ];
46 46
     db_query("UPDATE kundendaten.contacts SET email=:email WHERE id=:contact", $args);
47 47
     sync_legacy_contactdata();
48 48
 }
... ...
@@ -50,8 +50,8 @@ function update_mailaddress($daten)
50 50
 
51 51
 function upload_changed_contact($id)
52 52
 {
53
-    $args = array(
54
-        "id" => (int) $id);
53
+    $args = [
54
+        "id" => (int) $id, ];
55 55
     $result = db_query("SELECT id, state, lastchange, nic_id, nic_handle, company, name, address, zip, city, country, phone, mobile, fax, email, pgp_id, pgp_key FROM kundendaten.contacts WHERE id=:id", $args);
56 56
     if ($result->rowCount() == 0) {
57 57
         return ;
... ...
@@ -60,7 +60,7 @@ function upload_changed_contact($id)
60 60
     if (! ($c['nic_id'] || $c['nic_handle'])) {
61 61
         return ;
62 62
     }
63
-    $ac = array();
63
+    $ac = [];
64 64
     $ac['id'] = $c['nic_id'];
65 65
     $ac['handle'] = $c['nic_handle'];
66 66
     $ac['type'] = 'person';
... ...
@@ -76,8 +76,8 @@ function upload_changed_contact($id)
76 76
     if ($c['state'] == 'deleted') {
77 77
         $ac['hidden'] = true;
78 78
     }
79
-    $data = array("contact" => $ac,
80
-            "actingAs" => "designatedAgent");
79
+    $data = ["contact" => $ac,
80
+            "actingAs" => "designatedAgent", ];
81 81
     $result = api_request('contactUpdate', $data);
82 82
     if ($result['status'] != 'success') {
83 83
         warning("Es gab ein Problem beim Hochladen der geänderten Adresse zum Domainregistrar. Das sollte nicht sein!");
... ...
@@ -21,7 +21,7 @@ require_once('inc/icons.php');
21 21
 require_once('session/start.php');
22 22
 
23 23
 
24
-require_role(array(ROLE_CUSTOMER));
24
+require_role([ROLE_CUSTOMER]);
25 25
 
26 26
 title("Adressen verwalten");
27 27
 
... ...
@@ -32,8 +32,8 @@ $kundenkontakte = get_kundenkontakte();
32 32
 output('<p>Sie haben aktuell diese Adressen gespeichert:</p>
33 33
 <div class="contact-list">');
34 34
 
35
-$liste = array_merge(array_filter(array($kundenkontakte['kunde'], $kundenkontakte['rechnung'], $kundenkontakte['extern'])), array_keys($contacts));
36
-$already_displayed = array();
35
+$liste = array_merge(array_filter([$kundenkontakte['kunde'], $kundenkontakte['rechnung'], $kundenkontakte['extern']]), array_keys($contacts));
36
+$already_displayed = [];
37 37
 foreach ($liste as $id) {
38 38
     if (in_array($id, $already_displayed)) {
39 39
         continue;
... ...
@@ -44,7 +44,7 @@ foreach ($liste as $id) {
44 44
         system_failure('Fehlerhafte Kunden-Zuordnung bei den Kontakten');
45 45
     }
46 46
     $contact = $contacts[$id];
47
-    $usage = array();
47
+    $usage = [];
48 48
     if ($id == $kundenkontakte['kunde']) {
49 49
         $cssclass .= 'mainaddress';
50 50
         $usage[] = 'Stamm-Adresse';
... ...
@@ -18,5 +18,5 @@ $role = $_SESSION['role'];
18 18
 
19 19
 
20 20
 if (($role & ROLE_CUSTOMER)) {
21
-    $menu["contacts_list"] = array("label" => "Adressen verwalten", "file" => "list", "weight" => 1, "submenu" => "index_index");
21
+    $menu["contacts_list"] = ["label" => "Adressen verwalten", "file" => "list", "weight" => 1, "submenu" => "index_index"];
22 22
 }
... ...
@@ -19,7 +19,7 @@ require_once('numbers.php');
19 19
 $number = $_REQUEST['number'];
20 20
 $country = $_REQUEST['country'];
21 21
 
22
-$return = array();
22
+$return = [];
23 23
 $return['field'] = $_REQUEST['field'];
24 24
 
25 25
 if ($number) {
... ...
@@ -21,7 +21,7 @@ require_once('inc/debug.php');
21 21
 require_once('session/start.php');
22 22
 
23 23
 
24
-require_role(array(ROLE_CUSTOMER));
24
+require_role([ROLE_CUSTOMER]);
25 25
 $section = 'contacts_list';
26 26
 
27 27
 $back = 'list';
... ...
@@ -23,7 +23,7 @@ require_once('inc/jquery.php');
23 23
 require_once('session/start.php');
24 24
 
25 25
 
26
-require_role(array(ROLE_CUSTOMER));
26
+require_role([ROLE_CUSTOMER]);
27 27
 $section = 'contacts_list';
28 28
 
29 29
 title("Adresse verwenden als...");
... ...
@@ -111,7 +111,7 @@ if (isset($_REQUEST['useas'])) {
111 111
     if (possible_domainholder($contact)) {
112 112
         $domains = domainlist_by_contact($contact);
113 113
         foreach ($domains as $d) {
114
-            $funktion = array();
114
+            $funktion = [];
115 115
             if ($contact['id'] == $d->owner) {
116 116
                 $funktion[] = 'Inhaber';
117 117
             }
... ...
@@ -16,7 +16,7 @@ Nevertheless, in case you use a significant part of this code, we ask (but not r
16 16
 
17 17
 require_once('contract.php');
18 18
 
19
-require_role(array(ROLE_CUSTOMER));
19
+require_role([ROLE_CUSTOMER]);
20 20
 
21 21
 echo contract_html();
22 22
 die();
... ...
@@ -19,8 +19,8 @@ require_role(ROLE_CUSTOMER);
19 19
 
20 20
 function get_orderprocessing_contract()
21 21
 {
22
-    $args = array(
23
-        "cid" => (int) $_SESSION['customerinfo']['customerno']);
22
+    $args = [
23
+        "cid" => (int) $_SESSION['customerinfo']['customerno'], ];
24 24
     $result = db_query("SELECT id, signed, type, startdate, enddate FROM kundendaten.contract WHERE customer=:cid AND type='orderprocessing' AND (enddate IS NULL OR enddate < CURDATE())", $args);
25 25
     if ($result->rowCount() == 0) {
26 26
         return null;
... ...
@@ -62,8 +62,8 @@ function contract_html()
62 62
 
63 63
 function save_op_contract($pdfdata)
64 64
 {
65
-    $args = array("cid" => $_SESSION['customerinfo']['customerno'],
66
-            "pdfdata" => $pdfdata);
65
+    $args = ["cid" => $_SESSION['customerinfo']['customerno'],
66
+            "pdfdata" => $pdfdata, ];
67 67
     db_query(
68 68
         "INSERT INTO kundendaten.contract (customer, signed, type, startdate, pdfdata) VALUES (:cid, NOW(), 'orderprocessing', CURDATE(), :pdfdata)",
69 69
         $args
... ...
@@ -73,8 +73,8 @@ function save_op_contract($pdfdata)
73 73
 
74 74
 function get_contract_pdf($id)
75 75
 {
76
-    $args = array("id" => $id,
77
-        "cid" => $_SESSION['customerinfo']['customerno']);
76
+    $args = ["id" => $id,
77
+        "cid" => $_SESSION['customerinfo']['customerno'], ];
78 78
     $result = db_query("SELECT pdfdata FROM kundendaten.contract WHERE id=:id AND customer=:cid", $args);
79 79
     $line = $result->fetch();
80 80
     return $line['pdfdata'];
... ...
@@ -18,7 +18,7 @@ require_once('contract.php');
18 18
 require_once('inc/debug.php');
19 19
 require_once('inc/icons.php');
20 20
 
21
-require_role(array(ROLE_CUSTOMER));
21
+require_role([ROLE_CUSTOMER]);
22 22
 
23 23
 title("AV-Vertrag");
24 24
 
... ...
@@ -18,5 +18,5 @@ $role = $_SESSION['role'];
18 18
 
19 19
 
20 20
 if (($role & ROLE_CUSTOMER)) {
21
-    $menu["contract_list"] = array("label" => "AV-Vertrag", "file" => "list", "weight" => 10, "submenu" => "index_index");
21
+    $menu["contract_list"] = ["label" => "AV-Vertrag", "file" => "list", "weight" => 10, "submenu" => "index_index"];
22 22
 }
... ...
@@ -18,7 +18,7 @@ require_once('contract.php');
18 18
 require_once('inc/debug.php');
19 19
 require_once('inc/icons.php');
20 20
 
21
-require_role(array(ROLE_CUSTOMER));
21
+require_role([ROLE_CUSTOMER]);
22 22
 
23 23
 title("Neuen AV-Vertrag abschließen");
24 24
 
... ...
@@ -16,7 +16,7 @@ Nevertheless, in case you use a significant part of this code, we ask (but not r
16 16
 
17 17
 require_once('contract.php');
18 18
 
19
-require_role(array(ROLE_CUSTOMER));
19
+require_role([ROLE_CUSTOMER]);
20 20
 
21 21
 if (isset($_REQUEST['agree']) && $_REQUEST['agree'] == 'yes') {
22 22
     require_once('vendor/autoload.php');
... ...
@@ -23,7 +23,7 @@ require_role(ROLE_SYSTEMUSER);
23 23
 require_once('dnsinclude.php');
24 24
 
25 25
 
26
-$domains = get_domain_list((isset($_SESSION['customerinfo']['customerno']) ? $_SESSION['customerinfo']['customerno'] : null), $_SESSION['userinfo']['uid']);
26
+$domains = get_domain_list(($_SESSION['customerinfo']['customerno'] ?? null), $_SESSION['userinfo']['uid']);
27 27
 
28 28
 title('DNS-Records');
29 29
 output('<p>Hier sehen Sie eine Übersicht über die angelegten DNS-records zu Ihren Domains.</p>');
... ...
@@ -83,7 +83,7 @@ foreach ($records as $rec) {
83 83
     }
84 84
     $ttl = ($rec['ttl'] ? $rec['ttl'] : 3600);
85 85
     $link = $rec['fqdn'];
86
-    if (!in_array($rec['type'], array('a', 'aaaa', 'mx', 'cname', 'ns', 'txt', 'spf', 'ptr', 'sshfp', 'srv', 'caa'))) {
86
+    if (!in_array($rec['type'], ['a', 'aaaa', 'mx', 'cname', 'ns', 'txt', 'spf', 'ptr', 'sshfp', 'srv', 'caa'])) {
87 87
         $editable = false;
88 88
     }
89 89
     $delete = internal_link('dns_record_save', icon_delete('Record löschen'), "id={$rec['id']}&action=delete");
... ...
@@ -25,11 +25,11 @@ require_once('dnsinclude.php');
25 25
 
26 26
 $section = 'dns_dns';
27 27
 
28
-$data = array();
28
+$data = [];
29 29
 $type = null;
30 30
 
31 31
 $dyndns = false;
32
-$dyndns_accounts = array();
32
+$dyndns_accounts = [];
33 33
 foreach (get_dyndns_accounts() as $t) {
34 34
     $dyndns_accounts[$t['id']] = $t['handle'];
35 35
 }
... ...
@@ -123,11 +123,11 @@ if ($type == 'spf' || $type == 'txt') {
123 123
 }
124 124
 
125 125
 if ($type == 'sshfp') {
126
-    $algs = array(
126
+    $algs = [
127 127
     1 => "RSA",
128 128
     2 => "DSA",
129 129
     3 => "ECDSA",
130
-    4 => "ED25519" );
130
+    4 => "ED25519", ];
131 131
 
132 132
     $option="";
133 133
     foreach ($algs as $key => $alg) {
... ...
@@ -61,8 +61,8 @@ if (isset($_GET['action']) && ($_GET['action'] == 'delete')) {
61 61
 
62 62
     $record['hostname'] = $_REQUEST['hostname'];
63 63
     $record['domain'] = (int) $_REQUEST['domain'];
64
-    $record['ip'] = (isset($_REQUEST['ip']) ? $_REQUEST['ip'] : null);
65
-    $record['data'] = (isset($_REQUEST['data']) ? $_REQUEST['data'] : null);
64
+    $record['ip'] = ($_REQUEST['ip'] ?? null);
65
+    $record['data'] = ($_REQUEST['data'] ?? null);
66 66
     $record['dyndns'] = (isset($_REQUEST['dyndns']) ? (int) $_REQUEST['dyndns'] : null);
67 67
     $record['spec'] = (isset($_REQUEST['spec']) ? (int) $_REQUEST['spec'] : null);
68 68
     $record['ttl'] = (int) $_REQUEST['ttl'];
... ...
@@ -25,7 +25,7 @@ $section = 'dns_dyndns';
25 25
 
26 26
 
27 27
 $new = true;
28
-$dyndns = array();
28
+$dyndns = [];
29 29
 if (isset($_REQUEST['id'])) {
30 30
     $dyndns = get_dyndns_account($_REQUEST['id']);
31 31
     $new = false;
... ...
@@ -71,7 +71,7 @@ if (! $new) {
71 71
   </div>';
72 72
 }
73 73
 
74
-$form = '<p><label for="handle">Bezeichnung:</label>&#160;<input type="text" name="handle" id="handle" value="'.(isset($dyndns['handle']) ? $dyndns['handle'] : '').'" onkeyup="updateUsernameHTTP()" /></p>
74
+$form = '<p><label for="handle">Bezeichnung:</label>&#160;<input type="text" name="handle" id="handle" value="'.($dyndns['handle'] ?? '').'" onkeyup="updateUsernameHTTP()" /></p>
75 75
 
76 76
 <h4>Update per HTTPs</h4>
77 77
 <p style="margin-left: 2em;">Geben Sie hier ein Passwort ein um das Update per HTTPs zu aktivieren.'.$http_update_info.'</p>
... ...
@@ -80,7 +80,7 @@ $form = '<p><label for="handle">Bezeichnung:</label>&#160;<input type="text" nam
80 80
 
81 81
 <h4>Update per SSH</h4>
82 82
 <p style="margin-left: 2em;">Kopieren Sie Ihren SSH-public-Key im OpenSSH-Format in dieses Eingabefeld um das Update per SSH zu aktivieren.</p>
83
-<p style="margin-left: 2em; vertical-align: middle;"><label for="sshkey">SSH Public-Key:</label><br /><textarea style="height: 10em; width: 80%;" id="sshkey" name="sshkey">'.(isset($dyndns['sshkey']) ? $dyndns['sshkey'] : '').'</textarea></p>
83
+<p style="margin-left: 2em; vertical-align: middle;"><label for="sshkey">SSH Public-Key:</label><br /><textarea style="height: 10em; width: 80%;" id="sshkey" name="sshkey">'.($dyndns['sshkey'] ?? '').'</textarea></p>
84 84
 
85 85
 <p style="margin-left: 2em;"><input type="submit" value="Speichern" /></p>
86 86
 ';
... ...
@@ -27,7 +27,7 @@ $dyndns = get_dyndns_account($_REQUEST['id']);
27 27
 
28 28
 title("Hostnames für DynDNS-Account ".filter_output_html($dyndns['handle']));
29 29
 
30
-$available_domains = array();
30
+$available_domains = [];
31 31
 
32 32
 $domains = get_domain_list($_SESSION['customerinfo']['customerno'], $_SESSION['userinfo']['uid']);
33 33
 foreach ($domains as $d) {
... ...
@@ -21,13 +21,13 @@ require_once('inc/error.php');
21 21
 
22 22
 require_once('class/domain.php');
23 23
 
24
-$caa_properties= array( 0 => "issue", 1 => "issuewild", 2 => "iodef" );
24
+$caa_properties= [ 0 => "issue", 1 => "issuewild", 2 => "iodef" ];
25 25
 
26 26
 function get_dyndns_accounts()
27 27
 {
28 28
     $uid = (int) $_SESSION['userinfo']['uid'];
29
-    $result = db_query("SELECT * FROM dns.dyndns WHERE uid=?", array($uid));
30
-    $list = array();
29
+    $result = db_query("SELECT * FROM dns.dyndns WHERE uid=?", [$uid]);
30
+    $list = [];
31 31
     while ($item = $result->fetch()) {
32 32
         array_push($list, $item);
33 33
     }
... ...
@@ -38,8 +38,8 @@ function get_dyndns_accounts()
38 38
 
39 39
 function get_dyndns_account($id, $ignore=true)
40 40
 {
41
-    $args = array(":id" => (int) $id,
42
-                ":uid" => (int) $_SESSION['userinfo']['uid']);
41
+    $args = [":id" => (int) $id,
42
+                ":uid" => (int) $_SESSION['userinfo']['uid'], ];
43 43
     $result = db_query("SELECT * FROM dns.dyndns WHERE id=:id AND uid=:uid", $args);
44 44
     if ($result->rowCount() != 1) {
45 45
         if ($ignore) {
... ...
@@ -78,7 +78,7 @@ function create_dyndns_account($handle, $password_http, $sshkey)
78 78
     db_query(
79 79
         "INSERT INTO dns.dyndns (uid, handle, password, sshkey) VALUES ".
80 80
            "(:uid, :handle, :pwhash, :sshkey)",
81
-        array(":uid" => $uid, ":handle" => $handle, ":pwhash" => $pwhash, ":sshkey" => $sshkey)
81
+        [":uid" => $uid, ":handle" => $handle, ":pwhash" => $pwhash, ":sshkey" => $sshkey]
82 82
     );
83 83
     $dyndns_id = db_insert_id();
84 84
     //$masterdomain = new Domain(config('masterdomain'));
... ...
@@ -100,7 +100,7 @@ function edit_dyndns_account($id, $handle, $password_http, $sshkey)
100 100
         $sshkey = null;
101 101
     }
102 102
 
103
-    $args = array(":handle" => $handle, ":sshkey" => $sshkey, ":id" => $id);
103
+    $args = [":handle" => $handle, ":sshkey" => $sshkey, ":id" => $id];
104 104
     $pwhash = null;
105 105
     if ($password_http && $password_http != '************') {
106 106
         $args[":pwhash"] = "{SHA}".base64_encode(sha1($password_http, true));
... ...
@@ -116,7 +116,7 @@ function delete_dyndns_account($id)
116 116
 {
117 117
     $id = (int) $id;
118 118
 
119
-    db_query("DELETE FROM dns.dyndns WHERE id=?", array($id));
119
+    db_query("DELETE FROM dns.dyndns WHERE id=?", [$id]);
120 120
     logger(LOG_INFO, "modules/dns/include/dnsinclude", "dyndns", "deleted account »{$id}«");
121 121
 }
122 122
 
... ...
@@ -124,8 +124,8 @@ function delete_dyndns_account($id)
124 124
 function get_dyndns_records($id)
125 125
 {
126 126
     $id = (int) $id;
127
-    $result = db_query("SELECT hostname, domain, type, ttl, lastchange, id FROM dns.custom_records WHERE dyndns=?", array($id));
128
-    $data = array();
127
+    $result = db_query("SELECT hostname, domain, type, ttl, lastchange, id FROM dns.custom_records WHERE dyndns=?", [$id]);
128
+    $data = [];
129 129
     while ($entry = $result->fetch()) {
130 130
         $dom = new Domain((int) $entry['domain']);
131 131
         if ($dom->fqdn != config('masterdomain') && $dom->fqdn != config('user_vhosts_domain')) {
... ...
@@ -141,7 +141,7 @@ function get_dyndns_records($id)
141 141
     return $data;
142 142
 }
143 143
 
144
-$valid_record_types = array('a', 'aaaa', 'mx', 'ns', 'spf', 'txt', 'cname', 'ptr', 'srv', 'raw', 'sshfp', 'caa', 'srv');
144
+$valid_record_types = ['a', 'aaaa', 'mx', 'ns', 'spf', 'txt', 'cname', 'ptr', 'srv', 'raw', 'sshfp', 'caa', 'srv'];
145 145
 
146 146
 
147 147
 function blank_dns_record($type)
... ...
@@ -150,14 +150,14 @@ function blank_dns_record($type)
150 150
     if (!in_array(strtolower($type), $valid_record_types)) {
151 151
         system_failure('invalid type: '.$type);
152 152
     }
153
-    $rec = array('hostname' => null,
153
+    $rec = ['hostname' => null,
154 154
                'domain' => 0,
155 155
                'type' => strtolower($type),
156 156
                'ttl' => 3600,
157 157
                'ip' => null,
158 158
                'dyndns' => null,
159 159
                'data' => null,
160
-               'spec' => null);
160
+               'spec' => null, ];
161 161
     if (strtolower($type) == 'mx') {
162 162
         $rec['data'] = config('default_mx');
163 163
         $rec['spec'] = '5';
... ...
@@ -168,7 +168,7 @@ function blank_dns_record($type)
168 168
 function get_dns_record($id)
169 169
 {
170 170
     $id = (int) $id;
171
-    $result = db_query("SELECT hostname, domain, type, ip, dyndns, spec, data, ttl FROM dns.custom_records WHERE id=?", array($id));
171
+    $result = db_query("SELECT hostname, domain, type, ip, dyndns, spec, data, ttl FROM dns.custom_records WHERE id=?", [$id]);
172 172
     if ($result->rowCount() != 1) {
173 173
         system_failure('illegal ID');
174 174
     }
... ...
@@ -183,8 +183,8 @@ function get_dns_record($id)
183 183
 function get_domain_records($dom)
184 184
 {
185 185
     $dom = (int) $dom;
186
-    $result = db_query("SELECT hostname, domain, type, ip, dyndns, spec, data, ttl, id FROM dns.custom_records WHERE domain=?", array($dom));
187
-    $data = array();
186
+    $result = db_query("SELECT hostname, domain, type, ip, dyndns, spec, data, ttl, id FROM dns.custom_records WHERE domain=?", [$dom]);
187
+    $data = [];
188 188
     while ($entry = $result->fetch()) {
189 189
         $dom = new Domain((int) $entry['domain']);
190 190
         $dom->ensure_userdomain();
... ...
@@ -200,8 +200,8 @@ function get_domain_records($dom)
200 200
 
201 201
 function get_domain_auto_records($domainname)
202 202
 {
203
-    $result = db_query("SELECT hostname, domain, CONCAT_WS('.', hostname, domain) AS fqdn, type, ip, spec, data, ttl FROM dns.tmp_autorecords WHERE domain=?", array($domainname));
204
-    $data = array();
203
+    $result = db_query("SELECT hostname, domain, CONCAT_WS('.', hostname, domain) AS fqdn, type, ip, spec, data, ttl FROM dns.tmp_autorecords WHERE domain=?", [$domainname]);
204
+    $data = [];
205 205
     while ($entry = $result->fetch()) {
206 206
         array_push($data, $entry);
207 207
     }
... ...
@@ -222,7 +222,7 @@ function warn_autorecord_collission($hostname, $domain, $type)
222 222
 }
223 223
 
224 224
 
225
-$implemented_record_types = array('a', 'aaaa', 'mx', 'spf', 'txt', 'cname', 'ptr', 'srv', 'ns', 'sshfp', 'caa');
225
+$implemented_record_types = ['a', 'aaaa', 'mx', 'spf', 'txt', 'cname', 'ptr', 'srv', 'ns', 'sshfp', 'caa'];
226 226
 
227 227
 function save_dns_record($id, $record)
228 228
 {
... ...
@@ -339,7 +339,7 @@ function save_dns_record($id, $record)
339 339
       if (count($data) != 2) {
340 340
           system_failure('Das eingegebene Ziel war nicht im Format hostname:port');
341 341
       }
342
-      list($hostname, $port) = $data;
342
+      [$hostname, $port] = $data;
343 343
       verify_input_hostname($hostname);
344 344
       if ($port !== (string)(int) $port || (int)$port < 1 || (int)$port > 65535) {
345 345
           system_failure('Ungültige Portnummer');
... ...
@@ -350,14 +350,14 @@ function save_dns_record($id, $record)
350 350
       system_failure('Not implemented');
351 351
   }
352 352
     $id = (int) $id;
353
-    $args = array(":domain" => $dom->id,
353
+    $args = [":domain" => $dom->id,
354 354
                 ":hostname" => $record['hostname'],
355 355
                 ":type" => $record['type'],
356 356
                 ":ttl" => ($record['ttl'] == 0 ? null : (int) $record['ttl']),
357 357
                 ":ip" => $record['ip'],
358 358
                 ":dyndns" => $record['dyndns'],
359 359
                 ":data" => $record['data'],
360
-                ":spec" => $record['spec']);
360
+                ":spec" => $record['spec'], ];
361 361
     if ($id) {
362 362
         $args[":id"] = $id;
363 363
         db_query("UPDATE dns.custom_records SET hostname=:hostname, domain=:domain, type=:type, ttl=:ttl, ip=:ip, dyndns=:dyndns, data=:data, spec=:spec WHERE id=:id", $args);
... ...
@@ -372,7 +372,7 @@ function delete_dns_record($id)
372 372
     $id = (int) $id;
373 373
     // Diese Funktion prüft, ob der Eintrag einer eigenen Domain gehört
374 374
     $record = get_dns_record($id);
375
-    db_query("DELETE FROM dns.custom_records WHERE id=?", array($id));
375
+    db_query("DELETE FROM dns.custom_records WHERE id=?", [$id]);
376 376
 }
377 377
 
378 378
 
... ...
@@ -382,7 +382,7 @@ function convert_from_autorecords($domainid)
382 382
     $dom->ensure_userdomain();
383 383
     $dom = $dom->id;
384 384
 
385
-    db_query("INSERT IGNORE INTO dns.custom_records SELECT r.id, r.lastchange, type, d.id, hostname, ip, NULL AS dyndns, data, spec, ttl FROM dns.v_tmptable_allrecords AS r INNER JOIN dns.v_domains AS d ON (d.name=r.domain) WHERE d.id=?", array($dom));
385
+    db_query("INSERT IGNORE INTO dns.custom_records SELECT r.id, r.lastchange, type, d.id, hostname, ip, NULL AS dyndns, data, spec, ttl FROM dns.v_tmptable_allrecords AS r INNER JOIN dns.v_domains AS d ON (d.name=r.domain) WHERE d.id=?", [$dom]);
386 386
     disable_autorecords($dom);
387 387
     db_query("UPDATE dns.dnsstatus SET status='outdated'");
388 388
     warning("Die automatischen Einträge werden in Kürze abgeschaltet, bitte haben Sie einen Moment Geduld.");
... ...
@@ -395,8 +395,8 @@ function enable_autorecords($domainid)
395 395
     $dom->ensure_userdomain();
396 396
     $dom = $dom->id;
397 397
 
398
-    db_query("UPDATE kundendaten.domains SET autodns=1 WHERE id=?", array($dom));
399
-    db_query("DELETE FROM dns.custom_records WHERE type='ns' AND domain=? AND hostname IS NULL", array($dom));
398
+    db_query("UPDATE kundendaten.domains SET autodns=1 WHERE id=?", [$dom]);
399
+    db_query("DELETE FROM dns.custom_records WHERE type='ns' AND domain=? AND hostname IS NULL", [$dom]);
400 400
     warning("Die automatischen Einträge werden in Kürze aktiviert, bitte haben Sie einen Moment Geduld.");
401 401
 }
402 402
 
... ...
@@ -406,20 +406,20 @@ function disable_autorecords($domainid)
406 406
     $dom->ensure_userdomain();
407 407
     $dom = $dom->id;
408 408
 
409
-    db_query("UPDATE kundendaten.domains SET autodns=0 WHERE id=?", array($dom));
409
+    db_query("UPDATE kundendaten.domains SET autodns=0 WHERE id=?", [$dom]);
410 410
 }
411 411
 
412 412
 
413 413
 function domain_is_maildomain($domain)
414 414
 {
415 415
     $domain = (int) $domain;
416
-    $result = db_query("SELECT mail FROM kundendaten.domains WHERE id=?", array($domain));
416
+    $result = db_query("SELECT mail FROM kundendaten.domains WHERE id=?", [$domain]);
417 417
     $dom = $result->fetch();
418 418
     return ($dom['mail'] != 'none');
419 419
 }
420 420
 
421 421
 
422
-$own_ns = array();
422
+$own_ns = [];
423 423
 
424 424
 function own_ns()
425 425
 {
... ...
@@ -436,7 +436,7 @@ function own_ns()
436 436
 }
437 437
 
438 438
 
439
-$tld_ns = array();
439
+$tld_ns = [];
440 440
 
441 441
 function check_dns($domainname, $tld)
442 442
 {
... ...
@@ -478,7 +478,7 @@ function remove_from_dns($dom)
478 478
     if (! $current) {
479 479
         system_failure("Domain nicht gefunden!");
480 480
     }
481
-    db_query("UPDATE kundendaten.domains SET dns=0 WHERE id=?", array($current->id));
481
+    db_query("UPDATE kundendaten.domains SET dns=0 WHERE id=?", [$current->id]);
482 482
 }
483 483
 
484 484
 function add_to_dns($dom)
... ...
@@ -494,5 +494,5 @@ function add_to_dns($dom)
494 494
     if (! $current) {
495 495
         system_failure("Domain nicht gefunden!");
496 496
     }
497
-    db_query("UPDATE kundendaten.domains SET dns=1, autodns=1 WHERE id=?", array($current->id));
497
+    db_query("UPDATE kundendaten.domains SET dns=1, autodns=1 WHERE id=?", [$current->id]);
498 498
 }
... ...
@@ -18,6 +18,6 @@ $role = $_SESSION['role'];
18 18
 
19 19
 
20 20
 if ($role & ROLE_SYSTEMUSER) {
21
-    $menu["dns_dns"] = array("label" => "DNS-Einträge", "file" => "dns", "weight" => 10, "submenu" => "domains_domains");
22
-    $menu["dns_dyndns"] = array("label" => "DynDNS", "file" => "dyndns", "weight" => 11, "submenu" => "domains_domains");
21
+    $menu["dns_dns"] = ["label" => "DNS-Einträge", "file" => "dns", "weight" => 10, "submenu" => "domains_domains"];
22
+    $menu["dns_dyndns"] = ["label" => "DynDNS", "file" => "dyndns", "weight" => 11, "submenu" => "domains_domains"];
23 23
 }
... ...
@@ -20,7 +20,7 @@ require_once('inc/icons.php');
20 20
 require_once('class/domain.php');
21 21
 require_once('domains.php');
22 22
 
23
-require_role(array(ROLE_CUSTOMER, ROLE_SYSTEMUSER));
23
+require_role([ROLE_CUSTOMER, ROLE_SYSTEMUSER]);
24 24
 
25 25
 $dom = null;
26 26
 if (isset($_REQUEST['id'])) {
... ...
@@ -55,7 +55,7 @@ if (have_role(ROLE_CUSTOMER) && isset($_SESSION['customerinfo']['customerno']) &
55 55
             $is_current_user = false;
56 56
         }
57 57
         // Mehrere User vorhanden
58
-        $options = array();
58
+        $options = [];
59 59
         foreach ($useraccounts as $u) {
60 60
             $options[$u['uid']] = $u['username'];
61 61
         }
... ...
@@ -21,7 +21,7 @@ require_once('inc/icons.php');
21 21
 require_once('class/domain.php');
22 22
 require_once('domains.php');
23 23
 
24
-require_role(array(ROLE_SYSTEMUSER, ROLE_CUSTOMER));
24
+require_role([ROLE_SYSTEMUSER, ROLE_CUSTOMER]);
25 25
 
26 26
 if (have_role(ROLE_CUSTOMER)) {
27 27
     $user_domains = get_domain_list($_SESSION['customerinfo']['customerno']);
... ...
@@ -88,7 +88,7 @@ foreach ($user_domains as $domain) {
88 88
         $regdate = '<em>Zuständige Kundennummer: '.$domain->kunde.'</em>';
89 89
     }
90 90
 
91
-    $features = array();
91
+    $features = [];
92 92
     if ($domain->dns == 1) {
93 93
         if (dns_in_use($domain->id)) {
94 94
             $features[] = 'DNS';
... ...
@@ -24,13 +24,13 @@ require_once('contactapi.php');
24 24
 
25 25
 function api_download_domain($id)
26 26
 {
27
-    $result = db_query("SELECT id, CONCAT_WS('.', domainname, tld) AS fqdn, owner, admin_c, registrierungsdatum, kuendigungsdatum FROM kundendaten.domains WHERE id=?", array($id));
27
+    $result = db_query("SELECT id, CONCAT_WS('.', domainname, tld) AS fqdn, owner, admin_c, registrierungsdatum, kuendigungsdatum FROM kundendaten.domains WHERE id=?", [$id]);
28 28
     if ($result->rowCount() < 1) {
29 29
         system_failure('Domain nicht gefunden');
30 30
     }
31 31
     $dom = $result->fetch();
32 32
 
33
-    $data = array("domainName" => $dom['fqdn']);