diff options
Diffstat (limited to 'admin.c')
-rw-r--r-- | admin.c | 22 |
1 files changed, 15 insertions, 7 deletions
@@ -1,16 +1,24 @@ +#include <stdlib.h> +#include <stdbool.h> #include "login.h" #include "icclient/admin.h" -void icclient_admin_login(size_t (*handler)(void *, size_t, size_t, void *), - struct icclient_member *member, const char *username, - const char *password, const char *successpage, const char *nextpage, - const char *failpage) +typedef struct icclient_admin icclient_admin; + +icclient_admin *icclient_admin_login(const char *username, const char *password, + const char *successpage, const char *nextpage, const char *failpage, + size_t (*handler)(void *, size_t, size_t, void *)) { - login(handler, member, username, password, NULL, "MMLogin", successpage, nextpage, - failpage); + icclient_admin *admin = malloc(sizeof(icclient_admin)); + admin->name = NULL; + admin->username = NULL; + admin->super = false; + login(username, password, NULL, "MMLogin", successpage, nextpage, failpage, + handler, admin); + return admin; } -void icclient_admin_logout() +void icclient_admin_logout(icclient_admin *admin) { request(NULL, NULL, NULL, "%s", "admin/login"); } |