mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-10 18:23:28 +00:00
Implemented retrieve_elog_from
SVN revision: 916
This commit is contained in:
parent
5712033a15
commit
f256b8499a
33
src/elogd.c
33
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.353 2004/06/21 19:11:35 midas
|
||||||
|
Implemented retrieve_elog_from
|
||||||
|
|
||||||
Revision 1.352 2004/06/21 18:04:43 midas
|
Revision 1.352 2004/06/21 18:04:43 midas
|
||||||
Fixed email notification problem if URL does not contain a trailing '/'
|
Fixed email notification problem if URL does not contain a trailing '/'
|
||||||
|
|
||||||
@ -2396,6 +2399,20 @@ void check_config()
|
|||||||
check_language();
|
check_language();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*-------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
void retrieve_email_from(LOGBOOK *lbs, char *ret)
|
||||||
|
{
|
||||||
|
char str[256];
|
||||||
|
|
||||||
|
if (isparam("user_email") && *getparam("user_email"))
|
||||||
|
strcpy(str, getparam("user_email"));
|
||||||
|
else if (!getcfg(lbs->name, "Use Email from", str))
|
||||||
|
sprintf(str, "ELog@%s", host_name);
|
||||||
|
|
||||||
|
strcpy(ret, str);
|
||||||
|
}
|
||||||
|
|
||||||
/*------------------------------------------------------------------*/
|
/*------------------------------------------------------------------*/
|
||||||
|
|
||||||
void el_decode(char *message, char *key, char *result)
|
void el_decode(char *message, char *key, char *result)
|
||||||
@ -8194,8 +8211,7 @@ int save_user_config(LOGBOOK * lbs, char *user, BOOL new_user, BOOL activate)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!getcfg(lbs->name, "Use Email from", mail_from))
|
retrieve_email_from(lbs, mail_from);
|
||||||
sprintf(mail_from, "ELog@%s", host_name);
|
|
||||||
|
|
||||||
if (activate) {
|
if (activate) {
|
||||||
sprintf(subject, loc("Your ELOG account has been activated"));
|
sprintf(subject, loc("Your ELOG account has been activated"));
|
||||||
@ -8593,8 +8609,7 @@ void show_forgot_pwd_page(LOGBOOK * lbs)
|
|||||||
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));
|
||||||
|
|
||||||
if (!getcfg(lbs->name, "Use Email from", mail_from))
|
retrieve_email_from(lbs, mail_from);
|
||||||
sprintf(mail_from, "ELog@%s", host_name);
|
|
||||||
|
|
||||||
if (lbs)
|
if (lbs)
|
||||||
sprintf(subject, loc("Password recovery for ELOG %s"), lbs->name);
|
sprintf(subject, loc("Password recovery for ELOG %s"), lbs->name);
|
||||||
@ -13636,15 +13651,7 @@ int compose_email(LOGBOOK * lbs, char *mail_to, int message_id,
|
|||||||
if (getcfg(lbs->name, "Email format", str))
|
if (getcfg(lbs->name, "Email format", str))
|
||||||
flags = atoi(str);
|
flags = atoi(str);
|
||||||
|
|
||||||
if (getcfg(lbs->name, "Use Email from", mail_from)) {
|
retrieve_email_from(lbs, mail_from);
|
||||||
j = build_subst_list(lbs, slist, svalue, attrib, TRUE);
|
|
||||||
sprintf(str, "%d", message_id);
|
|
||||||
add_subst_list(slist, svalue, "message id", str, &j);
|
|
||||||
strsubst(mail_from, slist, svalue, j);
|
|
||||||
if (strncmp(mail_from, "mailto:", 7) == 0)
|
|
||||||
strcpy(mail_from, mail_from + 7);
|
|
||||||
} else
|
|
||||||
sprintf(mail_from, "ELog@%s", host_name);
|
|
||||||
|
|
||||||
mail_text = malloc(TEXT_SIZE + 1000);
|
mail_text = malloc(TEXT_SIZE + 1000);
|
||||||
mail_text[0] = 0;
|
mail_text[0] = 0;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user