]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/extra/m_ldapauth.cpp
Add initial query support to m_mysql [patch by Athenon]
[user/henk/code/inspircd.git] / src / modules / extra / m_ldapauth.cpp
index 1bc0925da5dae3b2e8f17d417bd93d7a0307774d..8ffccd8632e3d6d873e6644074f5c04987578e08 100644 (file)
@@ -111,20 +111,20 @@ public:
                return true;
        }
 
-       virtual int OnUserRegister(User* user)
+       virtual ModResult OnUserRegister(User* user)
        {
                if ((!allowpattern.empty()) && (InspIRCd::Match(user->nick,allowpattern)))
                {
                        user->Extend("ldapauthed");
-                       return 0;
+                       return MOD_RES_PASSTHRU;
                }
 
                if (!CheckCredentials(user))
                {
                        ServerInstance->Users->QuitUser(user, killreason);
-                       return 1;
+                       return MOD_RES_DENY;
                }
-               return 0;
+               return MOD_RES_PASSTHRU;
        }
 
        bool CheckCredentials(User* user)
@@ -146,7 +146,7 @@ public:
                        {
                                // Attempt to reconnect if the connection dropped
                                if (verbose)
-                                       ServerInstance->SNO->WriteToSnomask('a', "LDAP server has gone away - reconnecting...");
+                                       ServerInstance->SNO->WriteToSnoMask('a', "LDAP server has gone away - reconnecting...");
                                Connect();
                                res = ldap_sasl_bind_s(conn, username.c_str(), LDAP_SASL_SIMPLE, &cred, NULL, NULL, NULL);
                        }
@@ -217,9 +217,9 @@ public:
                user->Shrink("ldapauth_failed");
        }
 
-       virtual bool OnCheckReady(User* user)
+       virtual ModResult OnCheckReady(User* user)
        {
-               return user->GetExt("ldapauthed");
+               return user->GetExt("ldapauthed") ? MOD_RES_PASSTHRU : MOD_RES_DENY;
        }
 
        virtual Version GetVersion()