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

Back to archive index

Minahito minah****@users*****
2006年 7月 13日 (木) 19:52:08 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.8 xoops2jp/html/modules/user/admin/forms/UserAdminEditForm.class.php:1.1.2.9
--- xoops2jp/html/modules/user/admin/forms/UserAdminEditForm.class.php:1.1.2.8	Tue Mar 28 22:32:04 2006
+++ xoops2jp/html/modules/user/admin/forms/UserAdminEditForm.class.php	Thu Jul 13 19:52:08 2006
@@ -1,4 +1,8 @@
 <?php
+/**
+ * @package user
+ * @version $Id: UserAdminEditForm.class.php,v 1.1.2.9 2006/07/13 10:52:08 minahito Exp $
+ */
 
 if (!defined('XOOPS_ROOT_PATH')) exit();
 
@@ -6,6 +10,8 @@
 
 /**
  * This class is generated by makeActionForm tool.
+ * 
+ * TODO We may have to check the format of URL.
  */
 class User_UserAdminEditForm extends XCube_ActionForm
 {
@@ -13,7 +19,7 @@
 	
 	function getTokenName()
 	{
-		return "module.user.UserAdminEditForm.Token";
+		return "module.user.UserAdminEditForm.Token" . $this->get('uid');
 	}
 	
 	function prepare()
@@ -89,13 +95,6 @@
 		$this->mFieldProperties['user_from']->addMessage('maxlength', _AD_USER_ERROR_MAXLENGTH, _AD_USER_LANG_USER_FROM, '100');
 		$this->mFieldProperties['user_from']->addVar('maxlength', 100);
 
-		$this->mFieldProperties['user_sig'] =& new XCube_FieldProperty($this);
-//		$this->mFieldProperties['user_sig']->setDependsByArray(array(''));
-//		$this->mFieldProperties['user_sig']->addMessage('required', _AD_USER_ERROR_REQUIRED, _AD_USER_LANG_USER_SIG);
-
-		$this->mFieldProperties['user_viewemail'] =& new XCube_FieldProperty($this);
-//		$this->mFieldProperties['user_viewemail']->setDependsByArray(array(''));
-
 		$this->mFieldProperties['user_aim'] =& new XCube_FieldProperty($this);
 		$this->mFieldProperties['user_aim']->setDependsByArray(array('maxlength'));
 		$this->mFieldProperties['user_aim']->addMessage('maxlength', _AD_USER_ERROR_MAXLENGTH, _AD_USER_LANG_USER_AIM, '18');
@@ -125,9 +124,6 @@
 		$this->mFieldProperties['posts']->setDependsByArray(array('required'));
 		$this->mFieldProperties['posts']->addMessage('required', _AD_USER_ERROR_REQUIRED, _AD_USER_LANG_POSTS);
 
-		$this->mFieldProperties['attachsig'] =& new XCube_FieldProperty($this);
-//		$this->mFieldProperties['attachsig']->setDependsByArray(array(''));
-
 		$this->mFieldProperties['rank'] =& new XCube_FieldProperty($this);
 		$this->mFieldProperties['rank']->setDependsByArray(array('required'));
 		$this->mFieldProperties['rank']->addMessage('required', _AD_USER_ERROR_REQUIRED, _AD_USER_LANG_RANK);
@@ -170,16 +166,10 @@
 		$this->mFieldProperties['user_occ']->addMessage('maxlength', _AD_USER_ERROR_MAXLENGTH, _AD_USER_LANG_USER_OCC, '100');
 		$this->mFieldProperties['user_occ']->addVar('maxlength', 100);
 
-		$this->mFieldProperties['bio'] =& new XCube_FieldProperty($this);
-//		$this->mFieldProperties['bio']->setDependsByArray(array(''));
-
 		$this->mFieldProperties['user_intrest'] =& new XCube_FieldProperty($this);
 		$this->mFieldProperties['user_intrest']->setDependsByArray(array('maxlength'));
 		$this->mFieldProperties['user_intrest']->addMessage('maxlength', _AD_USER_ERROR_MAXLENGTH, _AD_USER_LANG_USER_INTREST, '150');
 		$this->mFieldProperties['user_intrest']->addVar('maxlength', 150);
-
-		$this->mFieldProperties['user_mailok'] =& new XCube_FieldProperty($this);
-//		$this->mFieldProperties['user_mailok']->setDependsByArray(array(''));
 	}
 	
 	function validateUname()
@@ -196,6 +186,16 @@
 		}
 	}
 	
