diff --git a/rest/index.php b/rest/index.php index 54169f6262ae476bab9bd6ce85df2dbf1e74d2cc..91014da0aba6ad2a4163133765776a8583860bf0 100755 --- a/rest/index.php +++ b/rest/index.php @@ -51,6 +51,7 @@ $app->add(function (\Slim\Http\Request $request, \Slim\Http\Response $response, }); //Authentication +$app->get('/authenticationInformations', \SrcCore\controllers\AuthenticationController::class . ':getInformations'); $app->post('/authenticate', \SrcCore\controllers\AuthenticationController::class . ':authenticate'); $app->get('/authenticate/token', \SrcCore\controllers\AuthenticationController::class . ':getRefreshedToken'); diff --git a/src/core/controllers/AuthenticationController.php b/src/core/controllers/AuthenticationController.php index b7ae4ff2a383919277d877783f4f861f1a06bd3f..ba47ac943d3063120a8a70b83290581ef5588c6b 100755 --- a/src/core/controllers/AuthenticationController.php +++ b/src/core/controllers/AuthenticationController.php @@ -18,6 +18,7 @@ use Configuration\models\ConfigurationModel; use Email\controllers\EmailController; use Firebase\JWT\JWT; use History\controllers\HistoryController; +use Parameter\models\ParameterModel; use Respect\Validation\Validator; use Slim\Http\Request; use Slim\Http\Response; @@ -31,9 +32,21 @@ class AuthenticationController { const MAX_DURATION_TOKEN = 30; //Minutes const ROUTES_WITHOUT_AUTHENTICATION = [ - 'GET/jnlp/{jnlpUniqueId}', 'POST/password', 'PUT/password', 'GET/passwordRules', 'GET/onlyOffice/mergedFile', 'POST/onlyOfficeCallback' + 'GET/authenticationInformations', 'POST/password', 'PUT/password', 'GET/passwordRules', + 'GET/jnlp/{jnlpUniqueId}', 'GET/onlyOffice/mergedFile', 'POST/onlyOfficeCallback' ]; + public function getInformations(Request $request, Response $response) + { +// $path = CoreConfigModel::getConfigPath(); +// $hashedPath = md5($path); + + $appName = CoreConfigModel::getApplicationName(); + $parameter = ParameterModel::getById(['id' => 'loginpage_message', 'select' => ['param_value_string']]); + + return $response->withJson(['instanceId' => null, 'applicationName' => $appName, 'loginMessage' => $parameter['param_value_string'] ?? null]); + } + public static function authentication() { $userId = null;