From 8ca5be64b013f2c22f3667c34e79f78b65c04eb6 Mon Sep 17 00:00:00 2001
From: Juan Fuentes <juanf@bs-mbpr28.d.ethz.ch>
Date: Mon, 16 Sep 2019 16:10:08 +0200
Subject: [PATCH] SSDM-8751 : More better user profile

---
 .../html/js/views/UserProfile/UserProfileController.js | 10 +++++++---
 .../html/js/views/UserProfile/UserProfileView.js       | 10 ++++++----
 2 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/UserProfile/UserProfileController.js b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/UserProfile/UserProfileController.js
index 93d3c3fc9e2..3dcb8b68608 100644
--- a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/UserProfile/UserProfileController.js
+++ b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/UserProfile/UserProfileController.js
@@ -54,9 +54,13 @@ function UserProfileController(mainController, mode) {
 		this.setSettingValue(this._zenodoApiTokenKey, userInformation.zenodoToken);
 		this._mainController.serverFacade.updateUserInformation(userId, userInformation, (function(ok) {
 			if (ok) {
-				Util.showInfo("Profile saved. You will be logged out automatically in order to reload the profile data upon login.", (function() {
-					this._mainController.serverFacade.logout();
-				}).bind(this));
+				if(this.isFileAuthentication()) {
+				    Util.showInfo("Profile saved. You will be logged out automatically in order to reload the profile data upon login.", (function() {
+					    this._mainController.serverFacade.logout();
+				    }).bind(this));
+				} else {
+				    mainController.changeView("showUserProfilePage");
+				}
 			}
 		}).bind(this));
 	}
diff --git a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/UserProfile/UserProfileView.js b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/UserProfile/UserProfileView.js
index 65d80e7574d..3bc96d0b85e 100644
--- a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/UserProfile/UserProfileView.js
+++ b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/UserProfile/UserProfileView.js
@@ -97,12 +97,14 @@ function UserProfileView(userProfileController, userProfileModel) {
     }
 
 	this._getOptionsMenu = function() {
-        var items = [
-            {
+        var items = [];
+        if(this._userProfileController.isFileAuthentication()) {
+            items.push({
                 label : "Change Password",
                 event : this._userProfileController.resetPassword.bind(this._userProfileController),
-            }
-        ];
+            })
+        }
+
         return FormUtil.getOperationsMenu(items);
 	}
 
-- 
GitLab