Admin.php won't work, redirected to webshop home instead

J-L

Avatar: J-L

2018-08-30 15:39

Hi there

I have a problem when trying to sign into the admin panel.

STEPS TO REPRODUCE:
1. Open https://www.website.com/webshop/admin.php (SSL is forced)

EXPECTED BEHAVIOUR:
1. The admin login page should load

ACTUAL BEHAVIOUR:
1. I'm redirected to the main page of the webshop

Please note, that in the first place, immediately after installing the script, the admin.php page DID work. But after a day, this problem occured. This also persists if I re-install the webshop using softaculous.
I already tried different browsers, different computers and different locations of computers. They all give the same problem.

Please, can anyone tell me how I can get into the admin panel again?

» Quick.Cart v6.x

Justin

treewood (OpenSolution)

Avatar: treewood

2018-08-31 08:22

Log to FTP and search for:
- admin.php
- .htaccess and redirect lists - maybe this causes a problem?

J-L

Avatar: J-L

2018-09-02 09:18

Hi treewood,

Thanks for your reply!

I have searched in admin.php and removed the following line:

if( isset( $config['allowed_ip_admin_panel'] ) && $config['allowed_ip_admin_panel'] != $_SERVER['REMOTE_ADDR'] ){
  
header'Location: ./' );
  exit;
}
elseif( !empty( 
$p ) && ( $config['login'] == 'admin' || $config['pass'] == 'admin' ) && !preg_match'/login|dasbhoard|logout|tools-config/'$p ) && $_SERVER['SERVER_ADDR'] != '127.0.0.1' && !strstr$_SERVER['HTTP_HOST'], 'localhost' )  ){
  
header'Location: '.$_SERVER['PHP_SELF'].'?p=tools-config&sOption=login-pass' );
  exit;  
}



Removing this, solved the problem. I wonder how this could create this problem...
Any idea?

Anyways, it's solved for me so cheers :)

Justin

treewood (OpenSolution)

Avatar: treewood

2018-09-04 08:35

Perhaps $_SERVER['REMOTE_ADDR'] is empty on your server. It should contain your IP address:
http://php.net/manual/en/reserved.variables.server.php

Back to top
about us | contact