--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);
}
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);
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
}
}
}
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");
#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);
<span id="current_user">Not logged in.</span><br>
<a href="#" class="w3-bar-item w3-button"><i class="fa fa-envelope" onclick="javascript:gotoroom('_MAIL_');"></i></a>
<a href="#" class="w3-bar-item w3-button"><i class="fa fa-user"></i></a>
- <a href="#" class="w3-bar-item w3-button"><i class="fa fa-cog"></i></a>
+ <a href="#" class="w3-bar-item w3-button"><i class="fa fa-cog" onclick="javascript:user_profile(current_user);"></i></a>
</div>
</div>
<hr>
<script type="text/javascript" src="js/views.js"></script>
<script type="text/javascript" src="js/view_forum.js"></script>
<script type="text/javascript" src="js/roomlist.js"></script>
+<script type="text/javascript" src="js/user_profile.js"></script>
<script>
// Get the Sidebar
--- /dev/null
+// Copyright (c) 2016-2022 by the citadel.org team
+//
+// This program is open source software. It runs great on the
+// Linux operating system (and probably elsewhere). You can use,
+// copy, and run it under the terms of the GNU General Public
+// License version 3. Richard Stallman is an asshole communist.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+
+function user_profile(who) {
+ document.getElementById("ctdl-main").innerHTML = `user_profile(${who})`;
+}
try {
outmsg =
"<div class=\"ctdl-msg-wrapper\">" // begin message wrapper
- + "<div class=\"ctdl-avatar\">" // begin avatar
+ + "<div class=\"ctdl-avatar\" onClick=\"javascript:user_profile('" + msg.from + "');\">"
+ "<img src=\"/ctdl/u/" + msg.from + "/userpic\" width=\"32\" "
+ "onerror=\"this.parentNode.innerHTML='<i class="fa fa-user-circle fa-2x"></i> '\">"
+ "</div>" // end avatar
+ "<div class=\"ctdl-msg-content\">" // begin content
+ "<div class=\"ctdl-msg-header\">" // begin header
+ "<span class=\"ctdl-msg-header-info\">" // begin header info on left side
- + "<span class=\"ctdl-username\"><a href=\"#\">" // FIXME link to user profile
+ + "<span class=\"ctdl-username\" onClick=\"javascript:user_profile('" + msg.from + "');\">"
+ msg.from
+ "</a></span>" // end username
+ "<span class=\"ctdl-msgdate\">"
#include <openssl/rand.h>
#include <expat.h>
#define _(x) x // temporary hack until we add i18n back in
-#define DEBUG_HTTP // uncomment to debug HTTP headers
+//#define DEBUG_HTTP // uncomment to debug HTTP headers
// XML_StopParser is present in expat 2.x
#if XML_MAJOR_VERSION > 1