phpwcms Login problem again !!

Get help with installation and running phpwcms here. Please do not post bug reports or feature requests here.
Mike1
Posts: 70
Joined: Thu 10. Jun 2004, 13:39

Post by Mike1 »

GREAT!!! IT WORKS!!! Thanks Olivers!!! You are man!! :lol: :lol: :lol:
mdgroot
Posts: 155
Joined: Wed 11. Feb 2004, 17:47
Location: Netherlands

Post by mdgroot »

Oliver,
Thank you for answering my mail and solving this issue last night.

It's working like a charm ! :D

Thanks,
Marc
seo-105
Posts: 23
Joined: Sun 18. Apr 2004, 00:07

login problem

Post by seo-105 »

Hi :

Recommend you place this thread in the announcements. I also had the same problem. A lot of people are going to be looking for this thread!

thanks
User avatar
Kosse
Posts: 1066
Joined: Thu 9. Sep 2004, 12:08
Location: Brussels, Belgium
Contact:

Hallelujah!!!!

Post by Kosse »

YES YES YES :P :P :P :P :P :P :P :P :P :P :P

Thanks Oliver!
this file is EXCELLENT --> that change made the admin part WORK also on IEXPLORER !!!
You should include it in next releases!

Since I'm using PHPWCMS, my problem was that I had to say to pple or use myself Firefox or Mozilla to use the admin backend, I had this login prob with Explorer, couldn't find why.

This is like penicilline, you didn't do that in order to fix that, but it does it.
YIIIIIIIIPIEEEEEEEEEEEEEEEE, hurray, hurray

Cheers
User avatar
Kosse
Posts: 1066
Joined: Thu 9. Sep 2004, 12:08
Location: Brussels, Belgium
Contact:

Post by Kosse »

