ILIAS  trunk Revision v12.0_alpha-1613-gae4c99ebb18
ILIAS\AuthSOAP\SessionValidationClient Class Reference
+ Collaboration diagram for ILIAS\AuthSOAP\SessionValidationClient:

Public Member Functions

 __construct (private string $location, private string $namespace, private bool $use_dotnet=false,)
 
 validateSession (string $ext_uid, string $soap_pw, bool $new_user,)
 

Private Member Functions

 buildCallParameters (string $ext_uid, string $soap_pw, bool $new_user)
 Mirrors legacy nusoap_client::call() parameter naming (ns1: prefix in .NET mode). More...
 
 normalizeValidationResult (mixed $valid)
 

Detailed Description

Definition at line 23 of file SessionValidationClient.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\AuthSOAP\SessionValidationClient::__construct ( private string  $location,
private string  $namespace,
private bool  $use_dotnet = false 
)

Definition at line 25 of file SessionValidationClient.php.

29 {
30 }

Member Function Documentation

◆ buildCallParameters()

ILIAS\AuthSOAP\SessionValidationClient::buildCallParameters ( string  $ext_uid,
string  $soap_pw,
bool  $new_user 
)
private

Mirrors legacy nusoap_client::call() parameter naming (ns1: prefix in .NET mode).

Returns
list<\SoapParam>

Definition at line 70 of file SessionValidationClient.php.

70 : array
71 {
72 if ($this->use_dotnet) {
73 return [
74 new \SoapParam($ext_uid, 'ns1:ext_uid'),
75 new \SoapParam($soap_pw, 'ns1:soap_pw'),
76 new \SoapParam($new_user, 'ns1:new_user'),
77 ];
78 }
79
80 return [
81 new \SoapParam($ext_uid, 'ext_uid'),
82 new \SoapParam($soap_pw, 'soap_pw'),
83 new \SoapParam($new_user, 'new_user'),
84 ];
85 }
$soap_pw
$ext_uid
$new_user

References $ext_uid, $new_user, and $soap_pw.

◆ normalizeValidationResult()

ILIAS\AuthSOAP\SessionValidationClient::normalizeValidationResult ( mixed  $valid)
private
Returns
array{valid: bool, firstname?: string, lastname?: string, email?: string}

Definition at line 90 of file SessionValidationClient.php.

90 : array
91 {
92 if (\is_object($valid)) {
93 $valid = (array) $valid;
94 }
95
96 if (!\is_array($valid)) {
97 return ['valid' => false];
98 }
99
100 return $valid;
101 }

◆ validateSession()

ILIAS\AuthSOAP\SessionValidationClient::validateSession ( string  $ext_uid,
string  $soap_pw,
bool  $new_user 
)

Definition at line 32 of file SessionValidationClient.php.

36 : SessionValidationResult {
37 $service_namespace = $this->namespace !== '' ? $this->namespace : $this->location;
38
39 $soap_client = new \SoapClient(null, [
40 'location' => $this->location,
41 'uri' => $service_namespace,
42 'trace' => true,
43 'exceptions' => true,
44 'style' => SOAP_RPC,
45 'use' => SOAP_ENCODED,
46 ]);
47
48 $call_options = ['uri' => $service_namespace];
49 if ($this->use_dotnet) {
50 $call_options['soapaction'] = $service_namespace . '/isValidSession';
51 }
52
53 $valid = $soap_client->__soapCall(
54 'isValidSession',
56 $call_options
57 );
58
59 return new SessionValidationResult(
60 $this->normalizeValidationResult($valid),
61 (string) $soap_client->__getLastRequest(),
62 (string) $soap_client->__getLastResponse(),
63 );
64 }
buildCallParameters(string $ext_uid, string $soap_pw, bool $new_user)
Mirrors legacy nusoap_client::call() parameter naming (ns1: prefix in .NET mode).
return true
if(!file_exists('../ilias.ini.php'))

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