Fatal error during admin login
I had to re-install zencart from a backup, but when I go to the admin area now, I am getting the following error:
Quote:
Fatal error: Call to undefined function whos_online_session_recreate() in /home/accountname/public_html/zencart/includes/functions/sessions.php on line 171
Does anyone have a suggestion on how to resolve this?
Thanks.
Re: Fatal error during admin login
How old is your backup?
Your /includes/functions/whos_online.php file is missing stuff ...
Re: Fatal error during admin login
Thank you. It's about a week old.
Is there any way to recover from this?
Meeven
Re: Fatal error during admin login
Quote:
Originally Posted by
meeven
It's about a week old.
Is there any way to recover from this?
Let's think about this logically ...
1. Why did you do this restore anyway?
2. What have you changed in the last week?
3. It would make sense to re-do those changes.
4. And make sure the file I mentioned actually exists and is complete.
Many times when uploading files there will be timeouts and incomplete uploads.
I'm not sure how you did your restore, but if you simply uploaded the files, then you may be victim of incomplete uploads.
Re: Fatal error during admin login
Thanks again:smile:
The reason I did the restore is that I got caught in a rather convoluted situation. I was trying to install Harslade's book product type, so I took a backup of the install files and the db before attempting it. The book product type install didn't go too well, so I cleaned out the whole install and untarred the backup file into the subdomain. However, Zencart went through the whole install routine again instead of reverting to the old install, so I dropped the tables and imported the old db backup.
When I went to the site and typed in the url, I saw an error about the application_top.php and realised that, when zipping the files for backup, I had inadvertently left out the includes and media directories. So, I uploaded those directories into the existing install and got the site back, but not the admin area.
This is where I stand now:
1.) Old install restored along with old db
2.) Book product type files uploaded (sql patch still to be done)
3.) Site is up, but admin area throws the error.
Hope this makes sense.
Meeven.
Re: Fatal error during admin login
edit your /includes/functions/sessions.php file.
Around line 157 you'll see this:
Code:
function zen_session_recreate() {
global $http_domain, $https_domain, $current_domain;
if ($http_domain == $https_domain) {
$saveSession = $_SESSION;
$oldSessID = session_id();
session_regenerate_id();
$newSessID = session_id();
session_id($oldSessID);
session_id($newSessID);
if (STORE_SESSIONS == 'db') {
session_set_save_handler('_sess_open', '_sess_close', '_sess_read', '_sess_write', '_sess_destroy', '_sess_gc');
}
session_start();
$_SESSION = $saveSession;
whos_online_session_recreate($oldSessID, $newSessID);
} else {
change it to this:
Code:
function zen_session_recreate() {
global $http_domain, $https_domain, $current_domain;
if ($http_domain == $https_domain) {
$saveSession = $_SESSION;
$oldSessID = session_id();
session_regenerate_id();
$newSessID = session_id();
session_id($oldSessID);
session_id($newSessID);
if (STORE_SESSIONS == 'db') {
session_set_save_handler('_sess_open', '_sess_close', '_sess_read', '_sess_write', '_sess_destroy', '_sess_gc');
}
session_start();
$_SESSION = $saveSession;
if (IS_ADMIN_FLAG !== true) {
whos_online_session_recreate($oldSessID, $newSessID);
}
} else {
NOTE: IF THIS HELPS YOU, YOU NEED TO UPGRADE YOUR SITE TO THE CURRENT VERSION !!!!!!!!!!!!
Re: Fatal error during admin login
Wonderful, thank you.
I am going to try this right away.
Re: Fatal error during admin login
Problem solved. Thank you very much.:smile:
Re: Fatal error during admin login
Having the same issue after a server hack (IX Webhosting). Trying to get the site up and running on a new server from my backups.
The new site is located at http://shop2.lisasdesigns.net
When I change the code like above, the error message goes away, but when I try to log in, it doesn't do anything.
Any help would be greatly appreciated!
Re: Fatal error during admin login
Quote:
Originally Posted by
hamburgler100
Having the same issue after a server hack
You said "having the same issue" ... are you referring to "undefined funciton whos_online_session_recreate()" ? or just being unable to login to your admin?
Quote:
Originally Posted by
meeven
I had to re-install zencart from a backup, but when I go to the admin area now, I am getting the following error:
Quote:
Fatal error: Call to undefined function whos_online_session_recreate() in /home/accountname/public_html/zencart/includes/functions/sessions.php on line 171
Does anyone have a suggestion on how to resolve this?
Thanks.