Minahito
minah****@users*****
2006年 8月 19日 (土) 20:56:06 JST
Index: xoops2jp/html/modules/user/actions/EditUserAction.class.php diff -u xoops2jp/html/modules/user/actions/EditUserAction.class.php:1.1.2.10 xoops2jp/html/modules/user/actions/EditUserAction.class.php:1.1.2.11 --- xoops2jp/html/modules/user/actions/EditUserAction.class.php:1.1.2.10 Thu Jul 20 17:14:28 2006 +++ xoops2jp/html/modules/user/actions/EditUserAction.class.php Sat Aug 19 20:56:06 2006 @@ -1,7 +1,7 @@ <?php /** * @package user - * @version $Id: EditUserAction.class.php,v 1.1.2.10 2006/07/20 08:14:28 minahito Exp $ + * @version $Id: EditUserAction.class.php,v 1.1.2.11 2006/08/19 11:56:06 minahito Exp $ */ if (!defined('XOOPS_ROOT_PATH')) exit(); @@ -9,11 +9,24 @@ require_once XOOPS_MODULE_PATH . "/user/class/AbstractEditAction.class.php"; require_once XOOPS_MODULE_PATH . "/user/forms/EditUserForm.class.php"; +define ('USER_COOKIE_KEEP_TIME', 31536000); + /** * @see User_EditUserForm */ class User_EditUserAction extends User_AbstractEditAction { + /** + * @var string + */ + var $mUserCookie = ""; + + function prepare(&$controller, &$xoopsUser, $moduleConfig) + { + parent::prepare($controller, $xoopsUser, $moduleConfig); + $this->mUserCookie = $moduleConfig['usercookie']; + } + function _getId() { return isset($_REQUEST['uid']) ? intval(xoops_getrequest('uid')) : 0; @@ -62,6 +75,23 @@ return false; } + function _doExecute() + { + if ($this->mObjectHandler->insert($this->mObject)) { + if ($this->mActionForm->get('usercookie')) { + setcookie($this->mUserCookie, $this->mObject->getShow('uname'), time() + USER_COOKIE_KEEP_TIME); + } + else { + setcookie($this->mUserCookie); + } + + return true; + } + else { + return false; + } + } + function executeViewInput(&$controller, &$xoopsUser, &$render) { $render->setTemplateName("user_edituser.html");