diff options
| author | 2025-05-18 09:38:38 +0200 | |
|---|---|---|
| committer | 2025-05-18 09:38:38 +0200 | |
| commit | 072ae21013dc924c6bb3378a2480b571a66aba98 (patch) | |
| tree | e105012cda58849b833a71d2f33be655e147ada6 /html.c | |
| parent | Updated RELEASE_NOTES. (diff) | |
| download | snac2-072ae21013dc924c6bb3378a2480b571a66aba98.tar.gz snac2-072ae21013dc924c6bb3378a2480b571a66aba98.tar.xz snac2-072ae21013dc924c6bb3378a2480b571a66aba98.zip | |
Operations on the 'people' page redirects back to it instead of 'admin'.
Diffstat (limited to 'html.c')
| -rw-r--r-- | html.c | 21 |
1 files changed, 17 insertions, 4 deletions
| @@ -3149,6 +3149,8 @@ xs_html *html_people_list(snac *user, xs_list *list, const char *header, const c | |||
| 3149 | xs_html_tag("summary", | 3149 | xs_html_tag("summary", |
| 3150 | xs_html_text("...")))); | 3150 | xs_html_text("...")))); |
| 3151 | 3151 | ||
| 3152 | xs *redir = xs_fmt("%s/people", user->actor); | ||
| 3153 | |||
| 3152 | const char *actor_id; | 3154 | const char *actor_id; |
| 3153 | 3155 | ||
| 3154 | xs_list_foreach(list, actor_id) { | 3156 | xs_list_foreach(list, actor_id) { |
| @@ -3202,6 +3204,10 @@ xs_html *html_people_list(snac *user, xs_list *list, const char *header, const c | |||
| 3202 | xs_html_attr("value", actor_id)), | 3204 | xs_html_attr("value", actor_id)), |
| 3203 | xs_html_sctag("input", | 3205 | xs_html_sctag("input", |
| 3204 | xs_html_attr("type", "hidden"), | 3206 | xs_html_attr("type", "hidden"), |
| 3207 | xs_html_attr("name", "hard-redir"), | ||
| 3208 | xs_html_attr("value", redir)), | ||
| 3209 | xs_html_sctag("input", | ||
| 3210 | xs_html_attr("type", "hidden"), | ||
| 3205 | xs_html_attr("name", "actor-form"), | 3211 | xs_html_attr("name", "actor-form"), |
| 3206 | xs_html_attr("value", "yes"))); | 3212 | xs_html_attr("value", "yes"))); |
| 3207 | 3213 | ||
| @@ -5003,12 +5009,19 @@ int html_post_handler(const xs_dict *req, const char *q_path, | |||
| 5003 | } | 5009 | } |
| 5004 | 5010 | ||
| 5005 | if (status == HTTP_STATUS_SEE_OTHER) { | 5011 | if (status == HTTP_STATUS_SEE_OTHER) { |
| 5006 | const char *redir = xs_dict_get(p_vars, "redir"); | 5012 | const char *hard_redir = xs_dict_get(p_vars, "hard-redir"); |
| 5007 | 5013 | ||
| 5008 | if (xs_is_null(redir)) | 5014 | if (xs_is_string(hard_redir)) |
| 5009 | redir = "top"; | 5015 | *body = xs_dup(hard_redir); |
| 5016 | else { | ||
| 5017 | const char *redir = xs_dict_get(p_vars, "redir"); | ||
| 5018 | |||
| 5019 | if (xs_is_null(redir)) | ||
| 5020 | redir = "top"; | ||
| 5021 | |||
| 5022 | *body = xs_fmt("%s/admin#%s", snac.actor, redir); | ||
| 5023 | } | ||
| 5010 | 5024 | ||
| 5011 | *body = xs_fmt("%s/admin#%s", snac.actor, redir); | ||
| 5012 | *b_size = strlen(*body); | 5025 | *b_size = strlen(*body); |
| 5013 | } | 5026 | } |
| 5014 | 5027 | ||