|
@@ -1221,15 +1221,22 @@ char *HTTP_GetRequest(uint32_t reqNum, char *bufIn, char *bufOut, uint16_t lenBu
|
|
char *HTTP_NoFound(uint32_t reqNum, char *bufIn, char *bufOut, uint16_t lenBufIn, uint16_t *lenBufOut)
|
|
char *HTTP_NoFound(uint32_t reqNum, char *bufIn, char *bufOut, uint16_t lenBufIn, uint16_t *lenBufOut)
|
|
{
|
|
{
|
|
(void)bufIn;
|
|
(void)bufIn;
|
|
- (void)bufOut;
|
|
|
|
(void)lenBufIn;
|
|
(void)lenBufIn;
|
|
(void)reqNum;
|
|
(void)reqNum;
|
|
|
|
+ if (Authenticated) {
|
|
#ifdef HTTP_AUTH_ENABLE
|
|
#ifdef HTTP_AUTH_ENABLE
|
|
- HTTP_UpdateUserLoginTime(user_id);
|
|
|
|
|
|
+ HTTP_UpdateUserLoginTime(user_id);
|
|
#endif
|
|
#endif
|
|
- fs_open("/index.html", &file); // +
|
|
|
|
- *lenBufOut = file.len;
|
|
|
|
- return file.data;
|
|
|
|
|
|
+ fs_open("/index.html", &file); // +
|
|
|
|
+ *lenBufOut = file.len;
|
|
|
|
+ return file.data;
|
|
|
|
+ } else {
|
|
|
|
+ strcpy(bufOut, HTTP_401_NO_AUTH);
|
|
|
|
+ strcat(bufOut,
|
|
|
|
+ "<!DOCTYPE html><html lang=""><head><meta http-equiv=\"refresh\" content=\"0;url=/login.html\"/></head></html>\r\n");
|
|
|
|
+ *lenBufOut = strlen(bufOut);
|
|
|
|
+ return bufOut;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|