35 require_once
'Services/User/classes/class.ilObjUser.php';
38 $this->room = $chatroom;
50 $user_id = $this->user->getId();
52 if( $user_id == ANONYMOUS_USER_ID )
54 if( isset(
$_SESSION[
'chat'][$this->room->getRoomId()][
'user_id'] ) )
56 return $_SESSION[
'chat'][$this->room->getRoomId()][
'user_id'];
60 $user_id = mt_rand( -99999, -20 );
61 $_SESSION[
'chat'][$this->room->getRoomId()][
'user_id'] = $user_id;
79 $this->username = htmlspecialchars(
$username );
103 else if (
$_SESSION[
'chat'][$this->room->getRoomId()][
'username'])
105 return $_SESSION[
'chat'][$this->room->getRoomId()][
'username'];
108 return $this->user->getLogin();
119 $firstname = $this->user->getFirstname();
120 $lastname = $this->user->getLastname();
123 if( $this->user->getId() == ANONYMOUS_USER_ID )
144 $anonymous_name = str_replace(
145 '#', mt_rand( 0, 10000 ), $this->room->getSetting(
'autogen_usernames')
148 return $anonymous_name;
158 return $this->user->getLogin();
168 return $this->user->getFullname();
178 $firstname = $this->user->getFirstname();
180 return $firstname{0} .
'. ' . $this->user->getLastname();