From 7fdb9da98e080ad623e3099c05eab17041013cab Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Thu, 01 Apr 2010 11:54:57 -0400
Subject: [PATCH] - Fix sources list if 'ldap_public' is null/false

---
 program/include/rcmail.php |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/program/include/rcmail.php b/program/include/rcmail.php
index 09957ee..c9a0658 100644
--- a/program/include/rcmail.php
+++ b/program/include/rcmail.php
@@ -292,8 +292,8 @@
   public function get_address_sources($writeable = false)
   {
     $abook_type = strtolower($this->config->get('address_book_type'));
-    $ldap_config = (array)$this->config->get('ldap_public');
-    $autocomplete = (array)$this->config->get('autocomplete_addressbooks');
+    $ldap_config = $this->config->get('ldap_public');
+    $autocomplete = (array) $this->config->get('autocomplete_addressbooks');
     $list = array();
 
     // We are using the DB address book
@@ -308,7 +308,8 @@
       );
     }
 
-    if (is_array($ldap_config)) {
+    if ($ldap_config) {
+      $ldap_config = (array) $ldap_config;
       foreach ($ldap_config as $id => $prop)
         $list[$id] = array(
           'id' => $id,
@@ -329,7 +330,7 @@
         }
       }
     }
-    
+
     return $list;
   }
   

--
Gitblit v1.9.1