[pLog-svn] r6887 - plog/branches/lifetype-1.2/class/action/admin

jondaley at devel.lifetype.net jondaley at devel.lifetype.net
Wed May 13 08:13:48 EDT 2009


Author: jondaley
Date: 2009-05-13 08:13:48 -0400 (Wed, 13 May 2009)
New Revision: 6887

Modified:
   plog/branches/lifetype-1.2/class/action/admin/adminaction.class.php
Log:
run security pipeline on admin side too - so then hostblock can be used to block spammers from posting spam on their blogs too!

Modified: plog/branches/lifetype-1.2/class/action/admin/adminaction.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/action/admin/adminaction.class.php	2009-05-13 12:06:51 UTC (rev 6886)
+++ plog/branches/lifetype-1.2/class/action/admin/adminaction.class.php	2009-05-13 12:13:48 UTC (rev 6887)
@@ -10,6 +10,7 @@
 	lt_include( PLOG_CLASS_PATH."class/view/admin/admindefaultview.class.php" );
 	lt_include( PLOG_CLASS_PATH."class/data/textfilter.class.php" );
 	lt_include( PLOG_CLASS_PATH."class/dao/users.class.php" );
+    lt_include( PLOG_CLASS_PATH."class/security/pipeline.class.php" );
 	
 	/**
 	 * @see AdminAction::requirePermission()
@@ -107,6 +108,36 @@
 			        $this->_userBlogs[] = $this->_blogInfo;
 			    }
             }            
+
+            //
+            // security stuff
+            //
+            if(!empty($this->_blogInfo)){
+                $pipeline = new Pipeline($request, $this->_blogInfo);
+                $result = $pipeline->process();
+                    //
+                    // if the pipeline blocked the request, then we have
+                    // to let the user know
+                if(!$result->isValid()){
+                    if(!$result->hasView()){
+                            // use the default view
+                        lt_include(PLOG_CLASS_PATH."class/view/admin/adminerrorview.class.php");
+                        $message = $this->_locale->tr('error_you_have_been_blocked').'<br/><br/>';
+                        $message .= $result->getErrorMessage();
+                        $this->_view = new AdminErrorView($this->_blogInfo);
+                        $this->_view->setMessage($message);
+                    }
+                    else{
+                            // if the filter that forced the processing to stop provided
+                            // its own view, then use it				
+                        $this->_view = $result->getView();
+                    }
+                    $this->setCommonData();
+                    $this->_view->render();
+                    
+                    die();
+                }
+            }
         }
 
         /**



More information about the pLog-svn mailing list