Update the Filters plugin to comply with our Plugin Standards
[squirrelmail.git] / functions / abook_local_file.php
index d22114f6c4b0d636eebb5d2ff2bcb1f4e13a85ba..6d6a636b737f86c21e2d5dd22c20a90a0406d4c9 100644 (file)
@@ -26,6 +26,7 @@
  *                checking file permissions.
  * ? writeable => allow writing into address book. Used only when
  *                detect_writeable is set to false.
+ * ? listing   => enable/disable listing
  *</pre>
  * NOTE. This class should not be used directly. Use the
  *       "AddressBook" class instead.
@@ -70,6 +71,11 @@ class abook_local_file extends addressbook_backend {
      * @var bool
      */
     var $writeable = false;
+    /**
+     * controls listing of address book
+     * @var bool
+     */
+    var $listing = true;
     /**
      * Umask of the file
      * @var string
@@ -113,6 +119,9 @@ class abook_local_file extends addressbook_backend {
             if(!empty($param['writeable'])) {
                 $this->writeable = $param['writeable'];
             }
+            if(isset($param['listing'])) {
+                $this->listing = $param['listing'];
+            }
 
             $this->open(true);
         } else {
@@ -315,6 +324,11 @@ class abook_local_file extends addressbook_backend {
      */
     function list_addr() {
         $res = array();
+
+        if(isset($this->listing) && !$this->listing) {
+            return array();
+        }
+
         $this->open();
         @rewind($this->filehandle);