Exemplo n.º 1
0
 public function update()
 {
     $flash = Loader::helper('flash_data', 'social');
     $credentials = FacebookApiCredentials::load();
     $credentials->setApiKey($_POST['api_key']);
     $credentials->setSecret($_POST['secret']);
     $updated = $credentials->save();
     if ($updated) {
         $flash->notice(t("Successfully updated configuration."));
     } else {
         $flash->error(t("Couldn't save configuration to the database."));
     }
     $this->redirect('/dashboard/social/facebook');
 }
Exemplo n.º 2
0
 protected function get_hybrid_auth_config()
 {
     $facebook = FacebookApiCredentials::load();
     $linkedin = LinkedinApiCredentials::load();
     $twitter = TwitterApiCredentials::load();
     $google = GoogleApiCredentials::load();
     $baseUrl = BASE_URL . Loader::helper('concrete/urls')->getToolsURL('hybridauth', 'social');
     $config = array("base_url" => $baseUrl, "providers" => array("Facebook" => array("enabled" => true, "keys" => array("id" => $facebook->getApiKey(), "secret" => $facebook->getSecret()), "scope" => "email"), "Twitter" => array("enabled" => true, "keys" => array("key" => $twitter->getApiKey(), "secret" => $twitter->getSecret())), "LinkedIn" => array("enabled" => true, "keys" => array("key" => $linkedin->getApiKey(), "secret" => $linkedin->getSecret())), "Google" => array("enabled" => true, "keys" => array("id" => $google->getApiKey(), "secret" => $google->getSecret()))));
     return $config;
 }