1. added non anonymous ldap binding patch. (thanks to Ilyak Kasnacheev <ilyak at...
[squirrelmail.git] / functions / abook_database.php
index aad2871354e57df24080e863fcae30d218180d5d..8023f704026e85686c8c1f196b8e213c9453fd52 100644 (file)
  *        "AddressBook" class instead.
  *
  * $Id$
+ * @package squirrelmail
  */
-   
+
+/** Needs the DB functions */   
 require_once('DB.php');
-   
+
+/**
+ * Undocumented class - stores the addressbook in a sql database
+ * @package squirrelmail
+ */
 class abook_database extends addressbook_backend {
     var $btype = 'local';
     var $bname = 'database';
@@ -68,6 +74,10 @@ class abook_database extends addressbook_backend {
                $this->writeable = $param['writeable'];
             }
 
+            if (isset($param['listing'])) {
+               $this->listing = $param['listing'];
+            }
+
             $this->open(true);
         }
         else {
@@ -115,7 +125,7 @@ class abook_database extends addressbook_backend {
         if(!$this->open()) {
             return false;
         }
-         
+
         /* To be replaced by advanded search expression parsing */
         if (is_array($expr)) {
             return;
@@ -191,6 +201,11 @@ class abook_database extends addressbook_backend {
         if (!$this->open()) {
             return false;
         }
+       
+       if(!$this->listing) {
+           return array();
+       }
+
 
         $query = sprintf("SELECT * FROM %s WHERE owner='%s'",
                          $this->table, $this->owner);