mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-12 19:33:03 +00:00
Fixed problems with self registration
SVN revision: 1663
This commit is contained in:
parent
1c1c984329
commit
b8c5ddd371
@ -10899,6 +10899,8 @@ int save_user_config(LOGBOOK * lbs, char *user, BOOL new_user, BOOL activate)
|
|||||||
strlcpy(str, getparam("newpwd"), sizeof(str));
|
strlcpy(str, getparam("newpwd"), sizeof(str));
|
||||||
if (isparam("hpwd"))
|
if (isparam("hpwd"))
|
||||||
strlcpy(str, getparam("hpwd"), sizeof(str));
|
strlcpy(str, getparam("hpwd"), sizeof(str));
|
||||||
|
if (isparam("encpwd"))
|
||||||
|
strlcpy(str, getparam("encpwd"), sizeof(str));
|
||||||
if (str[0] == 0) {
|
if (str[0] == 0) {
|
||||||
show_error(loc("Empty password not allowed"));
|
show_error(loc("Empty password not allowed"));
|
||||||
return 0;
|
return 0;
|
||||||
@ -11150,7 +11152,7 @@ int save_user_config(LOGBOOK * lbs, char *user, BOOL new_user, BOOL activate)
|
|||||||
for (i = 0; lb_list[i].name[0]; i++) {
|
for (i = 0; lb_list[i].name[0]; i++) {
|
||||||
sprintf(str, "sub_lb%d", i);
|
sprintf(str, "sub_lb%d", i);
|
||||||
if (isparam(str) && atoi(getparam(str)) == 1)
|
if (isparam(str) && atoi(getparam(str)) == 1)
|
||||||
sprintf(mail_text + strlen(mail_text), "&%s=1", str);
|
sprintf(mail_text + strlen(mail_text), "&%s=1", str);
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintf(mail_text + strlen(mail_text), "&encpwd=%s&unm=%s\r\n", enc_pwd, pl);
|
sprintf(mail_text + strlen(mail_text), "&encpwd=%s&unm=%s\r\n", enc_pwd, pl);
|
||||||
@ -15432,6 +15434,10 @@ BOOL is_command_allowed(LOGBOOK * lbs, char *command)
|
|||||||
if (strstr(menu_str, "New"))
|
if (strstr(menu_str, "New"))
|
||||||
strlcat(other_str, "Update, Upload, Submit, Save, ", sizeof(other_str));
|
strlcat(other_str, "Update, Upload, Submit, Save, ", sizeof(other_str));
|
||||||
|
|
||||||
|
/* add save for new user registration */
|
||||||
|
if (isparam("new_user_name"))
|
||||||
|
strlcat(other_str, "Save, ", sizeof(other_str));
|
||||||
|
|
||||||
/* admin commands */
|
/* admin commands */
|
||||||
if (is_admin_user(lbs->name, getparam("unm"))) {
|
if (is_admin_user(lbs->name, getparam("unm"))) {
|
||||||
strcat(other_str, "Remove user, New user, Activate, ");
|
strcat(other_str, "Remove user, New user, Activate, ");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user