]> git.datanom.net - qtadmin.git/blame - rest_client.php
prepare for wblistadm server
[qtadmin.git] / rest_client.php
CommitLineData
5ec97892
MR
1<?php
2/*
3 * rest_client.php
4 *
5 * Copyright 2015 Michael Rasmussen <mir@datanom.net>
6 *
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.
11 *
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.
16 *
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,
20 * MA 02110-1301, USA.
21 */
0541127e 22require_once 'config.php';
5ec97892
MR
23require_once $CFG->root . 'lib/utils.inc.php';
24
c49d593f 25session_start();
5ec97892
MR
26$util = new Utils;
27
c49d593f 28$ticket = $cookies = null;
5ec97892
MR
29$data = 'username=mir@miras.org&password=Clara0503';
30$response = $util->RESTCall($CFG->wblistadm_url.'/ticket', $data, $cookiesIn = '')
349dde0f 31if ($response['http_code'] >= 200 && $response['http_code'] <= 204) {
c49d593f
MR
32 $ticket = json_decode($response['content']);
33 $cookies = $response['cookies'];
34}
5ec97892
MR
35
36?>
37<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
38 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
39<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
40
41<head>
42 <title>untitled</title>
43 <meta http-equiv="content-type" content="text/html;charset=utf-8" />
44 <meta name="generator" content="Geany 1.24.1" />
45</head>
46
47<body>
c49d593f
MR
48<pre>
49<?php
50print_r($response);
51print "Ticket: $ticket\nCookies: $cookies";
52?>
53</pre>
5ec97892
MR
54</body>
55
56</html>
This page took 0.064923 seconds and 5 git commands to generate.