Completed
Push — master ( b35b0f...acc097 )
by Greg
05:21
created
classes/DomainMOD/Date.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -30,6 +30,9 @@
 block discarded – undo
30 30
         $this->time = new Time();
31 31
     }
32 32
 
33
+    /**
34
+     * @param string $input_date
35
+     */
33 36
     public function checkDateFormat($input_date)
34 37
     {
35 38
         if (preg_match('/^(\d{4})-(\d{2})-(\d{2})$/', $input_date, $output_date)) {
Please login to merge, or discard this patch.
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -48,8 +48,12 @@
 block discarded – undo
48 48
         $start_date = substr($daterange, 0, 10);
49 49
         $end_date = substr($daterange, -10, 10);
50 50
 
51
-        if (!$this->checkDateFormat($start_date)) $start_date = $this->time->timeBasicMinusDays('14');
52
-        if (!$this->checkDateFormat($end_date)) $end_date = $this->time->timeBasicPlusYears('11');
51
+        if (!$this->checkDateFormat($start_date)) {
52
+            $start_date = $this->time->timeBasicMinusDays('14');
53
+        }
54
+        if (!$this->checkDateFormat($end_date)) {
55
+            $end_date = $this->time->timeBasicPlusYears('11');
56
+        }
53 57
 
54 58
         return array($start_date, $end_date);
55 59
     }
Please login to merge, or discard this patch.
classes/DomainMOD/Time.php 1 patch
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -39,6 +39,9 @@  discard block
 block discarded – undo
39 39
         return gmdate("Y-m-d", mktime(date("H"), date("i"), date("s"), date("m"), date("d"), date("Y")));
40 40
     }
41 41
 
42
+    /**
43
+     * @param string $days
44
+     */
42 45
     public function timeBasicMinusDays($days)
43 46
     {
44 47
         return gmdate("Y-m-d", mktime(date("H"), date("i"), date("s"), date("m"), date("d") - $days, date("Y")));
@@ -49,6 +52,9 @@  discard block
 block discarded – undo
49 52
         return gmdate("Y-m-d", mktime(date("H"), date("i"), date("s"), date("m"), date("d") + $days, date("Y")));
50 53
     }
51 54
 
55
+    /**
56
+     * @param string $years
57
+     */
52 58
     public function timeBasicPlusYears($years)
53 59
     {
54 60
         return gmdate("Y-m-d", mktime(date("H"), date("i"), date("s"), date("m"), date("d"), date("Y") + $years));
Please login to merge, or discard this patch.
classes/DomainMOD/DwZones.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -65,10 +65,10 @@
 block discarded – undo
65 65
             foreach ($xml->zone as $hit) {
66 66
 
67 67
                 $tmpq->execute(array(
68
-                               'server_id' => $server_id,
69
-                               'domain' => $hit->domain,
70
-                               'zonefile' => $hit->zonefile,
71
-                               'insert_time' => $this->time->stamp()));
68
+                                'server_id' => $server_id,
69
+                                'domain' => $hit->domain,
70
+                                'zonefile' => $hit->zonefile,
71
+                                'insert_time' => $this->time->stamp()));
72 72
 
73 73
             }
74 74
 
Please login to merge, or discard this patch.
classes/DomainMOD/DwBuild.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -108,8 +108,8 @@
 block discarded – undo
108 108
                 build_time_overall = :total_build_time_o,
109 109
                 has_ever_been_built_overall = '1'");
110 110
         $tmpq->execute(array(
111
-                       'build_end_time_o' => $build_end_time_o,
112
-                       'total_build_time_o' => $total_build_time_o));
111
+                        'build_end_time_o' => $build_end_time_o,
112
+                        'total_build_time_o' => $total_build_time_o));
113 113
     }
114 114
 
115 115
     public function getBuildTime($build_start_time)
Please login to merge, or discard this patch.
classes/DomainMOD/DwServers.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -56,8 +56,8 @@  discard block
 block discarded – undo
56 56
                     build_status = '0'
57 57
                 WHERE id = :id");
58 58
             $tmpq->execute(array(
59
-                           'build_start_time' => $build_start_time,
60
-                           'id' => $row->id));
59
+                            'build_start_time' => $build_start_time,
60
+                            'id' => $row->id));
61 61
 
62 62
             $api_call = $accounts->getApiCall();
63 63
             $api_results = $build->apiCall($api_call, $row->host, $row->protocol, $row->port, $row->username,
@@ -91,9 +91,9 @@  discard block
 block discarded – undo
91 91
                 has_ever_been_built = '1'
92 92
             WHERE id = :server_id");
93 93
         $tmpq->execute(array(
94
-                       'build_end_time' => $build_end_time,
95
-                       'total_build_time' => $total_build_time,
96
-                       'server_id' => $server_id));
94
+                        'build_end_time' => $build_end_time,
95
+                        'total_build_time' => $total_build_time,
96
+                        'server_id' => $server_id));
97 97
     }
