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:
Denis Flaven
2011-03-24 17:34:00 +00:00
parent 30f4ff8765
commit 5ad7ea1b7b
4 changed files with 20 additions and 1 deletions

View File

@@ -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)
{

View File

@@ -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

View File

@@ -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 !',

View File

@@ -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)