summaryrefslogtreecommitdiff
path: root/edit.php
diff options
context:
space:
mode:
authorwjames5 <will@tekimaki.com>2007-09-15 18:07:53 +0000
committerwjames5 <will@tekimaki.com>2007-09-15 18:07:53 +0000
commit0795bdde5f9c2bfa85efe8c0deba2a51a1edefb5 (patch)
treec158f58eb1766c41c81ef27faaa5b1fcd2625115 /edit.php
parent768866c24e7f9e00c703db33d9558b4dabb8b5ee (diff)
downloadwiki-0795bdde5f9c2bfa85efe8c0deba2a51a1edefb5.tar.gz
wiki-0795bdde5f9c2bfa85efe8c0deba2a51a1edefb5.tar.bz2
wiki-0795bdde5f9c2bfa85efe8c0deba2a51a1edefb5.zip
check hasEditPerm for editing pages
Diffstat (limited to 'edit.php')
-rw-r--r--edit.php13
1 files changed, 9 insertions, 4 deletions
diff --git a/edit.php b/edit.php
index 759620f..4f00264 100644
--- a/edit.php
+++ b/edit.php
@@ -1,6 +1,6 @@
<?php
/**
- * $Header: /cvsroot/bitweaver/_bit_wiki/edit.php,v 1.41 2007/08/23 22:33:55 squareing Exp $
+ * $Header: /cvsroot/bitweaver/_bit_wiki/edit.php,v 1.42 2007/09/15 18:07:53 wjames5 Exp $
*
* Copyright( c ) 2004 bitweaver.org
* Copyright( c ) 2003 tikwiki.org
@@ -8,7 +8,7 @@
* 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
*
- * $Id: edit.php,v 1.41 2007/08/23 22:33:55 squareing Exp $
+ * $Id: edit.php,v 1.42 2007/09/15 18:07:53 wjames5 Exp $
* @package wiki
* @subpackage functions
*/
@@ -37,10 +37,15 @@ if( ( !empty( $_REQUEST['page'] ) && $_REQUEST['page'] == 'SandBox' ) || ( !empt
if( $wiki_sandbox && !$gBitSystem->isFeatureActive( 'wiki_sandbox' ) ) {
$gBitSystem->fatalError( tra( "The SandBox is disabled" ));
-} elseif( !$wiki_sandbox && !$gContent->hasUserPermission( 'p_wiki_edit_page' ) ) {
- $gBitSystem->fatalError( tra( 'Permission denied you cannot edit the page named' ).' "'.$gContent->getTitle().'"' );
+} elseif( !$wiki_sandbox ){
+ if( $gContent->isValid() ) {
+ $gContent->verifyEditPermission();
+ } else {
+ $gBitSystem->verifyPermission( 'p_wiki_edit_page' );
+ }
}
+
if( $gContent->isLocked() ) {
$gBitSystem->fatalError( 'Cannot edit page because it is locked' );
}