Cannot Login!

Get help with installation and running phpwcms here. Please do not post bug reports or feature requests here.
User avatar
flip-flop
Moderator
Posts: 8178
Joined: Sat 21. May 2005, 21:25
Location: HAMM (Germany)
Contact:

Post by flip-flop »

Hi Revolvermann,

interesting documentations:
Template: http://www.phpwcms.de/index.php?id=14,0,0,1,0,0
Docu: http://www.phpwcms-docu.de/the_docu.phtml
FAQ: http://faq.phpwcms-docu.de

regards Knut :D
>> HowTo | DOCU | FAQ | TEMPLATES/DOCS << ( SITE )
Revolvermann
Posts: 24
Joined: Fri 14. Jul 2006, 10:42

Post 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?
User avatar
Oliver Georgi
Site Admin
Posts: 9940
Joined: Fri 3. Oct 2003, 22:22
Location: Dessau-Roßlau
Contact:

Post 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
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn
Post Reply