- if (result == true) {
- Client_SetUser(client, Client_OrigUser(client), true);
- (void)Hello_User_PostAuth(client);
- } else
- Reject_Client(client);
-}
-
-#endif
-
-
-/**
- * Reject a client because of wrong password.
- *
- * This function is called either when the global server password or a password
- * checked using PAM has been wrong.
- *
- * @param Client The client to reject.
- */
-static void
-Reject_Client(CLIENT *Client)
-{
- Log(LOG_ERR,
- "User \"%s\" rejected (connection %d): Access denied!",
- Client_Mask(Client), Client_Conn(Client));
- Conn_Close(Client_Conn(Client), NULL,
- "Access denied! Bad password?", true);
-}
-
-
-/**
- * Finish client registration.
- *
- * Introduce the new client to the network and send all "hello messages"
- * to it after authentication has been succeeded.
- *
- * @param Client The client logging in.
- * @returns CONNECTED or DISCONNECTED.
- */
-static bool
-Hello_User_PostAuth(CLIENT *Client)
-{
- Introduce_Client(NULL, Client, CLIENT_USER);
-
- if (!IRC_WriteStrClient
- (Client, RPL_WELCOME_MSG, Client_ID(Client), Client_Mask(Client)))
- return false;
- if (!IRC_WriteStrClient
- (Client, RPL_YOURHOST_MSG, Client_ID(Client),
- Client_ID(Client_ThisServer()), PACKAGE_VERSION, TARGET_CPU,
- TARGET_VENDOR, TARGET_OS))
- return false;
- if (!IRC_WriteStrClient
- (Client, RPL_CREATED_MSG, Client_ID(Client), NGIRCd_StartStr))
- return false;
- if (!IRC_WriteStrClient
- (Client, RPL_MYINFO_MSG, Client_ID(Client),
- Client_ID(Client_ThisServer()), PACKAGE_VERSION, USERMODES,
- CHANMODES))
- return false;
-
- /* Features supported by this server (005 numeric, ISUPPORT),
- * see <http://www.irc.org/tech_docs/005.html> for details. */
- if (!IRC_Send_ISUPPORT(Client))
- return DISCONNECTED;
-
- if (!IRC_Send_LUSERS(Client))
- return DISCONNECTED;
- if (!IRC_Show_MOTD(Client))
- return DISCONNECTED;
-
- /* Suspend the client for a second ... */
- IRC_SetPenalty(Client, 1);
-