コード例 #1
0
ファイル: login.php プロジェクト: shahadat014/geleyi
<?php

include "citrix.php";
$citrix = new Citrix('7d4acae493336cd5ce1250ca777972bf');
$organizer_key = $citrix->get_organizer_key();
//$citrix->pr($organizer_key);
if (!$organizer_key) {
    $url = $citrix->auth_citrixonline();
    echo "<script type='text/javascript'>top.location.href = '{$url}';</script>";
    exit;
}
$citrix->pr($citrix->get_organizer_key());
$citrix->pr($citrix->get_access_token());
コード例 #2
0
ファイル: hybridconnect.php プロジェクト: shahadat014/geleyi
 function admin_setup()
 {
     //   $this->admin_add_style_js('setup');
     $ccontact_set = false;
     $ccontact_valid = false;
     if (isset($_GET['code']) && isset($_GET['username'])) {
         $ccontact_set = true;
         update_option('hc_constant_contact_username', $_GET['username']);
         update_option('hc_constant_contact_code', $_GET['code']);
         if (!class_exists("ConstantContact")) {
             require_once 'includes/apis/CTCT-OAuth2/ConstantContact.php';
         }
         $apikey = get_option('hc_constantcontact_appkey');
         $csecret = get_option('hc_constantcontact_appid');
         $vUrl = admin_url() . "admin.php?page=hybridConnectAdminSetup";
         $ccontact_valid = false;
         try {
             $oAuth2 = new CTCTOauth2($apikey, $csecret, $vUrl, $_GET["code"]);
             // trade your code in for an access token by doing a POST
             $token = $oAuth2->getAccessToken();
             update_option('hc_constant_contact_token', $token);
             $ConstantContact = new ConstantContact("oauth2", $apikey, $_GET['username'], $token);
             if ($token && $token != '') {
                 $ccontact_valid = true;
             }
         } catch (Exception $e) {
             $ccontact_valid = false;
         }
     } else {
         if (isset($_GET["code"]) && !isset($_GET["username"])) {
             // gotowebinar
             require_once 'includes/apis/g2w/citrix.php';
             $citrix = new Citrix(get_option('hc_g2w_app_id'));
             $hcg2wError = false;
             try {
                 $g2worganizerKey = $citrix->get_organizer_key();
                 update_option("hc_g2w_organizer_key", $g2worganizerKey);
                 update_option("hc_g2w_error", "");
             } catch (Exception $e) {
                 update_option("hc_g2w_error", $citrix->pr($e->getMessage()));
                 $hcg2wError = true;
                 update_option("hc_g2w_valid", "false");
             }
             try {
                 $g2waccesssToken = $citrix->get_access_token();
                 update_option("hc_g2w_access_token", $g2waccesssToken);
                 update_option("hc_g2w_error_2", "");
             } catch (Exception $e) {
                 update_option("hc_g2w_error_2", $citrix->pr($e->getMessage()));
                 $hcg2wError = true;
                 update_option("hc_g2w_valid", "false");
             }
             if (get_option("hc_g2w_organizer_key") != "" && get_option("hc_g2w_access_token") != "") {
                 update_option("hc_g2w_valid", "true");
             }
         }
     }
     $my_services = $this->_get_services_array();
     include 'includes/hc_admin_setup.php';
 }