function resetForumsProperties($orgid) { global $lastError; $urlBase = "http://localhost:9991/forums/resetForumsProperties"; $doc = new DOMDocument("1.0", "UTF-8"); $xml = $doc->saveXML(); $top = $doc->createElement("resetForumsProperties", ""); $doc->appendChild($top); $node = $doc->createElement("orgid", $orgid); $top->appendChild($node); $xml = $doc->saveXML(); $response = sendServerRequest($urlBase, $xml); $xml = new SimpleXMLElement($response); $success = $xml->getName(); $reason = $response; if ($success != "ok") { $lastError = $reason; return False; } return True; }
function renameOrg($server, $orgid, $newName) { global $lastError, $allServers; // Setup the files on disk for the organization foreach ($allServers as $server) { if ($serverName == $server[0]) { $urlBase = $server[2]; } } $renameOrgUrl = $urlBase . "/coal/renameOrg"; // We don't have enough info at the php level to do the actual // org rename to punt and task the SP with it. echo "orgName is: " . $newName; $doc = new DOMDocument("1.0", "UTF-8"); $top = $doc->createElement("renameOrg", ""); $doc->appendChild($top); $node = $doc->createElement("orgid", $orgid); $top->appendChild($node); $node = $doc->createElement("orgName"); $node->appendChild($doc->createTextNode($newName)); $top->appendChild($node); $xml = $doc->saveXML(); echo $xml; $response = sendServerRequest($renameOrgUrl, $xml); echo $response; if (true) { $xml = new SimpleXMLElement($response); $success = $xml->getName(); $reason = $response; } else { $doc = parseServerResponse($response); $success = $doc->firstChild->nodeName; $reason = $doc->firstChild->nodeValue; } $lastError = $reason; return $success == "ok"; }
function getServerLogNamed($serverName, $file) { global $lastError; $urlBase = "http://{$serverName}:9991/forums/logs/{$file}"; $doc = new DOMDocument("1.0", "UTF-8"); $xml = $doc->saveXML(); $response = sendServerRequest($urlBase, $xml); $xml = new SimpleXMLElement($response); return $xml; }