当前位置: 首页>>代码示例>>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;未经允许,请勿转载。