[pLog-svn] r469 - in plog/trunk: . class/summary/action locale templates/summary

subaochen at devel.plogworld.net subaochen at devel.plogworld.net
Sat Dec 11 09:52:51 GMT 2004


Author: subaochen
Date: 2004-12-11 09:52:50 +0000 (Sat, 11 Dec 2004)
New Revision: 469

Added:
   plog/trunk/class/summary/action/dofinishregister.class.php
   plog/trunk/class/summary/action/doreadagreement.class.php
   plog/trunk/class/summary/action/registeraction.class.php
   plog/trunk/templates/summary/registerfinished.template
   plog/trunk/templates/summary/registerstep0.template
   plog/trunk/templates/summary/registerstep5.template
Modified:
   plog/trunk/class/summary/action/chooseblogtemplateaction.class.php
   plog/trunk/class/summary/action/doblogregistration.class.php
   plog/trunk/class/summary/action/dousercreation.class.php
   plog/trunk/class/summary/action/douserregister.class.php
   plog/trunk/locale/locale_en_UK.php
   plog/trunk/locale/locale_zh_CN.php
   plog/trunk/summary.php
   plog/trunk/templates/summary/header.template
   plog/trunk/templates/summary/registerstep1.template
   plog/trunk/templates/summary/registerstep2.template
   plog/trunk/templates/summary/registerstep3.template
   plog/trunk/templates/summary/registerstep4.template
Log:
make registration more security.

1 add user agreement
2 only collect user,blog and template information before really add into the backend db, so avoid orphant user left in the db.

the whole user and blog registration flow should be in a trascaction. 




Modified: plog/trunk/class/summary/action/chooseblogtemplateaction.class.php
===================================================================
--- plog/trunk/class/summary/action/chooseblogtemplateaction.class.php	2004-12-11 00:44:00 UTC (rev 468)
+++ plog/trunk/class/summary/action/chooseblogtemplateaction.class.php	2004-12-11 09:52:50 UTC (rev 469)
@@ -1,6 +1,6 @@
 <?php
 
-	include_once( PLOG_CLASS_PATH."class/summary/action/summaryaction.class.php" );
+	include_once( PLOG_CLASS_PATH."class/summary/action/registeraction.class.php" );
     include_once( PLOG_CLASS_PATH."class/data/validator/stringvalidator.class.php" );
     include_once( PLOG_CLASS_PATH."class/data/validator/integervalidator.class.php" );
     include_once( PLOG_CLASS_PATH."class/dao/blogs.class.php" );
@@ -11,53 +11,40 @@
 	 * shows a form where users can choose a new blog template
 	 * for their blog, to start with
 	 */
-    class ChooseBlogTemplateAction extends SummaryAction 
+    class ChooseBlogTemplateAction extends RegisterAction 
 	{
 
-        var $_blogId;
-        var $_templateId;
 
         function ChooseBlogTemplateAction( $actionInfo, $request )
         {
-        	$this->SummaryAction( $actionInfo, $request );
+        	$this->RegisterAction( $actionInfo, $request );
         	
         	// data validation, but very simple... this is not meant to 
         	// be ever triggered
         	$this->registerFieldValidator( "templateId", new StringValidator());
-        	$this->registerFieldValidator( "blogId", new IntegerValidator());
+        	//$this->registerFieldValidator( "blogId", new IntegerValidator());
         	$this->setValidationErrorView( new BlogTemplateChooserView());
         }
 
         function perform()
         {
 	        // get the data from the request, as it's already been validated
-			$this->_blogId = $this->_request->getValue( "blogId" );
-			$this->_templateId = $this->_request->getValue( "templateId" );
+			$this->templateId = $this->_request->getValue( "templateId" );
+            $this->blogName = $this->_request->getValue( "blogName" );
+            $this->blogLocale = $this->_request->getValue( "blogLocale" );
+            $this->userName = $this->_request->getValue( "userName" );
+            $this->userPassword = $this->_request->getValue( "userPassword" );
+            $this->userEmail = $this->_request->getValue( "userEmail" );
+			$this->userFullName = $this->_request->getValue( "userFullName" );
+            
 			
-			// and now simply save the settings after loading (and hopefully finding!)
-			// the information about the blog
-			$blogs = new Blogs();
-			$blogInfo = $blogs->getBlogInfo( $this->_blogId );
-			
-			// make sure we actually loaded the blog...
-			if( !$blogInfo ) {
-                $this->_view = new SummaryView( "registererror" );
-                $this->_view->setValue( "message", $this->_locale->tr("error_fetching_blog"));
-                return false;
-			}
-			
-			$ts = new TemplateSets();
-			$blogInfo->setTemplate( $this->_templateId );
-			
-			// update the blog settings in the db
-			$blogs->updateBlog( $blogInfo->getId(), $blogInfo );
-			
 			// show some info, and we're all happy!
 			$this->_view = new SummaryView( "registerstep4" );
-            $rg =$blogInfo->getBlogRequestGenerator();
-            $blogUrl = $rg->blogLink($blogInfo);
-            $this->_view->setValue( "blogurl", $blogUrl );
-			$this->_view->setValue( "locale", $this->_locale );            
+            //$rg =$blogInfo->getBlogRequestGenerator();
+            //$blogUrl = $rg->blogLink($blogInfo);
+            //$this->_view->setValue( "blogurl", $blogUrl );
+
+            $this->setValues();
         }
     }
-?>
\ No newline at end of file
+?>

Modified: plog/trunk/class/summary/action/doblogregistration.class.php
===================================================================
--- plog/trunk/class/summary/action/doblogregistration.class.php	2004-12-11 00:44:00 UTC (rev 468)
+++ plog/trunk/class/summary/action/doblogregistration.class.php	2004-12-11 09:52:50 UTC (rev 469)
@@ -1,6 +1,6 @@
 <?php
 
-	include_once( PLOG_CLASS_PATH."class/summary/action/summaryaction.class.php" );
+	include_once( PLOG_CLASS_PATH."class/summary/action/registeraction.class.php" );
     include_once( PLOG_CLASS_PATH."class/data/validator/stringvalidator.class.php" );
     include_once( PLOG_CLASS_PATH."class/data/validator/integervalidator.class.php" );
     include_once( PLOG_CLASS_PATH."class/dao/articlecategories.class.php" );	 		
@@ -13,19 +13,15 @@
 	/**
 	 * registers a blog
 	 */
-    class doBlogRegistration extends SummaryAction 
+    class doBlogRegistration extends RegisterAction 
 	{
-
-        var $_userId;
-        var $_blogName;
-        var $_blogLocale;
         
         function doBlogRegistration( $actionInfo, $request )
         {
-	    	$this->SummaryAction( $actionInfo, $request );
+	    	$this->RegisterAction( $actionInfo, $request );
 	    	
 	    	// data validation
-	    	$this->registerFieldValidator( "userId", new IntegerValidator());
+	    	//$this->registerFieldValidator( "userId", new IntegerValidator());
 	    	$this->registerFieldValidator( "blogName", new StringValidator());
 	    	$this->registerFieldValidator( "blogLocale", new StringValidator());
 	    	$view = new doBlogRegistrationView();
@@ -37,47 +33,22 @@
         {
             // validated values
             $tf = new Textfilter();
-            $this->_userId = $this->_request->getValue( "userId" );
-            $this->_blogName = $tf->filterAllHTML( $this->_request->getValue( "blogName" ));
-            $this->_localeCode = $this->_request->getValue( "blogLocale" );
+            $this->blogName = $tf->filterAllHTML( $this->_request->getValue( "blogName" ));
+            $this->blogLocale = $this->_request->getValue( "blogLocale" );
+            $this->userName = $tf->filterAllHTML($this->_request->getValue( "userName" ));
+            $this->userPassword = $tf->filterAllHTML($this->_request->getValue( "userPassword" ));
+            $this->userEmail = $tf->filterAllHTML($this->_request->getValue( "userEmail" ));
+			$this->userFullName = $tf->filterAllHTML($this->_request->getValue( "userFullName" ));
+			
 	        
-            // get the default locale configured for the site
-            $blogs = new Blogs();
-			$blogInfo = new BlogInfo( $this->_blogName, $this->_userId, "", "" );
-			$blogInfo->setStatus( BLOG_STATUS_ACTIVE );
-			$locale = Locales::getLocale( $this->_localeCode );
-			$blogInfo->setLocale( $locale );
-            $newblogId = $blogs->addBlog( $blogInfo );
-            if( !$newblogId ) {
-                $this->_view = new SummaryView( "registererror" );
-                $this->_view->setValue( "message", $this->_locale->tr("register_error_creating_blog"));
-                return false;
-            }
 
-            // get info about the blog
-            $blogInfo = $blogs->getBlogInfo( $newblogId );
-
-            // if the blog was created, we can add some basic information
-            // add a category
-            $articleCategories = new ArticleCategories();
-            $articleCategory = new ArticleCategory( $this->_locale->tr("register_default_category" ), "", $newblogId, true );
-            $catId = $articleCategories->addArticleCategory( $articleCategory );
-
-            // add an article based on that category
-            $articleTopic = $this->_locale->tr( "register_default_article_topic" );
-            $articleText  = $this->_locale->tr("register_default_article_text" );
-            $article = new Article( $articleTopic, $articleText, Array( $catId ), $this->_userId, $newblogId, POST_STATUS_PUBLISHED, 0, Array(), "welcome" );
-            $article->setDateObject( new Timestamp());  // set it to the current date
-            $article->setCommentsEnabled( true ); // enable comments
-            $articles = new Articles();
-            $articles->addArticle( $article );
-
             // create the new view and clean the cache
             $this->_view = new BlogTemplateChooserView();
-			$this->_view->setValue( "blogId", $blogInfo->getId());
+            $this->setValues();
+            $this->setCommonData();
 			
 			// reset the summary cache, since there's new information to show
 			CacheControl::resetSummaryCache();
         }
     }
-?>
\ No newline at end of file
+?>

Added: plog/trunk/class/summary/action/dofinishregister.class.php
===================================================================
--- plog/trunk/class/summary/action/dofinishregister.class.php	2004-12-11 00:44:00 UTC (rev 468)
+++ plog/trunk/class/summary/action/dofinishregister.class.php	2004-12-11 09:52:50 UTC (rev 469)
@@ -0,0 +1,175 @@
+<?php
+
+	include_once( PLOG_CLASS_PATH."class/summary/action/registeraction.class.php" );
+    include_once( PLOG_CLASS_PATH."class/dao/users.class.php" );
+    include_once( PLOG_CLASS_PATH."class/dao/blogs.class.php" );
+
+    /**
+     * finish the user and blog registration process
+     * @package summary
+     * @subpackage action
+     */
+    class doFinishRegister extends registerAction 
+	{
+		//{{{function doFinishRegister( $actionInfo, $request )
+        /**
+         * constructor
+         */
+		function doFinishRegister( $actionInfo, $request )
+		{
+			$this->RegisterAction( $actionInfo, $request );
+			
+			$view = new SummaryView( "registerstep4" );
+			$view->setErrorMessage( $this->_locale->tr("register_error_adding_user" ));
+			$this->setValidationErrorView( $view );
+
+            $this->_view = new SummaryView( "registererror" );
+		}	
+        //}}}
+
+        //{{{function perform()
+        /**
+         * perform
+         */
+        function perform()
+        {
+            $userId = $this->createUser();
+            if($userId){
+                $blogId = $this->createBlog($userId);
+            }
+            if($blogId){
+                $this->setTemplate($blogId);
+            }
+
+            $this->doneRegister();
+        }
+        //}}}
+
+        //{{{function createUser(){
+        /**
+         * create the user
+         */
+        function createUser(){
+            // all data is already correct
+            $this->userName = $this->_request->getValue("userName");
+            $this->userFullName = $this->_request->getValue("userFullName");
+            $this->userPassword = $this->_request->getValue("userPassword");
+            $this->userEmail = $this->_request->getValue("userEmail");
+
+            $this->log->debug("userName is ".$this->userName);
+            $this->log->debug("userPassword is ".$this->userPassword);
+
+            $users = new Users();
+			$user = new UserInfo( $this->userName, 
+                        $this->userPassword, 
+                        $this->userEmail, 
+                        "n/a", // about myself
+                        $this->userFullName );
+            $user->setStatus(USER_STATUS_ACTIVE);
+            $userId = $users->addUser( $user );
+            if( !$userId ) {
+                $this->_view = new SummaryView( "registererror" );
+                $this->_view->setErrorMessage( $this->_locale->tr("register_error_adding_user" ));
+                $this->setCommonData( true );
+                return false;
+            }
+
+            $this->log->debug("userId is ".$userId);
+
+            return $userId;
+        }
+        //}}}
+
+        //{{{function createBlog($userId){
+        /**
+         * create the blog
+         */
+        function createBlog($userId){
+            $this->blogName = $this->_request->getValue("blogName");
+            $this->bloglocale = $this->_request->getValue("blogLocale");
+
+            $this->log->debug("blogName is ".$this->blogName);
+            $this->log->debug("blogLocale is ".$this->blogLocale);
+
+            // get the default locale configured for the site
+            $blogs = new Blogs();
+			$blogInfo = new BlogInfo( $this->blogName, $userId, "", "" );
+			$blogInfo->setStatus( BLOG_STATUS_ACTIVE );
+			$locale = Locales::getLocale( $this->blogLocale );
+			$blogInfo->setLocale( $locale );
+            $newblogId = $blogs->addBlog( $blogInfo );
+            if( !$newblogId ) {
+                $this->log->debug("add blog failed,blog name is ".$this->blogName);
+                $this->_view = new SummaryView( "registererror" );
+                $this->_view->setValue( "message", $this->_locale->tr("register_error_creating_blog"));
+                return false;
+            }
+
+            // get info about the blog
+            $blogInfo = $blogs->getBlogInfo( $newblogId );
+
+            // if the blog was created, we can add some basic information
+            // add a category
+            $articleCategories = new ArticleCategories();
+            $articleCategory = new ArticleCategory( $this->_locale->tr("register_default_category" ), "", $newblogId, true );
+            $catId = $articleCategories->addArticleCategory( $articleCategory );
+
+            // add an article based on that category
+            $articleTopic = $this->_locale->tr( "register_default_article_topic" );
+            $articleText  = $this->_locale->tr("register_default_article_text" );
+            $article = new Article( $articleTopic, $articleText, Array( $catId ), $userId, $newblogId, POST_STATUS_PUBLISHED, 0, Array(), "welcome" );
+            $article->setDateObject( new Timestamp());  // set it to the current date
+            $article->setCommentsEnabled( true ); // enable comments
+            $articles = new Articles();
+            $articles->addArticle( $article );
+
+            return true;
+        }
+        //}}}
+
+        //{{{function setTemplate($blogId){
+        /**
+         * set blog template
+         */
+        function setTemplate($blogId){
+            $this->templateId = $this->_request->getValue("templateId");
+			// and now simply save the settings after loading (and hopefully finding!)
+			// the information about the blog
+			$blogs = new Blogs();
+			$blogInfo = $blogs->getBlogInfo( $blogId );
+			
+			// make sure we actually loaded the blog...
+			if( !$blogInfo ) {
+                $this->log->debug("set blog template failed,blog id is ".$blogId.",template id is  ".$this->templateId);
+                $this->_view = new SummaryView( "registererror" );
+                $this->_view->setValue( "message", $this->_locale->tr("error_fetching_blog"));
+                return false;
+			}
+			
+			$ts = new TemplateSets();
+			$blogInfo->setTemplate( $this->templateId );
+			
+			// update the blog settings in the db
+			$blogs->updateBlog( $blogInfo->getId(), $blogInfo );
+
+            return true;
+        }
+        //}}}
+
+        //{{{function doneRegister(){
+        /**
+         * finished registaration
+         */
+        function doneRegister(){
+            $this->_view = new SummaryView("registerstep5");
+            $this->setCommonData();
+            return true;
+        }
+        //}}}
+    }
+
+    /*
+     * vim600:  et sw=4 ts=4 fdm=marker expandtab
+     * vim<600: et sw=4 ts=4 expandtab
+     */
+?>

Added: plog/trunk/class/summary/action/doreadagreement.class.php
===================================================================
--- plog/trunk/class/summary/action/doreadagreement.class.php	2004-12-11 00:44:00 UTC (rev 468)
+++ plog/trunk/class/summary/action/doreadagreement.class.php	2004-12-11 09:52:50 UTC (rev 469)
@@ -0,0 +1,16 @@
+<?php
+
+	include_once( PLOG_CLASS_PATH."class/summary/action/summaryaction.class.php" );
+
+	/**
+	 * shows a form so that users can register
+	 */
+    class doReadAgreement extends SummaryAction 
+	{
+        function perform()
+        {
+            $this->_view = new SummaryView( "registerstep0" );
+            $this->setCommonData();
+        }
+    }	 
+?>

Modified: plog/trunk/class/summary/action/dousercreation.class.php
===================================================================
--- plog/trunk/class/summary/action/dousercreation.class.php	2004-12-11 00:44:00 UTC (rev 468)
+++ plog/trunk/class/summary/action/dousercreation.class.php	2004-12-11 09:52:50 UTC (rev 469)
@@ -1,6 +1,6 @@
 <?php
 
-	include_once( PLOG_CLASS_PATH."class/summary/action/summaryaction.class.php" );
+	include_once( PLOG_CLASS_PATH."class/summary/action/registeraction.class.php" );
     include_once( PLOG_CLASS_PATH."class/data/validator/emailvalidator.class.php" );
     include_once( PLOG_CLASS_PATH."class/data/validator/stringvalidator.class.php" );
     include_once( PLOG_CLASS_PATH."class/data/validator/usernamevalidator.class.php" );
@@ -11,18 +11,12 @@
     /**
      * starts the user and blog registration process
      */
-    class doUserCreation extends SummaryAction 
+    class doUserCreation extends RegisterAction 
 	{
-
-        var $_userName;
-        var $_userPassword;
-        var $_confirmPassword;
-        var $_userEmail;
-		var $_userFullName;
 	
 		function doUserCreation( $actionInfo, $request )
 		{
-			$this->SummaryAction( $actionInfo, $request );
+			$this->RegisterAction( $actionInfo, $request );
 			
 			// data validation and stuff like that :)
 			$this->registerFieldValidator( "userName", new UsernameValidator());
@@ -35,20 +29,19 @@
 			$this->setValidationErrorView( $view );
 		}	
 
-        // creates the user + blog
         function perform()
         {
 	        // if all data is correct, then we can proceed and use it
 			$tf = new Textfilter();	        
-            $this->_userName = $tf->filterAllHTML($this->_request->getValue( "userName" ));
-            $this->_userPassword = $tf->filterAllHTML($this->_request->getValue( "userPassword" ));
-            $this->_confirmPassword = $tf->filterAllHTML($this->_request->getValue( "userPasswordCheck" ));
-            $this->_userEmail = $tf->filterAllHTML($this->_request->getValue( "userEmail" ));
-			$this->_userFullName = $tf->filterAllHTML($this->_request->getValue( "userFullName" ));
+            $this->userName = $tf->filterAllHTML($this->_request->getValue( "userName" ));
+            $this->userPassword = $tf->filterAllHTML($this->_request->getValue( "userPassword" ));
+            $this->confirmPassword = $tf->filterAllHTML($this->_request->getValue( "userPasswordCheck" ));
+            $this->userEmail = $tf->filterAllHTML($this->_request->getValue( "userEmail" ));
+			$this->userFullName = $tf->filterAllHTML($this->_request->getValue( "userFullName" ));
 			
 			// check if there is already a user with the same username and quit if so
 			$users = new Users();
-			if( $users->userExists( $this->_userName )) {
+			if( $users->userExists( $this->userName )) {
 				$this->_view = new SummaryView( "registerstep1" );
 				//$this->_form->hasRun( true );
 				$this->_form->setFieldValidationStatus( "userName", false );
@@ -57,7 +50,7 @@
 			}
 			
 			// check if the passwords match, and stop processing if so too
-            if( $this->_userPassword != $this->_confirmPassword ) {
+            if( $this->userPassword != $this->confirmPassword ) {
 	            $this->_view = new SummaryView( "registerstep1" );
                 $this->_view->setErrorMessage( $this->_locale->tr("register_error_passwords_dont_match"));
 				$this->_form->setFieldValidationStatus( "userPasswordCheck", false );                
@@ -65,22 +58,12 @@
                 return false;
             }			
 
-            // try to add the user
-            $users = new Users();
-			$user = new UserInfo( $this->_userName, $this->_userPassword, $this->_userEmail, "", $this->_userFullName );
-            $userId = $users->addUser( $user );
-            if( !$userId ) {
-                $this->_view = new SummaryView( "registerstep1" );
-                $this->_view->setErrorMessage( $this->_locale->tr("register_error_adding_user" ));
-                $this->setCommonData( true );
-                return false;
-            }
 
             // if everything went fine, then proceed
             $this->_view = new doBlogRegistrationView();
-            $this->_view->setValue( "userId", $userId );
+            $this->setValues();
             $this->setCommonData();
             return true;
         }
     }
-?>
\ No newline at end of file
+?>

Modified: plog/trunk/class/summary/action/douserregister.class.php
===================================================================
--- plog/trunk/class/summary/action/douserregister.class.php	2004-12-11 00:44:00 UTC (rev 468)
+++ plog/trunk/class/summary/action/douserregister.class.php	2004-12-11 09:52:50 UTC (rev 469)
@@ -1,11 +1,11 @@
 <?php
 
-	include_once( PLOG_CLASS_PATH."class/summary/action/summaryaction.class.php" );
+	include_once( PLOG_CLASS_PATH."class/summary/action/registeraction.class.php" );
 
 	/**
 	 * shows a form so that users can register
 	 */
-    class doUserRegister extends SummaryAction 
+    class doUserRegister extends RegisterAction 
 	{
         function perform()
         {
@@ -13,4 +13,4 @@
             $this->setCommonData();
         }
     }	 
-?>
\ No newline at end of file
+?>

Added: plog/trunk/class/summary/action/registeraction.class.php
===================================================================
--- plog/trunk/class/summary/action/registeraction.class.php	2004-12-11 00:44:00 UTC (rev 468)
+++ plog/trunk/class/summary/action/registeraction.class.php	2004-12-11 09:52:50 UTC (rev 469)
@@ -0,0 +1,46 @@
+<?php
+
+include_once( PLOG_CLASS_PATH."class/action/action.class.php" );
+include_once( PLOG_CLASS_PATH."class/summary/view/summaryview.class.php" );
+include_once( PLOG_CLASS_PATH."class/summary/view/summarycachedview.class.php" );	
+
+/**
+ * Base action that all register actions should extend
+ * @package summary
+ * @subpackage action
+ */
+class RegisterAction extends Action
+{
+    //{{{ member variables
+    var $userName;
+    var $userPassword;
+    var $userFullName;
+    var $userEmail;
+    var $blogName;
+    var $blogLocale;
+    var $templateId;
+    //}}}
+
+    //{{{function RegisterAction( $actionInfo, $request )
+    function RegisterAction( $actionInfo, $request )
+    {
+        $this->Action( $actionInfo, $request );
+        $this->_config   = Config::getConfig();
+        $this->_locale   = Locales::getLocale( $this->_config->getValue("default_locale" ));			
+    }
+    //}}}
+    
+    /**
+     * make these values tranfered until the last register step
+     */
+    function setValues(){
+        $this->_view->setValue( "userName", $this->userName );
+        $this->_view->setValue( "userFullName", $this->userFullName );
+        $this->_view->setValue( "userPassword", $this->userPassword );
+        $this->_view->setValue( "userEmail", $this->userEmail );
+        $this->_view->setValue( "blogName", $this->blogName );
+        $this->_view->setValue( "blogLocale", $this->blogLocale );
+        $this->_view->setValue( "templateId", $this->templateId );
+    }
+}
+?>

Modified: plog/trunk/locale/locale_en_UK.php
===================================================================
--- plog/trunk/locale/locale_en_UK.php	2004-12-11 00:44:00 UTC (rev 468)
+++ plog/trunk/locale/locale_en_UK.php	2004-12-11 09:52:50 UTC (rev 469)
@@ -920,7 +920,7 @@
 $messages["blog_status_active"] = "Active";
 $messages["blog_status_disabled"] = "Disabled";
 
-// register ui
+// register part
 $messages["step1"] = "step 1";
 $messages["step2"] = "step 2";
 $messages["step3"] = "step 3";
@@ -934,4 +934,5 @@
 $messages["blog_locale_help"] = "please select you locale setting";
 $messages["register_new_blog_step3_title"] = "Select template";
 $messages["done"] = "register finished";
+$messages["register_new_blog_step4_description"] = "We have collected all information and ready to create your account and your blog.";
 ?>

Modified: plog/trunk/locale/locale_zh_CN.php
===================================================================
--- plog/trunk/locale/locale_zh_CN.php	2004-12-11 00:44:00 UTC (rev 468)
+++ plog/trunk/locale/locale_zh_CN.php	2004-12-11 09:52:50 UTC (rev 469)
@@ -1029,5 +1029,5 @@
 $messages["blog_locale_help"] = "请选择您的blog将要使用的语系";
 $messages["register_new_blog_step3_title"] = "选择模板";
 $messages["done"] = "完成注册";
-
+$messages["register_new_blog_step4_description"] = "我们已经收集了创建您的帐户和博客需要的所有信息,请点击\"完成注册\"按钮,完成整个注册过程。";
 ?>

Modified: plog/trunk/summary.php
===================================================================
--- plog/trunk/summary.php	2004-12-11 00:44:00 UTC (rev 468)
+++ plog/trunk/summary.php	2004-12-11 09:52:50 UTC (rev 469)
@@ -36,10 +36,12 @@
 	$_actionMap["UserProfile"] = "UserProfileAction";
 	$_actionMap["BlogProfile"] = "BlogProfileAction";
     $_actionMap["Faq"]           = "FaqAction";
+    $_actionMap["RegisterStep0"] = "doReadAgreement";
     $_actionMap["RegisterStep1"] = "doUserRegister";
     $_actionMap["RegisterStep2"] = "doUserCreation";
     $_actionMap["RegisterStep3"] = "doBlogRegistration";
     $_actionMap["RegisterStep4"] = "ChooseBlogTemplateAction";    
+    $_actionMap["RegisterStep5"] = "doFinishRegister";    
 	$_actionMap["resetPasswordForm"] = "SummaryShowResetPasswordForm";
 	$_actionMap["sendResetEmail"] = "SummarySendResetEmail";
 	$_actionMap["setNewPassword"] = "SummarySetNewPassword";
@@ -50,4 +52,4 @@
     //// main part ////
     $controller = new SummaryController();
     $controller->process( HttpVars::getRequest());
-?>
\ No newline at end of file
+?>

Modified: plog/trunk/templates/summary/header.template
===================================================================
--- plog/trunk/templates/summary/header.template	2004-12-11 00:44:00 UTC (rev 468)
+++ plog/trunk/templates/summary/header.template	2004-12-11 09:52:50 UTC (rev 469)
@@ -29,7 +29,7 @@
         <div id="menu">
           <ul class="menuTop">
              <li class="menuOption"><a href="?op=Summary">{$locale->tr("summary")}</a></li>
-             <li class="menuOption"><a href="?op=RegisterStep1">{$locale->tr("register")}</a></li>
+             <li class="menuOption"><a href="?op=RegisterStep0">{$locale->tr("register")}</a></li>
              <li class="menuOption"><a href="?op=BlogList">{$locale->tr("blog_list")}</a></li>
              <li class="menuOption"><a href="?op=UserList">{$locale->tr("user_list")}</a></li>
           </ul>

Added: plog/trunk/templates/summary/registerfinished.template
===================================================================
--- plog/trunk/templates/summary/registerfinished.template	2004-12-11 00:44:00 UTC (rev 468)
+++ plog/trunk/templates/summary/registerfinished.template	2004-12-11 09:52:50 UTC (rev 469)
@@ -0,0 +1,10 @@
+{include file="summary/header.template" selected="register" columns=1}
+<div id="onecolumn">
+
+ <h1>{$locale->tr("register_finished")}</h1>
+ <p>
+  {$locale->tr("register_finish_message")}
+ </p>
+
+</div>
+{include file="summary/footer.template"}

Added: plog/trunk/templates/summary/registerstep0.template
===================================================================
--- plog/trunk/templates/summary/registerstep0.template	2004-12-11 00:44:00 UTC (rev 468)
+++ plog/trunk/templates/summary/registerstep0.template	2004-12-11 09:52:50 UTC (rev 469)
@@ -0,0 +1,15 @@
+{include file="summary/header.template" section=$locale->tr("register_new_blog_step0_title")}
+
+<!--user aggreement-->
+<textarea name="textarea" class="contract" width="100%">
+{include file="summary/agreement.txt"}
+</textarea>
+<!--end user agreement-->
+
+  <form action="summary.php">
+      <input type="submit" value="{$locale->tr("accept")}" name="accept"/>
+      <input type="button" value="{$locale->tr("decline")}" name="decline"  onclick="window.location.href='summary.php'" />
+      <input type="hidden" name="op" value="RegisterStep1"/>
+  </form>
+
+{include file="summary/footer.template"}

Modified: plog/trunk/templates/summary/registerstep1.template
===================================================================
--- plog/trunk/templates/summary/registerstep1.template	2004-12-11 00:44:00 UTC (rev 468)
+++ plog/trunk/templates/summary/registerstep1.template	2004-12-11 09:52:50 UTC (rev 469)
@@ -41,4 +41,4 @@
       <input type="hidden" name="op" value="RegisterStep2"/>
     </div>
   </form>
-{include file="summary/footer.template"}
\ No newline at end of file
+{include file="summary/footer.template"}

Modified: plog/trunk/templates/summary/registerstep2.template
===================================================================
--- plog/trunk/templates/summary/registerstep2.template	2004-12-11 00:44:00 UTC (rev 468)
+++ plog/trunk/templates/summary/registerstep2.template	2004-12-11 09:52:50 UTC (rev 469)
@@ -12,7 +12,7 @@
      {include file="summary/validate.template" field=blogName message=$locale->tr("register_error_blog_name")}
    </div>  
    <div class="field">
-     <label for="blogLocale">{$locale->tr("locale")}</label>
+     <label for="blogLocale">{$locale->tr("locales")}</label>
      <span class="required">*</span>
      <div class="formHelp">{$locale->tr("blog_locale_help")}</div>
      <select name="blogLocale">
@@ -23,9 +23,12 @@
    </div>
   </fieldset>
   <div class="buttons">
-    <input type="hidden" name="userId" value="{$userId}" />
     <input type="submit" name="{$locale->tr("register_next")}" value="{$locale->tr("register_next")}"/>
     <input type="hidden" name="op" value="RegisterStep3"/>
+    <input type="hidden" name="userName" value="{$userName}"/>
+    <input type="hidden" name="userFullName" value="{$userFullName}"/>
+    <input type="hidden" name="userPassword" value="{$userPassword}"/>
+    <input type="hidden" name="userEmail" value="{$userEmail}"/>
   </div>  
  </form>
-{include file="summary/footer.template"}
\ No newline at end of file
+{include file="summary/footer.template"}

Modified: plog/trunk/templates/summary/registerstep3.template
===================================================================
--- plog/trunk/templates/summary/registerstep3.template	2004-12-11 00:44:00 UTC (rev 468)
+++ plog/trunk/templates/summary/registerstep3.template	2004-12-11 09:52:50 UTC (rev 469)
@@ -15,9 +15,14 @@
    </div>
   </fieldset>  
   <div class="buttons">
-    <input type="hidden" name="blogId" value="{$blogId}" />  
     <input type="hidden" name="op" value="RegisterStep4"/>
     <input type="submit" name="{$locale->tr("register_next")}" value="{$locale->tr("register_next")}"/>
+    <input type="hidden" name="userName" value="{$userName}"/>
+    <input type="hidden" name="userFullName" value="{$userFullName}"/>
+    <input type="hidden" name="userPassword" value="{$userPassword}"/>
+    <input type="hidden" name="userEmail" value="{$userEmail}"/>
+    <input type="hidden" name="blogName" value="{$blogName}"/>
+    <input type="hidden" name="blogLocale" value="{$blogLocale}"/>
   </div>  
  </form>
 {include file="summary/footer.template"}

Modified: plog/trunk/templates/summary/registerstep4.template
===================================================================
--- plog/trunk/templates/summary/registerstep4.template	2004-12-11 00:44:00 UTC (rev 468)
+++ plog/trunk/templates/summary/registerstep4.template	2004-12-11 09:52:50 UTC (rev 469)
@@ -1,16 +1,29 @@
 {include file="summary/header.template" section=$locale->tr("register_new_blog_step4_title")}
 <div id="onecolumn">
  <form name="formDone">
-  <fieldset class="inputField">
    {$locale->tr("register_new_blog_step4_description")}
-   {$locale->tr("register_step4_admin_link")}
-   {$locale->tr("register_step4_blog_link1")}
-   {$blogurl}
-   {$locale->tr("register_step4_blog_link2")}
-   {$locale->tr("register_step4_final_message")}
-  </fieldset>
+   
+   <div> {$locale->tr("username")}:{$userName}</div> 
+   <div> {$locale->tr("full_name")}:{$userFullName} </div>
+   <div> {$locale->tr("password")}:{$userPassword} </div>
+   <div> {$locale->tr("email")}:{$userEmail} </div>
+   <div> {$locale->tr("register_step2_blog_name")}:{$blogName} </div>
+   <div> {$locale->tr("locale")}:{$blogLocale} </div>
+   <div> {$locale->tr("templateId")}:{$templateId} </div>
+
   <div class="buttons">
    <input type="submit" name="done" value="{$locale->tr("done")}" />
+
+   <input type="hidden" name="userName" value="{$userName}"/>
+   <input type="hidden" name="userFullName" value="{$userFullName}"/>
+   <input type="hidden" name="userPassword" value="{$userPassword}"/>
+   <input type="hidden" name="userEmail" value="{$userEmail}"/>
+   <input type="hidden" name="blogName" value="{$blogName}"/>
+   <input type="hidden" name="blogLocale" value="{$blogLocale}"/>
+   <input type="hidden" name="templateId" value="{$templateId}"/>
+
+   <input type="hidden" name="op" value="RegisterStep5" />
  </form> 
+
 </div>
 {include file="summary/footer.template"}

Added: plog/trunk/templates/summary/registerstep5.template
===================================================================
--- plog/trunk/templates/summary/registerstep5.template	2004-12-11 00:44:00 UTC (rev 468)
+++ plog/trunk/templates/summary/registerstep5.template	2004-12-11 09:52:50 UTC (rev 469)
@@ -0,0 +1,16 @@
+{include file="summary/header.template" section=$locale->tr("register_new_blog_step5_title")}
+<div id="onecolumn">
+ <form name="formDone">
+  <fieldset class="inputField">
+   {$locale->tr("register_new_blog_step5_description")}
+   {$locale->tr("register_step5_admin_link")}
+   {$locale->tr("register_step5_blog_link1")}
+   {$blogurl}
+   {$locale->tr("register_step5_blog_link2")}
+   {$locale->tr("register_step5_final_message")}
+  </fieldset>
+  <div class="buttons">
+   <input type="submit" name="done" value="{$locale->tr("register_finished")}" onClick='window.location.href="summary.php"'/>
+ </form> 
+</div>
+{include file="summary/footer.template"}




More information about the pLog-svn mailing list