getSources(); $plugins = &PluginRegistry::loadCategory(AUTH_PLUGIN_CATEGORY); $pluginOptions = array(); if (is_array($plugins)) foreach ($plugins as $plugin) { $pluginOptions[$plugin->getName()] = $plugin->getDisplayName(); } $templateMgr = &TemplateManager::getManager(); $templateMgr->assign_by_ref('sources', $sources); $templateMgr->assign('pluginOptions', $pluginOptions); $templateMgr->assign('helpTopicId', 'site.siteManagement'); $templateMgr->display('admin/auth/sources.tpl'); } /** * Update the default authentication source. */ function updateAuthSources() { parent::validate(); $authDao = &DAORegistry::getDAO('AuthSourceDAO'); $authDao->setDefault((int) Request::getUserVar('defaultAuthId')); Request::redirect(null, null, null, 'auth'); } /** * Create an authentication source. */ function createAuthSource() { parent::validate(); $auth = &new AuthSource(); $auth->setPlugin(Request::getUserVar('plugin')); $authDao = &DAORegistry::getDAO('AuthSourceDAO'); if ($authDao->insertSource($auth)) { Request::redirect(null, null, null, 'editAuthSource', $auth->getAuthId()); } else { Request::redirect(null, null, null, 'auth'); } } /** * Display form to edit an authentication source. */ function editAuthSource($args) { parent::validate(); parent::setupTemplate(true); import('security.form.AuthSourceSettingsForm'); $form = &new AuthSourceSettingsForm((int)@$args[0]); $form->initData(); $form->display(); } /** * Update an authentication source. */ function updateAuthSource($args) { parent::validate(); import('security.form.AuthSourceSettingsForm'); $form = &new AuthSourceSettingsForm((int)@$args[0]); $form->readInputData(); $form->execute(); Request::redirect(null, null, null, 'auth'); } /** * Delete an authentication source. */ function deleteAuthSource($args) { parent::validate(); $authId = (int)@$args[0]; $authDao = &DAORegistry::getDAO('AuthSourceDAO'); $authDao->deleteSource($authId); Request::redirect(null, null, null, 'auth'); } } ?>