@@ -40,7 +40,7 @@ public function sites_aps_update_package_list($session_id)
4040 global $ app ;
4141
4242 if (!$ this ->checkPerm ($ session_id , 'sites_aps_update_package_list ' )) {
43- $ this -> server -> fault ('permission_denied ' , 'You do not have the permissions to access this function. ' );
43+ throw new SoapFault ('permission_denied ' , 'You do not have the permissions to access this function. ' );
4444 return false ;
4545 }
4646
@@ -60,7 +60,7 @@ public function sites_aps_available_packages_list($session_id, $params = array()
6060 global $ app ;
6161
6262 if (!$ this ->checkPerm ($ session_id , 'sites_aps_available_packages_list ' )) {
63- $ this -> server -> fault ('permission_denied ' , 'You do not have the permissions to access this function. ' );
63+ throw new SoapFault ('permission_denied ' , 'You do not have the permissions to access this function. ' );
6464 return false ;
6565 }
6666
@@ -82,7 +82,7 @@ public function sites_aps_get_package_details($session_id, $primary_id)
8282 global $ app ;
8383
8484 if (!$ this ->checkPerm ($ session_id , 'sites_aps_get_package_details ' )) {
85- $ this -> server -> fault ('permission_denied ' , 'You do not have the permissions to access this function. ' );
85+ throw new SoapFault ('permission_denied ' , 'You do not have the permissions to access this function. ' );
8686 return false ;
8787 }
8888
@@ -98,14 +98,14 @@ public function sites_aps_get_package_details($session_id, $primary_id)
9898
9999 // Make sure an integer ID is given
100100 if (!isset ($ primary_id ) || !$ gui ->isValidPackageID ($ primary_id , true )) {// always adminflag
101- $ this -> server -> fault ('package_error ' , 'The given Package ID is not valid. ' );
101+ throw new SoapFault ('package_error ' , 'The given Package ID is not valid. ' );
102102 return false ;
103103 }
104104
105105 // Get package details
106106 $ details = $ gui ->getPackageDetails ($ primary_id );
107107 if (isset ($ details ['error ' ])) {
108- $ this -> server -> fault ('package_error ' , $ details ['error ' ]);
108+ throw new SoapFault ('package_error ' , $ details ['error ' ]);
109109 return false ;
110110 }
111111
@@ -121,7 +121,7 @@ public function sites_aps_get_package_file($session_id, $primary_id, $filename)
121121 global $ app ;
122122
123123 if (!$ this ->checkPerm ($ session_id , 'sites_aps_get_package_file ' )) {
124- $ this -> server -> fault ('permission_denied ' , 'You do not have the permissions to access this function. ' );
124+ throw new SoapFault ('permission_denied ' , 'You do not have the permissions to access this function. ' );
125125 return false ;
126126 }
127127
@@ -137,14 +137,14 @@ public function sites_aps_get_package_file($session_id, $primary_id, $filename)
137137
138138 // Make sure an integer ID is given
139139 if (!isset ($ primary_id ) || !$ gui ->isValidPackageID ($ primary_id , true )) {// always adminflag
140- $ this -> server -> fault ('package_error ' , 'The given Package ID is not valid. ' );
140+ throw new SoapFault ('package_error ' , 'The given Package ID is not valid. ' );
141141 return false ;
142142 }
143143
144144 // Get package details
145145 $ details = $ gui ->getPackageDetails ($ primary_id );
146146 if (isset ($ details ['error ' ])) {
147- $ this -> server -> fault ('package_error ' , $ details ['error ' ]);
147+ throw new SoapFault ('package_error ' , $ details ['error ' ]);
148148 return false ;
149149 }
150150
@@ -155,7 +155,7 @@ public function sites_aps_get_package_file($session_id, $primary_id, $filename)
155155 foreach ($ details ['Screenshots ' ] as $ screen ) { if (basename ($ screen ['ScreenPath ' ]) == $ filename ) { $ found = true ; break ; } }
156156
157157 if (!$ found ) {
158- $ this -> server -> fault ('package_error ' , 'File not found in package. ' );
158+ throw new SoapFault ('package_error ' , 'File not found in package. ' );
159159 return false ;
160160 }
161161
@@ -167,7 +167,7 @@ public function sites_aps_get_package_settings($session_id, $primary_id)
167167 global $ app ;
168168
169169 if (!$ this ->checkPerm ($ session_id , 'sites_aps_get_package_details ' )) {
170- $ this -> server -> fault ('permission_denied ' , 'You do not have the permissions to access this function. ' );
170+ throw new SoapFault ('permission_denied ' , 'You do not have the permissions to access this function. ' );
171171 return false ;
172172 }
173173
@@ -183,14 +183,14 @@ public function sites_aps_get_package_settings($session_id, $primary_id)
183183
184184 // Make sure an integer ID is given
185185 if (!isset ($ primary_id ) || !$ gui ->isValidPackageID ($ primary_id , true )) {// always adminflag
186- $ this -> server -> fault ('package_error ' , 'The given Package ID is not valid. ' );
186+ throw new SoapFault ('package_error ' , 'The given Package ID is not valid. ' );
187187 return false ;
188188 }
189189
190190 // Get package settings
191191 $ settings = $ gui ->getPackageSettings ($ primary_id );
192192 if (isset ($ settings ['error ' ])) {
193- $ this -> server -> fault ('package_error ' , $ settings ['error ' ]);
193+ throw new SoapFault ('package_error ' , $ settings ['error ' ]);
194194 return false ;
195195 }
196196
@@ -205,7 +205,7 @@ public function sites_aps_change_package_status($session_id, $primary_id, $param
205205 global $ app ;
206206
207207 if (!$ this ->checkPerm ($ session_id , 'sites_aps_change_package_status ' )) {
208- $ this -> server -> fault ('permission_denied ' , 'You do not have the permissions to access this function. ' );
208+ throw new SoapFault ('permission_denied ' , 'You do not have the permissions to access this function. ' );
209209 return false ;
210210 }
211211
@@ -215,12 +215,12 @@ public function sites_aps_change_package_status($session_id, $primary_id, $param
215215
216216 // Make sure an integer ID is given
217217 if (!isset ($ primary_id ) || !$ gui ->isValidPackageID ($ primary_id , true )) {// always adminflag
218- $ this -> server -> fault ('package_error ' , 'The given Package ID is not valid. ' );
218+ throw new SoapFault ('package_error ' , 'The given Package ID is not valid. ' );
219219 return false ;
220220 }
221221
222222 if (!isset ($ params ['package_status ' ]) || (($ params ['package_status ' ] != PACKAGE_ENABLED ) && ($ params ['package_status ' ] != PACKAGE_LOCKED ))) {
223- $ this -> server -> fault ('package_error ' , 'Wrong new status: ' .$ params ['package_status ' ]);
223+ throw new SoapFault ('package_error ' , 'Wrong new status: ' .$ params ['package_status ' ]);
224224 return false ;
225225 }
226226
@@ -235,7 +235,7 @@ public function sites_aps_install_package($session_id, $primary_id, $params)
235235 global $ app ;
236236
237237 if (!$ this ->checkPerm ($ session_id , 'sites_aps_install_package ' )) {
238- $ this -> server -> fault ('permission_denied ' , 'You do not have the permissions to access this function. ' );
238+ throw new SoapFault ('permission_denied ' , 'You do not have the permissions to access this function. ' );
239239 return false ;
240240 }
241241
@@ -251,25 +251,25 @@ public function sites_aps_install_package($session_id, $primary_id, $params)
251251
252252 // Make sure an integer ID is given
253253 if (!isset ($ primary_id ) || !$ gui ->isValidPackageID ($ primary_id , true )) {// always adminflag
254- $ this -> server -> fault ('package_error ' , 'The given Package ID is not valid. ' );
254+ throw new SoapFault ('package_error ' , 'The given Package ID is not valid. ' );
255255 return false ;
256256 }
257257
258258 // Get package details
259259 $ details = $ gui ->getPackageDetails ($ primary_id );
260260 if (isset ($ details ['error ' ])) {
261- $ this -> server -> fault ('package_error ' , $ details ['error ' ]);
261+ throw new SoapFault ('package_error ' , $ details ['error ' ]);
262262 return false ;
263263 }
264264 $ settings = $ gui ->getPackageSettings ($ primary_id );
265265 if (isset ($ settings ['error ' ])) {
266- $ this -> server -> fault ('package_error ' , $ settings ['error ' ]);
266+ throw new SoapFault ('package_error ' , $ settings ['error ' ]);
267267 return false ;
268268 }
269269
270270 // Check given Site/VHostDomain
271271 if (!isset ($ params ['main_domain ' ])) {
272- $ this -> server -> fault ('invalid parameters ' , 'No valid domain given. ' );
272+ throw new SoapFault ('invalid parameters ' , 'No valid domain given. ' );
273273 return false ;
274274 }
275275
@@ -284,7 +284,7 @@ public function sites_aps_install_package($session_id, $primary_id, $params)
284284 }
285285
286286 if (!$ domain ) {
287- $ this -> server -> fault ('invalid parameters ' , 'No valid domain given. ' );
287+ throw new SoapFault ('invalid parameters ' , 'No valid domain given. ' );
288288 return false ;
289289 }
290290
@@ -295,7 +295,7 @@ public function sites_aps_install_package($session_id, $primary_id, $params)
295295 return $ gui ->createPackageInstance ($ result ['input ' ], $ primary_id );
296296 }
297297
298- $ this -> server -> fault ('invalid parameters ' , implode ('<br /> ' , $ result ['error ' ]));
298+ throw new SoapFault ('invalid parameters ' , implode ('<br /> ' , $ result ['error ' ]));
299299 return false ;
300300 }
301301
@@ -304,7 +304,7 @@ public function sites_aps_instance_get($session_id, $primary_id)
304304 global $ app ;
305305
306306 if (!$ this ->checkPerm ($ session_id , 'sites_aps_instance_get ' )) {
307- $ this -> server -> fault ('permission_denied ' , 'You do not have the permissions to access this function. ' );
307+ throw new SoapFault ('permission_denied ' , 'You do not have the permissions to access this function. ' );
308308 return false ;
309309 }
310310
@@ -318,7 +318,7 @@ public function sites_aps_instance_settings_get($session_id, $primary_id)
318318 global $ app ;
319319
320320 if (!$ this ->checkPerm ($ session_id , 'sites_aps_instance_get ' )) {
321- $ this -> server -> fault ('permission_denied ' , 'You do not have the permissions to access this function. ' );
321+ throw new SoapFault ('permission_denied ' , 'You do not have the permissions to access this function. ' );
322322 return false ;
323323 }
324324
@@ -332,7 +332,7 @@ public function sites_aps_instance_delete($session_id, $primary_id, $params = ar
332332 global $ app ;
333333
334334 if (!$ this ->checkPerm ($ session_id , 'sites_aps_instance_delete ' )) {
335- $ this -> server -> fault ('permission_denied ' , 'You do not have the permissions to access this function. ' );
335+ throw new SoapFault ('permission_denied ' , 'You do not have the permissions to access this function. ' );
336336 return false ;
337337 }
338338
@@ -344,7 +344,7 @@ public function sites_aps_instance_delete($session_id, $primary_id, $params = ar
344344 $ result = $ app ->db ->queryOneRecord ($ sql , $ primary_id );
345345
346346 if (!$ result ) {
347- $ this -> server -> fault ('instance_error ' , 'No valid instance id given. ' );
347+ throw new SoapFault ('instance_error ' , 'No valid instance id given. ' );
348348 return false ;
349349 }
350350
0 commit comments