11
Peekay
Re: how to create the term of use everytime login to XOOPS
  • 2008/2/25 10:24

  • Peekay

  • XOOPS is my life!

  • Posts: 2335

  • Since: 2004/11/20


If you turn on 'debug' in XOOPS admin you may see a message explaining the problem.

Does it all work up to the point of logging out?
A thread is for life. Not just for Christmas.

12
Peekay
Re: how to create the term of use everytime login to XOOPS
  • 2008/2/25 17:30

  • Peekay

  • XOOPS is my life!

  • Posts: 2335

  • Since: 2004/11/20


To clarify the PHP file code alterations:

include/checklogin.php

Quote:

include_once XOOPS_ROOT_PATH.'/language/'.$xoopsConfig['language'].'/user.php';
$uname = !isset($_POST['uname']) ? '' : trim($_POST['uname']);
$pass = !isset($_POST['pass']) ? '' : trim($_POST['pass']);
if ($uname == '' || $pass == '') {
redirect_header(XOOPS_URL.'/user.php', 1, _US_INCORRECTLOGIN);
exit();
}

// Peekays terms hack -------------------------------- //

if(!isset($_POST['termsaccepted'])) {
redirect_header(XOOPS_URL.'/user.php', 1, _US_MUSTACCEPTMYTERMS);
exit();
}

// End pk mod ---------------------------------------- //


$member_handler =& xoops_gethandler('member');
$myts =& MyTextsanitizer::getInstance();
$user =& $member_handler->loginUser($myts->addSlashes($uname), $myts->addSlashes($pass));
if (false != $user) {
if (0 == $user->getVar('level')) {
redirect_header(XOOPS_URL.'/index.php', 5, _US_NOACTTPADM);
exit();
}


user.php

Quote:

if ($op == 'main') {
if ( !$xoopsUser ) {
$xoopsOption['template_main'] = 'system_userform.html';
include 'header.php';
$xoopsTpl->assign('lang_login', _LOGIN);
$xoopsTpl->assign('lang_username', _USERNAME);
if (isset($_COOKIE[$xoopsConfig['usercookie']])) {
$xoopsTpl->assign('usercookie', $_COOKIE[$xoopsConfig['usercookie']]);
}
if (isset($_GET['xoops_redirect'])) {
$xoopsTpl->assign('redirect_page', htmlspecialchars(trim($_GET['xoops_redirect']), ENT_QUOTES));
}
$xoopsTpl->assign('lang_password', _PASSWORD);

// Peekays Terms Hack
$xoopsTpl->assign('lang_myterms', _MYTERMS);
// End pk mod


$xoopsTpl->assign('lang_notregister', _US_NOTREGISTERED);
$xoopsTpl->assign('lang_lostpassword', _US_LOSTPASSWORD);
$xoopsTpl->assign('lang_noproblem', _US_NOPROBLEM);
$xoopsTpl->assign('lang_youremail', _US_YOUREMAIL);
$xoopsTpl->assign('lang_sendpassword', _US_SENDPASSWORD);
$xoopsTpl->assign('mailpasswd_token', $GLOBALS['xoopsSecurity']->createToken());
include 'footer.php';
} elseif ( $xoopsUser ) {
header('Location: '.XOOPS_URL.'/userinfo.php?uid='.$xoopsUser->getVar('uid'));
}
exit();
}


The logout redirect (to index.php) is also dealt with in user.php, around line 73, but that should be unaltered:

Quote:

if ($op == 'logout') {
$message = '';
$_SESSION = array();
session_destroy();
if ($xoopsConfig['use_mysession'] && $xoopsConfig['session_name'] != '') {
setcookie($xoopsConfig['session_name'], '', time()- 3600, '/', '', 0);
}
// clear entry from online users table
if (is_object($xoopsUser)) {
$online_handler =& xoops_gethandler('online');
$online_handler->destroy($xoopsUser->getVar('uid'));
}
$message = _US_LOGGEDOUT.'
'._US_THANKYOUFORVISIT;
redirect_header('index.php', 1, $message);
exit();

}


The usual precautions about editing PHP files apply. Make sure your text editor has not allowed any spaces or line breaks after the closing PHP tag. Always FTP PHP files in text/ascii mode.
A thread is for life. Not just for Christmas.

Login

Who's Online

369 user(s) are online (66 user(s) are browsing Support Forums)


Members: 0


Guests: 369


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Oct 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits