From: SourceForge.net <no...@so...> - 2012-08-22 04:28:00
|
Bugs item #3560586, was opened at 2012-08-21 21:13 Message generated for change (Comment added) made by irmtfan You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=430840&aid=3560586&group_id=41586 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Core - Core Group: XOOPS 2.5.x Status: Open Resolution: None Priority: 5 Private: No Submitted By: irmtfan (irmtfan) Assigned to: Nobody/Anonymous (nobody) Summary: 2.5.5: xoopsUserTheme is not regenerate in remember me Initial Comment: if remember me is set to yes and the user select a theme other than default theme then: XOOPS should regenarate a new session and destroy old session for xoopsUserTheme in include/common.php i added this: [code] /** * Log user is and deal with Sessions and Cookies */ if (!empty($_SESSION['xoopsUserId'])) { $xoopsUser =& $member_handler->getUser($_SESSION['xoopsUserId']); if (!is_object($xoopsUser) || (isset($hash_login) && md5($xoopsUser->getVar('pass') . XOOPS_DB_NAME . XOOPS_DB_PASS . XOOPS_DB_PREFIX) != $hash_login)) { $xoopsUser = ''; $_SESSION = array(); session_destroy(); setcookie($xoopsConfig['usercookie'], 0, - 1, '/'); } else { if ((intval($xoopsUser->getVar('last_login')) + 60 * 5) < time()) { $sql = "UPDATE " . $xoopsDB->prefix('users') . " SET last_login = '" . time() . "' WHERE uid = " . $_SESSION['xoopsUserId']; @$xoopsDB->queryF($sql); } $sess_handler->update_cookie(); if (isset($_SESSION['xoopsUserGroups'])) { $xoopsUser->setGroups($_SESSION['xoopsUserGroups']); } else { $_SESSION['xoopsUserGroups'] = $xoopsUser->getGroups(); } // Start irmtfan to regenarate a new session and destroy old session for xoopsUserTheme $user_theme = $xoopsUser->getVar('theme'); if ($user_theme != $xoopsConfig['theme_set'] && in_array($user_theme, $xoopsConfig['theme_set_allowed'])) { $_SESSION['xoopsUserTheme'] = $user_theme; } // End irmtfan to regenarate a new session and destroy old session for xoopsUserTheme $xoopsUserIsAdmin = $xoopsUser->isAdmin(); } } [/code] I just think the above code would be the final solution but if anybody have better solution please let us know. also please take a look at class/xoopskernel.php [code] /** * xos_kernel_Xoops2::themeSelect() * * @return */ function themeSelect() { if (!empty($_POST['xoops_theme_select'] ) && in_array($_POST['xoops_theme_select'], xoops_getConfigOption('theme_set_allowed'))) { xoops_setConfigOption('theme_set', $_POST['xoops_theme_select']); $_SESSION['xoopsUserTheme'] = $_POST['xoops_theme_select']; } else if (!empty($_SESSION['xoopsUserTheme']) && in_array($_SESSION['xoopsUserTheme'], xoops_getConfigOption('theme_set_allowed'))) { xoops_setConfigOption('theme_set', $_SESSION['xoopsUserTheme']); } } [/code] also the function in modules/profile/edituser.php: [code] $profile->setVar('profile_id', $edituser->getVar('uid')); $profile_handler->insert($profile); unset($_SESSION['xoopsUserTheme']); redirect_header(XOOPS_URL.'/modules/' . $GLOBALS['xoopsModule']->getVar('dirname', 'n') . '/userinfo.php?uid=' . $edituser->getVar('uid'), 2, _US_PROFUPDATED); [/code] I dont know why it is unsetted? ---------------------------------------------------------------------- >Comment By: irmtfan (irmtfan) Date: 2012-08-21 21:28 Message: discussion in xoops.org forum here: http://xoops.org/modules/newbb/viewtopic.php?post_id=348937 ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=430840&aid=3560586&group_id=41586 |