1
diegoflash
Double User / Login
  • 2007/11/8 19:48

  • diegoflash

  • Just popping in

  • Posts: 1

  • Since: 2007/11/8


Hi everybody,

Sorry about my English...But I´ll Try explain my problem and i hope someone help me.

I can login with one user "test" in my site, but if a try login agina, i can.There are multiple sessions conections.

I want to limit form one user.

If this user was loged,he won´t get login.

I edited include/checklogin.php file end I did some changes.

if (!defined('XOOPS_ROOT_PATH')) {
exit();
}
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();
}
$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();
}

After this cod, I put this hack.

//

$query = $xoopsDB->queryF('SELECT * FROM '.$xoopsDB->prefix('online').' WHERE online_uname="'.$uname.'"');
$total = $xoopsDB->getRowsNum($query);
if ($user->getVar('uid')!='1'){
if ($total){
$msg = 'Desculpe '.$uname.' mas não foi possível efetuar o login no site!! <br />
<p align="left" style="color:red;">
Possíveis causas:<br />
- Você já está logado no site.<br />
- Alguém logou no site utilizando seu nome de usuário e senha.<br />
- Você saiu do site ou fechou a janela do navegador sem clicar no link de logout.<br />
</p>
Aguarde alguns minutos e tente novamente. Caso o problema persista entre em contato conosco através do formulário de contato clicando
<a href="'.XOOPS_URL.'/modules/contact/">aqui</a>.';
redirect_header(XOOPS_URL.'/index.php', 12, $msg);
exit();
}
}
//End


But, doesn´t work.I don´t know why.

Someone, help me plz ?

thanks !!!

2
svaha
Re: Double User / Login
  • 2007/11/8 20:25

  • svaha

  • Just can't stay away

  • Posts: 896

  • Since: 2003/8/2 2


Preventing multilogins by the same user is an option in XOOPS exm/xm, but I don't know where they implemented this code.
What doesn't kill me,
makes me stronger.

http://exm.amevita.eu
http://www.amevita.eu
http://www.alohaspirit.nl

Login

Who's Online

182 user(s) are online (116 user(s) are browsing Support Forums)


Members: 0


Guests: 182


more...

Donat-O-Meter

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

Latest GitHub Commits