web archive: don't allow users to delete gtk and windows
This commit is contained in:
parent
3032dbabce
commit
4c7e92f67b
|
@ -40,6 +40,11 @@ int main()
|
|||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
if (strcmp(name,"gtk")==0 || strcmp(name,"windows")==0) {
|
||||
generatepage("Permission denied to delete this file");
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
FILE *f = fopen("data.txt", "wt");
|
||||
if (f == NULL) {
|
||||
generatepage("Failed to delete file (access denied)");
|
||||
|
|
|
@ -22,6 +22,9 @@ void listAll(char **data)
|
|||
printf("<tr><td width=\"200\">%s</td>", name);
|
||||
printf("<td><input type=\"button\" onclick=\"editFile(\'%s\','%i')\" value=\"Edit\"/>", name, version);
|
||||
printf("<input type=\"button\" onclick=\"renameFile(\'%s\','%i')\" value=\"Rename\"/>", name, version);
|
||||
if (strcmp(name,"gtk")==0 || strcmp(name,"windows")==0)
|
||||
printf("<font color=\"gray\">Delete</font>");
|
||||
else
|
||||
printf("<input type=\"button\" onclick=\"deleteFile(\'%s\','%i')\" value=\"Delete\"/> </td>", name, version);
|
||||
printf("</tr>\n");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue