mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-12 19:33:03 +00:00
Evaluate "skiplock" parameter to make elog submissions work with "use lock=1"
SVN revision: 2122
This commit is contained in:
parent
722c4cf338
commit
9bbe6c0e97
50
src/elogd.c
50
src/elogd.c
@ -21814,33 +21814,35 @@ void submit_elog(LOGBOOK * lbs)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* check if lock has been stolen */
|
/* check if lock has been stolen */
|
||||||
if (getcfg(lbs->name, "Use Lock", str, sizeof(str)) && atoi(str) == 1 && message_id) {
|
if (!isparam("skiplock")) {
|
||||||
el_retrieve(lbs, message_id, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, locked_by);
|
if (getcfg(lbs->name, "Use Lock", str, sizeof(str)) && atoi(str) == 1 && message_id) {
|
||||||
|
el_retrieve(lbs, message_id, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, locked_by);
|
||||||
|
|
||||||
if (isparam("full_name"))
|
if (isparam("full_name"))
|
||||||
strlcpy(str, getparam("full_name"), sizeof(str));
|
strlcpy(str, getparam("full_name"), sizeof(str));
|
||||||
else
|
|
||||||
strlcpy(str, loc("user"), sizeof(str));
|
|
||||||
|
|
||||||
strcat(str, " ");
|
|
||||||
strcat(str, loc("on"));
|
|
||||||
strcat(str, " ");
|
|
||||||
strcat(str, rem_host);
|
|
||||||
|
|
||||||
if (locked_by[0] == 0 || strcmp(locked_by, str) != 0) {
|
|
||||||
if (locked_by[0])
|
|
||||||
sprintf(str, loc("This entry has in meantime been locked by %s"), locked_by);
|
|
||||||
else
|
else
|
||||||
sprintf(str, loc("This entry has in meantime been modified by someone else"));
|
strlcpy(str, loc("user"), sizeof(str));
|
||||||
strlcat(str, ".<p>\n", sizeof(str));
|
|
||||||
strlcat(str,
|
|
||||||
loc("Submitting it now would overwrite the other modification and is therefore prohibited"),
|
|
||||||
sizeof(str));
|
|
||||||
strlcat(str, ".", sizeof(str));
|
|
||||||
|
|
||||||
strencode2(str2, str, sizeof(str2));
|
strcat(str, " ");
|
||||||
show_error(str2);
|
strcat(str, loc("on"));
|
||||||
return;
|
strcat(str, " ");
|
||||||
|
strcat(str, rem_host);
|
||||||
|
|
||||||
|
if (locked_by[0] == 0 || strcmp(locked_by, str) != 0) {
|
||||||
|
if (locked_by[0])
|
||||||
|
sprintf(str, loc("This entry has in meantime been locked by %s"), locked_by);
|
||||||
|
else
|
||||||
|
sprintf(str, loc("This entry has in meantime been modified by someone else"));
|
||||||
|
strlcat(str, ".<p>\n", sizeof(str));
|
||||||
|
strlcat(str,
|
||||||
|
loc("Submitting it now would overwrite the other modification and is therefore prohibited"),
|
||||||
|
sizeof(str));
|
||||||
|
strlcat(str, ".", sizeof(str));
|
||||||
|
|
||||||
|
strencode2(str2, str, sizeof(str2));
|
||||||
|
show_error(str2);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user