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

Back to archive index

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


Index: xoops2jp/html/modules/user/admin/forms/UserAdminEditForm.class.php
diff -u xoops2jp/html/modules/user/admin/forms/UserAdminEditForm.class.php:1.1.2.16.2.2 xoops2jp/html/modules/user/admin/forms/UserAdminEditForm.class.php:1.1.2.16.2.3
--- xoops2jp/html/modules/user/admin/forms/UserAdminEditForm.class.php:1.1.2.16.2.2	Fri Sep 29 17:14:44 2006
+++ xoops2jp/html/modules/user/admin/forms/UserAdminEditForm.class.php	Sat Oct  7 15:30:10 2006
@@ -1,7 +1,7 @@
 <?php
 /**
  * @package user
- * @version $Id: UserAdminEditForm.class.php,v 1.1.2.16.2.2 2006/09/29 08:14:44 minahito Exp $
+ * @version $Id: UserAdminEditForm.class.php,v 1.1.2.16.2.3 2006/10/07 06:30:10 ryuji_amano Exp $
  */
 
 if (!defined('XOOPS_ROOT_PATH')) exit();
@@ -79,7 +79,7 @@
 		$this->mFieldProperties['email']->setDependsByArray(array('required', 'maxlength', 'email'));
 		$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, _MD_USER_LANG_EMAIL);
+		$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'));
@@ -187,6 +187,23 @@
 		}
 	}
 	
+	function validateEmail()
+	{
+		if (strlen($this->get('email')) > 0) {
+			//
+			// 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);
+			}
+		}
+	}
+	
 	function validateUrl()
 	{
 		$t_url = $this->get('url');


xoops-cvslog メーリングリストの案内
Back to archive index