diff --git a/src/elogd.c b/src/elogd.c index 204e7de2..9dcdee54 100755 --- a/src/elogd.c +++ b/src/elogd.c @@ -6,6 +6,9 @@ Contents: Web server program for Electronic Logbook ELOG $Log$ + Revision 1.347 2004/06/17 15:16:34 midas + Fixed bug with password recovery + Revision 1.346 2004/06/16 12:27:00 midas Submit (unlock) unmodified entry upon unload @@ -5973,20 +5976,22 @@ void show_change_pwd_page(LOGBOOK * lbs) wrong_pwd = 2; } - /* replace password */ - if (!wrong_pwd) - change_pwd(lbs, user, new_pwd); + if (new_pwd[0]) { + /* replace password */ + if (!wrong_pwd) + change_pwd(lbs, user, new_pwd); - if (!wrong_pwd && strcmp(user, getparam("unm")) == 0) { - set_login_cookies(lbs, user, new_pwd); - return; - } + if (!wrong_pwd && strcmp(user, getparam("unm")) == 0) { + set_login_cookies(lbs, user, new_pwd); + return; + } - if (!wrong_pwd) { - /* redirect back to configuration page */ - sprintf(str, "?cmd=%s&cfg_user=%s", loc("Config"), getparam("config")); - redirect(lbs, str); - return; + if (!wrong_pwd) { + /* redirect back to configuration page */ + sprintf(str, "?cmd=%s&cfg_user=%s", loc("Config"), getparam("config")); + redirect(lbs, str); + return; + } } } @@ -6008,9 +6013,10 @@ void show_change_pwd_page(LOGBOOK * lbs) rsprintf("%s \"%s\"\n", loc("Change password for user"), user); - if (is_admin_user(lbs->name, getparam("unm"))) { - if (isparam("old_pwd")) - rsprintf("name, getparam("unm")) || stricmp(getparam("unm"), user) == 0) { + if (isparam("oldpwd")) + rsprintf("
| \n"); + rsprintf(" | |
| \n"); + rsprintf(loc("Email notification")); + rsprintf(" | |
| \n"); rsprintf(loc("A new password for user \"%s\" has been sent to %s"), full_name, user_email); - rsprintf(" | |