+ if (!Lists_CheckReason(&My_Classes[Class], Client, str, sizeof(str)))
+ return false;
+
+ switch(Class) {
+ case CLASS_GLINE:
+ snprintf(reason, len, "\"%s\" (G-Line)", str);
+ break;
+ case CLASS_KLINE:
+ snprintf(reason, len, "\"%s\" (K-Line)", str);
+ break;
+ default:
+ snprintf(reason, len, "%s", str);
+ break;
+ }
+ return true;
+}
+
+/**
+ * Check if a client is banned from this server: GLINE, KLINE.
+ *
+ * If a client isn't allowed to connect, it will be disconnected again.
+ *
+ * @param Client The client to check.
+ * @return CONNECTED if client is allowed to join, DISCONNECTED if not.
+ */
+GLOBAL bool
+Class_HandleServerBans(CLIENT *Client)
+{
+ char reject[COMMAND_LEN];
+
+ assert(Client != NULL);
+
+ if (Class_GetMemberReason(CLASS_GLINE, Client, reject, sizeof(reject)) ||
+ Class_GetMemberReason(CLASS_KLINE, Client, reject, sizeof(reject))) {
+ Client_Reject(Client, reject, true);
+ return DISCONNECTED;
+ }
+
+ return CONNECTED;