/** * Delete a node. Requires login and user must be owner of the node. * * @param string $nodeid * @return Result or Error */ function deleteNode($nodeid) { $n = new CNode($nodeid); $result = $n->delete(); return $result; }
include_once $path; die; } checkLogin(); include_once $HUB_FLM->getCodeDirPath("ui/headerdialog.php"); if ($USER == null || $USER->getIsAdmin() == "N") { echo "<div class='errors'>." . $LNG->ADMIN_NOT_ADMINISTRATOR_MESSAGE . "</div>"; include_once $HUB_FLM->getCodeDirPath("ui/footerdialog.php"); die; } $errors = array(); if (isset($_POST["deletenode"])) { $nodeid = optional_param("nodeid", "", PARAM_ALPHANUMEXT); if ($nodeid != "") { $node = new CNode($nodeid); $node->delete(); } else { array_push($errors, $LNG->SPAM_ADMIN_ID_ERROR); } } else { if (isset($_POST["restorenode"])) { $nodeid = optional_param("nodeid", "", PARAM_ALPHANUMEXT); if ($nodeid != "") { $node = new CNode($nodeid); $node->updateStatus($CFG->STATUS_ACTIVE); } else { array_push($errors, $LNG->SPAM_ADMIN_ID_ERROR); } } } $ns = getNodesByStatus($CFG->STATUS_SPAM, 0, -1, 'name', 'ASC', 'long');