mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-08 17:13:56 +00:00
Added back missing getttimedate code
SVN revision: 1843
This commit is contained in:
parent
5887d3ad5d
commit
e35fbcbb9d
21
src/elogd.c
21
src/elogd.c
@ -9273,13 +9273,6 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL
|
|||||||
else
|
else
|
||||||
rsprintf("browser = 'Other';\n");
|
rsprintf("browser = 'Other';\n");
|
||||||
|
|
||||||
if (!getcfg(lbs->name, "Time format", format, sizeof(format)))
|
|
||||||
strcpy(format, DEFAULT_TIME_FORMAT);
|
|
||||||
time(<ime);
|
|
||||||
pts = localtime(<ime);
|
|
||||||
my_strftime(str, sizeof(str), format, pts);
|
|
||||||
rsprintf("datetime = '%s';", str);
|
|
||||||
|
|
||||||
rsprintf("//-->\n");
|
rsprintf("//-->\n");
|
||||||
rsprintf("</script>\n");
|
rsprintf("</script>\n");
|
||||||
|
|
||||||
@ -24421,7 +24414,7 @@ void server_loop(void)
|
|||||||
{
|
{
|
||||||
int status, i, n, n_error, authorized, min, i_min, i_conn, length;
|
int status, i, n, n_error, authorized, min, i_min, i_conn, length;
|
||||||
struct sockaddr_in serv_addr, acc_addr;
|
struct sockaddr_in serv_addr, acc_addr;
|
||||||
char pwd[256], str[1000], url[256], cl_pwd[256], *p;
|
char pwd[256], str[1000], url[256], cl_pwd[256], format[256], *p;
|
||||||
char cookie[256], boundary[256], list[1000], theme[256],
|
char cookie[256], boundary[256], list[1000], theme[256],
|
||||||
host_list[MAX_N_LIST][NAME_LENGTH], logbook[256], logbook_enc[256], global_cmd[256];
|
host_list[MAX_N_LIST][NAME_LENGTH], logbook[256], logbook_enc[256], global_cmd[256];
|
||||||
int lsock, len, flag, content_length, header_length;
|
int lsock, len, flag, content_length, header_length;
|
||||||
@ -24430,6 +24423,8 @@ void server_loop(void)
|
|||||||
struct timeval timeout;
|
struct timeval timeout;
|
||||||
char *net_buffer = NULL;
|
char *net_buffer = NULL;
|
||||||
int net_buffer_size;
|
int net_buffer_size;
|
||||||
|
time_t now;
|
||||||
|
struct tm *ts;
|
||||||
|
|
||||||
i_conn = content_length = 0;
|
i_conn = content_length = 0;
|
||||||
net_buffer_size = 100000;
|
net_buffer_size = 100000;
|
||||||
@ -25339,6 +25334,16 @@ void server_loop(void)
|
|||||||
if (!logbook[0] && global_cmd[0] && stricmp(global_cmd, "GetConfig") == 0) {
|
if (!logbook[0] && global_cmd[0] && stricmp(global_cmd, "GetConfig") == 0) {
|
||||||
download_config();
|
download_config();
|
||||||
goto redir;
|
goto redir;
|
||||||
|
} else if (stricmp(global_cmd, "gettimedate") == 0) {
|
||||||
|
if (!getcfg(logbook, "Time format", format, sizeof(format)))
|
||||||
|
strcpy(format, DEFAULT_TIME_FORMAT);
|
||||||
|
time(&now);
|
||||||
|
ts = localtime(&now);
|
||||||
|
my_strftime(str, sizeof(str), format, ts);
|
||||||
|
show_http_header(NULL, FALSE, NULL);
|
||||||
|
rsputs(str);
|
||||||
|
rsputs(" ");
|
||||||
|
goto redir;
|
||||||
} else if (strncmp(net_buffer, "GET", 3) == 0) {
|
} else if (strncmp(net_buffer, "GET", 3) == 0) {
|
||||||
/* extract path and commands */
|
/* extract path and commands */
|
||||||
if (strchr(net_buffer, '\r'))
|
if (strchr(net_buffer, '\r'))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user