Added changes for Sharelatex/Overleaf 5.0.6; Added Track Changes.

This commit is contained in:
Simon M. Haller-Seeber
2024-06-24 16:36:53 +02:00
parent 09a38afa57
commit ddd0a14b3e
10 changed files with 129 additions and 561 deletions

View File

@@ -1,12 +1,9 @@
19a20,25
> // >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
19a20,22
> const fs = require("fs")
> const { Client } = require("ldapts")
> const ldapEscape = require("ldap-escape")
> // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
120a124,132
>
120a127,136
> // >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
> _checkUserPassword2(query, password, callback) {
> // leave original _checkUserPassword untouched, because it will be called by
> // setUserPasswordInV2 (e.g. UserRegistrationHandler.js )
@@ -14,17 +11,16 @@
> AuthenticationManager.authUserObj(error, user, query, password, callback)
> })
> },
> // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
>
126c142,144
122c134,138
< AuthenticationManager._checkUserPassword(
---
> // >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
> if (typeof callback === 'undefined') {
> callback = auditLog
> auditLog = null
> }
> AuthenticationManager._checkUserPassword2(
> // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
190a209,488
>
> // >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
201a218,467
> /**
> * login with any password
> */
@@ -32,33 +28,6 @@
> callback(null, user, true)
> },
>
> createIfNotFoundAndLogin(
> query,
> callback,
> uid,
> firstname,
> lastname,
> mail,
> isAdmin
> ) {
> User.findOne(query, (error, user) => {
> if (error) {
> console.log(error)
> }
>
> AuthenticationManager.createIfNotExistAndLogin(
> query,
> user,
> callback,
> uid,
> firstname,
> lastname,
> mail,
> isAdmin
> )
> })
> },
>
> createIfNotExistAndLogin(
> query,
> user,
@@ -70,9 +39,10 @@
> isAdmin
> ) {
> if (!user) {
> //console.log('Creating User:' + JSON.stringify(query))
> //create random pass for local userdb, does not get checked for ldap users during login
> const pass = require("crypto").randomBytes(32).toString("hex")
> console.log('Creating User', { mail, uid, firstname, lastname, isAdmin, pass })
> let pass = require("crypto").randomBytes(32).toString("hex")
> //console.log('Creating User:' + JSON.stringify(query) + 'Random Pass' + pass)
>
> const userRegHand = require("../User/UserRegistrationHandler.js")
> userRegHand.registerNewUser(
@@ -102,7 +72,6 @@
> }
> ) // end register user
> } else {
> console.log('User exists', { mail })
> AuthenticationManager.login(user, "randomPass", callback)
> }
> },
@@ -302,4 +271,3 @@
> }
> })
> },
> // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<