summaryrefslogtreecommitdiff
path: root/html.c
diff options
context:
space:
mode:
Diffstat (limited to 'html.c')
-rw-r--r--html.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/html.c b/html.c
index f97c45d..4522050 100644
--- a/html.c
+++ b/html.c
@@ -1013,11 +1013,21 @@ xs_html *html_top_controls(snac *snac)
1013 xs_html_attr("type", "file"), 1013 xs_html_attr("type", "file"),
1014 xs_html_attr("name", "avatar_file"))), 1014 xs_html_attr("name", "avatar_file"))),
1015 xs_html_tag("p", 1015 xs_html_tag("p",
1016 xs_html_sctag("input",
1017 xs_html_attr("type", "checkbox"),
1018 xs_html_attr("name", "avatar_delete")),
1019 xs_html_text(L("Delete current avatar"))),
1020 xs_html_tag("p",
1016 xs_html_text(L("Header image (banner): ")), 1021 xs_html_text(L("Header image (banner): ")),
1017 xs_html_sctag("input", 1022 xs_html_sctag("input",
1018 xs_html_attr("type", "file"), 1023 xs_html_attr("type", "file"),
1019 xs_html_attr("name", "header_file"))), 1024 xs_html_attr("name", "header_file"))),
1020 xs_html_tag("p", 1025 xs_html_tag("p",
1026 xs_html_sctag("input",
1027 xs_html_attr("type", "checkbox"),
1028 xs_html_attr("name", "header_delete")),
1029 xs_html_text(L("Delete current header image"))),
1030 xs_html_tag("p",
1021 xs_html_text(L("Bio:")), 1031 xs_html_text(L("Bio:")),
1022 xs_html_sctag("br", NULL), 1032 xs_html_sctag("br", NULL),
1023 xs_html_tag("textarea", 1033 xs_html_tag("textarea",
@@ -3306,6 +3316,16 @@ int html_post_handler(const xs_dict *req, const char *q_path,
3306 } 3316 }
3307 } 3317 }
3308 3318
3319 /* delete images by removing url from user.json */
3320 for (n = 0; uploads[n]; n++) {
3321 xs *var_name = xs_fmt("%s_delete", uploads[n]);
3322 const char *delete_var = xs_dict_get(p_vars, var_name);
3323
3324 if (delete_var != NULL && strcmp(delete_var, "on") == 0) {
3325 snac.config = xs_dict_set(snac.config, uploads[n], "");
3326 }
3327 }
3328
3309 /* password change? */ 3329 /* password change? */
3310 if ((p1 = xs_dict_get(p_vars, "passwd1")) != NULL && 3330 if ((p1 = xs_dict_get(p_vars, "passwd1")) != NULL &&
3311 (p2 = xs_dict_get(p_vars, "passwd2")) != NULL && 3331 (p2 = xs_dict_get(p_vars, "passwd2")) != NULL &&