mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 10:38:45 +02:00
WIP
This commit is contained in:
@@ -112,8 +112,7 @@ if (is_null($aModuleDelegatedAuthenticationEndpoints) || !in_array($sPage, $aMod
|
||||
if (is_null($aModuleDelegatedAuthenticationEndpoints) && !MetaModel::GetConfig()->Get('security.force_login_when_no_delegated_authentication_endpoints_list')) {
|
||||
// check if user is not logged in, if not log a warning in the log file as the page is executed without login, which is not recommended for security reason
|
||||
if (is_null(UserRights::GetUserId())) {
|
||||
IssueLog::Warning("The page '$sPage' is called be executed without login. In the future, this call will be blocked, and will likely cause unwanted behavior in the module '$sModule'.
|
||||
Please define a delegated authentication endpoints for the module as described in https://www.itophub.io/wiki/page?id=latest:customization:new_extension#security.");
|
||||
IssueLog::Warning("The page '$sPage' is executed without login. In the future, this call will be blocked, and will likely cause unwanted behavior in the module '$sModule'. \n Please define a delegated authentication endpoints for the module as described in https://www.itophub.io/wiki/page?id=latest:customization:new_extension#security.");
|
||||
}
|
||||
}
|
||||
if (is_array($aModuleDelegatedAuthenticationEndpoints) && !in_array($sPage, $aModuleDelegatedAuthenticationEndpoints)) {
|
||||
|
||||
@@ -150,7 +150,7 @@ class LoginWebPageTest extends ItopDataTestCase
|
||||
true
|
||||
);
|
||||
$bShouldSeeForbiddenAdminPage ?
|
||||
$this->assertStringNotContainsString('<title>Access restricted to people having administrator privileges</title>', $sPageContent, 'Should prevent non admin user to access this page') : // in delegated authentication endpoints list (in the module), login should not be required
|
||||
$this->assertStringContainsString('Access restricted to people having administrator privileges', $sPageContent, 'Should prevent non admin user to access this page') : // in delegated authentication endpoints list (in the module), login should not be required
|
||||
$this->assertStringContainsString('Yo !', $sPageContent, 'Should execute the file and see its content since user has admin profile');
|
||||
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
SetupWebPage::AddModule(
|
||||
__FILE__, // Path to the current file, all other file names are relative to the directory containing this file
|
||||
'extension-with-execution-policy/0.0.1',
|
||||
'extension-without-delegated-authentication-endpoints-list/0.0.1',
|
||||
[
|
||||
// Identification
|
||||
//
|
||||
@@ -19,7 +19,7 @@ SetupWebPage::AddModule(
|
||||
// Security
|
||||
'delegated_authentication_endpoints' => [
|
||||
'src/Controller/FileInDelegatedAuthenticationEndpointsList.php',
|
||||
'src/Controller/FileInDelegatedAuthenticationEndpointsAndAdminRequiredList.php',
|
||||
'src/Controller/FileInDelegatedAuthenticationEndpointsListAndAdminRequired.php',
|
||||
],
|
||||
|
||||
// Components
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
SetupWebPage::AddModule(
|
||||
__FILE__, // Path to the current file, all other file names are relative to the directory containing this file
|
||||
'extension-without-execution-policy/0.0.1',
|
||||
'extension-without-delegated-authentication-endpoints-list/0.0.1',
|
||||
[
|
||||
// Identification
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user