Skip to content

@saltybeagle /storydelete.php
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Story deletion procedure with error
<?php
if (!isset($_POST['delete'])) {
return false;
}
if (UNL_ENews_Controller::getUser()->uid !== $story->uid_created) {
throw new Exception('You did not create that story - you can not delete it', 403);
}
foreach ($story->getNewsrooms() as $newsroom) {
if (UNL_ENews_Newsroom_Story::getById($newsroom->id, $story->id)->status !== 'pending') {
throw new Exception('A story you attempted to delete has already been approved for use by a newsroom', 403);
}
}
return $story->delete();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.