Skip to content

Commit df1d52c

Browse files
author
Marius Cramer
committed
Fixed FS#3173 - Update Domain Status via API
1 parent c02d3f0 commit df1d52c

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

interface/lib/classes/remoting.inc.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3237,16 +3237,20 @@ public function sites_web_domain_set_status($session_id, $primary_id, $status) {
32373237
$this->server->fault('permission_denied', 'You do not have the permissions to access this function.');
32383238
return false;
32393239
}
3240+
$app->uses('remoting_lib');
3241+
32403242
if(in_array($status, array('active', 'inactive'))) {
32413243
if ($status == 'active') {
32423244
$status = 'y';
32433245
} else {
32443246
$status = 'n';
32453247
}
3246-
$sql = "UPDATE web_domain SET active = '$status' WHERE domain_id = ".$app->functions->intval($primary_id);
3247-
$app->db->query($sql);
3248-
$result = $app->db->affectedRows();
3249-
return $result;
3248+
$app->remoting_lib->loadFormDef('../sites/form/web_domain.tform.php');
3249+
$params = $app->remoting_lib->getDataRecord($primary_id);
3250+
$params['active'] = $status;
3251+
3252+
$affected_rows = $this->updateQuery('../sites/form/web_domain.tform.php', $client_id, $primary_id, $params);
3253+
return $affected_rows;
32503254
} else {
32513255
$this->server->fault('status_undefined', 'The status is not available');
32523256
return false;

0 commit comments

Comments
 (0)