Exemplo n.º 1
0
 public function __construct()
 {
     if (!extension_loaded('ldap')) {
         throw new Exception('The LDAP authentication service requires "ldap" PHP extension to be present.');
     }
     if (!isset(midgardmvc_core::get_instance()->configuration->services_authentication_ldap)) {
         throw new Exception('The LDAP authentication service requires configuration key "services_authentication_ldap" to be set with subkeys "server" and "dn"');
     }
     if (!in_array('LDAP', midgardmvc_core::get_instance()->configuration->services_authentication_authtypes)) {
         throw new Exception('LDAP has to be enabled in allowed authentication types to use the LDAP authentication service.');
     }
     $ldap_settings = midgardmvc_core::get_instance()->configuration->services_authentication_ldap;
     $this->server = $ldap_settings['server'];
     $this->dn = $ldap_settings['dn'];
     parent::__construct();
 }
Exemplo n.º 2
0
 public function __construct()
 {
     if (!in_array('BrowserID', midgardmvc_core::get_instance()->configuration->services_authentication_authtypes)) {
         throw new Exception('BrowserID has to be enabled in allowed authentication types to use the BrowserID authentication service.');
     }
     if (isset(midgardmvc_core::get_instance()->configuration->services_authentication_browserid)) {
         $browserid_settings = midgardmvc_core::get_instance()->configuration->services_authentication_browserid;
         if (isset($browserid_settings['provider'])) {
             $this->provider = $browserid_settings['provider'];
         }
         if (isset($browserid_settings['include'])) {
             $this->include = $browserid_settings['include'];
         }
     }
     parent::__construct();
 }