$client->setRedirectUri(REDIRECT_URL); $client->setApplicationName(APP_NAME); $client->setScopes(array(ANALYTICS_SCOPE)); // Magic. Returns objects from the Analytics Service // instead of associative arrays. $client->setUseObjects(true); // Build a new storage object to handle and store tokens in sessions. // Create a new storage object to persist the tokens across sessions. $storage = new apiSessionStorage(); $authHelper = new AuthHelper($client, $storage, THIS_PAGE); // Main controller logic. if ($_GET['action'] == 'revoke') { $authHelper->revokeToken(); } else { if ($_GET['action'] == 'auth' || $_GET['code']) { $authHelper->authenticate(); } else { $authHelper->setTokenFromStorage(); if ($authHelper->isAuthorized()) { $analytics = new Google_AnalyticsService($client); if ($_GET['demo'] == 'hello') { // Hello Analytics API Demo. require_once 'helloAnalyticsApi.php'; $demo = new HelloAnalyticsApi($analytics); $htmlOutput = $demo->getHtmlOutput(); $demoError = $demo->getError(); } else { if ($_GET['demo'] == 'mgmt') { // Management API Reference Demo. require_once 'managementApiReference.php'; $demo = new ManagementApiReference($analytics);
@extends('app') @section('content') {!! Form::model(new App\Video, array( 'route' => 'videos.store', 'class' => 'form-horizontal', 'novalidate' => 'novalidate', 'files' => true) ) !!} <?php $userRole = AuthHelper::authenticate(); $user = Cas::user(); ?> <!-- @include('videos/partials/_form', ['submit_text' => 'Upload']) --> <div class="hidden">{{AuthHelper::authenticate()}}</div> <div class = "container" style="padding:10px;"> <div class="row" style="padding:10px"> <div calss="col-xs-12" style="margin:auto;" > <div class="hidden" id="progress-box" style="max-width:100%;padding-left:0px; margin:auto; width:750px;"> <div class="panel-heading"><p id="panel-heading" class="text-muted">Loading.........</p></div> <center><div id="videoplayer" style="max-width:100%; height:auto; padding:10px;"> <div class="container-fluid" > <div class="progress"> <div class="progress-bar" id="progress-bar" style="width: 0%"></div> </div> </div></div></div></center> </div> </div>