public static function install() { $config = Zend_Registry::get(APPLICATION_CONFIG); $fb = Ishali_Facebook::getFB(); $Ishali_Api = new Ishali_Api(); $paramsp['scope'] = $config->facebook->login_admin->scope; $paramsp['response_type'] = $config->facebook->login_admin->response_type; $paramsp['redirect_uri'] = $config->facebook->appurl . "admin"; $loginUrl = $fb->getLoginUrl($paramsp); $Ishali_Api->parentRedirect($loginUrl); }
function parse_signed_request($signed_request, $secret) { list($encoded_sig, $payload) = explode('.', $signed_request, 2); // decode the data @($sig = Ishali_Api::base64_url_decode($encoded_sig)); @($data = json_decode(Ishali_Api::base64_url_decode($payload), true)); if (strtoupper($data['algorithm']) !== 'HMAC-SHA256') { error_log('Unknown algorithm. Expected HMAC-SHA256'); return null; } // check sig $expected_sig = hash_hmac('sha256', $payload, $secret, $raw = true); if ($sig !== $expected_sig) { error_log('Bad Signed JSON signature!'); return null; } return $data; }
public function dangungdunglentuong() { $Ishali_Api = new Ishali_Api(); $config = Zend_Registry::get(APPLICATION_CONFIG); $app_id = $config->facebook->appid; $redirect_url = Ishali_Facebook::getpage_app_redirect(); $convertUrl = "http://www.facebook.com/dialog/feed?app_id={$app_id}&redirect_uri={$redirect_url}"; $Ishali_Api->parentRedirect($convertUrl); }
public static function addpagetab() { $Ishali_Api = new Ishali_Api(); $convertUrl = "http://www.facebook.com/dialog/pagetab?app_id=254387861355717&redirect_uri=http://apps.facebook.com/tochuccuocthihinh&scope=manage_pages,publish_stream&response_type=code"; $Ishali_Api->parentRedirect($convertUrl); }