14 Jun
2012
Posted in: Community, Faqs
By    No Comments

Why can’t login admin panel?

Many new users have come up against login problem in admin panel after they install TomatoCart.
Till now a few posts on this topic can be found in forum, however the reason and the solution
varies.Consequently, I make a brief summary here, listing all the occasions mentioned here with
the possible reasons and solutions.

Case 1 – Redirect to login page again and again

Reason 1:

If the domain name is set as example.com as installing the project, it will result this issue as
accessing the website with www.example.com and vice versa.It is necessary to do the following
steps to avoid this issue. .

1. Add the following code at the top of application_top.php in ‘includes’ directory:

if ($_SERVER['HTTP_HOST'] != HTTP_COOKIE_DOMAIN) {
if ($_SERVER['HTTPS'] == 'on') {
osc_redirect_admin(HTTPS_SERVER . DIR_WS_HTTP_CATALOG . DIR_FS_ADMIN);
} else {
osc_redirect_admin(HTTP_SERVER . DIR_WS_HTTP_CATALOG . DIR_FS_ADMIN);
}
}

2.Put the constants (HTTP_COOKIE_DOMAIN and HTTPs_COOKIE_DOMAIN) with the same value.
This constants are defined in: /include/configure.php:

define('HTTP_COOKIE_DOMAIN', '');
define('HTTPS_COOKIE_DOMAIN', '')

After make sure to remove all cookies.

Reason 2:

Another problem that might cause the problem is the posix_getpwuid. This problem is caused by
the wrong return value of function_exists in the admin/includes/functions/compatibility.php file.

According to the note from php.net:
A function name may exist even if the function itself is unusable due to configuration or compiling options
The function function_exists return false even the posix_getpwuid does exist and it causes the function definition error.
A quick solution to this is to comment all the codes in the compatibility.php, since it is only used in file manager module.

Code:

 /*
* posix_getpwuid() not implemented on Microsoft Windows platforms
*/

// if (!function_exists(‘posix_getpwuid’)) {
// function posix_getpwuid($id) {
// return ‘-?-’;
// }
// }

/*
* posix_getgrgid() not implemented on Microsoft Windows platforms
*/

// if (!function_exists(‘posix_getgrgid’)) {
// function posix_getgrgid($id) {
// return ‘-?-’;
// }
// }

As you can see, it just need to comment them.

Reason 3:

Based on some user’s report,this problem happened when they input ‘localhost’ as installing the tomatocart.
Please specify your ipAddress instead of using localhost.

Case 2 - Always Initializing System Without Ending.

Reason 1: 

The cache in the ‘includes/work’ and offline content in your browser may cause this issue. So, delete all (cache) files in working directory: …/includes/work , delete all offline content in your browser, then restart or refresh admin panel.

Reason 2:

Some of the extjs files that did not upload completely. The ftp upload sometime bringing this kind of trouble.Please upload the zipped format and then unzip from hosting file manage. It is more safer.

Reason 3:

Database tables crashed. It is necessary to check the tables and repair the crashed tables.

If the issue can’t be resolve, please backup your data and files. Then, reinstall the tomatocart system.

Case 3 – Thrown Fata error.

Fatal error: Cannot redeclare posix_getpwuid() in /home/wbodxhgt/domains/****/public_html/winkel/admin/includes/functions/compatibility.php on line 19
(**** = censored website).

This file (“admin/includes/functions/compatibility.php “) not work on windows server,it is necessary to comment
all the code in the file.

I hope this summary is useful for you. If you find the other problems and the solutions about this section, please report it here.

Thanks.

Random Posts