3 posts by 2 authors in: Forums > CMS Builder
Last Post: March 26   (RSS)

Hi All,

When using the website membership plugin v1.10 and previous, I’ve been using some custom code (suggested by Ross many moons ago) to write an entry into a login_log table every time a non-admin logged in. It was inserted into the plugin as in the code below.

With plugin V1.13 and PHP 7.2 the code no longer works (although I do get logged in, which I would expect the ‘or die’ code to have prevented) and I occasionally get the following error in the error log: UNCAUGHT_EXCEPTION: Call to undefined function mysql_query() /home3/mrqsygmy/public_html/cmsAdmin/plugins/websiteMembership_1.13_custom/websiteMembership_1.13_custom.php (line 230)
http://dbtproviders.com/provider_login.php

I think it has something to do with needing to update to mysqli, but I don’t really have a clue where to begin with something like this.

Any thoughts?

Thanks,

Jerry Kornbluth

// clear form values
$_REQUEST['username'] = '';
$_REQUEST['password'] = '';

// CUSTOM CODE! add record to login_log table


if (!@$CURRENT_USER['isAdmin'])
{global $TABLE_PREFIX;
mysql_query(mysql_escapef("INSERT INTO {$TABLE_PREFIX}login_log SET
createdDate = NOW(), // line 230
who = ?,
last_name = ?,
first_name = ?,
practice_name = ?",
$CURRENT_USER['num'],
$CURRENT_USER['num'],
$CURRENT_USER['num'],
$CURRENT_USER['num']))
or die("Mysql error adding login_log record: ". htmlspecialchars(mysql_error()) . "\n");
}
// redirect on success
$postLoginUrl = coalesce( getPrefixedCookie('lastUrl'), @$GLOBALS['WEBSITE_LOGIN_POST_LOGIN_URL'], '/' );
removePrefixedCookie('lastUrl');​
The first CMS Builder reference book is now available on-line!
Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

Hey Daniel,

Worked like a charm...

Thank you Jedi Master!

Jerry Kornbluth

The first CMS Builder reference book is now available on-line!
Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php