:(

I was happy too soon it seems...

Wow, now it appears that it works on IE but not in Mozilla/Forefox anymore

:cry: :cry: :cry: :cry:

Should there be a script that says if agent is Mozilla/Firefox do ... checklogin.inc.php (the old file) and
if agent is Explorer (the new file) do that? Or even better one that handles the two?

I'm no LAMP guru, just a simple user. :roll:
Anyone?

Thanks
User avatar
Oliver Georgi
Site Admin
Posts: 9907
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post by Oliver Georgi »

don't understand what you want to say...

Oliver
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
User avatar
Kosse
Posts: 1066
Joined: Thu 9. Sep 2004, 12:08
Location: Brussels, Belgium
Contact:

Post by Kosse »

Hi Oliver,

What happens is this:
I never could have the login.php work with Explorer. Since you made the new checklogin.php it does!
BUT...
Now, when I try with Firefox/Mozilla it doesn't work anymore.

I did this and works on both (I don't know if it is a good way but it works now on both navigators):

Code: Select all

<?php
/*************************************************************************************
   Copyright notice
   
   (c) 2002-2005 Oliver Georgi (oliver@phpwcms.de) // All rights reserved.
 
   This script is part of PHPWCMS. The PHPWCMS web content management system is
   free software; you can redistribute it and/or modify it under the terms of
   the GNU General Public License as published by the Free Software Foundation;
   either version 2 of the License, or (at your option) any later version.
  
   The GNU General Public License can be found at http://www.gnu.org/copyleft/gpl.html
   A copy is found in the textfile GPL.txt and important notices to the license 
   from the author is found in LICENSE.txt distributed with these scripts.
  
   This script is distributed in the hope that it will be useful, but WITHOUT ANY 
   WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
   PARTICULAR PURPOSE.  See the GNU General Public License for more details.
 
   This copyright notice MUST APPEAR in all copies of the script!
*************************************************************************************/

// I added this line (to check IE):
if (strstr($_SERVER["HTTP_USER_AGENT"], "MSIE")) 
{

//Aktualisieren der Userliste bzgl. der eingeloggten Zeit, Notfalls deaktivieren
$sql = 	"UPDATE ".DB_PREPEND."phpwcms_userlog SET ".
$sql .= "logged_in = 0, logged_change = '".time()."' ";
$sql .= "WHERE logged_in = 1 AND ( ".time()." - logged_change ) > ".$phpwcms["max_time"];
mysql_query($sql, $db);

if(!empty($_SESSION["wcs_user"])) {
	$sql  = "SELECT COUNT(*) FROM ".DB_PREPEND."phpwcms_userlog ";
	$sql .= "WHERE logged_user='".aporeplace($_SESSION["wcs_user"])."' AND logged_in=1";
	if($check = mysql_query($sql, $db)) {
		if($row = mysql_fetch_row($check)) {
			if($row[0] == 0) {
				$_SESSION["wcs_user"] = "";
			} else {
				$sql  = "UPDATE ".DB_PREPEND."phpwcms_userlog SET ";
				$sql .= "logged_change=".time()." WHERE ";
				$sql .= "logged_user='".aporeplace($_SESSION["wcs_user"])."' AND logged_in=1";
				mysql_query($sql, $db);
			}
			mysql_free_result($check);
		}
	}
}
if(empty($_SESSION["wcs_user"])) {
	session_destroy();
	header("Location: ".$phpwcms["site"].$phpwcms["root"]."login.php");
	exit();
}
}

// I added the former file (that worked with Mozilla and Firefox):

else {
$sql = 	"UPDATE ".DB_PREPEND."phpwcms_userlog SET logged_in = 0, logged_change = UNIX_TIMESTAMP( NOW( ) ) ".
		"WHERE logged_in = 1 AND ( UNIX_TIMESTAMP( NOW( ) ) - logged_change ) > ".	$phpwcms["max_time"].";";
mysql_query($sql, $db);

if($_SESSION["wcs_user"]) {
	$sql = "SELECT COUNT(*) FROM ".DB_PREPEND."phpwcms_userlog WHERE logged_user='".$_SESSION["wcs_user"]."' AND logged_in=1;";
	if($check = mysql_query($sql, $db)) {
		if($row = mysql_fetch_row($check)) {
			if($row[0] == 0) {
				$_SESSION["wcs_user"] = "";
			} else {
				$sql =	"UPDATE ".DB_PREPEND."phpwcms_userlog SET logged_change=".
						time()." WHERE logged_user='".$_SESSION["wcs_user"]."' AND logged_in=1;";
				$check = mysql_query($sql, $db);
			}
		}
	}
}

if (!isset($_SESSION["wcs_user"]) || !$_SESSION["wcs_user"]) {
	session_destroy();
	header("Location: ".$phpwcms["site"].$phpwcms["root"]."login.php");
	exit();
}
}
?>
It works!
I repeat, don't know if it is the proper way, but does the job!
What do you think about it? :oops:
Thanks
User avatar
Oliver Georgi
Site Admin
Posts: 9907
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post by Oliver Georgi »

You have used a buggy checklogin.inc.php (sorry). Compare 1st SQL line. Is solved in upgraded dev release I published yesterday midday.

Code: Select all

<?php
/*************************************************************************************
   Copyright notice
   
   (c) 2002-2005 Oliver Georgi (oliver@phpwcms.de) // All rights reserved.
 
   This script is part of PHPWCMS. The PHPWCMS web content management system is
   free software; you can redistribute it and/or modify it under the terms of
   the GNU General Public License as published by the Free Software Foundation;
   either version 2 of the License, or (at your option) any later version.
  
   The GNU General Public License can be found at http://www.gnu.org/copyleft/gpl.html
   A copy is found in the textfile GPL.txt and important notices to the license 
   from the author is found in LICENSE.txt distributed with these scripts.
  
   This script is distributed in the hope that it will be useful, but WITHOUT ANY 
   WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
   PARTICULAR PURPOSE.  See the GNU General Public License for more details.
 
   This copyright notice MUST APPEAR in all copies of the script!
*************************************************************************************/


//Aktualisieren der Userliste bzgl. der eingeloggten Zeit, Notfalls deaktivieren
$sql  = 	"UPDATE ".DB_PREPEND."phpwcms_userlog SET "; // <--- SEE HERE
$sql .= "logged_in = 0, logged_change = '".time()."' ";
$sql .= "WHERE logged_in = 1 AND ( ".time()." - logged_change ) > ".$phpwcms["max_time"];
mysql_query($sql, $db);

if(!empty($_SESSION["wcs_user"])) {
	$sql  = "SELECT COUNT(*) FROM ".DB_PREPEND."phpwcms_userlog ";
	$sql .= "WHERE logged_user='".aporeplace($_SESSION["wcs_user"])."' AND logged_in=1";
	if($check = mysql_query($sql, $db)) {
		if($row = mysql_fetch_row($check)) {
			if($row[0] == 0) {
				$_SESSION["wcs_user"] = "";
			} else {
				$sql  = "UPDATE ".DB_PREPEND."phpwcms_userlog SET ";
				$sql .= "logged_change=".time()." WHERE ";
				$sql .= "logged_user='".aporeplace($_SESSION["wcs_user"])."' AND logged_in=1";
				mysql_query($sql, $db);
			}
			mysql_free_result($check);
		}
	}
}
if(empty($_SESSION["wcs_user"])) {
	session_destroy();
	header("Location: ".$phpwcms["site"].$phpwcms["root"]."login.php");
	exit();
}
?>
Oliver
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
User avatar
Kosse
Posts: 1066
Joined: Thu 9. Sep 2004, 12:08
Location: Brussels, Belgium
Contact:

Post by Kosse »

Yes, works fine what a ";" can do :P

It is because I downloaded the
Rename old checklogin.inc.php, download, unzip and put new file in "include/inc_lib":
http://www.phpwcms.de/support/checklogin.inc.zip
In your post, that file seems buggy...
Now works ok.

Thanks again! Thus, I repeat:

YIPIEEEEEEEE HURRRAAAAAAAAY

:D :D :D :D :D
User avatar
Oliver Georgi
Site Admin
Posts: 9907
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post by Oliver Georgi »

Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
liquiqvisions
Posts: 8
Joined: Mon 7. Feb 2005, 05:07

Post by liquiqvisions »

Hiya OG,

I have the tried
a higer "max_time" (5800000) in conf.inc.php
editing my php.ini file to match (5800000)
upgraded to your new checklogin file

but I still get logged out. their isn't really an amount of time that it happens
but it does it all the time every session. I a matter of 10 min's I get loggeed out about 10-15 times.

please help.......
User avatar
Oliver Georgi
Site Admin
Posts: 9907
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post by Oliver Georgi »

Hm - difficult to find a solution without additional information like:
what system local and/or remote, which PHP version, which browser, FireWall, Proxy and so on...

Oliver
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
liquiqvisions
Posts: 8
Joined: Mon 7. Feb 2005, 05:07

Post by liquiqvisions »

(remote)
Linux
PhPwcms 1.9 Dev
PHP Version 4.3.10
MSQL Version 4.1.7
register_globals: on
session.use_trans_sid: off

Used to access phpwcms :
(local)
tested on 4 different computers all-
windows XP professional
browsers used "Internet Explorer, Firefox"
no fire walls or firewalls disabled.
Last edited by liquiqvisions on Mon 14. Feb 2005, 05:16, edited 2 times in total.
liquiqvisions
Posts: 8
Joined: Mon 7. Feb 2005, 05:07

Post by liquiqvisions »

double post sorry
User avatar
Oliver Georgi
Site Admin
Posts: 9907
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post by Oliver Georgi »

can you post settings for session of you php.ini?

Oliver
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
Post Reply