Minahito
minah****@users*****
2006年 7月 19日 (水) 19:21:26 JST
Index: xoops2jp/html/modules/user/forms/LostPassEditForm.class.php diff -u xoops2jp/html/modules/user/forms/LostPassEditForm.class.php:1.1.2.2 xoops2jp/html/modules/user/forms/LostPassEditForm.class.php:1.1.2.3 --- xoops2jp/html/modules/user/forms/LostPassEditForm.class.php:1.1.2.2 Tue Mar 28 22:32:19 2006 +++ xoops2jp/html/modules/user/forms/LostPassEditForm.class.php Wed Jul 19 19:21:25 2006 @@ -1,4 +1,8 @@ <?php +/** + * @package user + * @version $Id: LostPassEditForm.class.php,v 1.1.2.3 2006/07/19 10:21:25 minahito Exp $ + */ if (!defined('XOOPS_ROOT_PATH')) exit(); @@ -7,7 +11,7 @@ /** * This class is generated by makeActionForm tool. */ -class LostPassEditForm extends XCube_ActionForm +class User_LostPassEditForm extends XCube_ActionForm { function getTokenName() { @@ -21,21 +25,14 @@ // $this->mFormProperties['email'] =& new XCube_StringProperty('email'); $this->mFormProperties['code'] =& new XCube_StringProperty('code'); - $this->mFormProperties['newpass'] =& new XCube_StringProperty('newpass'); // // Set field properties // $this->mFieldProperties['email'] =& new XCube_FieldProperty($this); - $this->mFieldProperties['email']->setDependsByArray(array('required')); + $this->mFieldProperties['email']->setDependsByArray(array('required', 'email')); $this->mFieldProperties['email']->addMessage('required', _MD_USER_ERROR_REQUIRED, _MD_USER_LANG_EMAIL); - } - - function validateEmail() - { - if ($this->get('email') != null && !preg_match("/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+([\.][a-z0-9-]+)+$/i",$this->get('email'))) { - $this->addErrorMessage(_MD_USER_ERROR_EMAIL_FORMAT); - } + $this->mFieldProperties['email']->addMessage('email', _MD_USER_ERROR_EMAIL_FORMAT); } } Index: xoops2jp/html/modules/user/forms/AvatarSelectForm.class.php diff -u xoops2jp/html/modules/user/forms/AvatarSelectForm.class.php:1.1.2.2 xoops2jp/html/modules/user/forms/AvatarSelectForm.class.php:1.1.2.3 --- xoops2jp/html/modules/user/forms/AvatarSelectForm.class.php:1.1.2.2 Tue Mar 28 22:32:19 2006 +++ xoops2jp/html/modules/user/forms/AvatarSelectForm.class.php Wed Jul 19 19:21:25 2006 @@ -1,4 +1,8 @@ <?php +/** + * @package user + * @version $Id: AvatarSelectForm.class.php,v 1.1.2.3 2006/07/19 10:21:25 minahito Exp $ + */ if (!defined('XOOPS_ROOT_PATH')) exit(); @@ -10,7 +14,7 @@ function getTokenName() { - return "module.user.AvatarSelectForm.TOKEN"; + return "module.user.AvatarSelectForm.TOKEN" . $this->get('uid'); } function prepare() Index: xoops2jp/html/modules/user/forms/EditUserForm.class.php diff -u xoops2jp/html/modules/user/forms/EditUserForm.class.php:1.1.2.10 xoops2jp/html/modules/user/forms/EditUserForm.class.php:1.1.2.11 --- xoops2jp/html/modules/user/forms/EditUserForm.class.php:1.1.2.10 Tue Mar 28 22:32:19 2006 +++ xoops2jp/html/modules/user/forms/EditUserForm.class.php Wed Jul 19 19:21:25 2006 @@ -2,140 +2,215 @@ if (!defined('XOOPS_ROOT_PATH')) exit(); -require_once XOOPS_ROOT_PATH."/class/XCube_ActionForm.class.php"; +require_once XOOPS_MODULE_PATH . "/user/forms/AbstractUserEditForm.class.php"; /** * This class is generated by makeActionForm tool. * @auchor makeActionForm */ -class EditUserForm extends XCube_ActionForm +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'); - $this->mFormProperties['email']=new XCube_StringProperty('email'); - $this->mFormProperties['user_viewemail']=new XCube_IntProperty('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['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_IntProperty('attachsig'); - $this->mFormProperties['bio']=new XCube_TextProperty('bio'); - $this->mFormProperties['pass']=new XCube_StringProperty('pass'); - $this->mFormProperties['vpass']=new XCube_StringProperty('vpass'); - $this->mFormProperties['user_mailok']=new XCube_IntProperty('user_mailok'); + // + $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['user_mailok'] =& new XCube_BoolProperty('user_mailok'); + + // // set fields - $this->mFieldProperties['name']=new XCube_FieldProperty($this); + // + $this->mFieldProperties['name'] =& new XCube_FieldProperty($this); $this->mFieldProperties['name']->setDependsByArray(array('maxlength')); - $this->mFieldProperties['name']->addMessage("maxlength",_MD_USER_ERROR_MAXLENGTH,_US_REALNAME,"60"); - $this->mFieldProperties['name']->addVar("maxlength",60); + $this->mFieldProperties['name']->addMessage("maxlength", _MD_USER_ERROR_MAXLENGTH, _US_REALNAME, "60"); + $this->mFieldProperties['name']->addVar("maxlength", 60); - $this->mFieldProperties['email']=new XCube_FieldProperty($this); - $this->mFieldProperties['email']->setDependsByArray(array('required','maxlength')); - $this->mFieldProperties['email']->addMessage("required",_MD_USER_ERROR_REQUIRED,_US_EMAIL,"60"); - $this->mFieldProperties['email']->addMessage("maxlength",_MD_USER_ERROR_MAXLENGTH,_US_EMAIL,"60"); - $this->mFieldProperties['email']->addVar("maxlength",60); - - $this->mFieldProperties['user_viewemail']=new XCube_FieldProperty($this); - $this->mFieldProperties['user_viewemail']->setDependsByArray(array('intRange')); - $this->mFieldProperties['user_viewemail']->addMessage("intRange",_MD_USER_ERROR_INTRANGE,"user_viewemail"); - $this->mFieldProperties['user_viewemail']->addVar("min",0); - $this->mFieldProperties['user_viewemail']->addVar("max",1); + 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, _US_EMAIL, "60"); + $this->mFieldProperties['email']->addMessage("maxlength", _MD_USER_ERROR_MAXLENGTH, _US_EMAIL, "60"); + $this->mFieldProperties['email']->addVar("maxlength", 60); + $this->mFieldProperties['email']->addMessage('email', _MD_USER_ERROR_EMAIL_FORMAT); + } - $this->mFieldProperties['url']=new XCube_FieldProperty($this); + $this->mFieldProperties['url'] =& new XCube_FieldProperty($this); $this->mFieldProperties['url']->setDependsByArray(array('maxlength')); - $this->mFieldProperties['url']->addMessage("maxlength",_MD_USER_ERROR_MAXLENGTH,_US_WEBSITE,"100"); - $this->mFieldProperties['url']->addVar("maxlength",100); + $this->mFieldProperties['url']->addMessage("maxlength", _MD_USER_ERROR_MAXLENGTH, _US_WEBSITE, "100"); + $this->mFieldProperties['url']->addVar("maxlength", 100); - $this->mFieldProperties['user_icq']=new XCube_FieldProperty($this); + $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,_US_ICQ,"15"); - $this->mFieldProperties['user_icq']->addVar("maxlength",15); + $this->mFieldProperties['user_icq']->addMessage("maxlength", _MD_USER_ERROR_MAXLENGTH, _US_ICQ, "15"); + $this->mFieldProperties['user_icq']->addVar("maxlength", 15); - $this->mFieldProperties['user_from']=new XCube_FieldProperty($this); + $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,_US_LOCATION,"100"); - $this->mFieldProperties['user_from']->addVar("maxlength",100); + $this->mFieldProperties['user_from']->addMessage("maxlength", _MD_USER_ERROR_MAXLENGTH, _US_LOCATION, "100"); + $this->mFieldProperties['user_from']->addVar("maxlength", 100); - $this->mFieldProperties['user_aim']=new XCube_FieldProperty($this); + $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,_US_AIM,"18"); - $this->mFieldProperties['user_aim']->addVar("maxlength",18); + $this->mFieldProperties['user_aim']->addMessage("maxlength", _MD_USER_ERROR_MAXLENGTH, _US_AIM, "18"); + $this->mFieldProperties['user_aim']->addVar("maxlength", 18); - $this->mFieldProperties['user_msnm']=new XCube_FieldProperty($this); + $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,_US_MSNM,"100"); - $this->mFieldProperties['user_msnm']->addVar("maxlength",100); - - $this->mFieldProperties['attachsig']=new XCube_FieldProperty($this); - $this->mFieldProperties['attachsig']->setDependsByArray(array('intRange')); - $this->mFieldProperties['attachsig']->addMessage("intRange",_MD_USER_ERROR_INTRANGE,"attachsig"); - $this->mFieldProperties['attachsig']->addVar("min",0); - $this->mFieldProperties['attachsig']->addVar("max",1); - - $this->mFieldProperties['user_mailok']=new XCube_FieldProperty($this); - $this->mFieldProperties['user_mailok']->setDependsByArray(array('intRange')); - $this->mFieldProperties['user_mailok']->addMessage("intRange",_MD_USER_ERROR_INTRANGE,"user_mailok"); - $this->mFieldProperties['user_mailok']->addVar("min",0); - $this->mFieldProperties['user_mailok']->addVar("max",1); - } - - function validatePass() - { - if(strlen($this->getVar('pass'))>0||strlen($this->getVar('vpass'))>0) - if($this->getVar('pass')!=$this->getVar('vpass')) { - $this->addErrorMessage(_MD_USER_ERROR_PASSWORD); - $this->set('pass',null); // reset - $this->set('vpass',null); - } + $this->mFieldProperties['user_msnm']->addMessage("maxlength", _MD_USER_ERROR_MAXLENGTH, _US_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, _US_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, _US_CDISPLAYMODE); + + $this->mFieldProperties['uorder'] =& new XCube_FieldProperty($this); + $this->mFieldProperties['uorder']->setDependsByArray(array('required','intRange')); + $this->mFieldProperties['uorder']->addMessage('required', _MD_USER_ERROR_REQUIRED, _US_CSORTORDER); + $this->mFieldProperties['uorder']->addMessage('intRange', _MD_USER_ERROR_INJURY, _US_CSORTORDER); + $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, _US_OCCUPATION, '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, _US_INTEREST, '150'); + $this->mFieldProperties['user_intrest']->addVar('maxlength', 150); } - function load(&$user) + function load(&$obj) { - //Corner-cutting - $vars=$user->getProperties(); - foreach($vars as $key=>$val) { - $this->set($key,$val); + $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('pass',null); - $this->set('vpass',null); + $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); } - function update(&$user) + function update(&$obj) { - $user->set('name',$this->getVar('name')); - $user->set('email',$this->getVar('email')); - $user->set('user_viewemail',$this->getVar('user_viewemail')); - $user->set('url',$this->getVar('url')); - $user->set('user_icq',$this->getVar('user_icq')); - $user->set('user_aim',$this->getVar('user_aim')); - $user->set('user_yim',$this->getVar('user_yim')); - $user->set('user_msnm',$this->getVar('user_msnm')); - $user->set('user_from',$this->getVar('user_from')); - $user->set('user_occ',$this->getVar('user_occ')); - $user->set('user_intrest',$this->getVar('user_intrest')); - $user->set('user_sig',$this->getVar('user_sig')); - $user->set('attachsig',$this->getVar('attachsig')); - $user->set('user_sig',$this->getVar('user_sig')); - $user->set('bio',$this->getVar('bio')); - $user->set('user_mailok',$this->getVar('user_mailok')); + $obj->set('name', $this->get('name')); - if($this->getVar('pass')) - $user->set('pass',md5($this->getVar('pass'))); + 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/UserConfirmForm.class.php diff -u xoops2jp/html/modules/user/forms/UserConfirmForm.class.php:1.1.2.3 xoops2jp/html/modules/user/forms/UserConfirmForm.class.php:1.1.2.4 --- xoops2jp/html/modules/user/forms/UserConfirmForm.class.php:1.1.2.3 Tue Mar 28 22:32:19 2006 +++ xoops2jp/html/modules/user/forms/UserConfirmForm.class.php Wed Jul 19 19:21:25 2006 @@ -1,14 +1,18 @@ <?php +/** + * @package user + * @version $Id: UserConfirmForm.class.php,v 1.1.2.4 2006/07/19 10:21:25 minahito Exp $ + */ if (!defined('XOOPS_ROOT_PATH')) exit(); -require_once XOOPS_ROOT_PATH."/class/XCube_ActionForm.class.php"; +require_once XOOPS_ROOT_PATH . "/class/XCube_ActionForm.class.php"; /** * This class is generated by makeActionForm tool. * @auchor makeActionForm */ -class UserConfirmForm extends XCube_ActionForm +class User_UserConfirmForm extends XCube_ActionForm { function getTokenName() { Index: xoops2jp/html/modules/user/forms/AbstractUserEditForm.class.php diff -u xoops2jp/html/modules/user/forms/AbstractUserEditForm.class.php:1.1.2.5 xoops2jp/html/modules/user/forms/AbstractUserEditForm.class.php:1.1.2.6 --- xoops2jp/html/modules/user/forms/AbstractUserEditForm.class.php:1.1.2.5 Tue Mar 28 22:32:19 2006 +++ xoops2jp/html/modules/user/forms/AbstractUserEditForm.class.php Wed Jul 19 19:21:25 2006 @@ -9,8 +9,11 @@ */ class User_AbstractUserEditForm extends XCube_ActionForm { - var $mConfig = array(); + var $mConfig = null; + /** + * TODO The argument of this member property may be moved to constructor. + */ function prepare($userConfig) { $this->mConfig = $userConfig; @@ -73,10 +76,13 @@ } } - function validateEmail() + function validateUrl() { - if ($this->get('email') != null && !preg_match("/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+([\.][a-z0-9-]+)+$/i",$this->get('email'))) { - $this->addErrorMessage(_MD_USER_ERROR_EMAIL_FORMAT); + $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)); + } } } Index: xoops2jp/html/modules/user/forms/AvatarFilterForm.class.php diff -u xoops2jp/html/modules/user/forms/AvatarFilterForm.class.php:1.1.2.3 xoops2jp/html/modules/user/forms/AvatarFilterForm.class.php:1.1.2.4 --- xoops2jp/html/modules/user/forms/AvatarFilterForm.class.php:1.1.2.3 Tue Mar 28 22:32:19 2006 +++ xoops2jp/html/modules/user/forms/AvatarFilterForm.class.php Wed Jul 19 19:21:25 2006 @@ -1,4 +1,8 @@ <?php +/** + * @package user + * @version $Id: AvatarFilterForm.class.php,v 1.1.2.4 2006/07/19 10:21:25 minahito Exp $ + */ if (!defined('XOOPS_ROOT_PATH')) exit(); @@ -12,7 +16,6 @@ class User_AvatarFilterForm extends User_AbstractFilterForm { var $mSort = 0; - var $_mCriteria = null; function fetch() { Index: xoops2jp/html/modules/user/forms/AvatarEditForm.class.php diff -u xoops2jp/html/modules/user/forms/AvatarEditForm.class.php:1.1.2.4 xoops2jp/html/modules/user/forms/AvatarEditForm.class.php:1.1.2.5 --- xoops2jp/html/modules/user/forms/AvatarEditForm.class.php:1.1.2.4 Tue Mar 28 22:32:19 2006 +++ xoops2jp/html/modules/user/forms/AvatarEditForm.class.php Wed Jul 19 19:21:25 2006 @@ -1,4 +1,8 @@ <?php +/** + * @package user + * @version $Id: AvatarEditForm.class.php,v 1.1.2.5 2006/07/19 10:21:25 minahito Exp $ + */ if (!defined('XOOPS_ROOT_PATH')) exit(); @@ -12,12 +16,12 @@ var $mOldAvatarFilename = null; var $mFormFile = null; - var $mWidth; - var $mHeight; + var $mWidth = 0; + var $mHeight = 0; function getTokenName() { - return "module.user.AvatarEditForm.TOKEN"; + return "module.user.AvatarEditForm.TOKEN" . $this->get('uid'); } function prepare($width, $height, $maxfilesize) Index: xoops2jp/html/modules/user/forms/UserRegisterEditForm.class.php diff -u xoops2jp/html/modules/user/forms/UserRegisterEditForm.class.php:1.1.2.6 xoops2jp/html/modules/user/forms/UserRegisterEditForm.class.php:1.1.2.7 --- xoops2jp/html/modules/user/forms/UserRegisterEditForm.class.php:1.1.2.6 Tue Mar 28 22:32:19 2006 +++ xoops2jp/html/modules/user/forms/UserRegisterEditForm.class.php Wed Jul 19 19:21:25 2006 @@ -7,7 +7,7 @@ /** * This class is generated by makeActionForm tool. */ -class UserRegisterEditForm extends User_AbstractUserEditForm +class User_RegisterEditForm extends User_AbstractUserEditForm { function getTokenName() { @@ -36,7 +36,7 @@ // Set field properties // $this->mFieldProperties['uname'] =& new XCube_FieldProperty($this); - $this->mFieldProperties['uname']->setDependsByArray(array('required','maxlength','minlength')); + $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']); @@ -44,10 +44,11 @@ $this->mFieldProperties['uname']->addVar('minlength', $this->mConfig['minuname']); $this->mFieldProperties['email'] =& new XCube_FieldProperty($this); - $this->mFieldProperties['email']->setDependsByArray(array('required','maxlength')); + $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_FORMAT); $this->mFieldProperties['url'] =& new XCube_FieldProperty($this); $this->mFieldProperties['url']->setDependsByArray(array('maxlength')); @@ -55,15 +56,15 @@ $this->mFieldProperties['url']->addVar('maxlength', 100); $this->mFieldProperties['pass'] =& new XCube_FieldProperty($this); - $this->mFieldProperties['pass']->setDependsByArray(array('required','minlength','maxlength')); + $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_MAXLENGTH, _MD_USER_LANG_PASS, $this->mConfig['minpass']); + $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']->setDependsByArray(array('required', 'maxlength')); $this->mFieldProperties['vpass']->addMessage('required', _MD_USER_ERROR_REQUIRED, _US_VERIFYPASS, '32'); $this->mFieldProperties['vpass']->addMessage('maxlength', _MD_USER_ERROR_MAXLENGTH, _US_VERIFYPASS, '32'); $this->mFieldProperties['vpass']->addVar('maxlength', 32); @@ -94,7 +95,8 @@ $obj->set('user_regdate',time(),true); } } -class UserRegisterAgreeEditForm extends UserRegisterEditForm + +class User_RegisterAgreeEditForm extends User_RegisterEditForm { function prepare($userConfig) { Index: xoops2jp/html/modules/user/forms/GroupsFilterForm.class.php diff -u xoops2jp/html/modules/user/forms/GroupsFilterForm.class.php:1.1.2.2 xoops2jp/html/modules/user/forms/GroupsFilterForm.class.php:removed --- xoops2jp/html/modules/user/forms/GroupsFilterForm.class.php:1.1.2.2 Tue Mar 28 22:32:19 2006 +++ xoops2jp/html/modules/user/forms/GroupsFilterForm.class.php Wed Jul 19 19:21:26 2006 @@ -1,48 +0,0 @@ -<?php - -if (!defined('XOOPS_ROOT_PATH')) exit(); - -require_once XOOPS_MODULE_PATH . "/user/class/AbstractFilterForm.class.php"; - -define('GROUPS_SORT_KEY_DEFAULT', 0); -define('GROUPS_SORT_KEY_GROUPID', 1); -define('GROUPS_SORT_KEY_NAME', 2); -define('GROUPS_SORT_KEY_DESCRIPTION', 3); -define('GROUPS_SORT_KEY_GROUP_TYPE', 4); -define('GROUPS_SORT_KEY_MAXVALUE', 4); - -class User_GroupsFilterForm extends User_AbstractFilterForm -{ - var $mSort = 0; - var $_mSortKeys = array( - GROUPS_SORT_KEY_DEFAULT => 'groupid', - GROUPS_SORT_KEY_GROUPID => 'groupid', - GROUPS_SORT_KEY_NAME => 'name', - GROUPS_SORT_KEY_DESCRIPTION => 'description', - GROUPS_SORT_KEY_GROUP_TYPE => 'group_type' - ); - var $_mCriteria = null; - - function fetch() - { - $this->mSort = isset($_REQUEST['sort']) ? intval($_REQUEST['sort']) : 0; - - if ($this->mSort > GROUPS_SORT_KEY_MAXVALUE) { - $this->mSort = GROUPS_SORT_KEY_DEFAULT; - } - - if (isset($_REQUEST['groupid'])) { - $this->_mCriteria->add(new Criteria('groupid', array(XOBJ_DTYPE_INT, xoops_getrequest('groupid')))); - } - - if (isset($_REQUEST['name'])) { - $this->_mCriteria->add(new Criteria('name', array(XOBJ_DTYPE_STRING, xoops_getrequest('name')))); - } - - if (isset($_REQUEST['group_type'])) { - $this->_mCriteria->add(new Criteria('group_type', array(XOBJ_DTYPE_STRING, xoops_getrequest('group_type')))); - } - } -} - -?>