]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/extra/m_ldap.cpp
Initial support for listening on UNIX socket endpoints.
[user/henk/code/inspircd.git] / src / modules / extra / m_ldap.cpp
index c1102583600d1defcb15f6215725a6d218a19e5e..f3ace540932854886f6f70699a1b160a34166170 100644 (file)
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+/// $LinkerFlags: -llber -lldap_r
+
+/// $PackageInfo: require_system("centos") openldap-devel
+/// $PackageInfo: require_system("debian") libldap2-dev
+/// $PackageInfo: require_system("ubuntu") libldap2-dev
+
 #include "inspircd.h"
 #include "modules/ldap.h"
 
+// Ignore OpenLDAP deprecation warnings on OS X Yosemite and newer.
+#if defined __APPLE__
+# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+
 #include <ldap.h>
 
 #ifdef _WIN32
@@ -27,8 +38,6 @@
 # pragma comment(lib, "liblber.lib")
 #endif
 
-/* $LinkerFlags: -lldap_r */
-
 class LDAPService;
 
 class LDAPRequest
@@ -170,7 +179,6 @@ class LDAPService : public LDAPProvider, public SocketThread
        time_t last_connect;
        int searchscope;
        time_t timeout;
-       time_t last_timeout_check;
 
  public:
        static LDAPMod** BuildMods(const LDAPMods& attributes)
@@ -247,7 +255,7 @@ class LDAPService : public LDAPProvider, public SocketThread
 
        LDAPService(Module* c, ConfigTag* tag)
                : LDAPProvider(c, "LDAP/" + tag->getString("id"))
-               , con(NULL), config(tag), last_connect(0), last_timeout_check(0)
+               , con(NULL), config(tag), last_connect(0)
        {
                std::string scope = config->getString("searchscope");
                if (scope == "base")
@@ -256,7 +264,7 @@ class LDAPService : public LDAPProvider, public SocketThread
                        searchscope = LDAP_SCOPE_ONELEVEL;
                else
                        searchscope = LDAP_SCOPE_SUBTREE;
-               timeout = config->getInt("timeout", 5);
+               timeout = config->getDuration("timeout", 5);
 
                Connect();
        }