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