Redefine globals on per LDAP server basic
authorBenjamin Dauvergne <bdauvergne@entrouvert.com>
Fri, 12 Dec 2014 21:11:32 +0000 (22:11 +0100)
committerBenjamin Renard <brenard@easter-eggs.com>
Mon, 9 Feb 2015 09:39:39 +0000 (10:39 +0100)
Signed-off-by: Benjamin Renard <brenard@easter-eggs.com>
public_html/includes/class/class.LSsession.php

index 7458ad4..adab3f1 100644 (file)
@@ -955,6 +955,7 @@ class LSsession {
       self :: $ldapServerId = $id;
       self :: $ldapServer = $conf;
       self :: setLocale();
+      self :: setGlobals();
       return true;
     }
     else {
@@ -2318,6 +2319,19 @@ class LSsession {
       $data=array('recoverPassword' => isset(self :: $ldapServer['recoverPassword']));
     }
   }
+
+       /**
+        * Set globals from the ldap server
+        *
+        * @retval void
+        */
+       public static function setGlobals() {
+               if ( isset(self :: $ldapServer['globals'])) {
+                       foreach(self :: $ldapServer['globals'] as $key => $value) {
+                               $GLOBALS[$key] = $value;
+                       }
+               }
+       }
 }
 
 ?>