ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilAuthFrontendCredentialsSoap Class Reference
+ Inheritance diagram for ilAuthFrontendCredentialsSoap:
+ Collaboration diagram for ilAuthFrontendCredentialsSoap:

Public Member Functions

 __construct (ServerRequestInterface $httpRequest, ilCtrl $ctrl, ilSetting $settings)
 ilAuthFrontendCredentialsApache constructor. More...
 
 tryAuthenticationOnLoginPage ()
 Check if an authentication attempt should be done when login page has been called. More...
 
- Public Member Functions inherited from ilAuthFrontendCredentials
 __construct ()
 
 getLogger ()
 Get logger. More...
 
 setLogger (ilLogger $logger)
 Set Logger. More...
 
 setUsername ($a_name)
 Set username. More...
 
 getUsername ()
 Get username. More...
 
 setPassword ($a_password)
 Set password. More...
 
 getPassword ()
 Get password. More...
 
 setCaptchaCode ($a_code)
 Set captcha code. More...
 
 getCaptchaCode ()
 Get captcha code. More...
 
 setAuthMode ($a_auth_mode)
 Set auth mode. More...
 
 getAuthMode ()
 Get auth mode. More...
 
 setUsername ($a_name)
 Set username. More...
 
 getUsername ()
 Get username. More...
 
 setPassword ($a_password)
 Set password. More...
 
 getPassword ()
 Get password. More...
 
 setCaptchaCode ($a_code)
 Set captcha code. More...
 
 getCaptchaCode ()
 Get captcha code. More...
 
 setAuthMode ($a_auth_mode)
 Set auth mode. More...
 
 getAuthMode ()
 Get auth mode. More...
 

Private Attributes

 $httpRequest
 
 $ctrl
 
 $settings
 

Detailed Description

Definition at line 4 of file class.ilAuthFrontendCredentialsSoap.php.

Constructor & Destructor Documentation

◆ __construct()

ilAuthFrontendCredentialsSoap::__construct ( ServerRequestInterface  $httpRequest,
ilCtrl  $ctrl,
ilSetting  $settings 
)

ilAuthFrontendCredentialsApache constructor.

Parameters
ServerRequestInterface$httpRequest
ilCtrl$ctrl
ilSetting$settings

Definition at line 21 of file class.ilAuthFrontendCredentialsSoap.php.

References $ctrl, $httpRequest, $settings, and settings().

+ Here is the call graph for this function:

Member Function Documentation

◆ tryAuthenticationOnLoginPage()

ilAuthFrontendCredentialsSoap::tryAuthenticationOnLoginPage ( )

Check if an authentication attempt should be done when login page has been called.

Definition at line 32 of file class.ilAuthFrontendCredentialsSoap.php.

33 {
34 $cmd = '';
35 if (isset($this->httpRequest->getQueryParams()['cmd']) && is_string($this->httpRequest->getQueryParams()['cmd'])) {
36 $cmd = $this->httpRequest->getQueryParams()['cmd'];
37 }
38 if ('' === $cmd) {
39 if (isset($this->httpRequest->getParsedBody()['cmd']) && is_string($this->httpRequest->getParsedBody()['cmd'])) {
40 $cmd = $this->httpRequest->getParsedBody()['cmd'];
41 }
42 }
43
44 $passedSso = '';
45 if (isset($this->httpRequest->getQueryParams()['passed_sso']) && is_string($this->httpRequest->getQueryParams()['passed_sso'])) {
46 $passedSso = $this->httpRequest->getParsedBody()['passed_sso'];
47 }
48
49 if ('force_login' === $cmd || !empty($passedSso)) {
50 return false;
51 }
52
53 if (!$this->settings->get('soap_auth_active', false)) {
54 return false;
55 }
56
57 if (empty($this->getUsername()) || empty($this->getPassword())) {
58 return false;
59 }
60
61 $this->getLogger()->debug('Using SOAP authentication.');
62
63 $status = ilAuthStatus::getInstance();
64
65 require_once 'Services/SOAPAuth/classes/class.ilAuthProviderSoap.php';
66 $provider = new ilAuthProviderSoap($this);
67
68 $frontend_factory = new ilAuthFrontendFactory();
69 $frontend_factory->setContext(ilAuthFrontendFactory::CONTEXT_STANDARD_FORM);
70 $frontend = $frontend_factory->getFrontend(
71 $GLOBALS['DIC']['ilAuthSession'],
72 $status,
73 $this,
74 [$provider]
75 );
76
77 $frontend->authenticate();
78
79 switch ($status->getStatus()) {
81 ilLoggerFactory::getLogger('auth')->debug(
82 'Redirecting to default starting page.'
83 );
84 ilInitialisation::redirectToStartingPage();
85 break;
86
88 ilUtil::sendFailure($status->getTranslatedReason(), true);
89 $this->ctrl->redirectToURL(ilUtil::appendUrlParameterString(
90 $this->ctrl->getLinkTargetByClass('ilStartupGUI', 'showLoginPage', '', false, false),
91 'passed_sso=1'
92 ));
93 break;
94 }
95 }
Factory for auth frontend classes.
Class ilAuthProviderSoap.
static getInstance()
Get status instance.
const STATUS_AUTHENTICATION_FAILED
static getLogger($a_component_id)
Get component logger.
static appendUrlParameterString($a_url, $a_par, $xml_style=false)
append URL parameter string ("par1=value1&par2=value2...") to given URL string
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.

References $GLOBALS, PHPMailer\PHPMailer\$provider, ilUtil\appendUrlParameterString(), ilAuthFrontendFactory\CONTEXT_STANDARD_FORM, ilAuthStatus\getInstance(), ilLoggerFactory\getLogger(), ilAuthFrontendCredentials\getLogger(), ilAuthFrontendCredentials\getPassword(), ilAuthFrontendCredentials\getUsername(), ilUtil\sendFailure(), settings(), ilAuthStatus\STATUS_AUTHENTICATED, and ilAuthStatus\STATUS_AUTHENTICATION_FAILED.

+ Here is the call graph for this function:

Field Documentation

◆ $ctrl

ilAuthFrontendCredentialsSoap::$ctrl
private

Definition at line 10 of file class.ilAuthFrontendCredentialsSoap.php.

Referenced by __construct().

◆ $httpRequest

ilAuthFrontendCredentialsSoap::$httpRequest
private

Definition at line 7 of file class.ilAuthFrontendCredentialsSoap.php.

Referenced by __construct().

◆ $settings

ilAuthFrontendCredentialsSoap::$settings
private

Definition at line 13 of file class.ilAuthFrontendCredentialsSoap.php.

Referenced by __construct().


The documentation for this class was generated from the following file: