-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
38 changed files
with
221 additions
and
418 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
|
||
/** | ||
* collages | ||
*/ | ||
|
||
|
||
# browse | ||
Flight::route("/collages", function () { | ||
$app = Gazelle\App::go(); | ||
$app->middleware(["collages" => "read"]); | ||
require_once "{$app->env->serverRoot}/sections/collages/browse.php"; | ||
}); | ||
|
||
|
||
# create | ||
Flight::route("/collages/create", function () { | ||
$app = Gazelle\App::go(); | ||
$app->middleware(["collages" => "create"]); | ||
require_once "{$app->env->serverRoot}/sections/collages/updateOrCreate.php"; | ||
}); | ||
|
||
|
||
# read | ||
Flight::route("/collages/@identifier", function (int|string $identifier = null) { | ||
$app = Gazelle\App::go(); | ||
$app->middleware(["collages" => "read"]); | ||
require_once "{$app->env->serverRoot}/sections/collages/details.php"; | ||
}); | ||
|
||
|
||
# update | ||
Flight::route("/collages/@identifier/update", function (int|string $identifier = null) { | ||
$app = Gazelle\App::go(); | ||
$app->middleware(["collages" => "updateAny"]); | ||
require_once "{$app->env->serverRoot}/sections/collages/updateOrCreate.php"; | ||
}); | ||
|
||
|
||
# delete | ||
Flight::route("/collages/@identifier/delete", function (int|string $identifier = null) { | ||
$app = Gazelle\App::go(); | ||
$app->middleware(["collages" => "deleteAny"]); | ||
require_once "{$app->env->serverRoot}/sections/collages/delete.php"; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,25 @@ | ||
<?php | ||
#declare(strict_types=1); | ||
|
||
$app = \Gazelle\App::go(); | ||
declare(strict_types=1); | ||
|
||
$CollageID = $_GET['collageId']; | ||
if (!is_numeric($CollageID) || !$CollageID) { | ||
error(404); | ||
} | ||
|
||
$app->dbOld->query(" | ||
SELECT Name, CategoryID, UserID | ||
FROM collages | ||
WHERE ID = '$CollageID'"); | ||
list($Name, $CategoryID, $UserID) = $app->dbOld->next_record(); | ||
/** | ||
* delete a collage | ||
*/ | ||
|
||
$app = Gazelle\App::go(); | ||
|
||
if ($app->user->cant(["collages" => "deleteAny"]) && $UserID != $app->user->core['id']) { | ||
error(403); | ||
$identifier ??= null; | ||
if (!$identifier) { | ||
$app->error(404); | ||
} | ||
|
||
View::header('Delete collage'); | ||
?> | ||
<div class="center"> | ||
<div class="box" style="width: 600px; margin: 0px auto;"> | ||
<div class="head colhead"> | ||
Delete collage | ||
</div> | ||
<div class="pad"> | ||
<form class="delete_form" name="collage" action="collages.php" method="post"> | ||
<input type="hidden" name="action" value="take_delete"> | ||
<input type="hidden" name="auth" value="<?=$app->user->extra['AuthKey']?>"> | ||
<input type="hidden" name="collageId" value="<?=$CollageID?>"> | ||
<?php | ||
if ($CategoryID == 0) { | ||
?> | ||
<div class="alertbar" style="margin-bottom: 1em;"> | ||
<strong>Warning: This is a personal collage. If you delete this collage, it <em>cannot</em> be recovered!</strong> | ||
</div> | ||
<?php | ||
try { | ||
$collage = new Gazelle\Collages($identifier); | ||
$collage->delete(); | ||
} catch (Throwable $e) { | ||
$app->error(404); | ||
} | ||
?> | ||
<div> | ||
<strong>Reason: </strong> | ||
<input type="text" name="reason" size="40"> | ||
</div> | ||
<div class="submit_div"> | ||
<input value="Delete" type="submit"> | ||
</div> | ||
</form> | ||
</div> | ||
</div> | ||
</div> | ||
<?php | ||
View::footer(); | ||
?> | ||
|
||
# redirect to collages index | ||
Gazelle\Http::redirect("/collages"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.