Exemplo n.º 1
0
 /**
  * Create a contact group with the given name
  *
  * @param string The group name
  * @return mixed False on error, array with record props in success
  */
 function create_group($name)
 {
     $result = false;
     // make sure we have a unique name
     $name = $this->unique_groupname($name);
     $this->db->query("INSERT INTO " . $this->db->table_name($this->db_groups) . " (user_id, changed, name)" . " VALUES (" . intval($this->user_id) . ", " . $this->db->now() . ", " . $this->db->quote($name) . ")");
     if ($insert_id = $this->db->insert_id($this->db_groups)) {
         $result = array('id' => $insert_id, 'name' => $name);
     }
     return $result;
 }
Exemplo n.º 2
0
 /**
  * Clears thread cache.
  *
  * @param string  $mailbox     Folder name
  */
 function remove_thread($mailbox = null)
 {
     $this->db->query("DELETE FROM " . get_table_name('cache_thread') . " WHERE user_id = " . intval($this->userid) . (strlen($mailbox) ? " AND mailbox = " . $this->db->quote($mailbox) : ""));
     if (strlen($mailbox)) {
         unset($this->icache[$mailbox]['thread']);
         // Thread data removed, set flag to skip SELECT query in get_thread()
         $this->icache[$mailbox]['thread_queried'] = true;
     } else {
         $this->icache = array();
     }
 }