Page 3 of 4

Posted: Sat 22. Jan 2005, 11:16
by Mike1
GREAT!!! IT WORKS!!! Thanks Olivers!!! You are man!! :lol: :lol: :lol:

Posted: Sat 22. Jan 2005, 13:43
by mdgroot
Oliver,
Thank you for answering my mail and solving this issue last night.

It's working like a charm ! :D

Thanks,
Marc

login problem

Posted: Sat 22. Jan 2005, 16:40
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

Hallelujah!!!!

Posted: Wed 26. Jan 2005, 16:23
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

Posted: Wed 26. Jan 2005, 16:45
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

Posted: Wed 26. Jan 2005, 16:50
by Oliver Georgi
don't understand what you want to say...

Oliver

Posted: Wed 26. Jan 2005, 17:07
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

Posted: Wed 26. Jan 2005, 17:28
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

Posted: Wed 26. Jan 2005, 17:41
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

Posted: Wed 26. Jan 2005, 19:35
by Oliver Georgi

Posted: Mon 14. Feb 2005, 00:05
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.......

Posted: Mon 14. Feb 2005, 00:10
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

Posted: Mon 14. Feb 2005, 04:33
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.

Posted: Mon 14. Feb 2005, 04:34
by liquiqvisions
double post sorry

Posted: Mon 14. Feb 2005, 07:47
by Oliver Georgi
can you post settings for session of you php.ini?

Oliver