PEAK XOOPS - How to display a "Automatic login" message in englishin japanese

How to display a "Automatic login" message

  • You cannot open a new topic into this forum
  • Guests cannot post into this forum
Previous post - Next post | Parent - Children.1 | Posted on 2004/5/26 22:16
efla  Lance Corporal   Posts: 39
Hello,
I installed successfully this auto login hack.
Nevertherless, while the autlogin script runs, I would lke to display a message to the users telling him that the autologin is running.

How to do ?

Thanks
Votes:2 Average:10.00
Previous post - Next post | Parent - Children.1 | Posted on 2004/5/27 13:20
GIJOE  Gunnery Sergeant   Posts: 4110
hi efla.

Perhaps, this code is useful for you.

line 163 of include/common.php
	//autologin GIJ
	if(empty($HTTP_SESSION_VARS['xoopsUserId']) && isset($HTTP_COOKIE_VARS['autologin_uname']) && isset($HTTP_COOKIE_VARS['autologin_pass'])) {

		// redirect to Root when query string exists (anti-CSRF)
		if( ! empty( $HTTP_SERVER_VARS['QUERY_STRING'] ) ) {
			redirect_header( XOOPS_URL.'/' , 0 , 'Now, logging in automatically' ) ;
			exit ;
		}

		$myts =& MyTextSanitizer::getInstance();
		$uname = $myts->stripSlashesGPC($HTTP_COOKIE_VARS['autologin_uname']);
		$pass = $myts->stripSlashesGPC($HTTP_COOKIE_VARS['autologin_pass']);
		$myts =& MyTextsanitizer::getInstance();
		$user =& $member_handler->loginUserMd5(addslashes($uname), addslashes($pass));
		$xoops_cookie_path = defined('XOOPS_COOKIE_PATH') ? XOOPS_COOKIE_PATH : preg_replace( '?http://[^/]+(/.*)$?' , "$1" , XOOPS_URL ) ;
		if( $xoops_cookie_path == XOOPS_URL ) $xoops_cookie_path = '/' ;
		if (false != $user && $user->getVar('level') > 0) {
			// update time of last login
			$user->setVar('last_login', time());
			if (!$member_handler->insertUser($user, true)) {
			}
			//$HTTP_SESSION_VARS = array();
			$HTTP_SESSION_VARS['xoopsUserId'] = $user->getVar('uid');
			$HTTP_SESSION_VARS['xoopsUserGroups'] = $user->getGroups();
			// update autologin cookies
			$expire = time() + $xoopsConfig['session_expire'] * 60 ;
			setcookie('autologin_uname', $uname, $expire, $xoops_cookie_path, '', 0);
			setcookie('autologin_pass', $pass, $expire, $xoops_cookie_path, '', 0);
			redirect_header( XOOPS_URL.'/' , 0 , 'Now, logging in automatically' ) ;
			exit ;
		} else {
			setcookie('autologin_uname', '', time() - 3600, $xoops_cookie_path, '', 0);
			setcookie('autologin_pass', '', time() - 3600, $xoops_cookie_path, '', 0);
		}
	}
-------------
6/21 edited) XOOPS_URL to XOOPS_URL.'/' as redirection URL.
Votes:1 Average:0.00
Previous post - Next post | Parent - Children.1 .2 | Posted on 2004/6/15 19:28
Masaki  Private   Posts: 8
オートログインで『Now, logging in automatically』と表示されるにはテーマに何かを書き加えるのでしょうか?

ご教授ください。
Votes:1 Average:0.00
Previous post - Next post | Parent - No child | Posted on 2004/6/15 23:46
Masaki  Private   Posts: 8
サイトにアクセスしたら分かりました。
お騒がせしました。失礼致します。
Votes:1 Average:0.00
Previous post - Next post | Parent - No child | Posted on 2004/6/21 17:36
GIJOE  Gunnery Sergeant   Posts: 4110
hi Masaki

The older code does not work well in some environment.

Refer the newer code using XOOPS_URL.'/' instead of XOOPS_URL , please
Votes:2 Average:10.00

  Advanced search


Login
Username or e-mail:

Password:

Remember Me

Lost Password?

Register now!