mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-20 15:52:24 +02:00
🐛 Fix access to change password page
🎨 Code cleanup
This commit is contained in:
@@ -1015,22 +1015,6 @@ class LoginWebPage extends NiceWebPage
|
||||
$sMessage = ''; // most of the operations never return, but some can return a message to be displayed
|
||||
if ($operation == 'logoff')
|
||||
{
|
||||
if (isset($_SESSION['login_mode']))
|
||||
{
|
||||
$sLoginMode = $_SESSION['login_mode'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$aAllowedLoginTypes = MetaModel::GetConfig()->GetAllowedLoginTypes();
|
||||
if (count($aAllowedLoginTypes) > 0)
|
||||
{
|
||||
$sLoginMode = $aAllowedLoginTypes[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
$sLoginMode = 'form';
|
||||
}
|
||||
}
|
||||
self::ResetSession();
|
||||
$oPage = self::NewLoginWebPage();
|
||||
$oPage->DisplayLoginForm(false /* not a failed attempt */);
|
||||
@@ -1066,6 +1050,8 @@ class LoginWebPage extends NiceWebPage
|
||||
exit;
|
||||
}
|
||||
else if ($operation == 'change_pwd')
|
||||
{
|
||||
if (isset($_SESSION['auth_user']))
|
||||
{
|
||||
$sAuthUser = $_SESSION['auth_user'];
|
||||
UserRights::Login($sAuthUser); // Set the user's language
|
||||
@@ -1074,7 +1060,10 @@ class LoginWebPage extends NiceWebPage
|
||||
$oPage->output();
|
||||
exit;
|
||||
}
|
||||
}
|
||||
if ($operation == 'do_change_pwd')
|
||||
{
|
||||
if (isset($_SESSION['auth_user']))
|
||||
{
|
||||
$sAuthUser = $_SESSION['auth_user'];
|
||||
UserRights::Login($sAuthUser); // Set the user's language
|
||||
@@ -1089,6 +1078,7 @@ class LoginWebPage extends NiceWebPage
|
||||
}
|
||||
$sMessage = Dict::S('UI:Login:PasswordChanged');
|
||||
}
|
||||
}
|
||||
return $sMessage;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user