mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
Fixed Trac #365: Give the user some feedback when the password was successfully changed/set. Note that iTop does not check that the new password is different from the old one.
SVN:trunk[1147]
This commit is contained in:
@@ -36,6 +36,7 @@ class iTopWebPage extends NiceWebPage
|
||||
private $m_aTabs;
|
||||
private $m_sCurrentTabContainer;
|
||||
private $m_sCurrentTab;
|
||||
private $m_sMessage;
|
||||
|
||||
public function __construct($sTitle)
|
||||
{
|
||||
@@ -44,6 +45,7 @@ class iTopWebPage extends NiceWebPage
|
||||
$this->m_sCurrentTab = '';
|
||||
$this->m_aTabs = array();
|
||||
$this->m_sMenu = "";
|
||||
$this->m_sMessage = '';
|
||||
$oAppContext = new ApplicationContext();
|
||||
$sExtraParams = $oAppContext->GetForLink();
|
||||
// $this->m_currentOrganization = $currentOrganization;
|
||||
@@ -685,6 +687,10 @@ EOF
|
||||
}
|
||||
$sApplicationBanner .= '</div>';
|
||||
}
|
||||
else if(strlen($this->m_sMessage))
|
||||
{
|
||||
$sApplicationBanner = '<div id="admin-banner"><span style="padding:5px;">'.$this->m_sMessage.'<span></div>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$sApplicationBanner = '';
|
||||
@@ -898,6 +904,14 @@ EOF
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the message to be displayed in the 'admin-banner' section at the top of the page
|
||||
*/
|
||||
public function SetMessage($sMessage)
|
||||
{
|
||||
$this->m_sMessage = $sMessage;
|
||||
}
|
||||
|
||||
/*
|
||||
public function AddSearchForm($sClassName, $bOpen = false)
|
||||
{
|
||||
|
||||
@@ -352,6 +352,7 @@ EOF
|
||||
*/
|
||||
static function DoLogin($bMustBeAdmin = false, $bIsAllowedToPortalUsers = false)
|
||||
{
|
||||
$sMessage = ''; // In case we need to return a message to the calling web page
|
||||
$operation = utils::ReadParam('loginop', '');
|
||||
session_name(MetaModel::GetConfig()->Get('session_name'));
|
||||
session_start();
|
||||
@@ -401,6 +402,7 @@ EOF
|
||||
$oPage->DisplayChangePwdForm(true); // old pwd was wrong
|
||||
$oPage->output();
|
||||
}
|
||||
$sMessage = Dict::S('UI:Login:PasswordChanged');
|
||||
}
|
||||
|
||||
self::Login();
|
||||
@@ -419,6 +421,7 @@ EOF
|
||||
// No rights to be here, redirect to the portal
|
||||
header('Location: ../portal/index.php');
|
||||
}
|
||||
return $sMessage;
|
||||
}
|
||||
|
||||
} // End of class
|
||||
|
||||
@@ -456,6 +456,7 @@ Dict::Add('EN US', 'English', 'English', array(
|
||||
'UI:LogOff:ThankYou' => 'Thank you for using iTop',
|
||||
'UI:LogOff:ClickHereToLoginAgain' => 'Click here to login again...',
|
||||
'UI:ChangePwdMenu' => 'Change Password...',
|
||||
'UI:Login:PasswordChanged' => 'Password successfully set !',
|
||||
'UI:AccessRO-All' => 'iTop is read-only',
|
||||
'UI:AccessRO-Users' => 'iTop is read-only for end-users',
|
||||
'UI:Login:RetypePwdDoesNotMatch' => 'New password and retyped new password do not match !',
|
||||
|
||||
@@ -562,12 +562,13 @@ try
|
||||
$oKPI = new ExecutionKPI();
|
||||
|
||||
require_once(APPROOT.'/application/loginwebpage.class.inc.php');
|
||||
LoginWebPage::DoLogin(); // Check user rights and prompt if needed
|
||||
$sLoginMessage = LoginWebPage::DoLogin(); // Check user rights and prompt if needed
|
||||
$oAppContext = new ApplicationContext();
|
||||
|
||||
$oKPI->ComputeAndReport('User login');
|
||||
|
||||
$oP = new iTopWebPage(Dict::S('UI:WelcomeToITop'));
|
||||
$oP->SetMessage($sLoginMessage);
|
||||
|
||||
// All the following actions use advanced forms that require more javascript to be loaded
|
||||
switch($operation)
|
||||
|
||||
Reference in New Issue
Block a user