Issue Found - Unable To Login! (Fix Included)
-
- Posts: 7
- Joined: Tue Oct 07, 2014 5:45 am
Issue Found - Unable To Login! (Fix Included)
Hey Vesta! Love your product, but this bug I'm having is a little strange!
Login as admin fails - no error message is displayed. However, it says "incorrect password" if I enter the wrong password. I've reset the password through the web interface and through the /usr/local/vesta/bin command.
I check the logs...
FastCGI sent in stderr: "PHP message: PHP Warning: Invalid argument supplied for foreach() in /usr/local/vesta/web/login/index.php on line 33 ...
I checked line 33, and it looks like the issue is with it not being able to json decode the results of the "v-list-sys-config json"
I ran the results of the v-list-sys-config json command through a json validator and compared to the results off another (working) server. The bad bit seems to be a comma after FIREWALL_SYSTEM.
NON WORKING SERVER
WORKING SERVER
I was able to fix this issue by changing lines 30-35 to the following: The fix was adding a str_replace before the json_decode.
Login as admin fails - no error message is displayed. However, it says "incorrect password" if I enter the wrong password. I've reset the password through the web interface and through the /usr/local/vesta/bin command.
I check the logs...
FastCGI sent in stderr: "PHP message: PHP Warning: Invalid argument supplied for foreach() in /usr/local/vesta/web/login/index.php on line 33 ...
I checked line 33, and it looks like the issue is with it not being able to json decode the results of the "v-list-sys-config json"
I ran the results of the v-list-sys-config json command through a json validator and compared to the results off another (working) server. The bad bit seems to be a comma after FIREWALL_SYSTEM.
NON WORKING SERVER
Code: Select all
....
"FIREWALL_SYSTEM": "iptables",
WORKING SERVER
Code: Select all
....
"FIREWALL_SYSTEM": "iptables"
Code: Select all
// Check system configuration
exec (VESTA_CMD . "v-list-sys-config json", $output, $return_var);
// add in a str_replace to remove the infringing comma from the json output!
$data = json_decode(str_replace('"FIREWALL_SYSTEM": "iptables",', '"FIREWALL_SYSTEM": "iptables"', implode('', $output)), true);
$sys_arr = $data['config'];
foreach ($sys_arr as $key => $value) {
$_SESSION[$key] = $value;
}
Re: Issue Found - Unable To Login! (Fix Included)
This error can be from broken sudo:
viewtopic.php?f=10&t=8349&p=27113#p27113
viewtopic.php?f=10&t=8349&p=27113#p27113