[xoops-cvslog 4844] CVS update: xoops2jp/html/modules/user/forms

アーカイブの一覧に戻る

Ryuji AMANO ryuji_amano****@users*****
2006年 10月 7日 (土) 15:30:10 JST


Index: xoops2jp/html/modules/user/forms/LostPassEditForm.class.php
diff -u xoops2jp/html/modules/user/forms/LostPassEditForm.class.php:1.1.2.4.2.2 xoops2jp/html/modules/user/forms/LostPassEditForm.class.php:1.1.2.4.2.3
--- xoops2jp/html/modules/user/forms/LostPassEditForm.class.php:1.1.2.4.2.2	Fri Sep 29 17:14:45 2006
+++ xoops2jp/html/modules/user/forms/LostPassEditForm.class.php	Sat Oct  7 15:30:10 2006
@@ -1,7 +1,7 @@
 <?php
 /**
  * @package user
- * @version $Id: LostPassEditForm.class.php,v 1.1.2.4.2.2 2006/09/29 08:14:45 minahito Exp $
+ * @version $Id: LostPassEditForm.class.php,v 1.1.2.4.2.3 2006/10/07 06:30:10 ryuji_amano Exp $
  */
 
 if (!defined('XOOPS_ROOT_PATH')) exit();
@@ -32,7 +32,7 @@
 		$this->mFieldProperties['email'] =& new XCube_FieldProperty($this);
 		$this->mFieldProperties['email']->setDependsByArray(array('required', 'email'));
 		$this->mFieldProperties['email']->addMessage('required', _MD_USER_ERROR_REQUIRED, _MD_USER_LANG_EMAIL);
-		$this->mFieldProperties['email']->addMessage('email', _MD_USER_ERROR_EMAIL_FORMAT, _MD_USER_LANG_EMAIL);
+		$this->mFieldProperties['email']->addMessage('email', _MD_USER_ERROR_EMAIL, _MD_USER_LANG_EMAIL);
 	}
 }
 
Index: xoops2jp/html/modules/user/forms/AbstractUserEditForm.class.php
diff -u xoops2jp/html/modules/user/forms/AbstractUserEditForm.class.php:1.1.2.11.2.2 xoops2jp/html/modules/user/forms/AbstractUserEditForm.class.php:1.1.2.11.2.3
--- xoops2jp/html/modules/user/forms/AbstractUserEditForm.class.php:1.1.2.11.2.2	Fri Sep 29 17:14:45 2006
+++ xoops2jp/html/modules/user/forms/AbstractUserEditForm.class.php	Sat Oct  7 15:30:10 2006
@@ -25,7 +25,7 @@
 			//
 			$userHandler=&xoops_gethandler('user');
 			$criteria =& new CriteriaCompo(new Criteria('uname', $this->get('uname')));
-			if ($this->get('uid')) {
+			if ($this->get('uid') > 0) {
 				$criteria->add(new Criteria('uid', $this->get('uid'), '<>'));
 			}
 			if ($userHandler->getCount($criteria) > 0) {
@@ -71,9 +71,21 @@
 			foreach ($this->mConfig['bad_emails'] as $t_email) {
 				if (!empty($t_email) && preg_match("/${t_email}/i", $this->get('email'))) {
 					$this->addErrorMessage(_MD_USER_ERROR_INVALID_EMAIL);
-					break;
+					return;
 				}
 			}
+			
+			//
+			// email unique check
+			//
+			$userHandler=&xoops_gethandler('user');
+			$criteria =& new CriteriaCompo(new Criteria('email', $this->get('email')));
+			if ($this->get('uid') > 0) {
+				$criteria->add(new Criteria('uid', $this->get('uid'), '<>'));
+				}
+			if ($userHandler->getCount($criteria) > 0) {
+				$this->addErrorMessage(_MD_USER_ERROR_EMAILTAKEN);
+			}
 		}
 	}
 
Index: xoops2jp/html/modules/user/forms/AvatarEditForm.class.php
diff -u xoops2jp/html/modules/user/forms/AvatarEditForm.class.php:1.1.2.5.2.2 xoops2jp/html/modules/user/forms/AvatarEditForm.class.php:1.1.2.5.2.3
--- xoops2jp/html/modules/user/forms/AvatarEditForm.class.php:1.1.2.5.2.2	Fri Sep 29 17:14:45 2006
+++ xoops2jp/html/modules/user/forms/AvatarEditForm.class.php	Sat Oct  7 15:30:10 2006
@@ -1,7 +1,7 @@
 <?php
 /**
  * @package user
- * @version $Id: AvatarEditForm.class.php,v 1.1.2.5.2.2 2006/09/29 08:14:45 minahito Exp $
+ * @version $Id: AvatarEditForm.class.php,v 1.1.2.5.2.3 2006/10/07 06:30:10 ryuji_amano Exp $
  */
 
 if (!defined('XOOPS_ROOT_PATH')) exit();
@@ -39,7 +39,7 @@
 		// Set field properties
 		//
 		$this->mFieldProperties['uploadavatar'] =& new XCube_FieldProperty($this);
-		$this->mFieldProperties['uploadavatar']->setDependsByArray(array('extension,maxfilesize'));
+		$this->mFieldProperties['uploadavatar']->setDependsByArray(array('extension', 'maxfilesize'));
 		$this->mFieldProperties['uploadavatar']->addMessage('extension', _MD_USER_ERROR_AVATAR_EXTENSION);
 		$this->mFieldProperties['uploadavatar']->addVar('extension', "jpg,gif,png");
 		$this->mFieldProperties['uploadavatar']->addMessage('maxfilesize', _MD_USER_ERROR_AVATAR_MAXFILESIZE);
@@ -71,6 +71,7 @@
 		
 		$this->mFormFile = $this->get('uploadavatar');
 
+		if ($this->mFormFile != null) {
 		$this->mFormFile->setRandomToBodyName('cavt');
 		
 		$filename = $this->mFormFile->getFileName();
@@ -78,6 +79,7 @@
 		
 		$obj->set('user_avatar', $this->mFormFile->getFileName());	//< TODO
 	}
+	}
 	
 	/**
 	 * @return UserAvatarObject
Index: xoops2jp/html/modules/user/forms/UserRegisterEditForm.class.php
diff -u xoops2jp/html/modules/user/forms/UserRegisterEditForm.class.php:1.1.2.11 xoops2jp/html/modules/user/forms/UserRegisterEditForm.class.php:1.1.2.11.2.1
--- xoops2jp/html/modules/user/forms/UserRegisterEditForm.class.php:1.1.2.11	Sun Aug 27 01:50:27 2006
+++ xoops2jp/html/modules/user/forms/UserRegisterEditForm.class.php	Sat Oct  7 15:30:10 2006
@@ -48,7 +48,7 @@
 		$this->mFieldProperties['email']->addMessage('maxlength', _MD_USER_ERROR_MAXLENGTH, _MD_USER_LANG_EMAIL, '60');
 		$this->mFieldProperties['email']->addMessage('required', _MD_USER_ERROR_REQUIRED, _MD_USER_LANG_EMAIL, '60');
 		$this->mFieldProperties['email']->addVar('maxlength', 60);
-		$this->mFieldProperties['email']->addMessage('email', _MD_USER_ERROR_EMAIL_FORMAT);
+		$this->mFieldProperties['email']->addMessage('email', _MD_USER_ERROR_EMAIL, _MD_USER_LANG_EMAIL);
 
 		$this->mFieldProperties['url'] =& new XCube_FieldProperty($this);
 		$this->mFieldProperties['url']->setDependsByArray(array('maxlength'));
Index: xoops2jp/html/modules/user/forms/EditUserForm.class.php
diff -u xoops2jp/html/modules/user/forms/EditUserForm.class.php:1.1.2.16 xoops2jp/html/modules/user/forms/EditUserForm.class.php:1.1.2.16.2.1
--- xoops2jp/html/modules/user/forms/EditUserForm.class.php:1.1.2.16	Sun Aug 27 01:50:27 2006
+++ xoops2jp/html/modules/user/forms/EditUserForm.class.php	Sat Oct  7 15:30:10 2006
@@ -68,7 +68,7 @@
 			$this->mFieldProperties['email']->addMessage("required", _MD_USER_ERROR_REQUIRED, _MD_USER_LANG_EMAIL, "60");
 			$this->mFieldProperties['email']->addMessage("maxlength", _MD_USER_ERROR_MAXLENGTH, _MD_USER_LANG_EMAIL, "60");
 			$this->mFieldProperties['email']->addVar("maxlength", 60);
-			$this->mFieldProperties['email']->addMessage('email', _MD_USER_ERROR_EMAIL_FORMAT);
+			$this->mFieldProperties['email']->addMessage('email', _MD_USER_ERROR_EMAIL, _MD_USER_LANG_EMAIL);
 		}
 
 		$this->mFieldProperties['url'] =& new XCube_FieldProperty($this);


xoops-cvslog メーリングリストの案内
アーカイブの一覧に戻る