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

Back to archive index

NobuNobu nobun****@users*****
2007年 4月 30日 (月) 16:38:50 JST


Index: xoops2jp/html/modules/user/forms/AbstractUserEditForm.class.php
diff -u /dev/null xoops2jp/html/modules/user/forms/AbstractUserEditForm.class.php:1.1.4.1
--- /dev/null	Mon Apr 30 16:38:50 2007
+++ xoops2jp/html/modules/user/forms/AbstractUserEditForm.class.php	Mon Apr 30 16:38:50 2007
@@ -0,0 +1,126 @@
+<?php
+
+if (!defined('XOOPS_ROOT_PATH')) exit();
+
+require_once XOOPS_ROOT_PATH . "/core/XCube_ActionForm.class.php";
+
+/**
+ * This class is generated by makeActionForm tool.
+ */
+class User_AbstractUserEditForm extends XCube_ActionForm
+{
+	var $mConfig = null;
+	
+	function User_AbstractUserEditForm($userConfig)
+	{
+		parent::XCube_ActionForm();
+		$this->mConfig = $userConfig;
+	}
+	
+	function validateUname()
+	{
+		if($this->get('uname')) {
+			//
+			// uname unique check
+			//
+			$userHandler=&xoops_gethandler('user');
+			$criteria =& new CriteriaCompo(new Criteria('uname', $this->get('uname')));
+			if ($this->get('uid') > 0) {
+				$criteria->add(new Criteria('uid', $this->get('uid'), '<>'));
+			}
+			if ($userHandler->getCount($criteria) > 0) {
+				$this->addErrorMessage(_MD_USER_LANG_NICKNAMETAKEN);
+			}
+
+			//
+			// Check allow uname string pattern.
+			//
+			$regex="";
+			switch($this->mConfig['uname_test_level']) {
+				case 0:
+					$regex="/[^a-zA-Z0-9\_\-]/";
+					break;
+
+				case 1:
+					$regex="/[^a-zA-Z0-9\_\-\<\>\,\.\$\%\#\@\!\\\'\"]/";
+					break;
+
+				case 2:
+					$regex="//[\000-\040]/";
+					break;
+			}
+			if(preg_match($regex,$this->get('uname'))) {
+				$this->addErrorMessage(_MD_USER_LANG_INVALIDNICKNAME);
+			}
+
+			//
+			// Check bad uname patterns.
+			//
+			foreach($this->mConfig['bad_unames'] as $t_uname) {
+				if(!empty($t_uname) && preg_match("/${t_uname}/i", $this->get('uname'))) {
+					$this->addErrorMessage(_MD_USER_LANG_NAMERESERVED);
+					break;
+				}
+			}
+		}
+	}
+	
+	function validateEmail()
+	{
+		if (strlen($this->get('email')) > 0) {
+			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);
+					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);
+			}
+		}
+	}
+
+	function validateTimezone_offset()
+	{
+		$handler =& xoops_gethandler('timezone');
+		$obj =& $handler->get($this->get('timezone_offset'));
+		if (!is_object($obj)) {
+			$this->addErrorMessage(_MD_USER_ERROR_TIMEZONE);
+		}
+	}
+	
+	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(_MD_USER_ERROR_INJURY, _MD_USER_LANG_URL));
+			}
+		}
+	}
+	
+	/**
+	 * @todo 'HANKAKU' check.
+	 */
+	function validatePass()
+	{
+		if (strlen($this->get('pass'))>0||strlen($this->get('vpass'))>0) {
+			if($this->get('pass')!=$this->get('vpass')) {
+				$this->addErrorMessage(_MD_USER_ERROR_PASSWORD);
+				$this->set('pass',null);	// reset
+				$this->set('vpass',null);
+			}
+		}
+	}
+}
+
+?>
Index: xoops2jp/html/modules/user/forms/AvatarEditForm.class.php
diff -u /dev/null xoops2jp/html/modules/user/forms/AvatarEditForm.class.php:1.1.4.1
--- /dev/null	Mon Apr 30 16:38:50 2007
+++ xoops2jp/html/modules/user/forms/AvatarEditForm.class.php	Mon Apr 30 16:38:50 2007
@@ -0,0 +1,102 @@
+<?php
+/**
+ * @package user
+ * @version $Id: AvatarEditForm.class.php,v 1.1.4.1 2007/04/30 07:38:50 nobunobu Exp $
+ */
+
+if (!defined('XOOPS_ROOT_PATH')) exit();
+
+require_once XOOPS_ROOT_PATH . "/core/XCube_ActionForm.class.php";
+
+/**
+ * This class is generated by makeActionForm tool.
+ */
+class User_AvatarEditForm extends XCube_ActionForm
+{
+	var $mOldAvatarFilename = null;
+	var $mFormFile = null;
+	
+	var $mWidth = 0;
+	var $mHeight = 0;
+	
+	function getTokenName()
+	{
+		return "module.user.AvatarEditForm.TOKEN" . $this->get('uid');
+	}
+
+	function prepare($width, $height, $maxfilesize)
+	{
+		$this->mWidth = $width;
+		$this->mHeight = $height;
+		
+		//
+		// Set form properties
+		//
+		$this->mFormProperties['uid'] =& new XCube_IntProperty('uid');
+		$this->mFormProperties['uploadavatar'] =& new XCube_ImageFileProperty('uploadavatar');
+
+		//
+		// Set field properties
+		//
+		$this->mFieldProperties['uploadavatar'] =& new XCube_FieldProperty($this);
+		$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);
+		$this->mFieldProperties['uploadavatar']->addVar('maxfilesize', $maxfilesize);
+	}
+
+	function validateUploadavatar()
+	{
+		if ($this->get('uploadavatar') != null) {
+			$formfile = $this->get('uploadavatar');
+			if ($formfile->getWidth() > $this->mWidth) {
+				$this->addErrorMessage(_MD_USER_ERROR_AVATAR_SIZE);
+			}
+			elseif ($formfile->getHeight() > $this->mHeight) {
+				$this->addErrorMessage(_MD_USER_ERROR_AVATAR_SIZE);
+			}
+		}
+	}
+	
+	function load(&$obj)
+	{
+		$this->set('uid', $obj->get('uid'));
+		$this->mOldAvatarFilename = $obj->get('user_avatar');
+	}
+
+	function update(&$obj)
+	{
+		$obj->set('uid', $this->get('uid'));
+		
+		$this->mFormFile = $this->get('uploadavatar');
+
+		if ($this->mFormFile != null) {
+		$this->mFormFile->setRandomToBodyName('cavt');
+		
+		$filename = $this->mFormFile->getFileName();
+		$this->mFormFile->setBodyName(substr($filename, 0, 25));
+		
+		$obj->set('user_avatar', $this->mFormFile->getFileName());	//< TODO
+	}
+	}
+	
+	/**
+	 * @return UserAvatarObject
+	 */
+	function createAvatar()
+	{
+		$avatar = null;
+		if ($this->mFormFile != null) {
+			$avatarHandler =& xoops_getmodulehandler('avatar', 'user');
+			$avatar =& $avatarHandler->create();
+			$avatar->set('avatar_file', $this->mFormFile->getFileName());
+			$avatar->set('avatar_mimetype', $this->mFormFile->getContentType());
+			$avatar->set('avatar_type', 'C');
+		}
+		
+		return $avatar;
+	}
+}
+
+?>
Index: xoops2jp/html/modules/user/forms/AvatarFilterForm.class.php
diff -u /dev/null xoops2jp/html/modules/user/forms/AvatarFilterForm.class.php:1.1.4.1
--- /dev/null	Mon Apr 30 16:38:50 2007
+++ xoops2jp/html/modules/user/forms/AvatarFilterForm.class.php	Mon Apr 30 16:38:50 2007
@@ -0,0 +1,29 @@
+<?php
+/**
+ * @package user
+ * @version $Id: AvatarFilterForm.class.php,v 1.1.4.1 2007/04/30 07:38:50 nobunobu Exp $
+ */
+
+if (!defined('XOOPS_ROOT_PATH')) exit();
+
+require_once XOOPS_MODULE_PATH . "/user/class/AbstractFilterForm.class.php";
+
+/**
+ *  This filter does not have the sorting feature. To fetch the list of preset
+ * system avatars, it generates the criterion object which shows avatar_type
+ * is 'S' && the displaying flag is true.
+ */
+class User_AvatarFilterForm extends User_AbstractFilterForm
+{
+	var $mSort = 0;
+
+	function fetch()
+	{
+		parent::fetch();
+		
+		$this->_mCriteria->add(new Criteria('avatar_display', 1));
+		$this->_mCriteria->add(new Criteria('avatar_type', 'S'));
+	}
+}
+
+?>
Index: xoops2jp/html/modules/user/forms/AvatarSelectForm.class.php
diff -u /dev/null xoops2jp/html/modules/user/forms/AvatarSelectForm.class.php:1.1.4.1
--- /dev/null	Mon Apr 30 16:38:50 2007
+++ xoops2jp/html/modules/user/forms/AvatarSelectForm.class.php	Mon Apr 30 16:38:50 2007
@@ -0,0 +1,72 @@
+<?php
+/**
+ * @package user
+ * @version $Id: AvatarSelectForm.class.php,v 1.1.4.1 2007/04/30 07:38:50 nobunobu Exp $
+ */
+
+if (!defined('XOOPS_ROOT_PATH')) exit();
+
+require_once XOOPS_ROOT_PATH . "/core/XCube_ActionForm.class.php";
+
+class User_AvatarSelectForm extends XCube_ActionForm
+{
+	var $mSelectedId = null;
+	
+	function getTokenName()
+	{
+		return "module.user.AvatarSelectForm.TOKEN" . $this->get('uid');
+	}
+
+	function prepare()
+	{
+		$this->mFormProperties['uid'] =& new XCube_IntProperty('uid');
+		$this->mFormProperties['avatar_id'] =& new XCube_IntArrayProperty('avatar_id');
+	}
+	
+	function validateAvatar_id()
+	{
+		$ids = $this->get('avatar_id');
+		
+		if (count($ids) != 1) {
+			$this->addErrorMessage(_MD_USER_ERROR_AVATAR_SELECT);
+		}
+		
+		foreach ($ids as $avatar_id => $dmy_value) {
+			$this->mSelectedId = $avatar_id;
+		}
+		
+		if ($this->mSelectedId == 0) {
+			return;
+		}
+		
+		//
+		// Check whether specified avatar_id exists. 
+		//
+		$handler =& xoops_getmodulehandler('avatar', 'user');
+		$obj =& $handler->get($this->mSelectedId);
+		
+		if (!is_object($obj)) {
+			$this->addErrorMessage(_MD_USER_ERROR_AVATAR_SELECT);
+		}
+	}
+	
+	function load(&$obj)
+	{
+		$this->set('uid', $obj->get('uid'));
+	}
+	
+	function update(&$obj)
+	{
+		$handler =& xoops_getmodulehandler('avatar', 'user');
+		
+		if ($this->mSelectedId == 0) {
+			$obj->set('user_avatar', 'blank.gif');
+		}
+		else {
+			$avatar =& $handler->get($this->mSelectedId);
+			$obj->set('user_avatar', $avatar->get('avatar_file'));
+		}
+	}
+}
+
+?>
Index: xoops2jp/html/modules/user/forms/EditUserForm.class.php
diff -u /dev/null xoops2jp/html/modules/user/forms/EditUserForm.class.php:1.1.4.1
--- /dev/null	Mon Apr 30 16:38:50 2007
+++ xoops2jp/html/modules/user/forms/EditUserForm.class.php	Mon Apr 30 16:38:50 2007
@@ -0,0 +1,221 @@
+<?php
+
+if (!defined('XOOPS_ROOT_PATH')) exit();
+
+require_once XOOPS_MODULE_PATH . "/user/forms/AbstractUserEditForm.class.php";
+
+/**
+ * This class is generated by makeActionForm tool.
+ * @auchor makeActionForm
+ */
+class User_EditUserForm extends User_AbstractUserEditForm 
+{
+	function getTokenName()
+	{
+		return "Module.User.EditUserForm.Token." . $this->get('uid');
+	}
+	
+	/**
+	 * TODO The argument of this member property may be moved to constructor.
+	 */
+	function prepare()
+	{
+		parent::prepare();
+		
+		//
+		// set properties
+		//
+		$this->mFormProperties['uid'] =& new XCube_IntProperty('uid');
+		$this->mFormProperties['name'] =& new XCube_StringProperty('name');
+		
+		if ($this->mConfig['allow_chgmail']) {
+			$this->mFormProperties['email'] =& new XCube_StringProperty('email');
+		}
+
+		$this->mFormProperties['user_viewemail'] =& new XCube_BoolProperty('user_viewemail');
+		$this->mFormProperties['url'] =& new XCube_StringProperty('url');
+		$this->mFormProperties['user_icq'] =& new XCube_StringProperty('user_icq');
+		$this->mFormProperties['user_aim'] =& new XCube_StringProperty('user_aim');
+		$this->mFormProperties['user_yim'] =& new XCube_StringProperty('user_yim');
+		$this->mFormProperties['user_msnm'] =& new XCube_StringProperty('user_msnm');
+		$this->mFormProperties['user_from'] =& new XCube_StringProperty('user_from');
+		$this->mFormProperties['timezone_offset'] =& new XCube_FloatProperty('timezone_offset');
+		$this->mFormProperties['umode'] =& new XCube_StringProperty('umode');
+		$this->mFormProperties['uorder'] =& new XCube_IntProperty('uorder');
+		$this->mFormProperties['notify_method'] =& new XCube_IntProperty('notify_method');
+		$this->mFormProperties['notify_mode'] =& new XCube_IntProperty('notify_mode');
+		$this->mFormProperties['user_occ'] =& new XCube_StringProperty('user_occ');
+		$this->mFormProperties['user_intrest'] =& new XCube_StringProperty('user_intrest');
+		$this->mFormProperties['user_sig'] =& new XCube_TextProperty('user_sig');
+		$this->mFormProperties['attachsig'] =& new XCube_BoolProperty('attachsig');
+		$this->mFormProperties['bio'] =& new XCube_TextProperty('bio');
+		$this->mFormProperties['pass'] =& new XCube_StringProperty('pass');
+		$this->mFormProperties['vpass'] =& new XCube_StringProperty('vpass');
+		$this->mFormProperties['usercookie'] =& new XCube_BoolProperty('usercookie');
+		$this->mFormProperties['user_mailok'] =& new XCube_BoolProperty('user_mailok');
+
+		//
+		// set fields
+		//
+		$this->mFieldProperties['name'] =& new XCube_FieldProperty($this);
+		$this->mFieldProperties['name']->setDependsByArray(array('maxlength'));
+		$this->mFieldProperties['name']->addMessage("maxlength", _MD_USER_ERROR_MAXLENGTH, _MD_USER_LANG_NAME, "60");
+		$this->mFieldProperties['name']->addVar("maxlength", 60);
+
+		if ($this->mConfig['allow_chgmail']) {
+			$this->mFieldProperties['email'] =& new XCube_FieldProperty($this);
+			$this->mFieldProperties['email']->setDependsByArray(array('required', 'maxlength', 'email'));
+			$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, _MD_USER_LANG_EMAIL);
+		}
+
+		$this->mFieldProperties['url'] =& new XCube_FieldProperty($this);
+		$this->mFieldProperties['url']->setDependsByArray(array('maxlength'));
+		$this->mFieldProperties['url']->addMessage("maxlength", _MD_USER_ERROR_MAXLENGTH, _MD_USER_LANG_WEBSITE, "100");
+		$this->mFieldProperties['url']->addVar("maxlength", 100);
+
+		$this->mFieldProperties['user_icq'] =& new XCube_FieldProperty($this);
+		$this->mFieldProperties['user_icq']->setDependsByArray(array('maxlength'));
+		$this->mFieldProperties['user_icq']->addMessage("maxlength", _MD_USER_ERROR_MAXLENGTH, _MD_USER_LANG_USER_ICQ, "15");
+		$this->mFieldProperties['user_icq']->addVar("maxlength", 15);
+
+		$this->mFieldProperties['user_from'] =& new XCube_FieldProperty($this);
+		$this->mFieldProperties['user_from']->setDependsByArray(array('maxlength'));
+		$this->mFieldProperties['user_from']->addMessage("maxlength", _MD_USER_ERROR_MAXLENGTH, _MD_USER_LANG_USER_FROM, "100");
+		$this->mFieldProperties['user_from']->addVar("maxlength", 100);
+
+		$this->mFieldProperties['user_aim'] =& new XCube_FieldProperty($this);
+		$this->mFieldProperties['user_aim']->setDependsByArray(array('maxlength'));
+		$this->mFieldProperties['user_aim']->addMessage("maxlength", _MD_USER_ERROR_MAXLENGTH, _MD_USER_LANG_USER_AIM, "18");
+		$this->mFieldProperties['user_aim']->addVar("maxlength", 18);
+
+		$this->mFieldProperties['user_msnm'] =& new XCube_FieldProperty($this);
+		$this->mFieldProperties['user_msnm']->setDependsByArray(array('maxlength'));
+		$this->mFieldProperties['user_msnm']->addMessage("maxlength", _MD_USER_ERROR_MAXLENGTH, _MD_USER_LANG_USER_MSNM, "100");
+		$this->mFieldProperties['user_msnm']->addVar("maxlength", 100);
+		
+		$this->mFieldProperties['pass'] =& new XCube_FieldProperty($this);
+		$this->mFieldProperties['pass']->setDependsByArray(array('minlength', 'maxlength'));
+		$this->mFieldProperties['pass']->addMessage('minlength', _MD_USER_ERROR_MINLENGTH, _MD_USER_LANG_PASS, $this->mConfig['minpass']);
+		$this->mFieldProperties['pass']->addMessage('maxlength', _MD_USER_ERROR_MAXLENGTH, _MD_USER_LANG_PASS, '32');
+		$this->mFieldProperties['pass']->addVar('minlength', $this->mConfig['minpass']);
+		$this->mFieldProperties['pass']->addVar('maxlength', 32);
+
+		$this->mFieldProperties['vpass'] =& new XCube_FieldProperty($this);
+		$this->mFieldProperties['vpass']->setDependsByArray(array('maxlength'));
+		$this->mFieldProperties['vpass']->addMessage('maxlength', _MD_USER_ERROR_MAXLENGTH, _MD_USER_LANG_VERIFYPASS, '32');
+		$this->mFieldProperties['vpass']->addVar('maxlength', 32);
+		
+		$this->mFieldProperties['timezone_offset'] =& new XCube_FieldProperty($this);
+		$this->mFieldProperties['timezone_offset']->setDependsByArray(array('required'));
+		$this->mFieldProperties['timezone_offset']->addMessage('required', _MD_USER_ERROR_REQUIRED, _MD_USER_LANG_TIMEZONE_OFFSET);
+
+		$this->mFieldProperties['umode'] =& new XCube_FieldProperty($this);
+		$this->mFieldProperties['umode']->setDependsByArray(array('required'));
+		$this->mFieldProperties['umode']->addMessage('required', _MD_USER_ERROR_REQUIRED, _MD_USER_LANG_UMODE);
+
+		$this->mFieldProperties['uorder'] =& new XCube_FieldProperty($this);
+		$this->mFieldProperties['uorder']->setDependsByArray(array('required','intRange'));
+		$this->mFieldProperties['uorder']->addMessage('required', _MD_USER_ERROR_REQUIRED, _MD_USER_LANG_UORDER);
+		$this->mFieldProperties['uorder']->addMessage('intRange', _MD_USER_ERROR_INJURY, _MD_USER_LANG_UORDER);
+		$this->mFieldProperties['uorder']->addVar('min', 0);
+		$this->mFieldProperties['uorder']->addVar('max', 1);
+
+		$this->mFieldProperties['notify_method'] =& new XCube_FieldProperty($this);
+		$this->mFieldProperties['notify_method']->setDependsByArray(array('required','intRange'));
+		$this->mFieldProperties['notify_method']->addMessage('required', _MD_USER_ERROR_REQUIRED, _MD_USER_LANG_NOTIFY_METHOD);
+		$this->mFieldProperties['notify_method']->addMessage('intRange', _MD_USER_ERROR_INJURY, _MD_USER_LANG_NOTIFY_METHOD);
+		$this->mFieldProperties['notify_method']->addVar('min', 0);
+		$this->mFieldProperties['notify_method']->addVar('max', 2);
+
+		$this->mFieldProperties['notify_mode'] =& new XCube_FieldProperty($this);
+		$this->mFieldProperties['notify_mode']->setDependsByArray(array('required','intRange'));
+		$this->mFieldProperties['notify_mode']->addMessage('required', _MD_USER_ERROR_REQUIRED, _MD_USER_LANG_NOTIFY_MODE);
+		$this->mFieldProperties['notify_mode']->addMessage('intRange', _MD_USER_ERROR_INJURY, _MD_USER_LANG_NOTIFY_MODE);
+		$this->mFieldProperties['notify_mode']->addVar('min', 0);
+		$this->mFieldProperties['notify_mode']->addVar('max', 2);
+		
+		$this->mFieldProperties['user_occ'] =& new XCube_FieldProperty($this);
+		$this->mFieldProperties['user_occ']->setDependsByArray(array('maxlength'));
+		$this->mFieldProperties['user_occ']->addMessage('maxlength', _MD_USER_ERROR_MAXLENGTH, _MD_USER_LANG_USER_OCC, '100');
+		$this->mFieldProperties['user_occ']->addVar('maxlength', 100);
+
+		$this->mFieldProperties['user_intrest'] =& new XCube_FieldProperty($this);
+		$this->mFieldProperties['user_intrest']->setDependsByArray(array('maxlength'));
+		$this->mFieldProperties['user_intrest']->addMessage('maxlength', _MD_USER_ERROR_MAXLENGTH, _MD_USER_LANG_USER_INTREST, '150');
+		$this->mFieldProperties['user_intrest']->addVar('maxlength', 150);
+	}
+	
+	function load(&$obj)
+	{
+		$this->set('uid', $obj->get('uid'));
+		$this->set('name', $obj->get('name'));
+		
+		if ($this->mConfig['allow_chgmail']) {
+			$this->set('email', $obj->get('email'));
+		}
+
+		$this->set('url', $obj->get('url'));
+		$this->set('user_icq', $obj->get('user_icq'));
+		$this->set('user_from', $obj->get('user_from'));
+		$this->set('user_sig', $obj->get('user_sig'));
+		$this->set('user_viewemail', $obj->get('user_viewemail'));
+		$this->set('user_aim', $obj->get('user_aim'));
+		$this->set('user_yim', $obj->get('user_yim'));
+		$this->set('user_msnm', $obj->get('user_msnm'));
+
+		$this->set('attachsig', $obj->get('attachsig'));
+		$this->set('timezone_offset', $obj->get('timezone_offset'));
+		$this->set('umode', $obj->get('umode'));
+		$this->set('uorder', $obj->get('uorder'));
+		$this->set('notify_method', $obj->get('notify_method'));
+		$this->set('notify_mode', $obj->get('notify_mode'));
+		$this->set('user_occ', $obj->get('user_occ'));
+		$this->set('bio', $obj->get('bio'));
+		$this->set('user_intrest', $obj->get('user_intrest'));
+		$this->set('user_mailok', $obj->get('user_mailok'));
+		
+		$this->set('pass', null);
+		$this->set('vpass', null);
+		
+		$root =& XCube_Root::getSingleton();
+		$this->set('usercookie', empty($_COOKIE[$this->mConfig['usercookie']]) ? 0 : 1);
+	}
+	
+	function update(&$obj)
+	{
+		$obj->set('name', $this->get('name'));
+		
+		if ($this->mConfig['allow_chgmail']) {
+			$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->set('attachsig', $this->get('attachsig'));
+		$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'));
+	}
+}
+
+?>
Index: xoops2jp/html/modules/user/forms/LostPassEditForm.class.php
diff -u /dev/null xoops2jp/html/modules/user/forms/LostPassEditForm.class.php:1.1.4.1
--- /dev/null	Mon Apr 30 16:38:50 2007
+++ xoops2jp/html/modules/user/forms/LostPassEditForm.class.php	Mon Apr 30 16:38:50 2007
@@ -0,0 +1,39 @@
+<?php
+/**
+ * @package user
+ * @version $Id: LostPassEditForm.class.php,v 1.1.4.1 2007/04/30 07:38:50 nobunobu Exp $
+ */
+
+if (!defined('XOOPS_ROOT_PATH')) exit();
+
+require_once XOOPS_ROOT_PATH . "/core/XCube_ActionForm.class.php";
+
+/**
+ * This class is generated by makeActionForm tool.
+ */
+class User_LostPassEditForm extends XCube_ActionForm
+{
+	function getTokenName()
+	{
+		return "module.user.LostPassEditForm.TOKEN";
+	}
+
+	function prepare()
+	{
+		//
+		// Set form properties
+		//
+		$this->mFormProperties['email'] =& new XCube_StringProperty('email');
+		$this->mFormProperties['code'] =& new XCube_StringProperty('code');
+
+		//
+		// Set field properties
+		//
+		$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, _MD_USER_LANG_EMAIL);
+	}
+}
+
+?>
Index: xoops2jp/html/modules/user/forms/OnlineFilterForm.class.php
diff -u /dev/null xoops2jp/html/modules/user/forms/OnlineFilterForm.class.php:1.1.4.1
--- /dev/null	Mon Apr 30 16:38:50 2007
+++ xoops2jp/html/modules/user/forms/OnlineFilterForm.class.php	Mon Apr 30 16:38:50 2007
@@ -0,0 +1,39 @@
+<?php
+
+if (!defined('XOOPS_ROOT_PATH')) exit();
+
+require_once XOOPS_MODULE_PATH . "/user/class/AbstractFilterForm.class.php";
+
+define('ONLINE_SORT_KEY_ONLINE_UID', 1);
+define('ONLINE_SORT_KEY_ONLINE_UNAME', 2);
+define('ONLINE_SORT_KEY_ONLINE_UPDATED', 3);
+define('ONLINE_SORT_KEY_ONLINE_MODULE', 4);
+define('ONLINE_SORT_KEY_ONLINE_IP', 5);
+define('ONLINE_SORT_KEY_MAXVALUE', 5);
+
+define('ONLINE_SORT_KEY_DEFAULT', ONLINE_SORT_KEY_ONLINE_UID);
+
+class User_OnlineFilterForm extends User_AbstractFilterForm
+{
+	var $mSortKeys = array(
+		ONLINE_SORT_KEY_ONLINE_UID => 'online_uid',
+		ONLINE_SORT_KEY_ONLINE_UNAME => 'online_uname',
+		ONLINE_SORT_KEY_ONLINE_UPDATED => 'online_updated',
+		ONLINE_SORT_KEY_ONLINE_MODULE => 'online_module',
+		ONLINE_SORT_KEY_ONLINE_IP => 'online_ip'
+	);
+	
+	function getDefaultSortKey()
+	{
+		return ONLINE_SORT_KEY_DEFAULT;
+	}
+
+	function fetch()
+	{
+		parent::fetch();
+
+		$this->_mCriteria->addSort($this->getSort(), $this->getOrder());
+	}
+}
+
+?>
Index: xoops2jp/html/modules/user/forms/UserConfirmForm.class.php
diff -u /dev/null xoops2jp/html/modules/user/forms/UserConfirmForm.class.php:1.1.4.1
--- /dev/null	Mon Apr 30 16:38:50 2007
+++ xoops2jp/html/modules/user/forms/UserConfirmForm.class.php	Mon Apr 30 16:38:50 2007
@@ -0,0 +1,27 @@
+<?php
+/**
+ * @package user
+ * @version $Id: UserConfirmForm.class.php,v 1.1.4.1 2007/04/30 07:38:50 nobunobu Exp $
+ */
+
+if (!defined('XOOPS_ROOT_PATH')) exit();
+
+require_once XOOPS_ROOT_PATH . "/core/XCube_ActionForm.class.php";
+
+/**
+ * This class is generated by makeActionForm tool.
+ * @auchor makeActionForm
+ */
+class User_UserConfirmForm extends XCube_ActionForm 
+{
+	function getTokenName()
+	{
+		return "module.user.UserConfirmForm.TOKEN";
+	}
+
+	function prepare()
+	{
+	}
+}
+
+?>
\ No newline at end of file
Index: xoops2jp/html/modules/user/forms/UserDeleteForm.class.php
diff -u /dev/null xoops2jp/html/modules/user/forms/UserDeleteForm.class.php:1.1.4.1
--- /dev/null	Mon Apr 30 16:38:50 2007
+++ xoops2jp/html/modules/user/forms/UserDeleteForm.class.php	Mon Apr 30 16:38:50 2007
@@ -0,0 +1,20 @@
+<?php
+
+if (!defined('XOOPS_ROOT_PATH')) exit();
+
+require_once XOOPS_ROOT_PATH . "/core/XCube_ActionForm.class.php";
+require_once XOOPS_MODULE_PATH . "/legacy/class/Legacy_Validator.class.php";
+
+class User_UserDeleteForm extends XCube_ActionForm
+{
+	function getTokenName()
+	{
+		return "module.user.UserDeleteForm.TOKEN";
+	}
+
+	function prepare()
+	{
+	}
+}
+
+?>
Index: xoops2jp/html/modules/user/forms/UserRegisterEditForm.class.php
diff -u /dev/null xoops2jp/html/modules/user/forms/UserRegisterEditForm.class.php:1.1.4.1
--- /dev/null	Mon Apr 30 16:38:50 2007
+++ xoops2jp/html/modules/user/forms/UserRegisterEditForm.class.php	Mon Apr 30 16:38:50 2007
@@ -0,0 +1,118 @@
+<?php
+
+if (!defined('XOOPS_ROOT_PATH')) exit();
+
+require_once dirname(__FILE__) . "/AbstractUserEditForm.class.php";
+
+/**
+ * This class is generated by makeActionForm tool.
+ */
+class User_RegisterEditForm extends User_AbstractUserEditForm
+{
+	function getTokenName()
+	{
+		return "module.user.UserRegisterEditForm.TOKEN";
+	}
+
+	function prepare()
+	{
+		parent::prepare();
+		//
+		// Set form properties
+		//
+		$this->mFormProperties['uname'] =& new XCube_StringProperty('uname');
+		$this->mFormProperties['email'] =& new XCube_StringProperty('email');
+		$this->mFormProperties['user_viewemail'] =& new XCube_BoolProperty('user_viewemail');
+		$this->mFormProperties['url'] =& new XCube_StringProperty('url');
+		$this->mFormProperties['timezone_offset'] =& new XCube_FloatProperty('timezone_offset');
+		$this->mFormProperties['pass'] =& new XCube_StringProperty('pass');
+		$this->mFormProperties['vpass'] =& new XCube_StringProperty('vpass');
+		$this->mFormProperties['user_mailok'] =& new XCube_BoolProperty('user_mailok');
+		$this->mFormProperties['agree'] =& new XCube_BoolProperty('agree');
+		$this->mFormProperties['actkey']=new XCube_StringProperty('actkey');
+		$this->mFormProperties['user_regdate']=new XCube_IntProperty('user_regdate');
+
+		//
+		// Set field properties
+		//
+		$this->mFieldProperties['uname'] =& new XCube_FieldProperty($this);
+		$this->mFieldProperties['uname']->setDependsByArray(array('required', 'maxlength', 'minlength'));
+		$this->mFieldProperties['uname']->addMessage('required', _MD_USER_ERROR_REQUIRED, _MD_USER_LANG_UNAME, '25');
+		$this->mFieldProperties['uname']->addMessage('maxlength', _MD_USER_ERROR_MAXLENGTH, _MD_USER_LANG_UNAME, min(25,$this->mConfig['maxuname']));
+		$this->mFieldProperties['uname']->addMessage('minlength', _MD_USER_ERROR_MINLENGTH, _MD_USER_LANG_UNAME, $this->mConfig['minuname']);
+		$this->mFieldProperties['uname']->addVar('maxlength', min(25,$this->mConfig['maxuname']));
+		$this->mFieldProperties['uname']->addVar('minlength', $this->mConfig['minuname']);
+
+		$this->mFieldProperties['email'] =& new XCube_FieldProperty($this);
+		$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']->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, _MD_USER_LANG_EMAIL);
+
+		$this->mFieldProperties['url'] =& new XCube_FieldProperty($this);
+		$this->mFieldProperties['url']->setDependsByArray(array('maxlength'));
+		$this->mFieldProperties['url']->addMessage('maxlength', _MD_USER_ERROR_MAXLENGTH, _MD_USER_LANG_URL, '100');
+		$this->mFieldProperties['url']->addVar('maxlength', 100);
+
+		$this->mFieldProperties['pass'] =& new XCube_FieldProperty($this);
+		$this->mFieldProperties['pass']->setDependsByArray(array('required', 'minlength', 'maxlength'));
+		$this->mFieldProperties['pass']->addMessage('required', _MD_USER_ERROR_REQUIRED, _MD_USER_LANG_PASS, '32');
+		$this->mFieldProperties['pass']->addMessage('minlength', _MD_USER_ERROR_MINLENGTH, _MD_USER_LANG_PASS, $this->mConfig['minpass']);
+		$this->mFieldProperties['pass']->addMessage('maxlength', _MD_USER_ERROR_MAXLENGTH, _MD_USER_LANG_PASS, '32');
+		$this->mFieldProperties['pass']->addVar('minlength', $this->mConfig['minpass']);
+		$this->mFieldProperties['pass']->addVar('maxlength', 32);
+
+		$this->mFieldProperties['vpass'] =& new XCube_FieldProperty($this);
+		$this->mFieldProperties['vpass']->setDependsByArray(array('required', 'maxlength'));
+		$this->mFieldProperties['vpass']->addMessage('required', _MD_USER_ERROR_REQUIRED, _MD_USER_LANG_VERIFYPASS, '32');
+		$this->mFieldProperties['vpass']->addMessage('maxlength', _MD_USER_ERROR_MAXLENGTH, _MD_USER_LANG_VERIFYPASS, '32');
+		$this->mFieldProperties['vpass']->addVar('maxlength', 32);
+
+		$this->mFieldProperties['timezone_offset'] =& new XCube_FieldProperty($this);
+		$this->mFieldProperties['timezone_offset']->setDependsByArray(array('required'));
+		$this->mFieldProperties['timezone_offset']->addMessage('required', _MD_USER_ERROR_REQUIRED, _MD_USER_LANG_TIMEZONE_OFFSET);
+	}
+
+	function load(&$obj)
+	{
+	}
+
+	function update(&$obj)
+	{
+		$obj->set('uname', $this->get('uname'));
+		$obj->set('email', $this->get('email'));
+		$obj->set('user_viewemail', $this->get('user_viewemail'));
+		$obj->set('url', $this->get('url'));
+		$obj->set('user_avatar','blank.gif',true);
+		$obj->set('timezone_offset', $this->get('timezone_offset'));
+		$obj->set('pass', md5($this->get('pass')));
+		$obj->set('user_mailok', $this->get('user_mailok'));
+		$obj->set('agree', $this->get('agree'));
+
+		$actkey=substr(md5(uniqid(mt_rand(),1)),0,8);
+        $obj->set('actkey',$actkey,true);
+        $obj->set('user_regdate',time(),true);
+	}
+}
+
+class User_RegisterAgreeEditForm extends User_RegisterEditForm 
+{
+	function prepare()
+	{
+		parent::prepare();
+		
+		// set properties
+		$this->mFormProperties['agree']=new XCube_IntProperty('agree');
+
+		// set fields
+		$this->mFieldProperties['agree']=new XCube_FieldProperty($this);
+		$this->mFieldProperties['agree']->setDependsByArray(array('required','intRange'));
+		$this->mFieldProperties['agree']->addMessage("required",_MD_USER_ERROR_UNEEDAGREE);
+		$this->mFieldProperties['agree']->addMessage("intRange",_MD_USER_ERROR_UNEEDAGREE);
+		$this->mFieldProperties['agree']->addVar("min",1);
+		$this->mFieldProperties['agree']->addVar("max",1);
+	}
+}
+
+?>
Index: xoops2jp/html/modules/user/forms/index.html
diff -u /dev/null xoops2jp/html/modules/user/forms/index.html:1.1.4.1
--- /dev/null	Mon Apr 30 16:38:50 2007
+++ xoops2jp/html/modules/user/forms/index.html	Mon Apr 30 16:38:50 2007
@@ -0,0 +1 @@
+ <script>history.go(-1);</script>
\ No newline at end of file


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