+ yajl_gen_string(g, "subscribed", 10);
+ ret = parse_url_info(path + 10, &info);
+ if ((ret & URL_INFO_NAME) == 1) {
+ yajl_gen_bool(g, is_subscribed(username, info.name));
+ } else {
+ yajl_gen_bool(g, 0);
+ }
+ }
+ yajl_gen_map_close(g);
+
+ const unsigned char *ybuf;
+ yajl_gen_get_buf(g, &ybuf, &len);
+
+ printf("Content-type: application/json\r\n");
+ printf("Content-length: %d\r\n\r\n", len);
+ fwrite(ybuf, len, 1, stdout);
+
+ yajl_gen_free(g);
+ } else if (strncmp(path, "/passwd", 7) == 0) {
+ const char *username = cgi_getentrystr("username");
+ if (!check_auth(username))
+ exit(0);
+
+ const char *password = cgi_getentrystr("password");
+ const char *new_password = cgi_getentrystr("new_password");
+ if (password == NULL || new_password == NULL) {