From 2d08c50fd78e8ae74f27a2418f7909b18ae2bf42 Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Fri, 05 Mar 2010 04:47:32 -0500
Subject: [PATCH] - Support/Require tls:// prefix in 'smtp_server' option for TLS connections - "Split" config file into sections

---
 program/include/rcube_contacts.php |   52 +++++++++++-----------------------------------------
 1 files changed, 11 insertions(+), 41 deletions(-)

diff --git a/program/include/rcube_contacts.php b/program/include/rcube_contacts.php
index 7ef2af1..23f86e8 100644
--- a/program/include/rcube_contacts.php
+++ b/program/include/rcube_contacts.php
@@ -5,7 +5,7 @@
  | program/include/rcube_contacts.php                                    |
  |                                                                       |
  | This file is part of the RoundCube Webmail client                     |
- | Copyright (C) 2006-2008, RoundCube Dev. - Switzerland                 |
+ | Copyright (C) 2006-2009, RoundCube Dev. - Switzerland                 |
  | Licensed under the GNU GPL                                            |
  |                                                                       |
  | PURPOSE:                                                              |
@@ -15,7 +15,7 @@
  | Author: Thomas Bruederli <roundcube@gmail.com>                        |
  +-----------------------------------------------------------------------+
 
- $Id: rcube_contacts.inc 328 2006-08-30 17:41:21Z thomasb $
+ $Id$
 
 */
 
@@ -25,7 +25,7 @@
  *
  * @package Addressbook
  */
-class rcube_contacts
+class rcube_contacts extends rcube_addressbook
 {
   var $db = null;
   var $db_name = '';
@@ -56,30 +56,6 @@
     $this->db_name = get_table_name('contacts');
     $this->user_id = $user;
     $this->ready = $this->db && !$this->db->is_error();
-  }
-
-
-  /**
-   * Set internal list page
-   *
-   * @param  number  Page number to list
-   * @access public
-   */
-  function set_page($page)
-  {
-    $this->list_page = (int)$page;
-  }
-
-
-  /**
-   * Set internal page size
-   *
-   * @param  number  Number of messages to display on one page
-   * @access public
-   */
-  function set_pagesize($size)
-  {
-    $this->page_size = (int)$size;
   }
 
 
@@ -115,13 +91,6 @@
     $this->search_fields = null;
     $this->search_string = null;
   }
-  
-  
-  /**
-   * Close connection to source
-   * Called on script shutdown
-   */
-  function close(){}
   
   
   /**
@@ -172,6 +141,7 @@
    *
    * @param array   List of fields to search in
    * @param string  Search value
+   * @param boolean True for strict (=), False for partial (LIKE) matching
    * @param boolean True if results are requested, False if count only
    * @return Indexed list of contact records and 'count' value
    */
@@ -185,7 +155,7 @@
     {
       if ($col == 'ID' || $col == $this->primary_key)
       {
-        $ids = !is_array($value) ? split(',', $value) : $value;
+        $ids = !is_array($value) ? explode(',', $value) : $value;
         $add_where[] = $this->primary_key.' IN ('.join(',', $ids).')';
       }
       else if ($strict)
@@ -233,7 +203,7 @@
    *
    * @return Result array or NULL if nothing selected yet
    */
-  function get_result($as_res=true)
+  function get_result()
   {
     return $this->result;
   }
@@ -293,18 +263,18 @@
         $a_insert_cols[] = $this->db->quoteIdentifier($col);
         $a_insert_values[] = $this->db->quote($save_data[$col]);
       }
-    
+
     if (!$existing->count && !empty($a_insert_cols))
     {
       $this->db->query(
         "INSERT INTO ".$this->db_name."
          (user_id, changed, del, ".join(', ', $a_insert_cols).")
-         VALUES (?, ".$this->db->now().", 0, ".join(', ', $a_insert_values).")",
-        $this->user_id);
+         VALUES (".intval($this->user_id).", ".$this->db->now().", 0, ".join(', ', $a_insert_values).")"
+        );
         
-      $insert_id = $this->db->insert_id(get_sequence_name('contacts'));
+      $insert_id = $this->db->insert_id('contacts');
     }
-    
+
     return $insert_id;
   }
 

--
Gitblit v1.9.1