diff options
| -rw-r--r-- | html.c | 11 |
1 files changed, 11 insertions, 0 deletions
| @@ -243,6 +243,9 @@ d_char *html_top_controls(snac *snac, d_char *s) | |||
| 243 | "<textarea name=\"bio\" cols=\"40\" rows=\"4\">%s</textarea></p>\n" | 243 | "<textarea name=\"bio\" cols=\"40\" rows=\"4\">%s</textarea></p>\n" |
| 244 | 244 | ||
| 245 | "<p>%s:<br>\n" | 245 | "<p>%s:<br>\n" |
| 246 | "<input type=\"text\" name=\"email\" value=\"%s\"></p>\n" | ||
| 247 | |||
| 248 | "<p>%s:<br>\n" | ||
| 246 | "<input type=\"password\" name=\"passwd1\" value=\"\"></p>\n" | 249 | "<input type=\"password\" name=\"passwd1\" value=\"\"></p>\n" |
| 247 | 250 | ||
| 248 | "<p>%s:<br>\n" | 251 | "<p>%s:<br>\n" |
| @@ -257,6 +260,10 @@ d_char *html_top_controls(snac *snac, d_char *s) | |||
| 257 | "</div>\n" | 260 | "</div>\n" |
| 258 | "</div>\n"; | 261 | "</div>\n"; |
| 259 | 262 | ||
| 263 | char *email = xs_dict_get(snac->config, "email"); | ||
| 264 | if (xs_is_null(email)) | ||
| 265 | email = ""; | ||
| 266 | |||
| 260 | xs *s1 = xs_fmt(_tmpl, | 267 | xs *s1 = xs_fmt(_tmpl, |
| 261 | snac->actor, | 268 | snac->actor, |
| 262 | L("Post"), | 269 | L("Post"), |
| @@ -277,6 +284,8 @@ d_char *html_top_controls(snac *snac, d_char *s) | |||
| 277 | xs_dict_get(snac->config, "avatar"), | 284 | xs_dict_get(snac->config, "avatar"), |
| 278 | L("Bio"), | 285 | L("Bio"), |
| 279 | xs_dict_get(snac->config, "bio"), | 286 | xs_dict_get(snac->config, "bio"), |
| 287 | L("Email address for notifications"), | ||
| 288 | email, | ||
| 280 | L("Password (only to change it)"), | 289 | L("Password (only to change it)"), |
| 281 | L("Repeat Password"), | 290 | L("Repeat Password"), |
| 282 | L("Update user info") | 291 | L("Update user info") |
| @@ -1053,6 +1062,8 @@ int html_post_handler(d_char *req, char *q_path, d_char *payload, int p_size, | |||
| 1053 | snac.config = xs_dict_set(snac.config, "avatar", v); | 1062 | snac.config = xs_dict_set(snac.config, "avatar", v); |
| 1054 | if ((v = xs_dict_get(p_vars, "bio")) != NULL) | 1063 | if ((v = xs_dict_get(p_vars, "bio")) != NULL) |
| 1055 | snac.config = xs_dict_set(snac.config, "bio", v); | 1064 | snac.config = xs_dict_set(snac.config, "bio", v); |
| 1065 | if ((v = xs_dict_get(p_vars, "email")) != NULL) | ||
| 1066 | snac.config = xs_dict_set(snac.config, "email", v); | ||
| 1056 | 1067 | ||
| 1057 | /* password change? */ | 1068 | /* password change? */ |
| 1058 | if ((p1 = xs_dict_get(p_vars, "passwd1")) != NULL && | 1069 | if ((p1 = xs_dict_get(p_vars, "passwd1")) != NULL && |