예제 #1
0
파일: index.php 프로젝트: kbrabrand/sdk-php
<?php

require_once '../src/Client.php';
require_once 'config.php';
if (!$SPID_CREDENTIALS) {
    die('ERROR: You must configure $SPID_CREDENTIALS  in config.php first!');
}
$client = new VGS_Client($SPID_CREDENTIALS);
if (isset($_GET['logout'])) {
    $client->deleteSession();
}
$session = $client->getSession();
if ($session && isset($_GET['code'])) {
    header("Location: " . $client->getCurrentURI(array(), array('code')));
    exit;
}
?>
<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
	<link href="css/prettify.css" type="text/css" rel="stylesheet" />	
	<link rel="stylesheet" href="css/default.css" />
	<script src="js/jquery-1.5.2.min.js"></script>
	<script src="js/jquery.tmpl.js"></script>
	<script src="js/format-json.js"></script>			
	<script src="js/global.js"></script>
	<script>
		VG.api.methods = <?php 
try {
    $res = $client->api('/endpoints');