added custom error messages (fixed existing implementation) master
authorpk910 <philipp@zoelle1.de>
Tue, 13 Dec 2011 20:54:40 +0000 (21:54 +0100)
committerpk910 <philipp@zoelle1.de>
Tue, 13 Dec 2011 20:54:40 +0000 (21:54 +0100)
iauth_cmd.c

index 5480c380df187f9fca3c0e14d785e0f80d56feef..67f1d98c2511edbfc0ab5c3ee2d607bb015a4a39 100644 (file)
@@ -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);