option = new LoginDongleOption(); add_action('admin_menu', array($this, 'addPage')); add_action('admin_init', array($this, 'bindAPI')); } /** * Returns the default settings for the site option. * * @return struct */ protected function defaultSettings() { $result = array( 'message' => 'What did you expect?', ); return $result; } /** * Creates an admin menu item and binds it to the site settings page. * * This method is a handler bound to the admin_menu action. */ public function addPage() { add_options_page('Login Dongle Settings', 'Login Dongle', 'manage_options', self::PAGE_ID, array($this, 'handleGET')); } /** * Binds adminSiteSettings* handlers to the events of the 'simplified' admin API. * * This method is a handler bound to the admin_init action. */ public function bindAPI() { register_setting(self::OPTION_GROUP, LoginDonglePlugin::OPTION_NAME, array($this, 'handlePOST')); add_settings_section(self::NICE_ID, 'Nice Settings', array($this, 'handleGET_NiceSection_HelpText'), self::PAGE_ID); add_settings_field('message', 'Message', array($this, 'handleGET_NiceSection_MessageField'), self::PAGE_ID, self::NICE_ID); } /** * Echoes the html for the content of the site settings page. * */ public function handleGET() { ?>
Login Dongle makes the login for your personal use only, by means of a conventional challenge >> response mechanism.
Here you can configure the message displayed to possible attackers.
option->get(); if (! (is_array($data) && isset($data['message']) && ! empty($data['message']))) { $default = $this->defaultSettings(); $data['message'] = $default['message']; } ?>