mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-10 18:23:28 +00:00
Fixed bug with password recovery
SVN revision: 908
This commit is contained in:
parent
c3343e773c
commit
515b08e8b1
44
src/elogd.c
44
src/elogd.c
@ -6,6 +6,9 @@
|
|||||||
Contents: Web server program for Electronic Logbook ELOG
|
Contents: Web server program for Electronic Logbook ELOG
|
||||||
|
|
||||||
$Log$
|
$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
|
Revision 1.346 2004/06/16 12:27:00 midas
|
||||||
Submit (unlock) unmodified entry upon unload
|
Submit (unlock) unmodified entry upon unload
|
||||||
|
|
||||||
@ -5973,20 +5976,22 @@ void show_change_pwd_page(LOGBOOK * lbs)
|
|||||||
wrong_pwd = 2;
|
wrong_pwd = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* replace password */
|
if (new_pwd[0]) {
|
||||||
if (!wrong_pwd)
|
/* replace password */
|
||||||
change_pwd(lbs, user, new_pwd);
|
if (!wrong_pwd)
|
||||||
|
change_pwd(lbs, user, new_pwd);
|
||||||
|
|
||||||
if (!wrong_pwd && strcmp(user, getparam("unm")) == 0) {
|
if (!wrong_pwd && strcmp(user, getparam("unm")) == 0) {
|
||||||
set_login_cookies(lbs, user, new_pwd);
|
set_login_cookies(lbs, user, new_pwd);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!wrong_pwd) {
|
if (!wrong_pwd) {
|
||||||
/* redirect back to configuration page */
|
/* redirect back to configuration page */
|
||||||
sprintf(str, "?cmd=%s&cfg_user=%s", loc("Config"), getparam("config"));
|
sprintf(str, "?cmd=%s&cfg_user=%s", loc("Config"), getparam("config"));
|
||||||
redirect(lbs, str);
|
redirect(lbs, str);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -6008,9 +6013,10 @@ void show_change_pwd_page(LOGBOOK * lbs)
|
|||||||
|
|
||||||
rsprintf("%s \"%s\"</td></tr>\n", loc("Change password for user"), user);
|
rsprintf("%s \"%s\"</td></tr>\n", loc("Change password for user"), user);
|
||||||
|
|
||||||
if (is_admin_user(lbs->name, getparam("unm"))) {
|
/* do not ask for old pwasword if admin changes other user's password */
|
||||||
if (isparam("old_pwd"))
|
if (!is_admin_user(lbs->name, getparam("unm")) || stricmp(getparam("unm"), user) == 0) {
|
||||||
rsprintf("<input type=hidden name=oldpwd value=\"%s\"", getparam("old_pwd"));
|
if (isparam("oldpwd"))
|
||||||
|
rsprintf("<input type=hidden name=oldpwd value=\"%s\"", getparam("oldpwd"));
|
||||||
else {
|
else {
|
||||||
rsprintf("<tr><td align=right class=\"dlgform\">%s:\n", loc("Old password"));
|
rsprintf("<tr><td align=right class=\"dlgform\">%s:\n", loc("Old password"));
|
||||||
rsprintf("<td align=left class=\"dlgform\"><input type=password name=oldpwd>\n");
|
rsprintf("<td align=left class=\"dlgform\"><input type=password name=oldpwd>\n");
|
||||||
@ -8488,7 +8494,7 @@ void show_forgot_pwd_page(LOGBOOK * lbs)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintf(redir, "?cmd=%s&old_pwd=%s", loc("Change password"), pwd);
|
sprintf(redir, "?cmd=%s&oldpwd=%s", loc("Change password"), pwd);
|
||||||
url_encode(redir, sizeof(redir));
|
url_encode(redir, sizeof(redir));
|
||||||
sprintf(str, "?redir=%s&uname=%s&upassword=%s", redir, login_name, pwd);
|
sprintf(str, "?redir=%s&uname=%s&upassword=%s", redir, login_name, pwd);
|
||||||
strlcat(url, str, sizeof(url));
|
strlcat(url, str, sizeof(url));
|
||||||
@ -8523,11 +8529,13 @@ void show_forgot_pwd_page(LOGBOOK * lbs)
|
|||||||
show_standard_header(lbs, FALSE, loc("ELOG password recovery"), "");
|
show_standard_header(lbs, FALSE, loc("ELOG password recovery"), "");
|
||||||
|
|
||||||
rsprintf("<table class=\"dlgframe\" cellspacing=0 align=center>");
|
rsprintf("<table class=\"dlgframe\" cellspacing=0 align=center>");
|
||||||
rsprintf("<tr><td colspan=2 class=\"dlgtitle\">\n");
|
rsprintf("<tr><td class=\"dlgtitle\">\n");
|
||||||
|
rsprintf(loc("Email notification"));
|
||||||
|
rsprintf("</td></tr>\n");
|
||||||
|
|
||||||
|
rsprintf("<tr><td align=center class=\"dlgform\">\n");
|
||||||
rsprintf(loc("A new password for user <i>\"%s\"</i> has been sent to %s"),
|
rsprintf(loc("A new password for user <i>\"%s\"</i> has been sent to %s"),
|
||||||
full_name, user_email);
|
full_name, user_email);
|
||||||
|
|
||||||
rsprintf("</td></tr></table>\n");
|
rsprintf("</td></tr></table>\n");
|
||||||
show_bottom_text(lbs);
|
show_bottom_text(lbs);
|
||||||
rsprintf("</body></html>\n");
|
rsprintf("</body></html>\n");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user