Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2016-06-14 09:43:25

John5
New Member
Registered: 2016-06-14
Posts: 2

PHP version update, Mysqli trouble

Hi,
I have a site that’s running an old version of TXT Pattern (4.0.7 !!!) and after the server update there’s a problem with
logging in. The error message i’m getting is:

Warning: FUNCTION ***.old_password does not exist select name from txp_users where name = ‘***’ and (pass = password(lower(‘***’)) or pass = password(‘***’) or pass = old_password(lower(‘***’)) or pass = old_password(‘***’)) and privs > 0 in /***/***/lib/txplib_db.php on line 91

/ I changed the sensitive information to asterisk (*)

I tried a dummy fix by trying the “lost password” link, but although it worked and i got a new password the same problem / error message persists.

I know that i really should update the whole site etc. but is there are short term fix for this issue? The site seems to be running ok which is quite surprising considering that there was a PHP version change and the Mysql was changed into Mysqli.

I tried checking around the files and googling around…

Offline

#2 2016-06-14 09:58:32

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,665
Website

Re: PHP version update, Mysqli trouble

John5 wrote #299705:

is there are short term fix for this issue?

Yep. Open up textpattern/include/txp_auth.php and find the little block that has references to old_password() in it:

if (version_compare(mysql_get_server_info(), '4.1.0', '>='))
{
	$passwords[] = "old_password(lower('".doSlash($password)."'))";
	$passwords[] = "old_password('".doSlash($password)."')";
}

Delete that block, save, upload, done. Hope that helps.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#3 2016-06-14 10:04:28

John5
New Member
Registered: 2016-06-14
Posts: 2

Re: PHP version update, Mysqli trouble

Yeah, that did the trick. Thank you very much for your help!

Offline

#4 2019-04-23 13:10:57

ragger
Member
From: Netherlands
Registered: 2005-04-10
Posts: 82
Website

Re: PHP version update, Mysqli trouble

Thank you, this was useful information. I should have found it two weeks ago :)

Offline

Board footer

Powered by FluxBB