ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilAuthStatus Class Reference

Auth status implementation. More...

+ Collaboration diagram for ilAuthStatus:

Public Member Functions

 setStatus ($a_status)
 Set auth status. More...
 
 getStatus ()
 Get status. More...
 
 setReason ($a_reason)
 Set reason. More...
 
 setTranslatedReason ($a_reason)
 Set translated reason. More...
 
 getReason ()
 Get reason for authentication success, fail, migration... More...
 
 getTranslatedReason ()
 Get translated reason. More...
 
 setAuthenticatedUserId ($a_id)
 
 getAuthenticatedUserId ()
 Get authenticated user id. More...
 

Static Public Member Functions

static getInstance ()
 Get status instance. More...
 

Data Fields

const STATUS_UNDEFINED = 1
 
const STATUS_AUTHENTICATED = 2
 
const STATUS_AUTHENTICATION_FAILED = 3
 
const STATUS_ACCOUNT_MIGRATION_REQUIRED = 4
 
const STATUS_CODE_ACTIVATION_REQUIRED = 5
 

Protected Member Functions

 getLogger ()
 Get logger. More...
 

Private Member Functions

 __construct ()
 Constructor. More...
 

Private Attributes

 $logger = null
 
 $status = self::STATUS_UNDEFINED
 
 $reason = ''
 
 $translated_reason = ''
 
 $auth_user_id = 0
 

Static Private Attributes

static $instance = null
 

Detailed Description

Auth status implementation.

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e

Definition at line 11 of file class.ilAuthStatus.php.

Constructor & Destructor Documentation

◆ __construct()

ilAuthStatus::__construct ( )
private

Constructor.

Definition at line 33 of file class.ilAuthStatus.php.

34 {
35 $this->logger = ilLoggerFactory::getLogger('auth');
36 }
static getLogger($a_component_id)
Get component logger.

References ilLoggerFactory\getLogger().

+ Here is the call graph for this function:

Member Function Documentation

◆ getAuthenticatedUserId()

ilAuthStatus::getAuthenticatedUserId ( )

Get authenticated user id.

Returns
int

Definition at line 127 of file class.ilAuthStatus.php.

128 {
129 return $this->auth_user_id;
130 }

References $auth_user_id.

◆ getInstance()

static ilAuthStatus::getInstance ( )
static

Get status instance.

Returns
\ilAuthStatus

Definition at line 42 of file class.ilAuthStatus.php.

43 {
44 if(self::$instance)
45 {
46 return self::$instance;
47 }
48 return self::$instance = new self();
49 }

References $instance.

Referenced by ilCronStartUp\authenticate(), ilStartUpGUI\doApacheAuthentication(), ilStartUpGUI\doCasAuthentication(), ilStartUpGUI\doMigration(), ilStartUpGUI\doMigrationNewAccount(), ilStartUpGUI\doShibbolethAuthentication(), ilStartUpGUI\doStandardAuthentication(), ilAuthUtils\handleForcedAuthentication(), and ilDAVServer\tryAuthentication().

+ Here is the caller graph for this function:

◆ getLogger()

ilAuthStatus::getLogger ( )
protected

Get logger.

Returns
\ilLogger

Definition at line 55 of file class.ilAuthStatus.php.

56 {
57 return $this->logger;
58 }

References $logger.

◆ getReason()

ilAuthStatus::getReason ( )

Get reason for authentication success, fail, migration...

Returns
string

Definition at line 100 of file class.ilAuthStatus.php.

101 {
102 return $this->reason;
103 }

References $reason.

Referenced by getTranslatedReason().

+ Here is the caller graph for this function:

◆ getStatus()

ilAuthStatus::getStatus ( )

Get status.

Returns
int $status

Definition at line 73 of file class.ilAuthStatus.php.

74 {
75 return $this->status;
76 }

References $status.

◆ getTranslatedReason()

ilAuthStatus::getTranslatedReason ( )

Get translated reason.

Definition at line 108 of file class.ilAuthStatus.php.

109 {
110 if(strlen($this->translated_reason))
111 {
113 }
114 return $GLOBALS['DIC']->language()->txt($this->getReason());
115 }
getReason()
Get reason for authentication success, fail, migration...
$GLOBALS['loaded']
Global hash that tracks already loaded includes.

References $GLOBALS, $translated_reason, and getReason().

+ Here is the call graph for this function:

◆ setAuthenticatedUserId()

ilAuthStatus::setAuthenticatedUserId (   $a_id)

Definition at line 118 of file class.ilAuthStatus.php.

119 {
120 $this->auth_user_id = $a_id;
121 }

◆ setReason()

ilAuthStatus::setReason (   $a_reason)

Set reason.

Parameters
string$a_reasonA laguage key, which can be translated to an end user message

Definition at line 82 of file class.ilAuthStatus.php.

83 {
84 $this->reason = $a_reason;
85 }

◆ setStatus()

ilAuthStatus::setStatus (   $a_status)

Set auth status.

Parameters
int$a_status

Definition at line 64 of file class.ilAuthStatus.php.

65 {
66 $this->status = $a_status;
67 }

Referenced by ilAuthProviderCAS\doAuthentication(), ilAuthProviderRadius\doAuthentication(), and ilAuthProviderECS\doAuthentication().

+ Here is the caller graph for this function:

◆ setTranslatedReason()

ilAuthStatus::setTranslatedReason (   $a_reason)

Set translated reason.

Parameters
string$a_reason

Definition at line 91 of file class.ilAuthStatus.php.

92 {
93 $this->translated_reason = $a_reason;
94 }

Field Documentation

◆ $auth_user_id

ilAuthStatus::$auth_user_id = 0
private

Definition at line 26 of file class.ilAuthStatus.php.

Referenced by getAuthenticatedUserId().

◆ $instance

ilAuthStatus::$instance = null
staticprivate

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

Referenced by getInstance().

◆ $logger

ilAuthStatus::$logger = null
private

Definition at line 15 of file class.ilAuthStatus.php.

Referenced by getLogger().

◆ $reason

ilAuthStatus::$reason = ''
private

Definition at line 24 of file class.ilAuthStatus.php.

Referenced by getReason().

◆ $status

ilAuthStatus::$status = self::STATUS_UNDEFINED
private

Definition at line 23 of file class.ilAuthStatus.php.

Referenced by getStatus().

◆ $translated_reason

ilAuthStatus::$translated_reason = ''
private

Definition at line 25 of file class.ilAuthStatus.php.

Referenced by getTranslatedReason().

◆ STATUS_ACCOUNT_MIGRATION_REQUIRED

◆ STATUS_AUTHENTICATED

◆ STATUS_AUTHENTICATION_FAILED

◆ STATUS_CODE_ACTIVATION_REQUIRED

const ilAuthStatus::STATUS_CODE_ACTIVATION_REQUIRED = 5

◆ STATUS_UNDEFINED

const ilAuthStatus::STATUS_UNDEFINED = 1

Definition at line 17 of file class.ilAuthStatus.php.

Referenced by ilAuthFrontend\resetStatus().


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