From 79412060b67837fa9abf382f2b5ad7549aacff37 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Sat, 5 Mar 2022 18:30:15 -0500 Subject: [PATCH] Click on a user or their avatar to go to their profile from the forum view --- webcit-ng/ctdlclient.c | 6 +++--- webcit-ng/http.c | 6 ++++++ webcit-ng/static/index.html | 3 ++- webcit-ng/static/js/user_profile.js | 16 ++++++++++++++++ webcit-ng/static/js/view_forum.js | 4 ++-- webcit-ng/webcit.h | 2 +- 6 files changed, 30 insertions(+), 7 deletions(-) create mode 100644 webcit-ng/static/js/user_profile.js diff --git a/webcit-ng/ctdlclient.c b/webcit-ng/ctdlclient.c index 44daa3b55..24b378050 100644 --- a/webcit-ng/ctdlclient.c +++ b/webcit-ng/ctdlclient.c @@ -57,12 +57,12 @@ int ctdl_readline(struct ctdlsession *ctdl, char *buf, int maxbytes) { --len; } buf[len] = 0; - syslog(LOG_DEBUG, "\033[32m[ %s\033[0m", buf); + // syslog(LOG_DEBUG, "\033[32m[ %s\033[0m", buf); return (len); } ++len; } - syslog(LOG_DEBUG, "\033[32m[ %s\033[0m", buf); + // syslog(LOG_DEBUG, "\033[32m[ %s\033[0m", buf); return (len); } @@ -101,7 +101,7 @@ void ctdl_printf(struct ctdlsession *ctdl, const char *format, ...) { StrBufVAppendPrintf(Buf, format, arg_ptr); va_end(arg_ptr); - syslog(LOG_DEBUG, "\033[32m] %s\033[0m", ChrPtr(Buf)); + // syslog(LOG_DEBUG, "\033[32m] %s\033[0m", ChrPtr(Buf)); ctdl_write(ctdl, (char *) ChrPtr(Buf), StrLength(Buf)); ctdl_write(ctdl, "\n", 1); FreeStrBuf(&Buf); diff --git a/webcit-ng/http.c b/webcit-ng/http.c index a16e7c5af..bf535876f 100644 --- a/webcit-ng/http.c +++ b/webcit-ng/http.c @@ -172,7 +172,9 @@ void perform_one_http_transaction(struct client_handle *ch) { kv.key = strdup(tok); kv.val = strdup(eq); array_append(h.request_parms, &kv); +#ifdef DEBUG_HTTP syslog(LOG_DEBUG, "\033[1m\033[33m| %s = %s\033[0m", kv.key, kv.val); +#endif } } } @@ -197,7 +199,9 @@ void perform_one_http_transaction(struct client_handle *ch) { syslog(LOG_DEBUG, "Client disconnected"); } else { +#ifdef DEBUG_HTTP syslog(LOG_DEBUG, "\033[33m\033[1m< %s %s\033[0m", h.method, h.url); +#endif // If there is a request body, read it now. char *ccl = header_val(&h, "Content-Length"); @@ -229,7 +233,9 @@ void perform_one_http_transaction(struct client_handle *ch) { #endif // Output the results back to the client. +#ifdef DEBUG_HTTP syslog(LOG_DEBUG, "\033[33m\033[1m> %03d %s\033[0m", h.response_code, h.response_string); +#endif client_printf(ch, "HTTP/1.1 %03d %s\r\n", h.response_code, h.response_string); client_printf(ch, "Connection: close\r\n"); client_printf(ch, "Content-Length: %ld\r\n", h.response_body_length); diff --git a/webcit-ng/static/index.html b/webcit-ng/static/index.html index ad7ee4e59..4100bb8c0 100644 --- a/webcit-ng/static/index.html +++ b/webcit-ng/static/index.html @@ -49,7 +49,7 @@ LOADING Not logged in.
- +
@@ -82,6 +82,7 @@ Loading... +