Page 2 of 2
Posted: Fri 21. Jul 2006, 09:10
by flip-flop
Posted: Wed 9. Aug 2006, 08:30
by Revolvermann
Hi there!
Sorry for digging out my old post but my phpwcms is behaving very strange!
For some unknow reason the old installation (phpwcms 1.1 RC2) started working again, after a few weeks of trouble! I didn't do anything!
After that, the update of the site lost a bit importance and was postponed.
But today, the problem reoccured! Again, without any changes, neither content nor script!
What the hell is going on?
Posted: Wed 9. Aug 2006, 09:09
by Oliver Georgi
There is a problem in older releases and in combination with MySQL > 4.x. And that enables you to login correctly but login check fails so your are logget out in the same time.
Try to compare content of current
checklogin.inc.php against yours.
Code: Select all
$sql = "UPDATE ".DB_PREPEND."phpwcms_userlog SET ";
$sql .= "logged_in = 0, logged_change = '".time()."' ";
$sql .= "WHERE logged_in = 1 AND ( ".time()." - logged_change ) > ".intval($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) {
unset($_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();
headerRedirect(PHPWCMS_URL."login.php");
}
What might help too if it is an older release - reset your password directly in the database. Old system has used MySQL command PASSWORD() to encrypt it - the PASSWORD() passphrase (based on MySQL release) is often different between release so a check against will fail.
To reset password go into table "phpwcms_user" and edit the user entry by changing password of that user to PASSWORD('mypassword'). If phpMyAdmin is used there is a drop down select box where you can select that command.
Oliver