]>
git.datanom.net - qtadmin.git/blob - rest_client.php
5 * Copyright 2015 Michael Rasmussen <mir@datanom.net>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
22 require_once 'config.php';
23 require_once $CFG->root
. 'lib/utils.inc.php';
28 $ticket = $cookies = $data = null;
30 if (! isset($_SESSION['ticket'])) {
31 $data = 'username=mir@miras.org&password=Clara0503';
32 $response = $util->RESTCall($CFG->wblistadm_url
.'/ticket', $data, $cookiesIn = '');
33 if ($response['http_code'] >= 200 && $response['http_code'] <= 204) {
34 $_SESSION['ticket'] = json_decode($response['content']);
35 $_SESSION['CSRFPreventionToken'] = array('CSRFPreventionToken: ' . $_SESSION['ticket']->data
->CSRFPreventionToken
);
36 $_SESSION['cookies'] = $response['cookies'];
39 $response = $util->RESTCall($CFG->wblistadm_url
.'/show', null,
40 $cookiesIn = $_SESSION['cookies'], $_SESSION['CSRFPreventionToken']);
41 $data = json_decode($response['content']);
42 //$_SESSION['cookies'] = $response['cookies'];
46 <!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
47 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
48 <html xmlns
="http://www.w3.org/1999/xhtml" xml
:lang
="en" lang
="en">
51 <title
>untitled
</title
>
52 <meta http
-equiv
="content-type" content
="text/html;charset=utf-8" />
53 <meta name
="generator" content
="Geany 1.24.1" />
60 print "Ticket: \n".var_export($_SESSION['ticket'],true)."\nCookies: ".$_SESSION['cookies']."\nToken: ".
61 var_export($_SESSION['CSRFPreventionToken'], true);
This page took 0.094612 seconds and 6 git commands to generate.