Fixed illegal submit from curl()

SVN revision: 1655
This commit is contained in:
Stefan Ritt 2006-02-10 10:32:35 +00:00
parent 652d99bc91
commit 7d37837644

View File

@ -15448,8 +15448,12 @@ BOOL is_command_allowed(LOGBOOK * lbs, char *command)
strlcat(menu_str, "Config, ", sizeof(menu_str)); strlcat(menu_str, "Config, ", sizeof(menu_str));
} }
strcpy(other_str, "Update, Upload, Submit, Preview, Back, Search, Save, Download, CSV Import, "); strcpy(other_str, "Preview, Back, Search, Download, CSV Import, ");
strcat(other_str, "Cancel, First, Last, Previous, Next, Requested, Forgot, "); strlcat(other_str, "Cancel, First, Last, Previous, Next, Requested, Forgot, ", sizeof(other_str));
/* only allow Submit & Co if "New" is allowed */
if (strstr(menu_str, "New"))
strlcat(other_str, "Update, Upload, Submit, Save, ", sizeof(other_str));
/* admin commands */ /* admin commands */
if (is_admin_user(lbs->name, getparam("unm"))) { if (is_admin_user(lbs->name, getparam("unm"))) {
@ -15467,7 +15471,7 @@ BOOL is_command_allowed(LOGBOOK * lbs, char *command)
return TRUE; return TRUE;
} }
/* exclude non-localized submit for elog */ /* exclude non-localized submit for elog */
else if (command[0] && strieq(command, "Submit")) { else if (command[0] && strieq(command, "Submit") && strstr(menu_str, "New")) {
return TRUE; return TRUE;
} }
/* exclude other non-localized commands */ /* exclude other non-localized commands */