X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/disorder/blobdiff_plain/e61aef23714a47c79899ba5bc838c1f1f2a14618..04024c2cafab56ea76a9a2b35097584d6db98c06:/lib/eclient.c diff --git a/lib/eclient.c b/lib/eclient.c index 4f13558..a8ca322 100644 --- a/lib/eclient.c +++ b/lib/eclient.c @@ -841,9 +841,11 @@ static void stash_command(disorder_eclient *c, static void string_response_opcallback(disorder_eclient *c, struct operation *op) { D(("string_response_callback")); - if(c->rc / 100 == 2) { + if(c->rc / 100 == 2 || c->rc == 555) { if(op->completed) { - if(c->protocol >= 2) { + if(c->rc == 555) + ((disorder_eclient_string_response *)op->completed)(op->v, NULL); + else if(c->protocol >= 2) { char **rr = split(c->line + 4, 0, SPLIT_QUOTES, 0, 0); if(rr && *rr) @@ -1325,6 +1327,23 @@ int disorder_eclient_edituser(disorder_eclient *c, "edituser", user, property, value, (char *)0); } +/** @brief Create a new user + * @param c Client + * @param completed Called on completion + * @param user User to create + * @param password Initial password + * @param rights Initial rights or NULL + * @param v Passed to @p completed + */ +int disorder_eclient_adduser(disorder_eclient *c, + disorder_eclient_no_response *completed, + const char *user, + const char *password, + const char *rights, + void *v) { + return simple(c, no_response_opcallback, (void (*)())completed, v, + "adduser", user, password, rights, (char *)0); +} /* Log clients ***************************************************************/