Select Git revision
connect_class_dom.php 5.24 KiB
<?php
/**
* @package mod
* @subpackage adobeconnect
* @author Akinsaya Delamarre (adelamarre@remote-learner.net)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once('connect_class.php');
class connect_class_dom extends connect_class {
public function __construct($serverurl = '', $serverport = '',
$username = '', $password = '',
$cookie = '', $https) {
parent::__construct($serverurl, $serverport, $username, $password, $cookie, $https);
}
public function create_request($params = array(), $sentrequest = true) {
if (empty($params)) {
return false;
}
$dom = new DOMDocument('1.0', 'UTF-8');
$root = $dom->createElement('params');
$dom->appendChild($root);
foreach($params as $key => $data) {
// DFNVC
// htmlentities() durch htmlspecialchars() ersetzt,
// damit auch Nutzer agelegt werden können, deren Namen
// Umlaute enthalten.
//
$datahtmlent = htmlspecialchars($data);
$child = $dom->createElement('param', $datahtmlent);
$root->appendChild($child);
$attribute = $dom->createAttribute('name');
$child->appendChild($attribute);
$text = $dom->createTextNode($key);
$attribute->appendChild($text);
}
$this->_xmlrequest = $dom->saveXML();
if ($sentrequest) {
$this->_xmlresponse = $this->send_request();
}
}
/**
* Parses through xml and looks for the 'cookie' parameter
* @param string $xml the xml to parse through
* @return string $sessoin returns the session id
*/
public function read_cookie_xml($xml = '') {
global $USER, $COURSE, $CFG;
if (empty($xml)) {
if (is_siteadmin($USER->id)) {