function cas_auth_authenticate($credentials) { elgg_load_library('elgg:cas_auth'); $config = elgg_get_calling_plugin_entity('cas_auth'); // Perform the authentication return authCAS($config, $credentials); }
/** * Shorthand function for finding the plugin settings. * * @deprecated 1.8 Use elgg_get_calling_plugin_entity() or elgg_get_plugin_from_id() * * @param string $plugin_id Optional plugin id, if not specified * then it is detected from where you are calling. * * @return mixed */ function find_plugin_settings($plugin_id = null) { elgg_deprecated_notice('find_plugin_setting() is deprecated by elgg_get_calling_plugin_entity() or elgg_get_plugin_from_id()', 1.8); if ($plugin_id) { return elgg_get_plugin_from_id($plugin_id); } else { return elgg_get_calling_plugin_entity(); } }
/** * Unsets all plugin settings for a plugin. * * @param string $plugin_id Optional plugin name, if not specified * then it is detected from where you are calling from. * * @return bool * @since 1.8.0 */ function elgg_unset_all_plugin_settings($plugin_id = null) { if ($plugin_id) { $plugin = elgg_get_plugin_from_id($plugin_id); } else { $plugin = elgg_get_calling_plugin_entity(); } if (!$plugin) { return false; } return $plugin->unsetAllSettings(); }
/** * Unsets all plugin settings for a plugin. * * @param string $plugin_id The plugin ID (Required) * * @return bool * @see \ElggPlugin::unsetAllSettings() */ function unsetAllSettings($plugin_id = null) { if ($plugin_id) { $plugin = elgg_get_plugin_from_id($plugin_id); } else { elgg_deprecated_notice('elgg_unset_all_plugin_settings() requires plugin_id to be set', 1.9); $plugin = elgg_get_calling_plugin_entity(); } if (!$plugin) { return false; } return $plugin->unsetAllSettings(); }
/** * Prepare the new/edit form variables * * @param ElggObject $webinar * @return array */ function webinar_prepare_form_vars($webinar = null) { $plugin = elgg_get_calling_plugin_entity(); // input names => defaults $values = array('title' => '', 'description' => '', 'access_id' => ACCESS_DEFAULT, 'tags' => '', 'status' => 'upcoming', 'welcome_msg' => '', 'server_salt' => $plugin->server_salt, 'server_url' => $plugin->server_url, 'logout_url' => null, 'admin_pwd' => $plugin->admin_pwd, 'user_pwd' => $plugin->user_pwd, 'container_guid' => elgg_get_page_owner_guid(), 'guid' => null); // if webinar exists, populate form with his values if ($webinar) { foreach (array_keys($values) as $field) { if (isset($webinar->{$field})) { $values[$field] = $webinar->{$field}; } } } // overwrite by a form saved in this session if (elgg_is_sticky_form('webinar')) { $sticky_values = elgg_get_sticky_values('webinar'); foreach ($sticky_values as $key => $value) { $values[$key] = $value; } } elgg_clear_sticky_form('webinar'); return $values; }