diff options
| author | Christian Fowler <spider@viovio.com> | 2009-05-05 15:04:39 +0000 |
|---|---|---|
| committer | Christian Fowler <spider@viovio.com> | 2009-05-05 15:04:39 +0000 |
| commit | ad7a467a390653ac9a9d361499e45763b4b4e07c (patch) | |
| tree | 940c91456fe4d2c3b940270a03a4b08cb12cf51a | |
| parent | 6af8587fa9249f97ac620eb45b75ae6cd879b770 (diff) | |
| download | liberty-ad7a467a390653ac9a9d361499e45763b4b4e07c.tar.gz liberty-ad7a467a390653ac9a9d361499e45763b4b4e07c.tar.bz2 liberty-ad7a467a390653ac9a9d361499e45763b4b4e07c.zip | |
user userCanUpdate, and make sure to check for valid pRootContent
| -rw-r--r-- | LibertyComment.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/LibertyComment.php b/LibertyComment.php index d6c2926..933bcef 100644 --- a/LibertyComment.php +++ b/LibertyComment.php @@ -3,7 +3,7 @@ * Management of Liberty Content * * @package liberty - * @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertyComment.php,v 1.81 2009/05/01 14:10:31 spiderr Exp $ + * @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertyComment.php,v 1.82 2009/05/05 15:04:39 spiderr Exp $ * @author spider <spider@steelsun.com> */ @@ -306,8 +306,8 @@ class LibertyComment extends LibertyMime { return $ret; } - function userCanUpdate( $pRootContent ) { - return( $this->userCanEdit() || $pRootContent->userHasPermission( 'p_liberty_edit_comments' ) || $pRootContent->userHasPermission( 'p_liberty_admin_comments' ) ); + function userCanUpdate( $pRootContent=NULL ) { + return( $this->userCanEdit() || ($pRootContent && ($pRootContent->hasUserPermission( 'p_liberty_edit_comments' ) || $pRootContent->hasUserPermission( 'p_liberty_admin_comments' ))) ); } /** @@ -636,7 +636,7 @@ class LibertyComment extends LibertyMime { $c = new LibertyComment(); $c->mInfo=$row; $c->mRootObj = $this->getRootObj(); - $row['is_editable'] = $c->userCanEdit(); + $row['is_editable'] = $c->userCanUpdate( $c->mRootObj ); global $gBitSystem; if( $gBitSystem->isFeatureActive( 'comments_allow_attachments' ) ){ |
