Commit df1d52c6 authored by Marius Cramer's avatar Marius Cramer
Browse files

Fixed FS#3173 - Update Domain Status via API

parent c02d3f04
...@@ -3237,16 +3237,20 @@ class remoting { ...@@ -3237,16 +3237,20 @@ class remoting {
$this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); $this->server->fault('permission_denied', 'You do not have the permissions to access this function.');
return false; return false;
} }
$app->uses('remoting_lib');
if(in_array($status, array('active', 'inactive'))) { if(in_array($status, array('active', 'inactive'))) {
if ($status == 'active') { if ($status == 'active') {
$status = 'y'; $status = 'y';
} else { } else {
$status = 'n'; $status = 'n';
} }
$sql = "UPDATE web_domain SET active = '$status' WHERE domain_id = ".$app->functions->intval($primary_id); $app->remoting_lib->loadFormDef('../sites/form/web_domain.tform.php');
$app->db->query($sql); $params = $app->remoting_lib->getDataRecord($primary_id);
$result = $app->db->affectedRows(); $params['active'] = $status;
return $result;
$affected_rows = $this->updateQuery('../sites/form/web_domain.tform.php', $client_id, $primary_id, $params);
return $affected_rows;
} else { } else {
$this->server->fault('status_undefined', 'The status is not available'); $this->server->fault('status_undefined', 'The status is not available');
return false; return false;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment