[pLog-svn] r4155 - in plog/trunk: class/action/admin templates/admin

oscar at devel.lifetype.net oscar at devel.lifetype.net
Sun Oct 22 17:09:52 GMT 2006


Author: oscar
Date: 2006-10-22 17:09:51 +0000 (Sun, 22 Oct 2006)
New Revision: 4155

Modified:
   plog/trunk/class/action/admin/admindeletecommentaction.class.php
   plog/trunk/class/action/admin/admineditcommentsaction.class.php
   plog/trunk/class/action/admin/adminmarkcommentaction.class.php
   plog/trunk/templates/admin/editcomments.template
Log:
implemented permissions for managing comments


Modified: plog/trunk/class/action/admin/admindeletecommentaction.class.php
===================================================================
--- plog/trunk/class/action/admin/admindeletecommentaction.class.php	2006-10-22 15:00:20 UTC (rev 4154)
+++ plog/trunk/class/action/admin/admindeletecommentaction.class.php	2006-10-22 17:09:51 UTC (rev 4155)
@@ -38,6 +38,8 @@
 			$view = new AdminArticleCommentsListView( $this->_blogInfo );
 			$view->setErrorMessage( $this->_locale->tr("error_deleting_comments"));
 			$this->setValidationErrorView( $view );
+
+			$this->requirePermission( "update_comment" );			
         }
 		
 		/**

Modified: plog/trunk/class/action/admin/admineditcommentsaction.class.php
===================================================================
--- plog/trunk/class/action/admin/admineditcommentsaction.class.php	2006-10-22 15:00:20 UTC (rev 4154)
+++ plog/trunk/class/action/admin/admineditcommentsaction.class.php	2006-10-22 17:09:51 UTC (rev 4155)
@@ -31,7 +31,9 @@
 			
 			// we do this so that AdminEditTrackbacksAction can basically extend this class and provide
 			// a different view... it will allow us to save some extra code!
-			$this->_viewClass = "AdminArticleCommentsListView";			
+			$this->_viewClass = "AdminArticleCommentsListView";
+			
+			$this->requirePermission( "view_comments" );
         }
 
         /**

Modified: plog/trunk/class/action/admin/adminmarkcommentaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminmarkcommentaction.class.php	2006-10-22 15:00:20 UTC (rev 4154)
+++ plog/trunk/class/action/admin/adminmarkcommentaction.class.php	2006-10-22 17:09:51 UTC (rev 4155)
@@ -37,6 +37,8 @@
 			$view = new AdminPostsListView( $this->_blogInfo );
 			$view->setErrorMessage( $this->_locale->tr("error_incorrect_comment_id"));
 			$this->setValidationErrorView( $view );
+			
+			$this->requirePermission( "update_comment" );			
         }
 
         /**

Modified: plog/trunk/templates/admin/editcomments.template
===================================================================
--- plog/trunk/templates/admin/editcomments.template	2006-10-22 15:00:20 UTC (rev 4154)
+++ plog/trunk/templates/admin/editcomments.template	2006-10-22 17:09:51 UTC (rev 4155)
@@ -42,9 +42,11 @@
         </div>
 		
         <form id="postCommentsList" action="admin.php" method="post">
+		{check_perms perm=update_comment}	
         <div class="optionIcon">
 			<a id="optionIconLink" href="#bulkEdit" title="{$locale->tr("show_massive_change_option")}" onclick="switchMassiveOption()">{$locale->tr("show_massive_change_option")}</a>
 		</div>
+		{/check_perms}
         <div id="list">
   {include file="$admintemplatepath/successmessage.template"}
   {include file="$admintemplatepath/errormessage.template"}
@@ -96,6 +98,7 @@
                         </td>						
                         <td>
                             <div class="list_action_button">
+							{check_perms perm=update_comment}	
                             <a href="?op=deleteComment&amp;commentId={$comment->getId()}&amp;articleId={if $post}{$post->getId()}{else}0{/if}" title="{$locale->tr("delete")}">
                             	<img src="imgs/admin/icon_delete-16.png" alt="{$locale->tr("delete")}" />
                             </a>
@@ -108,6 +111,7 @@
 								 <img src="imgs/admin/icon_nospam-16.png" alt="{$locale->tr("mark_as_no_spam")}" />
 								</a>
 							{/if}
+							{/check_perms}
 							{if $comment->getUserUrl()}
 							  <a href="{$comment->getUserUrl()}" title="{$locale->tr("url")}">
 							   <img src="imgs/admin/icon_url-16.png" alt="{$locale->tr("url")}" />
@@ -123,9 +127,12 @@
 		<a name="bulkEdit"></a>
         <div id="list_action_bar">
 	    {adminpager style=list}
+			{check_perms perm=update_comment}	
 			<input type="hidden" name="articleId" value="{if $post}{$post->getId()}{else}0{/if}" />
             <input type="button" name="delete" value="{$locale->tr("delete")}" class="submit" onClick="javascript:submitCommentsList('deleteComments');" />
             <input type="hidden" name="op" value="" />
+			{/check_perms}
+			{check_perms perm=update_comment}
             <div id="massiveChangeOption" style="display: none">
                 <fieldset>
                 <legend>{$locale->tr("massive_change_option")}</legend>            
@@ -138,7 +145,8 @@
 		            </select>
 		            <input type="button" name="changeCommentsStatus" value="{$locale->tr("change_status")}" class="submit" onClick="javascript:submitCommentsList('changeCommentsStatus');" /> 
 		        </fieldset>
-			</div>           
+			</div>
+			{/check_perms} 
         </div>
         </form>
 {include file="$admintemplatepath/footernavigation.template"}



More information about the pLog-svn mailing list