98 98
 
99 99
 } //@formatter:on
Please login to merge, or discard this patch.
classes/DomainMOD/Log.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -55,13 +55,13 @@
 block discarded – undo
55 55
             VALUES
56 56
             (:user_id, :area, :level, :message, :extra, :url, :insert_time)");
57 57
         $tmpq->execute(array(
58
-                       'user_id' => $this->user_id,
59
-                       'area' => $this->area,
60
-                       'level' => $level,
61
-                       'message' => $message,
62
-                       'extra' => $extra_info_formatted,
63
-                       'url' => $this->url,
64
-                       'insert_time' => $this->time->stamp()));
58
+                        'user_id' => $this->user_id,
59
+                        'area' => $this->area,
60
+                        'level' => $level,
61
+                        'message' => $message,
62
+                        'extra' => $extra_info_formatted,
63
+                        'url' => $this->url,
64
+                        'insert_time' => $this->time->stamp()));
65 65
     }
66 66
 
67 67
     public function formatExtraInfo($extra_info)
Please login to merge, or discard this patch.
classes/DomainMOD/DwStats.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -63,10 +63,10 @@  discard block
 block discarded – undo
63 63
                 dw_dns_records = :total_dns_records
64 64
             WHERE id = :server_id");
65 65
         $tmpq->execute(array(
66
-                       'total_accounts' => $total_accounts,
67
-                       'total_dns_zones' => $total_dns_zones,
68
-                       'total_dns_records' => $total_dns_records,
69
-                       'server_id' => $server_id));
66
+                        'total_accounts' => $total_accounts,
67
+                        'total_dns_zones' => $total_dns_zones,
68
+                        'total_dns_records' => $total_dns_records,
69
+                        'server_id' => $server_id));
70 70
     }
71 71
 
72 72
     public function updateDwTotalsTable()
@@ -119,11 +119,11 @@  discard block
 block discarded – undo
119 119
             VALUES
120 120
             (:total_dw_servers, :total_dw_accounts, :total_dw_dns_zones, :total_dw_records, :insert_time)");
121 121
         $tmpq->execute(array(
122
-                       'total_dw_servers' => $total_dw_servers,
123
-                       'total_dw_accounts' => $total_dw_accounts,
124
-                       'total_dw_dns_zones' => $total_dw_dns_zones,
125
-                       'total_dw_records' => $total_dw_records,
126
-                       'insert_time' => $this->time->stamp()));
122
+                        'total_dw_servers' => $total_dw_servers,
123
+                        'total_dw_accounts' => $total_dw_accounts,
124
+                        'total_dw_dns_zones' => $total_dw_dns_zones,
125
+                        'total_dw_records' => $total_dw_records,
126
+                        'insert_time' => $this->time->stamp()));
127 127
     }
128 128
 
129 129
     public function getServerTotals()
Please login to merge, or discard this patch.
classes/DomainMOD/DwRecords.php 1 patch
Indentation   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -94,30 +94,30 @@
 block discarded – undo
94 94
             foreach ($xml->result->record as $hit) {
95 95
 
96 96
                 $tmpq->execute(array(
97
-                               'server_id' => $server_id,
98
-                               'zone_id' => $zone_id,
99
-                               'domain' => $domain,
100
-                               'mname' => $hit->mname,
101
-                               'rname' => $hit->rname,
102
-                               'serial' => $hit->serial,
103
-                               'refresh' => $hit->refresh,
104
-                               'retry' => $hit->retry,
105
-                               'expire' => $hit->expire,
106
-                               'minimum' => $hit->minimum,
107
-                               'nsdname' => $hit->nsdname,
108
-                               'name' => $hit->name,
109
-                               'ttl' => $hit->ttl,
110
-                               'class' => $hit->class,
111
-                               'type' => $hit->type,
112
-                               'address' => $hit->address,
113
-                               'cname' => $hit->cname,
114
-                               'exchange' => $hit->exchange,
115
-                               'preference' => $hit->preference,
116
-                               'txtdata' => $hit->txtdata,
117
-                               'line' => $hit->Line,
118
-                               'lines' => $hit->Lines,
119
-                               'raw' => $hit->raw,
120
-                               'insert_time' => $this->time->stamp()));
97
+                                'server_id' => $server_id,
98
+                                'zone_id' => $zone_id,
99
+                                'domain' => $domain,
100
+                                'mname' => $hit->mname,
101
+                                'rname' => $hit->rname,
102
+                                'serial' => $hit->serial,
103
+                                'refresh' => $hit->refresh,
104
+                                'retry' => $hit->retry,
105
+                                'expire' => $hit->expire,
106
+                                'minimum' => $hit->minimum,
107
+                                'nsdname' => $hit->nsdname,
108
+                                'name' => $hit->name,
109
+                                'ttl' => $hit->ttl,
110
+                                'class' => $hit->class,
111
+                                'type' => $hit->type,
112
+                                'address' => $hit->address,
113
+                                'cname' => $hit->cname,
114
+                                'exchange' => $hit->exchange,
115
+                                'preference' => $hit->preference,
116
+                                'txtdata' => $hit->txtdata,
117
+                                'line' => $hit->Line,
118
+                                'lines' => $hit->Lines,
119
+                                'raw' => $hit->raw,
120
+                                'insert_time' => $this->time->stamp()));
121 121
 
