Commit 13b76926 authored by Simon M. Haller-Seeber's avatar Simon M. Haller-Seeber
Browse files

Some minor update

parent 26b1aca3
Loading
Loading
Loading
Loading
+6 −0
Changes for README.md: 6 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -34,6 +34,12 @@ db.users.find({email:"EMAIL"}).pretty()
db.users.update({email : OLDEMAIL},{$set: { email : NEWEMAIL}});
```

## Coming soon

- Option that Admins can invite non LDAP User



## Configuration

### Domain Configuration
+3 −0
Changes for docker-compose.yml: 3 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -48,6 +48,9 @@ services:
            LDAP_BINDDN: ou=someunit,ou=people,dc=DOMAIN,dc=TLS
            # By default tries to bind directly with the ldap user - this user has to be in the LDAP GROUP
            LDAP_GROUP_FILTER: '(memberof=cn=GROUPNAME,ou=groups,dc=DOMAIN,dc=TLD)'
            #LDAP_GROUP_FILTER: '(memberof=GROUPNAME,ou=groups,dc=DOMAIN,dc=TLD)'
            # if user is in ADMIN_GROUP on user creation (first login) isAdmin is set to true.
            #LDAP_ADMIN_GROUP_FILTER: '(memberof=cn=ADMINGROUPNAME,ou=groups,dc=DOMAIN,dc=TLD)'
            LDAP_CONTACTS: 'false'

            # Same property, unfortunately with different names in
+13 −7
Changes for ldap-overleaf-sl/sharelatex/AuthenticationManager.js: 13 added lines, 7 removed lines.
Original line number Diff line number Diff line
@@ -59,7 +59,6 @@ const AuthenticationManager = {
      let pass = require("crypto").randomBytes(32).toString("hex")
      const userRegHand = require('../User/UserRegistrationHandler.js')
      userRegHand.registerNewUser({
        //_id: uid,
        email: mail,
        first_name: firstname,
        last_name: lastname,
@@ -70,11 +69,7 @@ const AuthenticationManager = {
          console.log(error)
        }
        user.email = mail
        if (isAdmin) {
          user.admin = true
        } else {
          user.admin = false
        }
        user.isAdmin = isAdmin
        user.emails[0].confirmedAt = Date.now()
        user.save()
        //console.log("user %s added to local library: ", mail)
@@ -93,8 +88,19 @@ const AuthenticationManager = {
  },

  authUserObj(error, user, query, password, callback) {
    // check if user is in ldap and logon if the ldapuser exists.
    // check if user is in ldap and logon if the ldapuser exists
    // external email login
    if (user && user.hashedPassword) {
      console.log("email login for existing user")
      bcrypt.compare(password, user.hashedPassword, function (error, match) {
        if (match) {
          console.log("Fine")
          AuthenticationManager.login(user, password, callback)
        }
      })
    } else {
      AuthenticationManager.ldapAuth(query, password, AuthenticationManager.createIfNotExistAndLogin, callback, user)
    }
    return null
  },