function processServerData($data, $return_array = true, $is_gzip = true) { if (empty($data)) { return false; } if ($return_array) { $xml = new XmlDoc(); $xml->parseString($data); return $xml->getArray(); } return true; }
function buildNavigation($xml) { if ($this->getConfigVar('enabled', 'filemanager') != 'yes') { $xml = str_replace('<node link="/publish/filemanager/" name="File Manager" />', NULL, file_get_contents($xml)); } $this->_nav = array(); $nav =& $this->_nav; $XML = new XmlDoc(); if (@is_file($xml)) { $XML->parseFile($xml); } else { $XML->parseString($xml); } $nodes = $XML->getArray(); $nav = array(); foreach ($nodes["navigation"] as $n) { $content = $n["node"]["attributes"]; $children = $n["node"][0]["children"]; if (!empty($content)) { $nav[] = $content; } if (@is_array($children)) { foreach ($children as $n) { if (!empty($n["node"]["attributes"])) { $nav[count($nav) - 1]["children"][] = $n["node"]["attributes"]; } } } } $sections = $this->_db->fetch("SELECT * FROM `tbl_sections` ORDER BY `sortorder` DESC"); if (is_array($sections) && !empty($sections)) { foreach ($sections as $s) { if ($_REQUEST['_sid'] == $s['id'] && preg_match('/publish\\/section/i', $_REQUEST['page']) && !$this->authorIsSuper() && !@in_array($s['id'], $this->getAuthorAllowableSections())) { $this->fatalError("Access Denied", "<p>Access denied. You are not authorised to access this page.</p>", true, true); } if ($this->authorIsSuper() || !$this->authorIsSuper() && @in_array($s['id'], $this->getAuthorAllowableSections())) { array_unshift($nav[0]["children"], array("link" => "/publish/section/&_sid=" . $s['id'], "name" => $s['name'])); } } } $services = $this->_cfm->listAll(); if (is_array($services) && !empty($services)) { foreach ($services as $owner => $list) { foreach ($list as $handle => $about) { if (@in_array("{$owner}/{$handle}", $this->_config->_vars['campfire-menu'])) { if (@is_file(CAMPFIRE . "/{$owner}/{$handle}/interface/content.index.php")) { $nav[3]["children"][] = array("link" => "/campfire/service/{$owner}/{$handle}/", "name" => $about['name']); } else { $nav[3]["children"][] = array("link" => "/campfire/info/&name={$owner}/{$handle}", "name" => $about['name']); } } elseif (!$this->authorIsSuper() && preg_match('/campfire\\/service\\/' . $owner . '\\/' . $handle . '/i', $_REQUEST['page']) && @(!in_array("{$owner}/{$handle}", $this->_config->_vars['campfire-menu']))) { $this->fatalError("Access Denied", "<p>Access denied. You are not authorised to access this page.</p>", true, true); } } } } if (count($nav[3]['children']) < 3 && !$this->authorIsSuper()) { unset($nav[3]); } return $this->_nav; }
<?php if (!isset($_REQUEST['auth'])) { General::redirect(URL . '/symphony/'); } $ch = new Gateway(); $ch->init(); $ch->setopt("URL", URL . '/symphony/ajax/'); $ch->setopt("POST", 1); $ch->setopt("POSTFIELDS", array('action' => 'status', 'token' => $_REQUEST['auth'], 'mode' => 'full')); $data = $ch->exec(); $parser = new XmlDoc(); $parser->parseString($data); $doc = $parser->getArray(); unset($parser); $obDate = $Admin->getDateObj(); $rss = new XMLElement('rss'); $rss->setAttribute('version', '2.0'); $channel = new XMLElement('channel'); $channel->addChild(new XMLElement('title', $Admin->getConfigVar('sitename', 'general'))); $channel->addChild(new XMLElement('link', URL)); $channel->addChild(new XMLElement('description', $Admin->getConfigVar('sitename', 'general') . ' Status Feed')); $channel->addChild(new XMLElement('language', 'en-us')); $channel->addChild(new XMLElement('generator', 'Symphony ' . $Admin->getConfigVar('build', 'symphony'))); function flattenFragment($f, $type) { $f = $f[$type]; $flattened = array(); $flattened['attributes'] = $f['attributes']; $flattened['data'] = array(); unset($f['attributes']);