diff --git a/src/controllers/loginpage.js b/src/controllers/loginpage.js index 2f396ff5eb..1c291e4c20 100644 --- a/src/controllers/loginpage.js +++ b/src/controllers/loginpage.js @@ -146,12 +146,8 @@ define(["apphost", "appSettings", "dom", "connectionManager", "loading", "cardSt var apiClient = getApiClient(); apiClient.getPublicUsers().then(function(users) { if (users.length) { - if (users[0].EnableAutoLogin) { - authenticateUserByName(view, apiClient, users[0].Name, ""); - } else { - showVisualForm(); - loadUserList(view, apiClient, users); - } + showVisualForm(); + loadUserList(view, apiClient, users); } else { view.querySelector("#txtManualName").value = ""; showManualForm(view, false, false); diff --git a/src/controllers/mypreferencescommon.js b/src/controllers/mypreferencescommon.js index 51e9c10869..5423c52948 100644 --- a/src/controllers/mypreferencescommon.js +++ b/src/controllers/mypreferencescommon.js @@ -7,14 +7,15 @@ define(["apphost", "connectionManager", "listViewStyle", "emby-button"], functio }); view.addEventListener("viewshow", function() { - var page = this; + // this page can also be used by admins to change user preferences from the user edit page var userId = params.userId || Dashboard.getCurrentUserId(); + var page = this; - page.querySelector(".lnkDisplayPreferences").setAttribute("href", "mypreferencesdisplay.html?userId=" + userId); - page.querySelector(".lnkLanguagePreferences").setAttribute("href", "mypreferenceslanguages.html?userId=" + userId); - page.querySelector(".lnkSubtitleSettings").setAttribute("href", "mypreferencessubtitles.html?userId=" + userId); - page.querySelector(".lnkHomeScreenPreferences").setAttribute("href", "mypreferenceshome.html?userId=" + userId); page.querySelector(".lnkMyProfile").setAttribute("href", "myprofile.html?userId=" + userId); + page.querySelector(".lnkDisplayPreferences").setAttribute("href", "mypreferencesdisplay.html?userId=" + userId); + page.querySelector(".lnkHomePreferences").setAttribute("href", "mypreferenceshome.html?userId=" + userId); + page.querySelector(".lnkLanguagePreferences").setAttribute("href", "mypreferenceslanguages.html?userId=" + userId); + page.querySelector(".lnkSubtitlePreferences").setAttribute("href", "mypreferencessubtitles.html?userId=" + userId); if (appHost.supports("multiserver")) { page.querySelector(".selectServer").classList.remove("hide") @@ -22,19 +23,15 @@ define(["apphost", "connectionManager", "listViewStyle", "emby-button"], functio page.querySelector(".selectServer").classList.add("hide"); } - connectionManager.user(ApiClient).then(function(user) { - if (user.localUser && !user.localUser.EnableAutoLogin) { - view.querySelector(".btnLogout").classList.remove("hide"); - } else { - view.querySelector(".btnLogout").classList.add("hide"); - } - }); + // hide the actions if user preferences are being edited for a different user + if (params.userId && params.userId !== Dashboard.getCurrentUserId) { + page.querySelector(".userSection").classList.add("hide"); + page.querySelector(".adminSection").classList.add("hide"); + } - Dashboard.getCurrentUser().then(function(user) { + ApiClient.getUser(userId).then(function(user) { page.querySelector(".headerUsername").innerHTML = user.Name; - if (user.Policy.IsAdministrator) { - page.querySelector(".adminSection").classList.remove("hide"); - } else { + if (!user.Policy.IsAdministrator) { page.querySelector(".adminSection").classList.add("hide"); } }); diff --git a/src/mypreferencesmenu.html b/src/mypreferencesmenu.html index eda9d4208b..008c39b431 100644 --- a/src/mypreferencesmenu.html +++ b/src/mypreferencesmenu.html @@ -22,7 +22,7 @@ - +
home
@@ -40,7 +40,7 @@
- +
closed_caption
@@ -49,52 +49,43 @@
-
+

${HeaderAdmin}

-
- - - -
+ diff --git a/src/scripts/librarymenu.js b/src/scripts/librarymenu.js index d25c4066c1..484ee1135d 100644 --- a/src/scripts/librarymenu.js +++ b/src/scripts/librarymenu.js @@ -201,11 +201,9 @@ define(["dom", "layoutManager", "inputManager", "connectionManager", "events", " if (appHost.supports("multiserver")) { html += 'wifi' + globalize.translate("ButtonSelectServer") + ""; } - if (!user.localUser.EnableAutoLogin) { - html += 'exit_to_app' + globalize.translate("ButtonSignOut") + ""; - } + html += 'exit_to_app' + globalize.translate("ButtonSignOut") + ""; + html += "
"; } - html += "
"; // add buttons to navigation drawer navDrawerScrollContainer.innerHTML = html;