当前位置: 首页>>代码示例>>PHP>>正文


PHP missingClientSecretsWarning函数代码示例

本文整理汇总了PHP中missingClientSecretsWarning函数的典型用法代码示例。如果您正苦于以下问题:PHP missingClientSecretsWarning函数的具体用法?PHP missingClientSecretsWarning怎么用?PHP missingClientSecretsWarning使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了missingClientSecretsWarning函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Google_Service_Urlshortener_Url

  unshortened URL, and call the 'insert' method on
  the 'url' resource. Note that we re-store the
  access_token bundle, just in case anything
  changed during the request - the main thing that
  might happen here is the access token itself is
  refreshed if the application has offline access.
 ************************************************/
if ($client->getAccessToken() && isset($_GET['url'])) {
    $url = new Google_Service_Urlshortener_Url();
    $url->longUrl = $_GET['url'];
    $short = $service->url->insert($url);
    $_SESSION['access_token'] = $client->getAccessToken();
}
echo pageHeader("User Query - URL Shortener");
if ($client_id == '<YOUR_CLIENT_ID>' || $client_secret == '<YOUR_CLIENT_SECRET>' || $redirect_uri == '<YOUR_REDIRECT_URI>') {
    echo missingClientSecretsWarning();
}
?>
<div class="box">
  <div class="request">
    <?php 