122 122
             }
123 123
 
Please login to merge, or discard this patch.
classes/DomainMOD/DwDisplay.php 2 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -86,8 +86,8 @@  discard block
 block discarded – undo
86 86
               AND a.server_id = :server_id
87 87
               AND a.domain = :domain");
88 88
         $tmpq->execute(array(
89
-                       'server_id' => $server_id,
90
-                       'domain' => $domain));
89
+                        'server_id' => $server_id,
90
+                        'domain' => $domain));
91 91
 
92 92
         return $tmpq->fetchAll();
93 93
     }
@@ -182,8 +182,8 @@  discard block
 block discarded – undo
182 182
             WHERE server_id = :server_id
183 183
               AND domain = :domain");
184 184
         $tmpq->execute(array(
185
-                       'server_id' => $server_id,
186
-                       'domain' => $domain));
185
+                        'server_id' => $server_id,
186
+                        'domain' => $domain));
187 187
         return $tmpq->fetchColumn();
188 188
     }
189 189
 
@@ -206,8 +206,8 @@  discard block
 block discarded – undo
206 206
               AND z.server_id = :server_id
207 207
               AND z.domain = :domain");
208 208
         $tmpq->execute(array(
209
-                       'server_id' => $server_id,
210
-                       'domain' => $domain));
209
+                        'server_id' => $server_id,
210
+                        'domain' => $domain));
211 211
         return $tmpq->fetchAll();
212 212
     }
213 213
 
Please login to merge, or discard this patch.
Braces   +8 added lines, -5 removed lines patch added patch discarded remove patch
@@ -51,7 +51,10 @@  discard block
 block discarded – undo
51 51
                 <strong>Shell:</strong> <?php echo $row->shell; ?><BR>
52 52
                 <strong>Home:</strong> /<?php echo $row->partition; ?> /<?php echo $row->user; ?><BR>
53 53
                 <strong>HD Quota:</strong> <?php echo $row->disklimit; ?>
54
-                <?php if ($row->disklimit != "unlimited") echo " MB"; ?><BR>
54
+                <?php if ($row->disklimit != "unlimited") {
55
+    echo " MB";
56
+}
57
+?><BR>
55 58
                 <strong>HD Used:</strong> <?php echo number_format($row->diskused); ?> MB
56 59
             </td>
57 60
             <td align="left" valign="top">
@@ -93,7 +96,7 @@  discard block
 block discarded – undo
93 96
     }
94 97
 
95 98
     public function accountSidebar($server_name, $domain, $show_heading, $show_url)
96
-    { 
99
+    {
97 100
         ob_start();
98 101
         echo $this->showHeading($domain, $show_heading);
99 102
         $server_wrapped = wordwrap($server_name, 20, "<BR>", true);
@@ -115,7 +118,7 @@  discard block
 block discarded – undo
115 118
     } 
116 119
 
117 120
     public function showUrl($domain, $text, $url, $show_url)
118
-    { 
121
+    {
119 122
         $result = '';
120 123
         
121 124
         if ($show_url == '1') {
@@ -125,7 +128,7 @@  discard block
 block discarded – undo
125 128
     } 
126 129
 
127 130
     public function zone($server_id, $domain)
128
-    { 
131
+    {
129 132
         ob_start();
130 133
 
131 134
         $result_zones = $this->getZone($server_id, $domain);
@@ -162,7 +165,7 @@  discard block
 block discarded – undo
162 165
     }
163 166
 
164 167
     public function zoneSidebar($server_id, $domain, $show_heading, $show_url)
165
-    { 
168
+    {
166 169
         ob_start();
167 170
         $zone = $this->getZonefile($server_id, $domain);
168 171
         echo $this->showHeading($zone, $show_heading);
Please login to merge, or discard this patch.