if (!$isExternal) { header('Location: ' . $redirect); exit; } } header('Location: ' . XOOPS_URL . '/userinfo.php?uid=' . $xoopsUser->getVar('uid')); exit; } if ($op == 'logout') { $message = ''; $_SESSION = array(); // add for login history : 2010-07-24 if ($xoopsUser) { include_once XOOPS_ROOT_PATH . "/modules/simantz/class/LoginHistory.php"; $lh = new LoginHistory(); $lh->insertEventRecord($xoopsUser->getVar('uid'), "O"); echo "ASDS"; } //end session_destroy(); setcookie($xoopsConfig['usercookie'], 0, -1, '/', XOOPS_COOKIE_DOMAIN, 0); setcookie($xoopsConfig['usercookie'], 0, -1, '/'); // clear entry from online users table if (is_object($xoopsUser)) { $online_handler =& xoops_gethandler('online'); $online_handler->destroy($xoopsUser->getVar('uid')); } $message = _US_LOGGEDOUT . '<br />' . _US_THANKYOUFORVISIT; redirect_header('index.php', 1, $message); exit; }
foreach ($user->getGroups() as $group) { if (in_array($group, $xoopsConfig['closesite_okgrp']) || XOOPS_GROUP_ADMIN == $group) { $allowed = true; break; } } if (!$allowed) { redirect_header(XOOPS_URL . '/index.php', 1, _NOPERM); exit; } } $user->setVar('last_login', time()); //modify by kstan@simit.com.my 2009-07-24 for trace login event include_once XOOPS_ROOT_PATH . "/modules/simantz/class/LoginHistory.php"; $lh = new LoginHistory(); $lh->insertEventRecord($user->getVar("uid"), "I", "r"); // (uid,insert,killprevioussession/reserveprevioussession) //end modifcation kstan@simit.com.my 2009-06-23 if (!$member_handler->insertUser($user)) { } // Regenrate a new session id and destroy old session $GLOBALS["sess_handler"]->regenerate_id(true); $_SESSION = array(); $_SESSION['xoopsUserId'] = $user->getVar('uid'); $_SESSION['xoopsUserGroups'] = $user->getGroups(); $user_theme = $user->getVar('theme'); if (in_array($user_theme, $xoopsConfig['theme_set_allowed'])) { $_SESSION['xoopsUserTheme'] = $user_theme; } // Set cookie for rememberme if (!empty($xoopsConfig['usercookie'])) {