@@ -21,8 +21,9 @@ discard block |
||
21 | 21 | { |
22 | 22 | $str = htmlspecialchars(trim($str), ENT_QUOTES, 'UTF-8'); |
23 | 23 | |
24 | - if($checkEmpty && empty($str)) |
|
25 | - exit('something went wrong 7'); |
|
24 | + if($checkEmpty && empty($str)) { |
|
25 | + exit('something went wrong 7'); |
|
26 | + } |
|
26 | 27 | |
27 | 28 | return $str; |
28 | 29 | } |
@@ -60,10 +61,12 @@ discard block |
||
60 | 61 | protected function readIni() |
61 | 62 | { |
62 | 63 | // check if ini files exists |
63 | - if(!file_exists($this->iniFilePath . $this->iniFileDomain)) |
|
64 | - exit('something went wrong 8'); |
|
65 | - if(!file_exists($this->iniFilePath . $this->iniFileInwx)) |
|
66 | - exit('something went wrong 1'); |
|
64 | + if(!file_exists($this->iniFilePath . $this->iniFileDomain)) { |
|
65 | + exit('something went wrong 8'); |
|
66 | + } |
|
67 | + if(!file_exists($this->iniFilePath . $this->iniFileInwx)) { |
|
68 | + exit('something went wrong 1'); |
|
69 | + } |
|
67 | 70 | |
68 | 71 | // read domain.ini |
69 | 72 | $ini = parse_ini_file($this->iniFilePath . $this->iniFileDomain, TRUE); |
@@ -85,8 +88,9 @@ discard block |
||
85 | 88 | |
86 | 89 | protected function checkAccess($apikey = null) |
87 | 90 | { |
88 | - if($apikey == null || $this->domain['ddns']['apikey'] !== $apikey) |
|
89 | - exit('something went wrong 3'); |
|
91 | + if($apikey == null || $this->domain['ddns']['apikey'] !== $apikey) { |
|
92 | + exit('something went wrong 3'); |
|
93 | + } |
|
90 | 94 | |
91 | 95 | return; |
92 | 96 | } |
@@ -101,14 +105,16 @@ discard block |
||
101 | 105 | // INWX Login |
102 | 106 | $result = $this->domrobot->login($this->inwx['username'], $this->inwx['password']); |
103 | 107 | |
104 | - if(DEBUG) |
|
105 | - print_r($result); |
|
108 | + if(DEBUG) { |
|
109 | + print_r($result); |
|
110 | + } |
|
106 | 111 | |
107 | 112 | // check result |
108 | 113 | if ($result['code'] != 1000) |
109 | 114 | { |
110 | - if(OUTPUT) |
|
111 | - exit('badauth'); |
|
115 | + if(OUTPUT) { |
|
116 | + exit('badauth'); |
|
117 | + } |
|
112 | 118 | |
113 | 119 | exit('something went wrong 4'); |
114 | 120 | } |
@@ -120,8 +126,9 @@ discard block |
||
120 | 126 | { |
121 | 127 | $result = $this->domrobot->logout(); |
122 | 128 | |
123 | - if(DEBUG) |
|
124 | - print_r($result); |
|
129 | + if(DEBUG) { |
|
130 | + print_r($result); |
|
131 | + } |
|
125 | 132 | |
126 | 133 | // check result |
127 | 134 | if ($result['code'] != 1500) |
@@ -143,8 +150,9 @@ discard block |
||
143 | 150 | |
144 | 151 | $result = $this->domrobot->call($object, $methode, $params); |
145 | 152 | |
146 | - if(DEBUG) |
|
147 | - print_r($result); |
|
153 | + if(DEBUG) { |
|
154 | + print_r($result); |
|
155 | + } |
|
148 | 156 | |
149 | 157 | // check result |
150 | 158 | if ($result['code'] != 1000) |
@@ -180,19 +188,19 @@ discard block |
||
180 | 188 | { |
181 | 189 | $params['id'] = $this->IP4['id']; |
182 | 190 | $params['content'] = $this->IP4['newip']; |
183 | - } |
|
184 | - elseif($type == 'ipv6') |
|
191 | + } elseif($type == 'ipv6') |
|
185 | 192 | { |
186 | 193 | $params['id'] = $this->IP6['id']; |
187 | 194 | $params['content'] = $this->IP6['newip']; |
195 | + } else { |
|
196 | + exit('something went wrong 9'); |
|
188 | 197 | } |
189 | - else |
|
190 | - exit('something went wrong 9'); |
|
191 | 198 | |
192 | 199 | $result = $this->domrobot->call($object, $methode, $params); |
193 | 200 | |
194 | - if(DEBUG) |
|
195 | - print_r($result); |
|
201 | + if(DEBUG) { |
|
202 | + print_r($result); |
|
203 | + } |
|
196 | 204 | |
197 | 205 | // check result |
198 | 206 | if ($result['code'] != 1000) |
@@ -200,8 +208,9 @@ discard block |
||
200 | 208 | exit('something went wrong 10'); |
201 | 209 | } |
202 | 210 | |
203 | - if(OUTPUT) |
|
204 | - echo('good'); |
|
211 | + if(OUTPUT) { |
|
212 | + echo('good'); |
|
213 | + } |
|
205 | 214 | |
206 | 215 | return; |
207 | 216 | } |
@@ -41,18 +41,21 @@ discard block |
||
41 | 41 | protected function precheck($str) { |
42 | 42 | $str = htmlspecialchars(trim($str), ENT_QUOTES, 'UTF-8'); |
43 | 43 | |
44 | - if (empty($str)) |
|
45 | - exit('something went wrong 7'); |
|
44 | + if (empty($str)) { |
|
45 | + exit('something went wrong 7'); |
|
46 | + } |
|
46 | 47 | |
47 | 48 | return $str; |
48 | 49 | } |
49 | 50 | |
50 | 51 | protected function readIni() { |
51 | 52 | // check if ini files exists |
52 | - if (!file_exists($this->iniFilePath . $this->iniFileDomain)) |
|
53 | - exit('something went wrong 8'); |
|
54 | - if (!file_exists($this->iniFilePath . $this->iniFileInwx)) |
|
55 | - exit('something went wrong 1'); |
|
53 | + if (!file_exists($this->iniFilePath . $this->iniFileDomain)) { |
|
54 | + exit('something went wrong 8'); |
|
55 | + } |
|
56 | + if (!file_exists($this->iniFilePath . $this->iniFileInwx)) { |
|
57 | + exit('something went wrong 1'); |
|
58 | + } |
|
56 | 59 | |
57 | 60 | // read domain.ini |
58 | 61 | $ini = parse_ini_file($this->iniFilePath . $this->iniFileDomain, TRUE); |
@@ -73,8 +76,9 @@ discard block |
||
73 | 76 | } |
74 | 77 | |
75 | 78 | protected function checkAccess($apikey = null) { |
76 | - if ($apikey == null || $this->domain['ddns']['apikey'] !== $apikey) |
|
77 | - exit('something went wrong 3'); |
|
79 | + if ($apikey == null || $this->domain['ddns']['apikey'] !== $apikey) { |
|
80 | + exit('something went wrong 3'); |
|
81 | + } |
|
78 | 82 | |
79 | 83 | return; |
80 | 84 | } |
@@ -88,13 +92,15 @@ discard block |
||
88 | 92 | // INWX Login |
89 | 93 | $result = $this->domrobot->login($this->inwx['username'], $this->inwx['password']); |
90 | 94 | |
91 | - if (DEBUG) |
|
92 | - print_r($result); |
|
95 | + if (DEBUG) { |
|
96 | + print_r($result); |
|
97 | + } |
|
93 | 98 | |
94 | 99 | // check result |
95 | 100 | if ($result['code'] != 1000) { |
96 | - if (OUTPUT) |
|
97 | - exit('badauth'); |
|
101 | + if (OUTPUT) { |
|
102 | + exit('badauth'); |
|
103 | + } |
|
98 | 104 | |
99 | 105 | exit('something went wrong 4'); |
100 | 106 | } |
@@ -105,8 +111,9 @@ discard block |
||
105 | 111 | protected function inwxLogout() { |
106 | 112 | $result = $this->domrobot->logout(); |
107 | 113 | |
108 | - if (DEBUG) |
|
109 | - print_r($result); |
|
114 | + if (DEBUG) { |
|
115 | + print_r($result); |
|
116 | + } |
|
110 | 117 | |
111 | 118 | // check result |
112 | 119 | if ($result['code'] != 1500) { |
@@ -126,8 +133,9 @@ discard block |
||
126 | 133 | |
127 | 134 | $result = $this->domrobot->call($object, $methode, $params); |
128 | 135 | |
129 | - if (DEBUG) |
|
130 | - print_r($result); |
|
136 | + if (DEBUG) { |
|
137 | + print_r($result); |
|
138 | + } |
|
131 | 139 | |
132 | 140 | // check result |
133 | 141 | if ($result['code'] != 1000) { |
@@ -160,21 +168,24 @@ discard block |
||
160 | 168 | } elseif ($type == 'ipv6') { |
161 | 169 | $params['id'] = $this->IP6['id']; |
162 | 170 | $params['content'] = $this->IP6['newip']; |
163 | - } else |
|
164 | - exit('something went wrong 9'); |
|
171 | + } else { |
|
172 | + exit('something went wrong 9'); |
|
173 | + } |
|
165 | 174 | |
166 | 175 | $result = $this->domrobot->call($object, $methode, $params); |
167 | 176 | |
168 | - if (DEBUG) |
|
169 | - print_r($result); |
|
177 | + if (DEBUG) { |
|
178 | + print_r($result); |
|
179 | + } |
|
170 | 180 | |
171 | 181 | // check result |
172 | 182 | if ($result['code'] != 1000) { |
173 | 183 | exit('something went wrong 10'); |
174 | 184 | } |
175 | 185 | |
176 | - if (OUTPUT) |
|
177 | - echo('good'); |
|
186 | + if (OUTPUT) { |
|
187 | + echo('good'); |
|
188 | + } |
|
178 | 189 | |
179 | 190 | return; |
180 | 191 | } |