2011-03-28 14:21:28 +00:00
|
|
|
<?
|
|
|
|
if (!check_perms('site_collages_recover')) {
|
|
|
|
error(403);
|
|
|
|
}
|
|
|
|
|
2013-05-05 08:00:31 +00:00
|
|
|
if ($_POST['collage_id'] && is_number($_POST['collage_id'])) {
|
2011-03-28 14:21:28 +00:00
|
|
|
authorize();
|
|
|
|
$CollageID = $_POST['collage_id'];
|
2011-07-10 08:00:06 +00:00
|
|
|
|
2013-06-28 08:01:04 +00:00
|
|
|
$DB->query("
|
|
|
|
SELECT Name
|
|
|
|
FROM collages
|
|
|
|
WHERE ID = $CollageID");
|
2013-07-10 00:08:53 +00:00
|
|
|
if (!$DB->has_results()) {
|
2011-07-10 08:00:06 +00:00
|
|
|
error('Collage is completely deleted');
|
|
|
|
} else {
|
2013-06-28 08:01:04 +00:00
|
|
|
$DB->query("
|
|
|
|
UPDATE collages
|
|
|
|
SET Deleted = '0'
|
|
|
|
WHERE ID = $CollageID");
|
|
|
|
$Cache->delete_value("collage_$CollageID");
|
2013-05-05 08:00:31 +00:00
|
|
|
Misc::write_log("Collage $CollageID was recovered by ".$LoggedUser['Username']);
|
2011-07-10 08:00:06 +00:00
|
|
|
header("Location: collages.php?id=$CollageID");
|
|
|
|
}
|
2011-03-28 14:21:28 +00:00
|
|
|
}
|
2013-05-05 08:00:31 +00:00
|
|
|
View::show_header('Collage recovery!');
|
2011-03-28 14:21:28 +00:00
|
|
|
?>
|
|
|
|
<div class="thin center">
|
2013-05-05 08:00:31 +00:00
|
|
|
<div class="box" style="width: 600px; margin: 0px auto;">
|
2011-03-28 14:21:28 +00:00
|
|
|
<div class="head colhead">
|
|
|
|
Recover deleted collage
|
|
|
|
</div>
|
|
|
|
<div class="pad">
|
2012-09-15 08:00:25 +00:00
|
|
|
<form class="undelete_form" name="collage" action="collages.php" method="post">
|
2011-03-28 14:21:28 +00:00
|
|
|
<input type="hidden" name="action" value="recover" />
|
|
|
|
<input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
|
2013-06-28 08:01:04 +00:00
|
|
|
<div class="field_div">
|
2013-11-23 08:01:14 +00:00
|
|
|
<strong>Collage ID: </strong>
|
2013-06-28 08:01:04 +00:00
|
|
|
<input type="text" name="collage_id" size="8" />
|
|
|
|
</div>
|
|
|
|
<div class="submit_div">
|
|
|
|
<input value="Recover!" type="submit" />
|
|
|
|
</div>
|
2011-03-28 14:21:28 +00:00
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2013-11-23 08:01:14 +00:00
|
|
|
<?
|
|
|
|
View::show_footer();
|