ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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
22
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 {
46 return self::$instance;
47 }
48 return self::$instance = new self();
49 }
50
55 protected function getLogger()
56 {
57 return $this->logger;
58 }
59
64 public function setStatus($a_status)
65 {
66 $this->status = $a_status;
67 }
68
73 public function getStatus()
74 {
75 return $this->status;
76 }
77
82 public function setReason($a_reason)
83 {
84 $this->reason = $a_reason;
85 }
86
91 public function setTranslatedReason($a_reason)
92 {
93 $this->translated_reason = $a_reason;
94 }
95
100 public function getReason()
101 {
102 return $this->reason;
103 }
104
108 public function getTranslatedReason()
109 {
110 if(strlen($this->translated_reason))
111 {
113 }
114 return $GLOBALS['DIC']->language()->txt($this->getReason());
115 }
116
117
118 public function setAuthenticatedUserId($a_id)
119 {
120 $this->auth_user_id = $a_id;
121 }
122
127 public function getAuthenticatedUserId()
128 {
129 return $this->auth_user_id;
130 }
131}
132?>
An exception for terminatinating execution or to throw for unit testing.
Auth status implementation.
getReason()
Get reason for authentication success, fail, migration...
getStatus()
Get status.
setTranslatedReason($a_reason)
Set translated reason.
const STATUS_CODE_ACTIVATION_REQUIRED
__construct()
Constructor.
setAuthenticatedUserId($a_id)
setStatus($a_status)
Set auth status.
getTranslatedReason()
Get translated reason.
setReason($a_reason)
Set reason.
getAuthenticatedUserId()
Get authenticated user id.
static getInstance()
Get status instance.
const STATUS_AUTHENTICATION_FAILED
const STATUS_ACCOUNT_MIGRATION_REQUIRED
getLogger()
Get logger.
static getLogger($a_component_id)
Get component logger.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.