+	function validateUrl()
+	{
+		$t_url = $this->get('url');
+		if (strlen($t_url) > 0) {
+			if (!preg_match('/^https?(:\/\/[-_.!~*\'()a-zA-Z0-9;\/?:\@&=+\$,%#]+)$', $t_url)) {
+				$this->addErrorMessage(XCube_Utils::formatMessage(_AD_USER_ERROR_INJURY, _AD_USER_LANG_URL));
+			}
+		}
+	}
+	
 	function validateGroups()
 	{
 		$groupHandler =& xoops_gethandler('group');
@@ -221,6 +221,23 @@
 		}
 	}
 	
+	function validateRank()
+	{
+		$t_rank = $this->get('rank');
+		
+		if ($t_rank > 0) {
+			$handler =& xoops_getmodulehandler('ranks', 'user');
+			$rank =& $handler->get($t_rank);
+			
+			if (!is_object($rank)) {
+				$this->addErrorMessage(XCube_Utils::formatMessage(_AD_USER_ERROR_INJURY, _AD_USER_LANG_RANK));
+			}
+			elseif ($rank->get('rank_special') != 1) {
+				$this->addErrorMessage(XCube_Utils::formatMessage(_AD_USER_ERROR_INJURY, _AD_USER_LANG_RANK));
+			}
+		}
+	}
+	
 	function validateUmode()
 	{
 		if (!in_array($this->get('umode'), array('nest', 'flat', 'thread'))) {
@@ -268,37 +285,36 @@
 
 	function update(&$obj)
 	{
-		$obj->setVar('uid', $this->get('uid'));
-		$obj->setVar('name', $this->get('name'));
-		$obj->setVar('uname', $this->get('uname'));
-		$obj->setVar('email', $this->get('email'));
-		$obj->setVar('url', $this->get('url'));
-		$obj->setVar('user_icq', $this->get('user_icq'));
-		$obj->setVar('user_from', $this->get('user_from'));
-		$obj->setVar('user_sig', $this->get('user_sig'));
-		$obj->setVar('user_viewemail', $this->get('user_viewemail'));
-		$obj->setVar('user_aim', $this->get('user_aim'));
-		$obj->setVar('user_yim', $this->get('user_yim'));
-		$obj->setVar('user_msnm', $this->get('user_msnm'));
+		$obj->set('uid', $this->get('uid'));
+		$obj->set('name', $this->get('name'));
+		$obj->set('uname', $this->get('uname'));
+		$obj->set('email', $this->get('email'));
+		$obj->set('url', $this->get('url'));
+		$obj->set('user_icq', $this->get('user_icq'));
+		$obj->set('user_from', $this->get('user_from'));
+		$obj->set('user_sig', $this->get('user_sig'));
+		$obj->set('user_viewemail', $this->get('user_viewemail'));
+		$obj->set('user_aim', $this->get('user_aim'));
+		$obj->set('user_yim', $this->get('user_yim'));
+		$obj->set('user_msnm', $this->get('user_msnm'));
 
 		if (strlen($this->get('pass'))) {
 			$obj->set('pass', md5($this->get('pass')));
 		}
 
-		$obj->setVar('posts', $this->get('posts'));
-		$obj->setVar('attachsig', $this->get('attachsig'));
-		$obj->setVar('rank', $this->get('rank'));
-		$obj->setVar('level', $this->get('level'));
-		$obj->setVar('timezone_offset', $this->get('timezone_offset'));
-		$obj->setVar('umode', $this->get('umode'));
-		$obj->setVar('uorder', $this->get('uorder'));
-		$obj->setVar('notify_method', $this->get('notify_method'));
-		$obj->setVar('notify_mode', $this->get('notify_mode'));
-		$obj->setVar('user_occ', $this->get('user_occ'));
-		$obj->setVar('bio', $this->get('bio'));
-		$obj->setVar('user_intrest', $this->get('user_intrest'));
-		$obj->setVar('user_mailok', $this->get('user_mailok'));
-//		$obj->setVar('groups', $this->get('groups'));
+		$obj->set('posts', $this->get('posts'));
+		$obj->set('attachsig', $this->get('attachsig'));
+		$obj->set('rank', $this->get('rank'));
+		$obj->set('level', $this->get('level'));
+		$obj->set('timezone_offset', $this->get('timezone_offset'));
+		$obj->set('umode', $this->get('umode'));
+		$obj->set('uorder', $this->get('uorder'));
+		$obj->set('notify_method', $this->get('notify_method'));
+		$obj->set('notify_mode', $this->get('notify_mode'));
+		$obj->set('user_occ', $this->get('user_occ'));
+		$obj->set('bio', $this->get('bio'));
+		$obj->set('user_intrest', $this->get('user_intrest'));
+		$obj->set('user_mailok', $this->get('user_mailok'));
 		
 		$obj->Groups = array();
 		$groups = $this->get('groups');


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