]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/extra/m_ldap.cpp
WebSocket: use one WebSocket message per IRC message.
[user/henk/code/inspircd.git] / src / modules / extra / m_ldap.cpp
index 6987381451f3b0690158219a1d786cb733bd063c..8c2752dbf3bea78f4b9a695a2b26b926a1caad5b 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 -llber */
-
 class LDAPService;
 
 class LDAPRequest
@@ -249,13 +258,13 @@ class LDAPService : public LDAPProvider, public SocketThread
                , con(NULL), config(tag), last_connect(0)
        {
                std::string scope = config->getString("searchscope");
-               if (scope == "base")
+               if (stdalgo::string::equalsci(scope, "base"))
                        searchscope = LDAP_SCOPE_BASE;
-               else if (scope == "onelevel")
+               else if (stdalgo::string::equalsci(scope, "onelevel"))
                        searchscope = LDAP_SCOPE_ONELEVEL;
                else
                        searchscope = LDAP_SCOPE_SUBTREE;
-               timeout = config->getInt("timeout", 5);
+               timeout = config->getDuration("timeout", 5);
 
                Connect();
        }
@@ -524,7 +533,7 @@ class ModuleLDAP : public Module
                {
                        const reference<ConfigTag>& tag = i->second;
 
-                       if (tag->getString("module") != "ldap")
+                       if (!stdalgo::string::equalsci(tag->getString("module"), "ldap"))
                                continue;
 
                        std::string id = tag->getString("id");