ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilAuthStatus.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
4 
12 {
13  private static $instance = null;
14 
15  private $logger = null;
16 
17  const STATUS_UNDEFINED = 1;
22 
23  private $status = self::STATUS_UNDEFINED;
24  private $reason = '';
25  private $translated_reason = '';
26  private $auth_user_id = 0;
27 
28 
29 
33  private function __construct()
34  {
35  $this->logger = ilLoggerFactory::getLogger('auth');
36  }
37 
42  public static function getInstance()
43  {
44  if (self::$instance) {
45  return self::$instance;
46  }
47  return self::$instance = new self();
48  }
49 
54  protected function getLogger()
55  {
56  return $this->logger;
57  }
58 
63  public function setStatus($a_status)
64  {
65  $this->status = $a_status;
66  }
67 
72  public function getStatus()
73  {
74  return $this->status;
75  }
76 
81  public function setReason($a_reason)
82  {
83  $this->reason = $a_reason;
84  }
85 
90  public function setTranslatedReason($a_reason)
91  {
92  $this->translated_reason = $a_reason;
93  }
94 
99  public function getReason()
100  {
101  return $this->reason;
102  }
103 
107  public function getTranslatedReason()
108  {
109  if (strlen($this->translated_reason)) {
111  }
112  return $GLOBALS['DIC']->language()->txt($this->getReason());
113  }
114 
115 
116  public function setAuthenticatedUserId($a_id)
117  {
118  $this->auth_user_id = $a_id;
119  }
120 
125  public function getAuthenticatedUserId()
126  {
127  return $this->auth_user_id;
128  }
129 }
getReason()
Get reason for authentication success, fail, migration...
const STATUS_AUTHENTICATION_FAILED
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
getLogger()
Get logger.
getAuthenticatedUserId()
Get authenticated user id.
setTranslatedReason($a_reason)
Set translated reason.
setAuthenticatedUserId($a_id)
getTranslatedReason()
Get translated reason.
setStatus($a_status)
Set auth status.
getStatus()
Get status.
setReason($a_reason)
Set reason.
const STATUS_CODE_ACTIVATION_REQUIRED
static getInstance()
Get status instance.
static getLogger($a_component_id)
Get component logger.
__construct()
Constructor.
Auth status implementation.
const STATUS_ACCOUNT_MIGRATION_REQUIRED