From: pk910 Date: Tue, 13 Dec 2011 20:54:40 +0000 (+0100) Subject: added custom error messages (fixed existing implementation) X-Git-Url: http://git.pk910.de/?p=iauth.git;a=commitdiff_plain;h=cbb2a0444370e80d27fb0102d11ef0b466c00380 added custom error messages (fixed existing implementation) --- diff --git a/iauth_cmd.c b/iauth_cmd.c index 5480c38..67f1d98 100644 --- a/iauth_cmd.c +++ b/iauth_cmd.c @@ -101,12 +101,17 @@ void iauth_cmd_L(struct iauth_client *client, char *arg) { iauth_stats_loc_deny(); } else { + if(strcmp(res->cclass, "error") == 0) { + iauth_query_reject(client->id, res->str); + iauth_stats_loc_deny(); + } else { if(*res->ident) iauth_query_set_username(client->id, res->ident); if(*res->host) iauth_query_sethost(client->id, res->host); if(*res->ip) iauth_query_setip(client->id, res->ip); if(*res->modes) iauth_query_setmodes(client->id, res->modes); iauth_query_assign(client->id, (*res->cclass)?res->cclass:NULL); iauth_stats_loc_allow(); + } } iauth_delid(client->id); @@ -134,12 +139,17 @@ void iauth_cmd_H(struct iauth_client *client, char *arg) { iauth_stats_def_deny(); } else { + if(strcmp(res->cclass, "error") == 0) { + iauth_query_reject(client->id, res->str); + iauth_stats_loc_deny(); + } else { if(*res->ident) iauth_query_set_username(client->id, res->ident); if(*res->host) iauth_query_sethost(client->id, res->host); if(*res->ip) iauth_query_setip(client->id, res->ip); if(*res->modes) iauth_query_setmodes(client->id, res->modes); iauth_query_assign(client->id, (*res->cclass)?res->cclass:NULL); iauth_stats_def_allow(); + } } iauth_delid(client->id);