public function authControl()
 {
     $config = Config::getInstance();
     Loader::definePathConstants();
     $this->setViewTemplate(THINKUP_WEBAPP_PATH . 'plugins/facebook/view/facebook.account.index.tpl');
     $this->view_mgr->addHelp('facebook', 'userguide/settings/plugins/facebook');
     /** set option fields **/
     // Application ID text field
     $this->addPluginOption(self::FORM_TEXT_ELEMENT, array('name' => 'facebook_app_id', 'label' => 'App ID', 'size' => 18));
     // add element
     // set a special required message
     $this->addPluginOptionRequiredMessage('facebook_app_id', 'The Facebook plugin requires a valid App ID.');
     // Application Secret text field
     $this->addPluginOption(self::FORM_TEXT_ELEMENT, array('name' => 'facebook_api_secret', 'label' => 'App Secret', 'size' => 37));
     // add element
     // set a special required message
     $this->addPluginOptionRequiredMessage('facebook_api_secret', 'The Facebook plugin requires a valid App Secret.');
     $max_crawl_time_label = 'Max crawl time in minutes';
     $max_crawl_time = array('name' => 'max_crawl_time', 'label' => $max_crawl_time_label, 'default_value' => '20', 'advanced' => true, 'size' => 3);
     $this->addPluginOption(self::FORM_TEXT_ELEMENT, $max_crawl_time);
     $this->addToView('thinkup_site_url', Utils::getApplicationURL());
     $facebook_plugin = new FacebookPlugin();
     if ($facebook_plugin->isConfigured()) {
         $this->setUpFacebookInteractions($facebook_plugin->getOptionsHash());
         $this->addToView('is_configured', true);
     } else {
         $this->addInfoMessage('Please complete plugin setup to start using it.', 'setup');
         $this->addToView('is_configured', false);
     }
     return $this->generateView();
 }