From c77757a8becbf14c48bb35f6878f3e5d36528652 Mon Sep 17 00:00:00 2001 From: juanf <juanf> Date: Mon, 29 May 2017 14:33:59 +0000 Subject: [PATCH] SSDM-5050 : Modification to file-based authentication user creation (template call) SVN: 38225 --- .../1/dss/reporting-plugins/eln-lims-api/script.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/dss/reporting-plugins/eln-lims-api/script.py b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/dss/reporting-plugins/eln-lims-api/script.py index 6c926ccdf14..67ca2f44b05 100644 --- a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/dss/reporting-plugins/eln-lims-api/script.py +++ b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/dss/reporting-plugins/eln-lims-api/script.py @@ -191,6 +191,8 @@ def process(tr, parameters, tableBuilder): isOk = True; if method == "registerUserPassword": isOk = registerUserPassword(tr, parameters, tableBuilder); + if method == "updateUserInformation": + isOk = updateUserInformation(tr, parameters, tableBuilder); if method == "getDirectLinkURL": result = getDirectLinkURL(); isOk = True; @@ -469,6 +471,18 @@ def registerUserPassword(tr, parameters, tableBuilder): return True; else: return False; + +def updateUserInformation(tr, parameters, tableBuilder): + userId = parameters.get("userId"); #String + firstName = parameters.get("firstName"); #String + lastName = parameters.get("lastName"); #String + email = parameters.get("email"); #String + path = '../openBIS-server/jetty/bin/passwd.sh'; + if os.path.isfile(path): + subprocess.call([path, 'change', userId, '-f', firstName, '-l', lastName, '-e', email]) #Changes the user info, fails silently if the user doesnt exist + return True; + else: + return False; def getThreadProperties(transaction): threadPropertyDict = {} -- GitLab