mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-24 11:08:45 +02:00
Trac #891: better error reporting when either the parameter auth_user or auth_pwd are missing.
SVN:trunk[3089]
This commit is contained in:
@@ -96,7 +96,15 @@ try
|
||||
utils::UseParamFile();
|
||||
|
||||
$sAuthUser = utils::ReadParam('auth_user', null, false, 'raw_data');
|
||||
if ($sAuthUser === null)
|
||||
{
|
||||
throw new Exception("Missing parameter 'auth_user'", RestResult::MISSING_AUTH_USER);
|
||||
}
|
||||
$sAuthPwd = utils::ReadParam('auth_pwd', null, false, 'raw_data');
|
||||
if ($sAuthPwd === null)
|
||||
{
|
||||
throw new Exception("Missing parameter 'auth_pwd'", RestResult::MISSING_AUTH_PWD);
|
||||
}
|
||||
if (UserRights::CheckCredentials($sAuthUser, $sAuthPwd))
|
||||
{
|
||||
UserRights::Login($sAuthUser); // Login & set the user's language
|
||||
|
||||
Reference in New Issue
Block a user