diff --git a/pub/api/classes/API_portalsettings.php b/pub/api/classes/API_portalsettings.php index bd6daad..2dfc47a 100644 --- a/pub/api/classes/API_portalsettings.php +++ b/pub/api/classes/API_portalsettings.php @@ -18,4 +18,14 @@ class API_portalsettings extends API $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); + } } \ No newline at end of file diff --git a/pub/api/v1/portal-management/configure/index.php b/pub/api/v1/portal-management/configure/index.php index 4caebb7..89b6786 100644 --- a/pub/api/v1/portal-management/configure/index.php +++ b/pub/api/v1/portal-management/configure/index.php @@ -7,7 +7,16 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/api/classes/API_portalsettings.php'; $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