Beispiel #1
0
$showForm = sql_num_rows($result) > 0 && !isset($_POST["submit"]);
if ($showForm) {
    ?>
		<form action="<?php 
    echo url(".");
    ?>
" method="post">
		<div>
			Select deleted submissions you want to purge forever:
		</div>
		<?php 
}
include_once INCLUDES . "submission.php";
while ($objData = sql_next($result)) {
    if (isset($_POST["delete" . $objData["objid"]])) {
        eraseSubmission($objData["objid"], false, false);
        notice("Purged: " . $objData["objTitle"]);
        continue;
    }
    if ($showForm) {
        ?>
			<div class="sep">
				<input type="checkbox" class="checkbox"
					name="delete<?php 
        echo $objData["objid"];
        ?>
" />
				<a target="_blank" href="<?php 
        echo url("view/" . $objData["objid"]);
        ?>
">
Beispiel #2
0
switch ($editAction) {
    case "resetedits":
        // reset submission's number of edits
        if (atLeastSModerator()) {
            sql_query("UPDATE {$_objExtData} SET `objNumEdits` = '0' " . "WHERE `objEid` = '{$objid}'");
        }
        redirect(url("view/" . ($isExtras ? "e" : "") . $objid));
    case "undelete":
        // undelete submission (administrator/creator only)
        if ($objData["objDeleted"] && (isAdmin() || $objData["objDeletedBy"] == $_auth["useid"])) {
            sql_query("UPDATE {$_objects} SET `objDeleted` = '0' " . "WHERE `objid` = '{$objid}'");
            sql_query("UPDATE {$_objExtData} SET `objDeletedBy` = '0', `objDeleteDate` = NOW() " . "WHERE `objEid` = '{$objid}'");
            include_once INCLUDES . "submission.php";
            updateObjCount($objData["objCreator"]);
        }
        redirect(url("view/" . ($isExtras ? "e" : "") . $objid));
    case "erase":
        // erase submission, removing the submission files from the disk (administrator only)
        if (isAdmin()) {
            include_once INCLUDES . "submission.php";
            eraseSubmission($objid, $isExtras);
            notice(_SUBMISSION_ERASED);
        }
        break;
    default:
        // no correct action specified, redirect back to the submission
        redirect(url("view/" . ($isExtras ? "e" : "") . $objid));
}
?>
</div>