struct url_info info;
char *data;
+ if (!blerg_init())
+ exit(1);
+
if (cgi_init() != CGIERR_NONE)
exit(0);
} else {
respond_blergref_list(feedlist, recs);
}
+
+ struct blerg *b = blerg_open(username);
+ blerg_set_subscription_mark(b);
+ blerg_close(b);
} else if (strncmp(path, "/feedinfo", 9) == 0) {
const char *username = cgi_getentrystr("username");
if (!check_auth(username))
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) {
+ respond_JSON_Failure();
+ } else {
+ if (auth_check_password(username, password)) {
+ auth_set_password(username, new_password);
+ respond_JSON_Success();
+ } else {
+ respond_JSON_Failure();
+ }
+ }
} else {
respond_404();
exit(0);