File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ class User implements \WebApp\Auth\Principal {
11
11
public const STATUS_DELETED = 'deleted ' ;
12
12
13
13
public function __construct () {
14
+ $ this ->created_on = new \TgUtils \Date ($ this ->created_on , WFW_TIMEZONE );
14
15
}
15
16
16
17
/**
@@ -37,11 +38,10 @@ public function passwordCriteriaMatched($password) {
37
38
}
38
39
39
40
public function getRoles () {
40
- $ rc = array ();
41
- if (is_string ($ this ->roles )) {
42
- $ rc = explode (', ' , $ this ->roles );
41
+ if (!isset ($ this ->_roles )) {
42
+ $ this ->_roles = explode (', ' , $ this ->roles );
43
43
}
44
- return $ rc ;
44
+ return $ this -> _roles ;
45
45
}
46
46
47
47
public function hasRole ($ s ) {
@@ -59,6 +59,7 @@ public function addRole($s) {
59
59
public function setRoles ($ arr ) {
60
60
if (is_string ($ arr )) $ this ->roles = $ arr ;
61
61
else if (is_array ($ arr )) $ this ->roles = implode (', ' , $ arr );
62
+ $ this ->_roles = explode (', ' , $ this ->roles );
62
63
}
63
64
64
65
public function isActive () {
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ protected function initialize() {
19
19
$ sql =
20
20
'CREATE TABLE ' .$ this ->database ->quoteName ($ this ->tableName ).' ( ' .
21
21
'`uid` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, ' .
22
+ '`created_on` DATETIME NOT NULL, ' .
22
23
'`email` varchar(250) COLLATE utf8mb4_bin NOT NULL, ' .
23
24
'`password` varchar(150) COLLATE utf8mb4_bin NOT NULL, ' .
24
25
'`name` varchar(50) COLLATE utf8mb4_bin NOT NULL, ' .
You can’t perform that action at this time.
0 commit comments