When reset webConfigurator password, if authentication server is not Local Database, ask user to back to it. Fix #3341

This commit is contained in:
Renato Botelho 2013-12-02 16:21:30 -02:00
parent 338ded9b3c
commit 61422dd487
1 changed files with 8 additions and 0 deletions

View File

@ -44,6 +44,14 @@ The webConfigurator admin password and privileges will be reset to the default (
gettext('Do you want to proceed [y|n]?');
if (strcasecmp(chop(fgets($fp)), "y") == 0) {
if (isset($config['system']['webgui']['authmode']) &&
$config['system']['webgui']['authmode'] != "Local Database") {
echo "\n" . gettext('
The User manager authentication server is set to "' . $config['system']['webgui']['authmode'] . '".') . "\n" .
gettext('Do you want to set it back to Local Database [y|n]?');
if (strcasecmp(chop(fgets($fp)), "y") == 0)
$config['system']['webgui']['authmode'] = "Local Database";
}
$admin_user =& getUserEntryByUID(0);
if (!$admin_user) {
echo "Failed to locate the admin user account! Attempting to restore access.\n";