-
Notifications
You must be signed in to change notification settings - Fork 0
/
metadata.php
75 lines (61 loc) · 2.29 KB
/
metadata.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<?php
/**
* Copyright (c) 2018 internetlehrer-gmbh.de
* GPLv2, see LICENSE
*/
/**
* edusharing plugin:
*
* @author Uwe Kohnle <[email protected]>
* @version $Id$
*/
chdir("../../../../../../../");
// Avoid redirection to start screen
// (see ilInitialisation::InitILIAS for details)
$_GET["baseClass"] = "ilStartUpGUI";
require_once "./include/inc.header.php";
$settings = new ilSetting("xedus");
// $appid = $settings->get('application_appid');
// $type = $settings->get('application_type');
// $host = $_SERVER['SERVER_ADDR'];
// $domain = gethostbyname($_SERVER['SERVER_NAME']);
// $key = $settings->get('application_public_key');
// $appcaption = '';
$xml = new SimpleXMLElement(
'<?xml version="1.0" encoding="utf-8" ?><!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"><properties></properties>');
$entry = $xml->addChild('entry', $settings->get('application_appid'));
$entry->addAttribute('key', 'appid');
$entry = $xml->addChild('entry', $settings->get('application_type'));
$entry->addAttribute('key', 'type');
$entry = $xml->addChild('entry', 'ILIAS');
$entry->addAttribute('key', 'subtype');
$entry = $xml->addChild('entry', gethostbyname($_SERVER['SERVER_NAME']));
$entry->addAttribute('key', 'domain');
$entry = $xml->addChild('entry', $_SERVER['SERVER_ADDR']);
$entry->addAttribute('key', 'host');
$entry = $xml->addChild('entry', 'true');
$entry->addAttribute('key', 'trustedclient');
// $entry = $xml->addChild('entry', 'moodle:course/update');
// $entry->addAttribute('key', 'hasTeachingPermission');
$entry = $xml->addChild('entry', $settings->get('application_public_key'));
$entry->addAttribute('key', 'public_key');
$entry = $xml->addChild('entry', $settings->get('EDU_AUTH_AFFILIATION_NAME'));
$entry->addAttribute('key', 'appcaption');
header('Content-type: text/xml');
print(html_entity_decode($xml->asXML()));
// $xmlstr=<<<XML
// <properties>
// <entry key="appid">$appid</entry>
// <entry key="type">$type</entry>
// <entry key="subtype">ILIAS</entry>
// <entry key="domain">$domain</entry>
// <entry key="host">$host</entry>
// <entry key="trustedclient">true</entry>
// <entry key="public_key">$key</entry>
// <entry key="appcaption">$appcaption</entry>
// </properties>
// XML;
// $xml = new SimpleXMLElement($xmlstr);
// echo $xml->asXML();
exit;
?>