addCheck(new FormValidatorPost($this)); $this->addCheck(new FormValidatorCSRF($this)); $this->authId = $authId; } /** * Display the form. */ function display() { $templateMgr = TemplateManager::getManager(); $templateMgr->assign('authId', $this->authId); if (isset($this->plugin)) { $this->plugin->addLocaleData(); $templateMgr->assign('pluginTemplate', $this->plugin->getSettingsTemplate()); } parent::display(); } /** * Initialize form data from current settings. */ function initData() { $authDao = DAORegistry::getDAO('AuthSourceDAO'); $auth =& $authDao->getSource($this->authId); if ($auth != null) { $this->_data = array( 'plugin' => $auth->getPlugin(), 'title' => $auth->getTitle(), 'settings' => $auth->getSettings() ); $this->plugin =& $auth->getPluginClass(); } } /** * Assign form data to user-submitted data. */ function readInputData() { $this->readUserVars(array('title', 'settings')); } /** * Save journal settings. */ function execute() { $authDao = DAORegistry::getDAO('AuthSourceDAO'); $auth = $authDao->newDataObject(); $auth->setAuthId($this->authId); $auth->setTitle($this->getData('title')); $auth->setSettings($this->getData('settings')); $authDao->updateObject($auth); } } ?>