diff --git a/pub/api/v1/portal-management/configure/index.php b/pub/api/v1/portal-management/configure/index.php index 89b6786..3efb046 100644 --- a/pub/api/v1/portal-management/configure/index.php +++ b/pub/api/v1/portal-management/configure/index.php @@ -3,7 +3,7 @@ use api\classes\API_portalsettings; session_start(); -require_once $_SERVER['DOCUMENT_ROOT'] . '/api/classes/API_portalsettings.php'; +require_once "{$_SERVER['DOCUMENT_ROOT']}/api/classes/API_portalsettings.php"; $API_portalsettings = new API_portalsettings(); @@ -29,6 +29,10 @@ if ($API_portalsettings->request_method === 'GET') { 'admin_auth_methods' => ['type' => 'string'] ]; + if (count($API_portalsettings->getPortalSettings()) !== 1) { + $API_portalsettings->apiOutput(400, ['error' => 'Invalid portal_uuid']); + } + $API_portalsettings->validateData($requiredFields); # Update the permission diff --git a/pub/api/v1/portal-management/mail/configure/index.php b/pub/api/v1/portal-management/mail/configure/index.php index e98fe54..261b9c6 100644 --- a/pub/api/v1/portal-management/mail/configure/index.php +++ b/pub/api/v1/portal-management/mail/configure/index.php @@ -1,9 +1,11 @@ request_method === 'PUT') { } } + $API_portalsettings = new API_portalsettings(); + if (count($API_portalsettings->getPortalSettings()) !== 1) { + $API_mailsettings->apiOutput(400, ['error' => 'Invalid portal_uuid']); + } + $API_mailsettings->validateData($requiredFields); # Update the permission