[pLog-svn] r4526 - in plugins/branches/lifetype-1.1/secret: class/security class/view locale

oscar at devel.lifetype.net oscar at devel.lifetype.net
Tue Jan 9 22:49:50 GMT 2007


Author: oscar
Date: 2007-01-09 22:49:49 +0000 (Tue, 09 Jan 2007)
New Revision: 4526

Added:
   plugins/branches/lifetype-1.1/secret/class/view/secretpluginenterpasswordview.class.php
Modified:
   plugins/branches/lifetype-1.1/secret/class/security/secretitemfilter.class.php
   plugins/branches/lifetype-1.1/secret/locale/locale_en_UK.php
Log:
in case the post is password-protected, show its own view instead of a potentially misleading screen with the word "error" in it.


Modified: plugins/branches/lifetype-1.1/secret/class/security/secretitemfilter.class.php
===================================================================
--- plugins/branches/lifetype-1.1/secret/class/security/secretitemfilter.class.php	2007-01-09 22:31:17 UTC (rev 4525)
+++ plugins/branches/lifetype-1.1/secret/class/security/secretitemfilter.class.php	2007-01-09 22:49:49 UTC (rev 4526)
@@ -8,7 +8,7 @@
     include_once( PLOG_CLASS_PATH."class/dao/articles.class.php" );
     include_once( PLOG_CLASS_PATH."class/dao/articlecategories.class.php" );
     include_once( PLOG_CLASS_PATH."class/dao/users.class.php" );
-    include_once( PLOG_CLASS_PATH . 'class/template/template.class.php' );
+    include_once( PLOG_CLASS_PATH.'class/template/template.class.php' );
 
     /**
      * Filters the text posted in a comment by a user, to prevent spam-bots. This
@@ -129,14 +129,16 @@
                     }
                 }
                 else {
-                    $ts = new TemplateService();
-                    $t = $ts->PluginTemplate( "secret", "passwordform" );
-                    $t->assign( "locale", $blogInfo->getLocale() );
-                    $t->assign( "params", $request->getAsArray());
-                    $t->assign( "articleId", $articleId );
-                    $t->assign( "url", RequestGenerator::getRequestGenerator( $blogInfo ));
-                    $message = $t->fetch();
-                    $result =  new PipelineResult( false, 500, $message );
+					// prepare the view we're going to show
+    				include_once( PLOG_CLASS_PATH."plugins/secret/class/view/secretpluginenterpasswordview.class.php" );					
+					$view = new SecretPluginEnterPasswordView( $blogInfo );
+                    $view->setValue( "locale", $blogInfo->getLocale() );
+                    $view->setValue( "params", $request->getAsArray());
+                    $view->setValue( "articleId", $articleId );
+                    $view->setValue( "url", $blogInfo->getBlogRequestGenerator());
+					// and give it to the pipeline for display
+                    $result =  new PipelineResult( false, 500, "" );
+					$result->setView( $view );
                 }
                 
                 return $result;

Added: plugins/branches/lifetype-1.1/secret/class/view/secretpluginenterpasswordview.class.php
===================================================================
--- plugins/branches/lifetype-1.1/secret/class/view/secretpluginenterpasswordview.class.php	2007-01-09 22:31:17 UTC (rev 4525)
+++ plugins/branches/lifetype-1.1/secret/class/view/secretpluginenterpasswordview.class.php	2007-01-09 22:49:49 UTC (rev 4526)
@@ -0,0 +1,12 @@
+<?php
+
+	include_once( PLOG_CLASS_PATH."class/view/plugintemplatedview.class.php" );
+	
+	class SecretPluginEnterPasswordView extends PluginTemplatedView
+	{
+		function SecretPluginEnterPasswordView( $blogInfo )
+		{
+			$this->PluginTemplatedView( $blogInfo, "secret", "passwordform" );
+		}
+	}
+?>
\ No newline at end of file

Modified: plugins/branches/lifetype-1.1/secret/locale/locale_en_UK.php
===================================================================
--- plugins/branches/lifetype-1.1/secret/locale/locale_en_UK.php	2007-01-09 22:31:17 UTC (rev 4525)
+++ plugins/branches/lifetype-1.1/secret/locale/locale_en_UK.php	2007-01-09 22:49:49 UTC (rev 4526)
@@ -17,6 +17,6 @@
 $messages["password_field_help"] = "Password for this entry (only applies if the 'enable password protection' checkbox on the right side has been enabled, otherwise it will be ignored).";
 
 $messages["item_protected"] = "Secret Post";
-$messages["item_protected_help"] = "Please kindly input your password! This is a secret post, you can not read this article without password.";
+$messages["item_protected_help"] = "This post is password-protected. You will not be allowed to proceed until you provide the right password.";
 $messages["send"] = "Send";
 ?>
\ No newline at end of file



More information about the pLog-svn mailing list