Author Topic: xampp and login problems - i get logged straight out  (Read 2662 times)

peta

  • Posts: 16
    • View Profile
xampp and login problems - i get logged straight out
« on: August 28, 2006, 12:09:43 pm »
Hi there, have everything set up nioce and neat on an XPpro machine... but when I try to login  to listmail it allows me in and then tells me that I must be logged in to continue... if I put in the wrong password, is gives me the wrong password message.

This is using the most recent version of xampp and also the most recent stable version of list mail.

Very frustrating, any suggestion will be well received

Thanks

(obviously I can't give you access to my 'server' as it is my desk top machine, just hoping that you're familiar with this problem)

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
xampp and login problems - i get logged straight out
« Reply #1 on: August 28, 2006, 02:17:09 pm »
It would seem that your browser is not accepting cookies or cookies are not enabled in PHP.  Unfortunately I don't know a lot about xampp but will try to guide you if possible.  Try this link for some ideas about what to check regarding cookies.

Regards
Dean Wiebe
ListMailPRO Author & Developer - Help | Support | Hosting

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
xampp and login problems - i get logged straight out
« Reply #2 on: August 28, 2006, 02:22:31 pm »
The line where it sets the cookie in ListMail's login.php is as follows:
Code: [Select]
 if($xpw) $adminpw='';
  setcookie('LMadm1',md5($instid),0,'/','.'.getdomain(),0);
  setcookie('LMadm2',md5($adminpw),0,'/','.'.getdomain(),0);

There could be a problem with the getdomain() function with your setup.  Try adding this temporarily after the above lines:
Code: [Select]
echo "instid=$instid<br>adminpw=$adminpw<br>detected domain=".getdomain()."<br>";
exit();

Do a test login and let me know (without true instid/adminpw) what it says.

Regards
Dean Wiebe
ListMailPRO Author & Developer - Help | Support | Hosting

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
xampp and login problems - i get logged straight out
« Reply #3 on: August 28, 2006, 02:24:29 pm »
If getdomain() is returning a bad value, try modifying the function in admin.php

Search for ion getdomain( to find the function and change:
Code: [Select]
function getdomain($www=''){
 $dom = $_SERVER['SERVER_NAME'];
 if(!$www && strpos(' '.$dom,'www.')>0) $dom = str_replace('www.','',$dom);
 return $dom;
}

To
Code: [Select]
function getdomain($www=''){
 $dom = $_SERVER['HTTP_HOST'];
 if(!$www && strpos(' '.$dom,'www.')>0) $dom = str_replace('www.','',$dom);
 return $dom;
}

Then run the same "echo getdomain();" test.

Regards
Dean Wiebe
ListMailPRO Author & Developer - Help | Support | Hosting

peta

  • Posts: 16
    • View Profile
xampp and login problems - i get logged straight out
« Reply #4 on: August 28, 2006, 06:04:56 pm »
Hi Dean,

thanks very much indeed for your swift response, been out this afternoon... I'll have a crack at your kind suggestions on the morrow.

cheers

peta

peta

  • Posts: 16
    • View Profile
xampp and login problems - i get logged straight out
« Reply #5 on: August 29, 2006, 02:13:59 am »
Hi Dean

in answer the first question I get

instid=394b27567fc787a07e202a11709ea8e6
adminpw=***********
detected domain=localhost

peta

  • Posts: 16
    • View Profile
xampp and login problems - i get logged straight out
« Reply #6 on: August 29, 2006, 02:43:53 am »
hi there, I got the same response with the alternative get_http command

This was an anser to a question on the XAMPP forum...

Quote
In your last sample script you are using the domain parameter in setcookie(). This does not work for "localhost" at the most times.

BTW:
In line 31 you should use $_GET['show'] and not $show.


obviously not refering to istmail, no idea if that helps at all... thanks again for your attention

ALSO:

I found this conversation which may explain something, unfrotunately I have no idea how to apply this to listmail (or even if it woudl work)

http://marc.theaimsgroup.com/?l=php-windows&m=110944633329079&w=2

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
xampp and login problems - i get logged straight out
« Reply #7 on: August 29, 2006, 09:28:42 am »
From the guidance in that link, try changing this in login.php:
Code: [Select]

  if($xpw) $adminpw='';
  setcookie('LMadm1',md5($instid),0,'/','.'.getdomain(),0);
  setcookie('LMadm2',md5($adminpw),0,'/','.'.getdomain(),0);

To
Code: [Select]
 if($xpw) $adminpw='';
  setcookie('LMadm1',md5($instid));
  setcookie('LMadm2',md5($adminpw));

That could allow you to login, but you may not be able to logout.  You would need to search for "setcookie" and trim each call down to 2 paramaters as we have done with the login cookies.

Regards
Dean Wiebe
ListMailPRO Author & Developer - Help | Support | Hosting

peta

  • Posts: 16
    • View Profile
xampp and login problems - i get logged straight out
« Reply #8 on: August 29, 2006, 10:39:41 am »
hey,

that sorted it, I can now log is, well done dean.

I'll go through and find any other instances and change them as well.

I'll keep you posted

cheers

peta