static function can_activate()
 {
     $messages = array();
     if (array_search("ldap", get_loaded_extensions()) === false) {
         $messages["error"][] = t("Cannot install LDAP identity provider as the PHP LDAP extension module is not enabled.");
     } else {
         $messages["warn"][] = IdentityProvider::confirmation_message();
     }
     return $messages;
 }
 static function can_activate()
 {
     $messages = array();
     try {
         // load config
         require MODPATH . 'wordpress_auth/config/identity.php';
         // create instance and fetch admin user
         $driver = ucfirst($config['wordpress_auth']['driver']);
         $filename = MODPATH . 'wordpress_auth/libraries/drivers/IdentityProvider/' . $driver . '.php';
         $classname = 'IdentityProvider_' . $driver . '_Driver';
         require $filename;
         $wordpress_auth_provider = new $classname($config['wordpress_auth']['params']);
         $admin = $wordpress_auth_provider->admin_user();
         // Everything is fine
         $messages["warn"][] = IdentityProvider::confirmation_message();
     } catch (Exception $e) {
         $messages["error"][] = 'Cannot install Wordpress identity provider. Error: ' . $e->getMessage();
     }
     return $messages;
 }
Example #3
0
 static function can_activate()
 {
     return array("warn" => array(IdentityProvider::confirmation_message()));
 }