當前位置: 首頁>>代碼示例>>PHP>>正文


PHP gapi::authenticateUser方法代碼示例

本文整理匯總了PHP中gapi::authenticateUser方法的典型用法代碼示例。如果您正苦於以下問題:PHP gapi::authenticateUser方法的具體用法?PHP gapi::authenticateUser怎麽用?PHP gapi::authenticateUser使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在gapi的用法示例。


在下文中一共展示了gapi::authenticateUser方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: elseif

        }
        if (!isset($google['password']) || !$google['password']) {
            $ga_errors[2] = "Please enter your analytics password";
        }
        if (!isset($google['profile']) || !$google['profile']) {
            $ga_errors[3] = "Please enter your analytics Profile ID";
        } elseif (!is_numeric($google['profile'])) {
            $ga_errors[3] = "Profile ID must be numeric";
        }
        if (!isset($google['tracking']) || !$google['tracking']) {
            $ga_errors[4] = "Please enter your analytics Tracking ID";
        }
        if (!count($ga_errors)) {
            require_once "../includes/gapi.class.php";
            $ga = new gapi($google['username'], $google['password']);
            $check = $ga->authenticateUser($google['username'], $google['password']);
            if ($check) {
                try {
                    $res = $ga->requestReportData($google['profile'], array('country'), array('pageviews', 'visits'), array("-visits"), null, date("Y-m-d"), date("Y-m-d"));
                    $settings->addSetting("analytics", json_encode($google));
                    $ga_success = true;
                } catch (Exception $e) {
                    $ga_errors[3] = "Invalid Profile ID";
                }
            } else {
                $ga_errors[1] = "Can't authenticate";
            }
        }
    }
} else {
    $google = $settings->getSetting("analytics", true);
開發者ID:Bluejuice1001,項目名稱:tvstreamscript,代碼行數:31,代碼來源:settings_accounts.php

示例2: authenticateUser

 /**
  * Authenticate Google Account with Google
  *
  * @param String $email
  * @param String $password
  */
 protected function authenticateUser($email, $password)
 {
     try {
         return parent::authenticateUser($email, $password);
     } catch (Exception $e) {
         throw new dmGapiException('GAPI: Failed to authenticate with email ' . $email . '. Please configure email and password in the admin configuration panel');
     }
 }
開發者ID:jdart,項目名稱:diem,代碼行數:14,代碼來源:dmGapi.php

示例3: date

     $from = date("Y-m-d", strtotime("29 days ago"));
 } else {
     $from = $_GET['from'];
 }
 if (!isset($_GET['to']) || !$_GET['to']) {
     $to = date("Y-m-d");
 } else {
     $to = $_GET['to'];
 }
 if (!isset($_GET['report_type'])) {
     $report_type = "country";
 } else {
     $report_type = $_GET['report_type'];
 }
 $ga = new gapi($account->username, $account->password);
 $check = $ga->authenticateUser($account->username, $account->password);
 if ($check) {
     if ($report_type == "country") {
         $res = $ga->requestReportData($account->profile, array('country'), array('pageviews', 'visits'), array("-visits"), null, $from, $to);
         $data = array();
         if (count($res)) {
             foreach ($res as $key => $val) {
                 $data[] = array("label" => $val->dimensions['country'], "data" => $val->metrics['visits']);
                 if (count($data) >= 12) {
                     break;
                 }
             }
         }
     } elseif ($report_type == "daily") {
         $res = $ga->requestReportData($account->profile, array('date'), array('pageviews', 'visits'), array("date"), null, $from, $to);
         $data_pv = array();
開發者ID:kvox,項目名稱:TVSS,代碼行數:31,代碼來源:graph.php


注:本文中的gapi::authenticateUser方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。