fix boundary_end in case of recursion
[squirrelmail.git] / functions / addressbook.php
index b31a71f82b28106a67c4c2ac97a6525b7c5836a5..a6f916b4b799f02b186618d806d69c932d1a3608 100644 (file)
    The global addressbook is unmodifiable by anyone.  You must actually
    use a shell script or whatnot to modify the contents.
 
-  global $data_dir;
+  global $data_dir, $address_book_global_filename;
   $address_book_global_filename = "$data_dir/global.abook";
 
-  Include backends here.
 */
 
-require_once(SM_PATH . 'functions/abook_local_file.php');
-require_once(SM_PATH . 'functions/abook_ldap_server.php');
-
 global $addrbook_dsn;
 
-/* Use this if you wanna have a global address book */
-if (isset($address_book_global_filename)) {
-    include_once(SM_PATH . 'functions/abook_global_file.php');
-}
-
-/* Only load database backend if database is configured */
-if(isset($addrbook_dsn) && !empty($addrbook_dsn)) {
-  include_once(SM_PATH . 'functions/abook_database.php');
-}
-
 /*
    Create and initialize an addressbook object.
    Returns the created object
@@ -545,4 +531,24 @@ function alistcmp($a,$b) {
     return (strtolower($a['name']) > strtolower($b['name'])) ? 1 : -1;
 }
 
+
+/*
+  PHP 5 requires that the class be made first, which seems rather
+  logical, and should have been the way it was generated the first time.
+*/
+
+require_once(SM_PATH . 'functions/abook_local_file.php');
+require_once(SM_PATH . 'functions/abook_ldap_server.php');
+
+/* Use this if you wanna have a global address book */
+if (isset($address_book_global_filename)) {
+    include_once(SM_PATH . 'functions/abook_global_file.php');
+}
+
+/* Only load database backend if database is configured */
+if(isset($addrbook_dsn) && !empty($addrbook_dsn)) {
+  include_once(SM_PATH . 'functions/abook_database.php');
+}
+
+
 ?>