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.

References ilLoggerFactory\getLogger().

34  {
35  $this->logger = ilLoggerFactory::getLogger('auth');
36  }
static getLogger($a_component_id)
Get component logger.
+ 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.

References $auth_user_id.

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

◆ getInstance()

static ilAuthStatus::getInstance ( )
static

Get status instance.

Returns

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

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

43  {
44  if(self::$instance)
45  {
46  return self::$instance;
47  }
48  return self::$instance = new self();
49  }
+ Here is the caller graph for this function:

◆ getLogger()

ilAuthStatus::getLogger ( )
protected

Get logger.

Returns

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

References $logger.

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

◆ getReason()

ilAuthStatus::getReason ( )

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

Returns
string

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

References $reason.

Referenced by getTranslatedReason().

101  {
102  return $this->reason;
103  }
+ 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.

References $status.

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

◆ getTranslatedReason()

ilAuthStatus::getTranslatedReason ( )

Get translated reason.

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

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

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.
+ Here is the call graph for this function:

◆ setAuthenticatedUserId()

◆ 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.

Referenced by ilAuthProvider\handleAuthenticationFail().

83  {
84  $this->reason = $a_reason;
85  }
+ Here is the caller graph for this function:

◆ setStatus()

◆ 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.

◆ $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: