[pLog-svn] r488 - in plog/trunk: class/dao class/summary/action
locale
subaochen at devel.plogworld.net
subaochen at devel.plogworld.net
Tue Dec 14 03:02:42 GMT 2004
Author: subaochen
Date: 2004-12-14 03:02:41 +0000 (Tue, 14 Dec 2004)
New Revision: 488
Modified:
plog/trunk/class/dao/blogs.class.php
plog/trunk/class/dao/users.class.php
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/locale/locale_en_UK.php
plog/trunk/locale/locale_zh_CN.php
Log:
verify the email address, one email address only can register one user account
not configurable yet.
Modified: plog/trunk/class/dao/blogs.class.php
===================================================================
--- plog/trunk/class/dao/blogs.class.php 2004-12-13 23:44:34 UTC (rev 487)
+++ plog/trunk/class/dao/blogs.class.php 2004-12-14 03:02:41 UTC (rev 488)
@@ -255,6 +255,9 @@
TextFilter::urlize($blog->getBlog())."', '".
Db::qstr($blog->getStatus())."')";
+ $this->log->debug($query);
+
+
$result = $this->Execute( $query );
if( !$result ){
Modified: plog/trunk/class/dao/users.class.php
===================================================================
--- plog/trunk/class/dao/users.class.php 2004-12-13 23:44:34 UTC (rev 487)
+++ plog/trunk/class/dao/users.class.php 2004-12-14 03:02:41 UTC (rev 488)
@@ -437,11 +437,32 @@
// check if the user is the owner of any blog
$owner = "SELECT id FROM ".$this->getPrefix()."blogs WHERE owner_id = ".$userid.";";
$result = $this->_db->Execute( $owner );
+
+ if(!$result)
+ return $blogId;
+
while( $row = $result->FetchRow($result)) {
$blogId = $row["id"];
}
return $blogId;
}
+
+ /**
+ * check if the email account has been registered
+ * @return true if the email account has been registered
+ */
+ function emailExists($email){
+ $query = "SELECT email
+ FROM ".$this->getPrefix()."users
+ WHERE email = '".Db::qstr($email)."'";
+
+ $result = $this->_db->Execute($query);
+
+ if($result)
+ return true;
+ else
+ return false;
+ }
}
?>
Modified: plog/trunk/class/summary/action/chooseblogtemplateaction.class.php
===================================================================
--- plog/trunk/class/summary/action/chooseblogtemplateaction.class.php 2004-12-13 23:44:34 UTC (rev 487)
+++ plog/trunk/class/summary/action/chooseblogtemplateaction.class.php 2004-12-14 03:02:41 UTC (rev 488)
@@ -36,6 +36,8 @@
$this->userPassword = $this->_request->getValue( "userPassword" );
$this->userEmail = $this->_request->getValue( "userEmail" );
$this->userFullName = $this->_request->getValue( "userFullName" );
+
+ $this->log->debug("blog name is ".$this->blogName);
// show some info, and we're all happy!
Modified: plog/trunk/class/summary/action/doblogregistration.class.php
===================================================================
--- plog/trunk/class/summary/action/doblogregistration.class.php 2004-12-13 23:44:34 UTC (rev 487)
+++ plog/trunk/class/summary/action/doblogregistration.class.php 2004-12-14 03:02:41 UTC (rev 488)
@@ -39,6 +39,9 @@
$this->userPassword = $tf->filterAllHTML($this->_request->getValue( "userPassword" ));
$this->userEmail = $tf->filterAllHTML($this->_request->getValue( "userEmail" ));
$this->userFullName = $tf->filterAllHTML($this->_request->getValue( "userFullName" ));
+
+ //$this->log->debug("blog name is ".$this->blogName);
+ $this->log->debug("blog name is ".$this->_request->getValue(blogName));
Modified: plog/trunk/class/summary/action/dousercreation.class.php
===================================================================
--- plog/trunk/class/summary/action/dousercreation.class.php 2004-12-13 23:44:34 UTC (rev 487)
+++ plog/trunk/class/summary/action/dousercreation.class.php 2004-12-14 03:02:41 UTC (rev 488)
@@ -48,6 +48,15 @@
$this->setCommonData( true );
return false;
}
+
+ // check if this email account has registered and quit if so
+ if( $users->emailExists($this->userEmail)) {
+ $this->_view = new SummaryView( "registerstep1" );
+ //$this->_form->hasRun( true );
+ $this->_form->setFieldValidationStatus( "userEmail", false );
+ $this->setCommonData( true );
+ return false;
+ }
// check if the passwords match, and stop processing if so too
if( $this->userPassword != $this->confirmPassword ) {
@@ -65,5 +74,6 @@
$this->setCommonData();
return true;
}
+
}
?>
Modified: plog/trunk/locale/locale_en_UK.php
===================================================================
--- plog/trunk/locale/locale_en_UK.php 2004-12-13 23:44:34 UTC (rev 487)
+++ plog/trunk/locale/locale_en_UK.php 2004-12-14 03:02:41 UTC (rev 488)
@@ -952,4 +952,6 @@
$messages["accept"] = "accept";
$messages["decline"] = "decline";
+
+$messages["confirm_result"] = "confirm result";
?>
Modified: plog/trunk/locale/locale_zh_CN.php
===================================================================
--- plog/trunk/locale/locale_zh_CN.php 2004-12-13 23:44:34 UTC (rev 487)
+++ plog/trunk/locale/locale_zh_CN.php 2004-12-14 03:02:41 UTC (rev 488)
@@ -1047,4 +1047,5 @@
$messages["accept"] = "同意以上条款";
$messages["decline"] = "不同意以上条款";
+$messages["confirm_result"] = "帐户激活状态";
?>
More information about the pLog-svn
mailing list