Added GET API call for portal-settings.
This commit is contained in:
@@ -18,4 +18,14 @@ class API_portalsettings extends API
|
|||||||
$this->apiOutput(200, ['success' => 'portal settings updated successfully.']);
|
$this->apiOutput(200, ['success' => 'portal settings updated successfully.']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getPortalSettings()
|
||||||
|
{
|
||||||
|
|
||||||
|
list($query, $types, $params) = $this->buildDynamicQuery('system_settings');
|
||||||
|
|
||||||
|
$items = $this->generalGetFunction($query, $types, $params, false, 'Settings');
|
||||||
|
|
||||||
|
return ($items);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -7,7 +7,16 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/api/classes/API_portalsettings.php';
|
|||||||
|
|
||||||
$API_portalsettings = new API_portalsettings();
|
$API_portalsettings = new API_portalsettings();
|
||||||
|
|
||||||
if ($API_portalsettings->request_method === 'PUT') {
|
if ($API_portalsettings->request_method === 'GET') {
|
||||||
|
$API_portalsettings->checkPermissions('admin-portalsettings', 'RO');
|
||||||
|
|
||||||
|
$portalSettings = $API_portalsettings->getPortalSettings();
|
||||||
|
if ($portalSettings !== null) {
|
||||||
|
unset($portalSettings[0]["mail_smtp_pass"]);
|
||||||
|
}
|
||||||
|
|
||||||
|
$API_portalsettings->apiOutput($code = 200, ['success' => $portalSettings]);
|
||||||
|
} elseif ($API_portalsettings->request_method === 'PUT') {
|
||||||
|
|
||||||
# Edit the portal settings of the platform
|
# Edit the portal settings of the platform
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user