if (isset($authUrl)) {
    ?>
      <a class='login' href='<?php 
    echo $authUrl;
    ?>
'>Connect Me!</a>
    <?php 
} else {
    ?>
      <form id="url" method="GET" action="<?php 
开发者ID:dev981,项目名称:gaptest,代码行数:31,代码来源:user-example.php

示例2: getGoogledata

 function getGoogledata()
 {
     include_once APPPATH . "libraries/Google/examples/templates/base.php";
     session_start();
     //require_once $_SERVER['DOCUMENT_ROOT'] . '/../googleapi.secrets/secrets.inc.php';
     require_once APPPATH . "libraries/Google/src/Google/autoload.php";
     $client_id = '562916899979-sqstcvrkb5ji1364at447l35sl5pqfa3.apps.googleusercontent.com';
     $client_secret = 'JT8lSp-62FHMjbXNqFp2Gy4V';
     //$redirect_uri = 'http://roster.plug-point.com/index.php/admin/sites/';
     $redirect_uri = 'http://roster.plug-point.com/index.php/admin/sites/getGoogledata';
     $client = new Google_Client();
     $client->setClientId($client_id);
     $client->setClientSecret($client_secret);
     $client->setRedirectUri($redirect_uri);
     //$client->addScope("https://www.googleapis.com/auth/contacts.readonly");
     $client->addScope("https://www.google.com/m8/feeds");
     // echo 'call google';exit;
     if (isset($_REQUEST['logout'])) {
         unset($_SESSION['access_token']);
     }
     if (isset($_GET['code'])) {
         $client->authenticate($_GET['code']);
         $_SESSION['access_token'] = $client->getAccessToken();
         //$redirect = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'];
         //header('Location: ' . filter_var($redirect, FILTER_SANITIZE_URL));
     }
     if (isset($_SESSION['access_token']) && $_SESSION['access_token']) {
         $client->setAccessToken($_SESSION['access_token']);
     } else {
         $authUrl = $client->createAuthUrl();
     }
     //echo $authUrl; exit;
     if ($client->getAccessToken()) {
         $_SESSION['access_token'] = $client->getAccessToken();
         $access_token = json_decode($client->getAccessToken())->access_token;
         $url = 'https://www.google.com/m8/feeds/contacts/default/full?alt=json&v=3.0&oauth_token=' . $access_token;
         $response = file_get_contents($url);
     }
     if ($client_id == '<YOUR_CLIENT_ID>' || $client_secret == '<YOUR_CLIENT_SECRET>' || $redirect_uri == '<YOUR_REDIRECT_URI>') {
         echo missingClientSecretsWarning();
     }
     if (isset($authUrl)) {
         header('location:' . $authUrl);
         //echo "<a class='login' href='" . $authUrl . "'>Connect Me!</a>";
     } else {
         // echo "<h3>Results Of Contacts List:</h3>";
         $response = str_replace('$', '_', $response);
         $j = json_decode($response);
         //  echo '<pre>';
         $contacts = $j->feed->entry;
         //var_dump($contacts);exit;
         for ($i = 0; $i < count($contacts); $i++) {
             // echo $gcontact=$contacts[$i]->gContact_userDefinedField[0];exit;
             $name = $contacts[$i]->gd_name->gd_fullName->_t;
             //                $full_name=$contacts[$i]->gd_name[0]->gd_fullName->_t;
             //                $staff_mobile=$contacts[$i]->gd_phoneNumber[0]->_t;
             $site_name = $contacts[$i]->gd_organization[0]->gd_orgName->_t;
             $email = $contacts[$i]->gd_email[0]->address;
             $phone = $contacts[$i]->gd_phoneNumber[0]->_t;
             $street = $contacts[$i]->gd_structuredPostalAddress[0]->gd_formattedAddress->_t;
             //echo $street;exit;
             $city = $contacts[$i]->gd_structuredPostalAddress[0]->gd_city->_t;
             $postalcode = $contacts[$i]->gd_structuredPostalAddress[0]->gd_postcode->_t;
             $customs = $contacts[$i]->gContact_userDefinedField;
             $cluster = $singaporean = $shift1_start = $shift1_end = $shift2_start = $shift2_end = $shift3_start = $shift3_end = $type1 = $ic = $emp_type = $shift_type = $payment_type = $call_preference = $nationality = '';
             for ($j = 0; $j < count($customs); $j++) {
                 $key = $customs[$j]->key;
                 if ($key == 'Cluster') {
                     $cluster = $customs[$j]->value;
                 } else {
                     if (strtolower($key) == 'singaporean only') {
                         $singaporean = $customs[$j]->value;
                     } else {
                         if (strtolower($key) == 'shift1 start') {
                             $shift1_start = $customs[$j]->value;
                         } else {
                             if (strtolower($key) == 'shift1 end') {
                                 $shift1_end = $customs[$j]->value;
                             } else {
                                 if (strtolower($key) == 'shift2 start') {
                                     $shift2_start = $customs[$j]->value;
                                 } else {
                                     if (strtolower($key) == 'shift2 end') {
                                         $shift2_end = $customs[$j]->value;
                                     } else {
                                         if (strtolower($key) == 'shift3 start') {
                                             $shift3_start = $customs[$j]->value;
                                         } else {
                                             if (strtolower($key) == 'shift3 end') {
                                                 $shift3_end = $customs[$j]->value;
                                             } else {
                                                 if (strtolower($key) == 'type') {
                                                     $type1 = $customs[$j]->value;
                                                 } else {
                                                     if (strtolower($key) == 'ic') {
                                                         $ic = $customs[$j]->value;
                                                     } else {
                                                         if (strtolower($key) == 'employment type') {
                                                             $emp_type = $customs[$j]->value;
                                                         } else {
//.........这里部分代码省略.........
开发者ID:anupkelkar02,项目名称:FSM,代码行数:101,代码来源:sites.php

示例3: getGoogledata

 function getGoogledata()
 {
     include_once APPPATH . "libraries/Google/examples/templates/base.php";
     session_start();
     require_once APPPATH . "libraries/Google/src/Google/autoload.php";
     $client_id = '354679217715-0f0fu7ejpvmh7m408ll1thjs7vlemmk5.apps.googleusercontent.com';
     $client_secret = 'hT9fCTljAoBSUcA5nucxb7FJ';
     //$scriptUri = 'http://fingerskies.com/aza_twilio/admin/sites';
     $redirect_uri = 'http://fingerskies.com/az-twilio/index.php/admin/sites/getGoogledata';
     $client = new Google_Client();
     $client->setClientId($client_id);
     $client->setClientSecret($client_secret);
     $client->setRedirectUri($redirect_uri);
     //$client->addScope("https://www.googleapis.com/auth/contacts.readonly");
     $client->addScope("https://www.google.com/m8/feeds");
     if (isset($_REQUEST['logout'])) {
         unset($_SESSION['access_token']);
     }
     if (isset($_GET['code'])) {
         $client->authenticate($_GET['code']);
         //var_dump($client);exit;
         $_SESSION['access_token'] = $client->getAccessToken();
         $redirect = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'];
         header('Location: ' . filter_var($redirect, FILTER_SANITIZE_URL));
     }
     if (isset($_SESSION['access_token']) && $_SESSION['access_token']) {
         $client->setAccessToken($_SESSION['access_token']);
     } else {
         $authUrl = $client->createAuthUrl();
     }
     //echo $authUrl; exit;
     if ($client->getAccessToken()) {
         $_SESSION['access_token'] = $client->getAccessToken();
         $access_token = json_decode($client->getAccessToken())->access_token;
         //$url = 'https://www.google.com/m8/feeds/contacts/default/full?max-results=3&alt=json&v=3.0&oauth_token='.$access_token;
         //$Gurl = 'https://www.google.com/m8/feeds/groups/default/full?alt=json&v=3.0&oauth_token='.$access_token;
         //$Gresponse =  file_get_contents($Gurl);
         //echo '<pre>';
         //var_dump(json_decode($Gresponse);
         $url = 'https://www.google.com/m8/feeds/contacts/default/full?alt=json&v=3.0&oauth_token=' . $access_token;
         $response = file_get_contents($url);
     }
     //echo pageHeader("User Query - Multiple APIs");
     if ($client_id == '<YOUR_CLIENT_ID>' || $client_secret == '<YOUR_CLIENT_SECRET>' || $redirect_uri == '<YOUR_REDIRECT_URI>') {
         echo missingClientSecretsWarning();
     }
     if (isset($authUrl)) {
         echo "<a class='login' href='" . $authUrl . "'>Connect Me!</a>";
     } else {
         echo "<h3>Results Of Contacts List:</h3>";
         $response = str_replace('$', '_', $response);
         //var_dump($response);
         //$t = str_replace("\n", '', $response);
         $j = json_decode($response);
         $j = str_replace('$', '_', $j);
         echo '<pre>';
         // var_dump($j->feed->entry);
         /* foreach($j->feed->entry as $contacts){
            $name = $contacts->title;
            $email = $contacts->gd$email[0]->address;
            $phone = $contacts->gd$phoneNumber[0]->$t;
            $address = $contacts->structuredPostalAddress[0]->gd$formattedAddress;
            $customs = $contacts->gContact$userDefinedField;
            foreach ($customs as $f){
            $key = $f->key;
            $val = $f->value;
            if($key=='Type' && $val=='Sites'){
            //Insert into DB
            echo $name.';'.$email.';'.$phone.';'.$address.';'.$key.';'.$val.'<br/>';
            }
            }
            } */
         file_put_contents('tst.json', $response);
     }
 }
开发者ID:anupkelkar02,项目名称:FSM,代码行数:75,代码来源:google_sync.php

示例4: getGoogledata

 function getGoogledata()
 {
     include_once APPPATH . "libraries/Google/examples/templates/base.php";
     session_start();
     //require_once $_SERVER['DOCUMENT_ROOT'] . '/../googleapi.secrets/secrets.inc.php';
     require_once APPPATH . "libraries/Google/src/Google/autoload.php";
     /*         * **********************************************
               ATTENTION: Fill in these values! Make sure
               the redirect URI is to this page, e.g:
               http://localhost:8080/user-example.php
              * ********************************************** */
     $client_id = '354679217715-0f0fu7ejpvmh7m408ll1thjs7vlemmk5.apps.googleusercontent.com';
     $client_secret = 'hT9fCTljAoBSUcA5nucxb7FJ';
     //$scriptUri = 'http://fingerskies.com/aza_twilio/admin/sites';
     $redirect_uri = 'http://fingerskies.com/az-twilio/index.php/admin/sites/getGoogledata';
     /*         * **********************************************
               Make an API request on behalf of a user. In
               this case we need to have a valid OAuth 2.0
               token for the user, so we need to send them
               through a login flow. To do this we need some
               information from our API console project.
              * ********************************************** */
     $client = new Google_Client();
     $client->setClientId($client_id);
     $client->setClientSecret($client_secret);
     $client->setRedirectUri($redirect_uri);
     //$client->addScope("https://www.googleapis.com/auth/contacts.readonly");
     $client->addScope("https://www.google.com/m8/feeds");
     /*         * **********************************************
               A general service created
              * ********************************************** */
     //$contacts = new Google_Service($client);
     /*         * **********************************************
               Boilerplate auth management - see
               user-example.php for details.
              * ********************************************** */
     if (isset($_REQUEST['logout'])) {
         unset($_SESSION['access_token']);
     }
     if (isset($_GET['code'])) {
         $client->authenticate($_GET['code']);
         //var_dump($client);exit;
         $_SESSION['access_token'] = $client->getAccessToken();
         $redirect = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'];
         header('Location: ' . filter_var($redirect, FILTER_SANITIZE_URL));
     }
     if (isset($_SESSION['access_token']) && $_SESSION['access_token']) {
         $client->setAccessToken($_SESSION['access_token']);
     } else {
         $authUrl = $client->createAuthUrl();
     }
     //echo $authUrl; exit;
     /*         * **********************************************
               If we're signed in, retrieve contacts
              * ********************************************** */
     if ($client->getAccessToken()) {
         $_SESSION['access_token'] = $client->getAccessToken();
         $access_token = json_decode($client->getAccessToken())->access_token;
         //$url = 'https://www.google.com/m8/feeds/contacts/default/full?max-results=3&alt=json&v=3.0&oauth_token='.$access_token;
         //$Gurl = 'https://www.google.com/m8/feeds/groups/default/full?alt=json&v=3.0&oauth_token='.$access_token;
         //$Gresponse =  file_get_contents($Gurl);
         //echo '<pre>';
         //var_dump(json_decode($Gresponse);
         $url = 'https://www.google.com/m8/feeds/contacts/default/full?alt=json&v=3.0&oauth_token=' . $access_token;
         $response = file_get_contents($url);
     }
     //echo pageHeader("User Query - Multiple APIs");
     if ($client_id == '<YOUR_CLIENT_ID>' || $client_secret == '<YOUR_CLIENT_SECRET>' || $redirect_uri == '<YOUR_REDIRECT_URI>') {
         echo missingClientSecretsWarning();
     }
     if (isset($authUrl)) {
         echo "<a class='login' href='" . $authUrl . "'>Connect Me!</a>";
     } else {
         echo "<h3>Results Of Contacts List:</h3>";
         $response = str_replace('$', '_', $response);
         //var_dump($response);
         //$t = str_replace("\n", '', $response);
         $j = json_decode($response);
         $j = str_replace('$', '_', $j);
         echo '<pre>';
         // var_dump($j->feed->entry);
         /* foreach($j->feed->entry as $contacts){
            $name = $contacts->title;
            $email = $contacts->gd$email[0]->address;
            $phone = $contacts->gd$phoneNumber[0]->$t;
            $address = $contacts->structuredPostalAddress[0]->gd$formattedAddress;
            $customs = $contacts->gContact$userDefinedField;
            foreach ($customs as $f){
            $key = $f->key;
            $val = $f->value;
            if($key=='Type' && $val=='Sites'){
            //Insert into DB
            echo $name.';'.$email.';'.$phone.';'.$address.';'.$key.';'.$val.'<br/>';
            }
            }
            } */
         file_put_contents('tst.json', $response);
     }
 }
开发者ID:anupkelkar02,项目名称:FSM,代码行数:99,代码来源:duty.php

示例5: getGoogledata

 function getGoogledata()
 {
     include_once APPPATH . "libraries/Google/examples/templates/base.php";
     session_start();
     //require_once $_SERVER['DOCUMENT_ROOT'] . '/../googleapi.secrets/secrets.inc.php';
     require_once APPPATH . "libraries/Google/src/Google/autoload.php";
     $client_id = '562916899979-sqstcvrkb5ji1364at447l35sl5pqfa3.apps.googleusercontent.com';
     $client_secret = 'JT8lSp-62FHMjbXNqFp2Gy4V';
     $redirect_uri = 'http://roster.plug-point.com/index.php/admin/sites/getGoogledata';
     $client = new Google_Client();
     $client->setClientId($client_id);
     $client->setClientSecret($client_secret);
     $client->setRedirectUri($redirect_uri);
     $client->addScope("https://www.google.com/m8/feeds");
     if (isset($_REQUEST['logout'])) {
         unset($_SESSION['access_token']);
     }
     if (isset($_GET['code'])) {
         $client->authenticate($_GET['code']);
         //var_dump($client);exit;
         $_SESSION['access_token'] = $client->getAccessToken();
         $redirect = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'];
         header('Location: ' . filter_var($redirect, FILTER_SANITIZE_URL));
     }
     if (isset($_SESSION['access_token']) && $_SESSION['access_token']) {
         $client->setAccessToken($_SESSION['access_token']);
     } else {
         $authUrl = $client->createAuthUrl();
     }
     if ($client->getAccessToken()) {
         $_SESSION['access_token'] = $client->getAccessToken();
         $access_token = json_decode($client->getAccessToken())->access_token;
         $url = 'https://www.google.com/m8/feeds/contacts/default/full?alt=json&v=3.0&oauth_token=' . $access_token;
         $response = file_get_contents($url);
     }
     //echo pageHeader("User Query - Multiple APIs");
     if ($client_id == '<YOUR_CLIENT_ID>' || $client_secret == '<YOUR_CLIENT_SECRET>' || $redirect_uri == '<YOUR_REDIRECT_URI>') {
         echo missingClientSecretsWarning();
     }
     if (isset($authUrl)) {
         echo "<a class='login' href='" . $authUrl . "'>Connect Me!</a>";
     } else {
         //echo "<h3>Results Of Contacts List:</h3>";
         $response = str_replace('$', '_', $response);
         //var_dump($response);
         //$t = str_replace("\n", '', $response);
         $j = json_decode($response);
         $j = str_replace('$', '_', $j);
         echo '<pre>';
         // var_dump($j->feed->entry);
         /* foreach($j->feed->entry as $contacts){
            $name = $contacts->title;
            $email = $contacts->gd$email[0]->address;
            $phone = $contacts->gd$phoneNumber[0]->$t;
            $address = $contacts->structuredPostalAddress[0]->gd$formattedAddress;
            $customs = $contacts->gContact$userDefinedField;
            foreach ($customs as $f){
            $key = $f->key;
            $val = $f->value;
            if($key=='Type' && $val=='Sites'){
            //Insert into DB
            echo $name.';'.$email.';'.$phone.';'.$address.';'.$key.';'.$val.'<br/>';
            }
            }
            } */
         file_put_contents('tst.json', $response);
     }
     set_message_note('Staff Sync Successfully', MESSAGE_NOTE_INFORMATION);
     redirect(uri_string());
     exit;
 }
开发者ID:anupkelkar02,项目名称:FSM,代码行数:71,代码来源:staff.php


注:本文中的missingClientSecretsWarning函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。