ILIAS  Release_3_10_x_branch Revision 61812
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilChatBlockedUsers Class Reference

Class ilChatUser. More...

+ Collaboration diagram for ilChatBlockedUsers:

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()

Detailed Description

Class ilChatUser.

Author
Stefan Meyer smeye.nosp@m.r@da.nosp@m.tabay.nosp@m..de
Version
Id:
class.ilChatBlockedUsers.php 15697 2008-01-08 20:04:33Z hschottm

Definition at line 32 of file class.ilChatBlockedUsers.php.

Member Function Documentation

ilChatBlockedUsers::__read ( )

Definition at line 142 of file class.ilChatBlockedUsers.php.

References $res, and DB_FETCHMODE_OBJECT.

Referenced by block(), ilChatBlockedUsers(), and unblock().

{
global $ilDB;
$this->blocked = array();
$query = "SELECT * FROM chat_blocked ".
"WHERE chat_id = ".$ilDB->quote($this->id)."";
$res = $this->db->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$this->blocked[] = $row->usr_id;
}
return true;
}

+ Here is the caller graph for this function:

ilChatBlockedUsers::_deleteChat (   $a_chat_id)

Definition at line 128 of file class.ilChatBlockedUsers.php.

{
global $ilDB;
$query = "DELETE FROM chat_blocked ".
"WHERE chat_id = ".$ilDB->quote((int) $a_chat_id)."";
$ilDB->query($query);
return true;
}
ilChatBlockedUsers::_deleteUser (   $a_usr_id)

Definition at line 117 of file class.ilChatBlockedUsers.php.

{
global $ilDB;
$query = "DELETE FROM chat_blocked ".
"WHERE usr_id = ".$ilDB->quote((int) $a_usr_id)."";
$ilDB->query($query);
return true;
}
ilChatBlockedUsers::_isBlocked (   $a_chat_id,
  $a_usr_id 
)

Definition at line 103 of file class.ilChatBlockedUsers.php.

References $res.

Referenced by ilObjChatGUI\__showOnlineUsers(), ilObjChatGUI\__showRooms(), and ilObjChatGUI\viewObject().

{
global $ilDB;
$query = "SELECT * FROM chat_blocked ".
"WHERE chat_id = ".$ilDB->quote($a_chat_id)." ".
"AND usr_id = ".$ilDB->quote($a_usr_id )."";
$res = $ilDB->query($query);
return $res->numRows() ? true : false;
}

+ Here is the caller graph for this function:

ilChatBlockedUsers::block (   $a_usr_id)

Definition at line 64 of file class.ilChatBlockedUsers.php.

References __read().

{
global $ilDB;
if(in_array((int) $a_usr_id,$this->blocked) or !((int) $a_usr_id))
{
return false;
}
$query = "INSERT INTO chat_blocked ".
"SET chat_id = ".$ilDB->quote($this->id).", ".
"usr_id = ".$ilDB->quote((int) $a_usr_id)."";
$this->db->query($query);
$this->__read();
return true;
}

+ Here is the call graph for this function:

ilChatBlockedUsers::getBlockedUsers ( )

Definition at line 55 of file class.ilChatBlockedUsers.php.

{
return $this->blocked ? $this->blocked : array();
}
ilChatBlockedUsers::ilChatBlockedUsers (   $a_id)

Constructor public.

Parameters
integerreference_id or object_id
booleantreat the id as reference_id (true) or object_id (false)

Definition at line 45 of file class.ilChatBlockedUsers.php.

References __read().

{
global $ilDB;
$this->db =& $ilDB;
$this->id = $a_id;
$this->__read();
}

+ Here is the call graph for this function:

ilChatBlockedUsers::isBlocked (   $a_usr_id)

Definition at line 60 of file class.ilChatBlockedUsers.php.

{
return in_array($a_usr_id,$this->blocked) ? true : false;
}
ilChatBlockedUsers::unblock (   $a_usr_id)

Definition at line 82 of file class.ilChatBlockedUsers.php.

References __read().

{
global $ilDB;
if(!in_array((int) $a_usr_id,$this->blocked))
{
return false;
}
$query = "DELETE FROM chat_blocked ".
"WHERE chat_id = ".$ilDB->quote($this->id)." ".
"AND usr_id = ".$ilDB->quote((int) $a_usr_id). "";
$this->db->query($query);
$this->__read();
return true;
}

+ Here is the call graph for this function:

Field Documentation

ilChatBlockedUsers::$blocked = array()

Definition at line 37 of file class.ilChatBlockedUsers.php.

ilChatBlockedUsers::$db

Definition at line 35 of file class.ilChatBlockedUsers.php.

ilChatBlockedUsers::$id

Definition at line 34 of file class.ilChatBlockedUsers.php.


The documentation for this class was generated from the following file: