Loading src/auth.cpp +7 −7 Original line number Diff line number Diff line Loading @@ -49,7 +49,10 @@ blogi::Auth::~Auth(){ bool blogi::Auth::login(const char* username, const char* password, std::string& ssid){ #ifdef LDAPSUPPORT return ldapLogin(username,password,ssid); if(!ldapLogin(username,password,ssid)) return locallogin(username,password,ssid); else return true; #else return locallogin(username,password,ssid); #endif Loading @@ -65,9 +68,6 @@ bool blogi::Auth::ldapLogin(const char *username,const char *password,std::strin timeval ltimeout; ltimeout.tv_sec = 5; char filter[255]; snprintf(filter, 255, Config::getInstance()->getlpfilter(), username); LDAP* userldap; LDAPControl* userserverctls = nullptr; LDAPControl* userclientctls = nullptr; Loading Loading @@ -107,9 +107,9 @@ bool blogi::Auth::ldapLogin(const char *username,const char *password,std::strin LDAPMessage* answer, * entry; struct timeval timeout; timeout.tv_sec = 5; timeout.tv_sec = 1; ulerr = ldap_search_ext_s(userldap, Config::getInstance()->getlpbasedn(), LDAP_SCOPE_SUBTREE, filter, attrs, 0, &userserverctls, &userclientctls, &timeout, 0, &answer); ulerr = ldap_search_ext_s(userldap, Config::getInstance()->getlpbasedn(), LDAP_SCOPE_SUBTREE, Config::getInstance()->getlpfilter(), attrs, 0, &userserverctls, &userclientctls, &timeout, 0, &answer); if (ulerr != LDAP_SUCCESS) { excep[libhttppp::HTTPException::Note] << "<span>User can'T find uid !</span>"; Loading @@ -118,7 +118,7 @@ bool blogi::Auth::ldapLogin(const char *username,const char *password,std::strin size_t entries_found = ldap_count_entries(userldap, answer); if (entries_found == 0) { if (entries_found <= 0) { excep[libhttppp::HTTPException::Note] << "<span>User can'T find uid !</span>"; throw excep; } Loading Loading
src/auth.cpp +7 −7 Original line number Diff line number Diff line Loading @@ -49,7 +49,10 @@ blogi::Auth::~Auth(){ bool blogi::Auth::login(const char* username, const char* password, std::string& ssid){ #ifdef LDAPSUPPORT return ldapLogin(username,password,ssid); if(!ldapLogin(username,password,ssid)) return locallogin(username,password,ssid); else return true; #else return locallogin(username,password,ssid); #endif Loading @@ -65,9 +68,6 @@ bool blogi::Auth::ldapLogin(const char *username,const char *password,std::strin timeval ltimeout; ltimeout.tv_sec = 5; char filter[255]; snprintf(filter, 255, Config::getInstance()->getlpfilter(), username); LDAP* userldap; LDAPControl* userserverctls = nullptr; LDAPControl* userclientctls = nullptr; Loading Loading @@ -107,9 +107,9 @@ bool blogi::Auth::ldapLogin(const char *username,const char *password,std::strin LDAPMessage* answer, * entry; struct timeval timeout; timeout.tv_sec = 5; timeout.tv_sec = 1; ulerr = ldap_search_ext_s(userldap, Config::getInstance()->getlpbasedn(), LDAP_SCOPE_SUBTREE, filter, attrs, 0, &userserverctls, &userclientctls, &timeout, 0, &answer); ulerr = ldap_search_ext_s(userldap, Config::getInstance()->getlpbasedn(), LDAP_SCOPE_SUBTREE, Config::getInstance()->getlpfilter(), attrs, 0, &userserverctls, &userclientctls, &timeout, 0, &answer); if (ulerr != LDAP_SUCCESS) { excep[libhttppp::HTTPException::Note] << "<span>User can'T find uid !</span>"; Loading @@ -118,7 +118,7 @@ bool blogi::Auth::ldapLogin(const char *username,const char *password,std::strin size_t entries_found = ldap_count_entries(userldap, answer); if (entries_found == 0) { if (entries_found <= 0) { excep[libhttppp::HTTPException::Note] << "<span>User can'T find uid !</span>"; throw excep; } Loading