Posted: Sat 22. Jan 2005, 11:16
GREAT!!! IT WORKS!!! Thanks Olivers!!! You are man!!
The phpwcms support forum will help to find answers to your questions. The small but strong community is here since more than 10 years.
https://forum.phpwcms.org/
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();
}
}
?>
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();
}
?>
In your post, that file seems buggy...Rename old checklogin.inc.php, download, unzip and put new file in "include/inc_lib":
http://www.phpwcms.de/support/checklogin.inc.zip