XCL Web Application Platform 2.5.0
The XoopsCube Legacy Project
Loading...
Searching...
No Matches
Legacy_Identity.class.php
1<?php
10
11if (!defined('XOOPS_ROOT_PATH')) {
12 exit();
13}
14
16{
17 public function __construct(&$xoopsUser)
18 {
19 parent::__construct($xoopsUser);
20
21 if (!is_object($xoopsUser)) {
22 die('Exception');
23 }
24
25 $this->mName = $xoopsUser->get('uname');
26 }
27
28 public function isAuthenticated()
29 {
30 return true;
31 }
32}
33
35{
36 public function isAuthenticated()
37 {
38 return false;
39 }
40}
41
52{
57 public function addRole($roleName)
58 {
59 if (!$this->isInRole($roleName)) {
60 $this->_mRoles[] = $roleName;
61 }
62 }
63
64 public function isInRole($roleName)
65 {
66 return in_array($roleName, $this->_mRoles);
67 }
68}