forked from cynial/STBlog
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUser.php
More file actions
155 lines (138 loc) · 2.76 KB
/
User.php
File metadata and controls
155 lines (138 loc) · 2.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
<?php if (!defined('BASEPATH')) exit('No direct access allowed.');
/**
* STBlog Blogging System
*
* 基于Codeigniter的单用户多权限开源博客系统
*
* STBlog is an open source multi-privilege blogging System built on the
* well-known PHP framework Codeigniter.
*
* @package STBLOG
* @author Saturn <[email protected]>
* @copyright Copyright (c) 2009 - 2010, cnsaturn.com.
* @license GNU General Public License 2.0
* @link http://code.google.com/p/stblog/
* @version 0.1.0
*/
// ------------------------------------------------------------------------
/**
* STBLOG User library Class
*
* 本类包含用户Domain的核心逻辑
*
*
* @package STBLOG
* @subpackage Libraries
* @category Libraries
* @author Saturn <[email protected]>
* @link http://code.google.com/p/stblog/
*/
class User
{
/**
* user domain
*
* @access private
* @var array
*/
private $_user = array();
/**
* 用户ID
*
* @access public
* @var integer
*/
public $uid = 0;
/**
* 登录用户名
*
* @access public
* @var string
*/
public $name = '';
/**
* Email
*
* @access public
* @var string
*/
public $mail = '';
/**
* 昵称
*
* @access public
* @var string
*/
public $screenName = '';
/**
* 帐号创建日期
*
* @access public
* @var string
*/
public $created = 0;
/**
* 最后活跃时间
*
* @access public
* @var string
*/
public $activated = 0;
/**
* 上次登录
*
* @access public
* @var string
*/
public $logged = 0;
/**
* 所属用户组
*
* @access public
* @var string
*/
public $group = 'visitor';
/**
* 本次登录Token
*
* @access public
* @var string
*/
public $token = '';
/**
* CI句柄
*
* @access private
* @var object
*/
private $_CI;
/**
* 构造函数
*
* @access public
* @return void
*/
public function __construct()
{
/** 获取CI句柄 */
$this->_CI = & get_instance();
$this->_user = unserialize($this->_CI->session->userdata('user'));
/** 初始化工作 */
if(!empty($this->_user))
{
$this->uid = $this->_user['uid'];
$this->name = $this->_user['name'];
$this->mail = $this->_user['mail'];
$this->url = $this->_user['url'];
$this->screenName = $this->_user['screenName'];
$this->created = $this->_user['created'];
$this->activated = $this->_user['activated'];
$this->logged = $this->_user['logged'];
$this->group = $this->_user['group'];
$this->token = $this->_user['token'];
}
log_message('debug', "STBLOG: User Domain library Class Initialized");
}
}
/* End of file User.php */
/* Location: ./application/libraries/User.php */