diff --git a/README.md b/README.md index 02c4ec7d..555b8cff 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,7 @@ [![Travis Build Status](https://travis-ci.org/dani-garcia/bitwarden_rs.svg?branch=master)](https://travis-ci.org/dani-garcia/bitwarden_rs) [![Docker Pulls](https://img.shields.io/docker/pulls/bitwardenrs/server.svg)](https://hub.docker.com/r/bitwardenrs/server) [![Dependency Status](https://deps.rs/repo/github/dani-garcia/bitwarden_rs/status.svg)](https://deps.rs/repo/github/dani-garcia/bitwarden_rs) +[![Code Status](https://www.codefactor.io/repository/github/liberodark/bitwarden_rs/badge)](https://www.codefactor.io/repository/github/liberodark/bitwarden_rs) [![GitHub Release](https://img.shields.io/github/release/dani-garcia/bitwarden_rs.svg)](https://github.com/dani-garcia/bitwarden_rs/releases/latest) [![GPL-3.0 Licensed](https://img.shields.io/github/license/dani-garcia/bitwarden_rs.svg)](https://github.com/dani-garcia/bitwarden_rs/blob/master/LICENSE.txt) [![Matrix Chat](https://img.shields.io/matrix/bitwarden_rs:matrix.org.svg?logo=matrix)](https://matrix.to/#/#bitwarden_rs:matrix.org) @@ -29,6 +30,7 @@ Basically full implementation of Bitwarden API is provided including: * Website icons API * Authenticator and U2F support * YubiKey OTP + * LDAP support ## Installation Pull the docker image and mount a volume from the host for persistent storage: diff --git a/src/api/identity.rs b/src/api/identity.rs index 2512619d..844c0ca0 100644 --- a/src/api/identity.rs +++ b/src/api/identity.rs @@ -96,7 +96,7 @@ fn _password_login(data: ConnectData, conn: DbConn, ip: ClientIp) -> JsonResult // Attempt to bind to ldap with these credentials match LdapConn::new(CONFIG.ldap_host().as_str()) { Ok(ldap) => { - let bind = ldap.simple_bind(ldap_username, password)?.success(); + let bind = ldap.simple_bind(ldap_username, password)?.non_error(); if bind.is_err() { err!( diff --git a/src/ldap.rs b/src/ldap.rs index 45982fcd..ee13af7d 100644 --- a/src/ldap.rs +++ b/src/ldap.rs @@ -18,8 +18,8 @@ pub fn launch_ldap_connector() { loop { if CONFIG._enable_ldap() { match sync_from_ldap(&conn) { - Err(_) => println!("Couldn't sync from LDAP, check LDAP config"), - _ => {} + Ok(_) => println!("Successfully synced LDAP users"), + Err(error) => println!("Couldn't sync from LDAP, check LDAP config : {:?}", error), } } sleep(interval); diff --git a/src/static/scripts/bootstrap-native-v4.js b/src/static/scripts/bootstrap-native-v4.js index e0cdf3a5..d31ef20e 100644 --- a/src/static/scripts/bootstrap-native-v4.js +++ b/src/static/scripts/bootstrap-native-v4.js @@ -1282,7 +1282,7 @@ if ( !!element && !(stringModal in element) ) { on(element, clickEvent, clickHandler); } - if ( !!self[content] ) { self.setContent( self[content] ); } + if ( self[content] ) { self.setContent( self[content] ); } if (element) { element[stringModal] = self; modal[modalTrigger] = element; } else { modal[stringModal] = self; } }; @@ -1372,7 +1372,7 @@ titleString = options.title || element[getAttribute](dataTitle); contentString = options.content || element[getAttribute](dataContent); // fixing https://github.com/thednp/bootstrap.native/issues/233 - contentString = !!contentString ? contentString.trim() : null; + contentString = contentString ? contentString.trim() : null; popover = DOC[createElement](div); @@ -1452,7 +1452,7 @@ updatePopover(); showPopover(); bootstrapCustomEvent.call(element, showEvent, component); - !!self[animation] ? emulateTransitionEnd(popover, showTrigger) : showTrigger(); + self[animation] ? emulateTransitionEnd(popover, showTrigger) : showTrigger(); } }, 20 ); }; @@ -1462,7 +1462,7 @@ if (popover && popover !== null && hasClass(popover,showClass)) { bootstrapCustomEvent.call(element, hideEvent, component); removeClass(popover,showClass); - !!self[animation] ? emulateTransitionEnd(popover, hideTrigger) : hideTrigger(); + self[animation] ? emulateTransitionEnd(popover, hideTrigger) : hideTrigger(); } }, self[delay] ); }; @@ -1516,7 +1516,7 @@ for (var i=0, il=links[length]; i