summaryrefslogtreecommitdiff
path: root/edit.php
diff options
context:
space:
mode:
authorNick Palmer <nick@sluggardy.net>2008-10-02 13:11:59 +0000
committerNick Palmer <nick@sluggardy.net>2008-10-02 13:11:59 +0000
commit12c3ab7b5114fc45eef96eaf5f480713e0890017 (patch)
tree382ffd2a63052d4e3f967c71b03a70fd0837c180 /edit.php
parent5f36a70f2df9527585f32e7300c0810ed34f3c17 (diff)
downloadboards-12c3ab7b5114fc45eef96eaf5f480713e0890017.tar.gz
boards-12c3ab7b5114fc45eef96eaf5f480713e0890017.tar.bz2
boards-12c3ab7b5114fc45eef96eaf5f480713e0890017.zip
Move expunge to edit where it belongs.
Diffstat (limited to 'edit.php')
-rw-r--r--edit.php21
1 files changed, 20 insertions, 1 deletions
diff --git a/edit.php b/edit.php
index 6bf5021..6e94c30 100644
--- a/edit.php
+++ b/edit.php
@@ -1,6 +1,6 @@
<?php
/**
- * $Header: /cvsroot/bitweaver/_bit_boards/edit.php,v 1.11 2008/07/31 23:31:38 wjames5 Exp $
+ * $Header: /cvsroot/bitweaver/_bit_boards/edit.php,v 1.12 2008/10/02 13:11:59 nickpalmer Exp $
* Copyright (c) 2004 bitweaver Messageboards
* All Rights Reserved. See copyright.txt for details and a complete list of authors.
* Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
@@ -29,6 +29,25 @@ if( $gContent->isValid() ) {
$gBitSystem->verifyPermission( 'p_boards_edit' );
}
+// Handle delete request
+if( isset( $_REQUEST['remove'] ) ) {
+ // @TODO: Change to verifyExpungePermission when that exists in LibertyContent
+ if ( $gContent->isValid() && $gContent->hasUserPermission( 'p_boards_remove', TRUE, TRUE ) ) {
+ if( empty( $_REQUEST['confirm'] ) ) {
+ $formHash['b'] = $_REQUEST['b'];
+ $formHash['remove'] = TRUE;
+ $gBitSystem->confirmDialog( $formHash, array( 'warning' => tra( 'Are you sure you want to remove the entire message board' ).' "'.$gContent->getTitle().'" ?', 'error' => 'This cannot be undone!' ) );
+ } elseif( !$gContent->expunge() ) {
+ $gBitSmarty->assign_by_ref( 'errors', $deleteComment->mErrors );
+ } else {
+ bit_redirect(BOARDS_PKG_URL.'index.php');
+ die;
+ }
+ } else {
+ $gBitSystem->fatalPermission( 'p_boards_remove' );
+ }
+}
+
// If we are in preview mode then preview it!
if( isset( $_REQUEST["preview"] ) ) {
$gBitSmarty->assign('preview', 'y');