diff options
| -rw-r--r-- | LibertyComment.php | 3 | ||||
| -rw-r--r-- | LibertyContent.php | 18 | ||||
| -rw-r--r-- | admin/schema_inc.php | 2 | ||||
| -rw-r--r-- | comments_inc.php | 8 | ||||
| -rw-r--r-- | plugins/format.tikiwiki.php | 4 | ||||
| -rw-r--r-- | templates/display_comment.tpl | 4 |
6 files changed, 28 insertions, 11 deletions
diff --git a/LibertyComment.php b/LibertyComment.php index 06f314c..f73988a 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.34 2006/08/22 18:14:22 sylvieg Exp $ + * @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertyComment.php,v 1.35 2006/09/06 09:02:46 spiderr Exp $ * @author spider <spider@steelsun.com> */ @@ -36,6 +36,7 @@ class LibertyComment extends LibertyContent { $this->mCommentId = $pCommentId; $this->mContentId = $pContentId; $this->mInfo = $pInfo; + $this->mAdminContentPerm = 'p_liberty_admin_comments'; if ($this->mCommentId || $this->mContentId) { $this->loadComment(); diff --git a/LibertyContent.php b/LibertyContent.php index 80ef31a..2abfd63 100644 --- a/LibertyContent.php +++ b/LibertyContent.php @@ -3,7 +3,7 @@ * Management of Liberty content * * @package liberty -* @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertyContent.php,v 1.136 2006/09/05 15:09:51 sylvieg Exp $ +* @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertyContent.php,v 1.137 2006/09/06 09:02:47 spiderr Exp $ * @author spider <spider@steelsun.com> */ @@ -1159,6 +1159,7 @@ class LibertyContent extends LibertyBase { * @return string Formated html the link to display the page. */ function getDisplayLink( $pLinkText, $pMixed ) { + $ret = ''; if( empty( $pLinkText ) && !empty( $this ) ) { $pLinkText = $this->getTitle(); } elseif( empty( $pLinkText ) && !empty( $pMixed['title'] ) ) { @@ -1679,8 +1680,23 @@ class LibertyContent extends LibertyBase { $formatGuid = $pFormatGuid; } +/* <<<<<<< LibertyContent.php + // get the content id if we have one to get + if( is_array( $pMixed ) && !empty( $pMixed['content_id'] ) ) { + $contentId = $pMixed['content_id']; + } elseif( is_object( $this ) && !empty( $this->mContentId ) ) { + $contentId = $this->mContentId; + } else { + $contentId = NULL; + } + + $ret = $data; + + if( $data && $formatGuid ) { +======= */ $ret = $parseHash['data']; if( !empty( $parseHash['data'] ) && $formatGuid ) { +//>>>>>>> 1.116 global $gLibertySystem; if( $func = $gLibertySystem->getPluginFunction( $formatGuid, 'load_function' ) ) { $ret = $func( $parseHash, $this ); diff --git a/admin/schema_inc.php b/admin/schema_inc.php index 80b9e52..ad279d7 100644 --- a/admin/schema_inc.php +++ b/admin/schema_inc.php @@ -200,9 +200,9 @@ $gBitInstaller->registerPreferences( LIBERTY_PKG_NAME, array( // ### Default UserPermissions $gBitInstaller->registerUserPermissions( LIBERTY_PKG_NAME, array( array('p_liberty_edit_html_style', 'Can include style information in HTML', 'editors', LIBERTY_PKG_NAME), + array('p_liberty_admin_comments', 'Can administer comments', 'editors', LIBERTY_PKG_NAME), array('p_liberty_post_comments', 'Can post new comments', 'registered', LIBERTY_PKG_NAME), array('p_liberty_read_comments', 'Can read comments', 'basic', LIBERTY_PKG_NAME), - array('p_liberty_remove_comments', 'Can delete comments', 'editors', LIBERTY_PKG_NAME), array('p_liberty_vote_comments', 'Can vote comments', 'registered', LIBERTY_PKG_NAME), array('p_liberty_edit_comments', 'Can edit all comments', 'editors', LIBERTY_PKG_NAME), array('p_liberty_attach_attachments', 'Can create content attachments', 'registered', LIBERTY_PKG_NAME), diff --git a/comments_inc.php b/comments_inc.php index dd5c5d3..8f0b334 100644 --- a/comments_inc.php +++ b/comments_inc.php @@ -3,12 +3,12 @@ * comment_inc * * @author spider <spider@steelsun.com> - * @version $Revision: 1.24 $ + * @version $Revision: 1.25 $ * @package liberty * @subpackage functions */ -// $Header: /cvsroot/bitweaver/_bit_liberty/comments_inc.php,v 1.24 2006/08/21 11:11:20 hash9 Exp $ +// $Header: /cvsroot/bitweaver/_bit_liberty/comments_inc.php,v 1.25 2006/09/06 09:02:47 spiderr Exp $ // Copyright (c) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al. // All Rights Reserved. See copyright.txt for details and a complete list of authors. @@ -46,9 +46,9 @@ $postComment = array(); $formfeedback = array(); $gBitSmarty->assign_by_ref('formfeedback', $formfeedback); -if( @BitBase::verifyId($_REQUEST['delete_comment_id']) && $gBitUser->hasPermission( 'p_liberty_post_comments' )) { +if( @BitBase::verifyId($_REQUEST['delete_comment_id']) ) { $deleteComment = new LibertyComment($_REQUEST['delete_comment_id']); - if( @BitBase::verifyId($deleteComment->mInfo['content_id'] ) ) { + if( $deleteComment->isValid() && $gBitUser->hasPermission('p_liberty_admin_comments') ) { $deleteComment->deleteComment(); } } diff --git a/plugins/format.tikiwiki.php b/plugins/format.tikiwiki.php index 8744933..6695a4e 100644 --- a/plugins/format.tikiwiki.php +++ b/plugins/format.tikiwiki.php @@ -1,6 +1,6 @@ <?php /** - * @version $Revision: 1.60 $ + * @version $Revision: 1.61 $ * @package liberty */ global $gLibertySystem; @@ -757,7 +757,7 @@ class TikiWikiParser extends BitBase { $data = strip_tags( $data, $acceptableTags ); } else { // convert HTML to chars - $data = htmlspecialchars( $data, ENT_NOQUOTES, 'UTF-8' ); +// $data = htmlspecialchars( $data, ENT_NOQUOTES, 'UTF-8' ); } // Process pre_handlers here diff --git a/templates/display_comment.tpl b/templates/display_comment.tpl index b3135ca..51af922 100644 --- a/templates/display_comment.tpl +++ b/templates/display_comment.tpl @@ -9,10 +9,10 @@ {if $gBitUser->hasPermission( 'p_liberty_post_comments' )} <a href="{$comments_return_url}&post_comment_reply_id={$comment.content_id}&post_comment_request=1#editcomments" rel="nofollow">{biticon ipackage="icons" iname="mail-reply-sender" iexplain="Reply to this comment"}</a> {/if} - {if $comment.editable} + {if $gBitUser->hasPermission('p_liberty_admin_comments') || ($gBitUser && $comment.user_id == $gBitUser->mInfo.user_id) || $comment.editable} <a href="{$comments_return_url}&post_comment_id={$comment.comment_id}&post_comment_request=1#editcomments" rel="nofollow">{biticon ipackage="icons" iname="accessories-text-editor" iexplain="Edit"}</a> {/if} - {if $gBitUser->isAdmin()} + {if $gBitUser->hasPermission('p_liberty_admin_comments')} <a href="{$comments_return_url}&delete_comment_id={$comment.comment_id}" rel="nofollow">{biticon ipackage="icons" iname="edit-delete" iexplain="Remove"}</a> {/if} </div> |
