commit 3b19a50
grunfink
·
2026-09-01 13:18:06 +0000 UTC
parent 2e4a9a9
New user page /operations.
1 files changed,
+22,
-0
M
html.c
M
html.c
+22,
-0
1@@ -4874,6 +4874,28 @@ int html_get_handler(const xs_dict *req, const char *q_path,
2 }
3 }
4 else
5+ if (strcmp(p_path, "operations") == 0) { /** operations and user settings **/
6+ if (!login(&snac, req)) {
7+ *body = xs_dup(uid);
8+ status = HTTP_STATUS_UNAUTHORIZED;
9+ }
10+ else {
11+ xs_html *h_body = html_user_body(&snac, 0);
12+
13+ xs_html *html = xs_html_tag("html",
14+ html_user_head(&snac, NULL, NULL),
15+ h_body);
16+
17+ xs_html_add(h_body,
18+ html_top_controls(&snac),
19+ html_footer(&snac));
20+
21+ *body = xs_html_render_s(html, "<!DOCTYPE html>\n");
22+ *b_size = strlen(*body);
23+ status = HTTP_STATUS_OK;
24+ }
25+ }
26+ else
27 if (strcmp(p_path, "admin") == 0) { /** private timeline **/
28 if (!login(&snac, req)) {
29 *body = xs_dup(uid);