function openid_connect_get_plugins in OpenID Connect / OAuth client 7
Returns the available OpenID Connect client plugins.
Parameters
bool $enabled_only: Whether to return only the plugins enabled by the administrator.
4 calls to openid_connect_get_plugins()
- openid_connect_admin_form in includes/
openid_connect.admin.inc - Form builder: Main administrative form.
- openid_connect_connect_form in includes/
openid_connect.forms.inc - Form builder: Connect an external account to your existing Drupal account.
- openid_connect_login_form in includes/
openid_connect.forms.inc - Form builder: Log in with an external account.
- openid_connect_update_7100 in ./
openid_connect.install - Converts client settings to the new format.
File
- ./
openid_connect.module, line 132 - A pluggable client implementation for the OpenID Connect protocol.
Code
function openid_connect_get_plugins($enabled_only = FALSE) {
ctools_include('plugins');
$plugins = ctools_get_plugins('openid_connect', 'openid_connect_client');
$plugins_enabled = variable_get('openid_connect_clients_enabled', array());
foreach ($plugins as $key => $plugin) {
if (!class_exists($plugin['class']) || $enabled_only && empty($plugins_enabled[$plugin['name']])) {
// Invalid class specified or client is not enabled and we only suppose to
// return those that are active.
unset($plugins[$key]);
continue;
}
}
uasort($plugins, 'ctools_plugin_sort');
return $plugins;
}