mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-19 16:48:42 +02:00
be able to call cron locally/remotely via any authentication mode that implements iTokenLoginUIExtension (interface badly named)
This commit is contained in:
@@ -9,7 +9,7 @@ use Combodo\iTop\Application\Helper\Session;
|
||||
* @license http://opensource.org/licenses/AGPL-3.0
|
||||
*/
|
||||
|
||||
class LoginBasic extends AbstractLoginFSMExtension
|
||||
class LoginBasic extends AbstractLoginFSMExtension implements iTokenLoginUIExtension
|
||||
{
|
||||
/**
|
||||
* Return the list of supported login modes for this plugin
|
||||
@@ -120,4 +120,21 @@ class LoginBasic extends AbstractLoginFSMExtension
|
||||
}
|
||||
return [$sAuthUser, $sAuthPwd];
|
||||
}
|
||||
|
||||
public function GetTokenInfo(): array
|
||||
{
|
||||
return $this->GetAuthUserAndPassword();
|
||||
}
|
||||
|
||||
public function GetUserLogin(array $aTokenInfo): string
|
||||
{
|
||||
$sLogin = $aTokenInfo[0];
|
||||
$sLoginMode = 'basic';
|
||||
if (UserRights::CheckCredentials($sLogin, $aTokenInfo[1], $sLoginMode, 'internal'))
|
||||
{
|
||||
return $sLogin;
|
||||
}
|
||||
|
||||
throw new Exception("Cannot CheckCredentials user login ($sLogin) with ($sLoginMode) mode");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user