forked from iflylabs/iflychat-php
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathiflychatuserdetails.php
executable file
·74 lines (56 loc) · 2.03 KB
/
iflychatuserdetails.php
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
<?php
class iFlyChatUserDetails
{
private $user_details = array();
public function __construct($name = NULL, $id = 0) {
$this->user_details['name'] = $name;
$this->user_details['id'] = $id;
$this->user_details['is_admin'] = FALSE;
$this->user_details['avatar_url'] = '';
$this->user_details['upl'] = '';
$this->user_details['relationships_set'] = FALSE;
$this->user_details['room_roles'] = array();
$this->user_details['user_groups'] = array();
}
public function getUserDetails() {
return $this->user_details;
}
public function setIsAdmin($is_admin = FALSE) {
$this->user_details['is_admin'] = $is_admin;
}
public function setAvatarUrl($avatar_url = '') {
$this->user_details['avatar_url'] = $avatar_url;
}
public function setProfileLink($upl = '') {
$this->user_details['upl'] = $upl;
}
public function setRelationshipSet($relationships_set = FALSE) {
$this->user_details['relationships_set'] = $relationships_set;
}
public function setRoomRoles($room_roles = array()) {
$this->user_details['room_roles'] = $room_roles;
}
public function setUserGroups($user_groups = array()) {
$this->user_details['user_groups'] = $user_groups;
}
}
/**
* Details of current logged-in user
* Retreive from database or PHP session
*/
//Uncomment the code below to pass the details of logged-in user
/*
global $iflychat_userinfo;
$iflychat_userinfo = new iFlyChatUserDetails('admin', 1);
$iflychat_userinfo->setIsAdmin(TRUE);
$iflychat_userinfo->setAvatarUrl('https://iflychat.com/sites/all/modules/drupalchat/themes/light/images/default_avatar.png');
$iflychat_userinfo->setProfileLink('/user.php?id=1');
$iflychat_userinfo->setRoomRoles(array());
$iflychat_userinfo->setRelationshipSet(FALSE);
*/
/**
* Pass no parameters if the user is NOT logged-in/unregistered/guest (anonymous user)
*
*/
$iflychat_userinfo = new iFlyChatUserDetails();
?>