Public Member Functions | |
ilChatBlockedUsers ($a_id) | |
Constructor public. | |
getBlockedUsers () | |
isBlocked ($a_usr_id) | |
block ($a_usr_id) | |
unblock ($a_usr_id) | |
_isBlocked ($a_chat_id, $a_usr_id) | |
_deleteUser ($a_usr_id) | |
_deleteChat ($a_chat_id) | |
__read () | |
Data Fields | |
$id | |
$db | |
$blocked = array() |
Definition at line 33 of file class.ilChatBlockedUsers.php.
ilChatBlockedUsers::__read | ( | ) |
Definition at line 139 of file class.ilChatBlockedUsers.php.
References $query, $res, and $row.
Referenced by block(), ilChatBlockedUsers(), and unblock().
{ $this->blocked = array(); $query = "SELECT * FROM chat_blocked ". "WHERE chat_id = '".$this->id."'"; $res = $this->db->query($query); while($row = $res->fetchRow(DB_FETCHMODE_OBJECT)) { $this->blocked[] = $row->usr_id; } return true; }
ilChatBlockedUsers::_deleteChat | ( | $ | a_chat_id | ) |
Definition at line 125 of file class.ilChatBlockedUsers.php.
References $query.
ilChatBlockedUsers::_deleteUser | ( | $ | a_usr_id | ) |
Definition at line 114 of file class.ilChatBlockedUsers.php.
References $query.
ilChatBlockedUsers::_isBlocked | ( | $ | a_chat_id, | |
$ | a_usr_id | |||
) |
Definition at line 100 of file class.ilChatBlockedUsers.php.
Referenced by ilObjChatGUI::__showOnlineUsers(), ilObjChatGUI::__showRooms(), and ilObjChatGUI::viewObject().
{ global $ilDB; $query = "SELECT * FROM chat_blocked ". "WHERE chat_id = '".$a_chat_id."' ". "AND usr_id = '".$a_usr_id."'"; $res = $ilDB->query($query); return $res->numRows() ? true : false; }
ilChatBlockedUsers::block | ( | $ | a_usr_id | ) |
Definition at line 65 of file class.ilChatBlockedUsers.php.
References $query, and __read().
{ if(in_array((int) $a_usr_id,$this->blocked) or !((int) $a_usr_id)) { return false; } $query = "INSERT INTO chat_blocked ". "SET chat_id = '".$this->id."', ". "usr_id = '".(int) $a_usr_id."'"; $this->db->query($query); $this->__read(); return true; }
ilChatBlockedUsers::getBlockedUsers | ( | ) |
Definition at line 56 of file class.ilChatBlockedUsers.php.
{
return $this->blocked ? $this->blocked : array();
}
ilChatBlockedUsers::ilChatBlockedUsers | ( | $ | a_id | ) |
Constructor public.
integer | reference_id or object_id | |
boolean | treat the id as reference_id (true) or object_id (false) |
Definition at line 46 of file class.ilChatBlockedUsers.php.
References __read().
{ global $ilDB; $this->db =& $ilDB; $this->id = $a_id; $this->__read(); }
ilChatBlockedUsers::isBlocked | ( | $ | a_usr_id | ) |
Definition at line 61 of file class.ilChatBlockedUsers.php.
{ return in_array($a_usr_id,$this->blocked) ? true : false; }
ilChatBlockedUsers::unblock | ( | $ | a_usr_id | ) |
Definition at line 81 of file class.ilChatBlockedUsers.php.
References $query, and __read().
{ if(!in_array((int) $a_usr_id,$this->blocked)) { return false; } $query = "DELETE FROM chat_blocked ". "WHERE chat_id = '".$this->id."' ". "AND usr_id = '".(int) $a_usr_id."'"; $this->db->query($query); $this->__read(); return true; }
ilChatBlockedUsers::$blocked = array() |
Definition at line 38 of file class.ilChatBlockedUsers.php.
ilChatBlockedUsers::$db |
Definition at line 36 of file class.ilChatBlockedUsers.php.
ilChatBlockedUsers::$id |
Definition at line 35 of file class.ilChatBlockedUsers.php.