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; } static function install() { IdentityProvider::change_provider('wordpress_auth'); } static function initialize() { module::set_version('wordpress_auth', 1); $root = item::root(); foreach (IdentityProvider::instance()->groups() as $group) { module::event("group_created", $group); access::allow($group, "view", $root); access::allow($group, "view_full", $root); } } static function uninstall() { // Delete all groups so that we give other modules an opportunity to clean up $wordpress_auth_provider = new IdentityProvider("wordpress_auth"); foreach ($wordpress_auth_provider->groups() as $group) { module::event("group_deleted", $group); } } }