';
@@ -69,7 +69,7 @@
html += '
';
- //html += '';
+ html += '';
html += "
";
@@ -147,7 +147,7 @@
});
}
- function rejectInvitation(page, id) {
+ function deleteServer(page, id) {
Dashboard.showLoadingMsg();
@@ -164,11 +164,29 @@
});
}
+ function rejectInvitation(page, id) {
+
+ Dashboard.showLoadingMsg();
+
+ // Add/Update connect info
+ ConnectionManager.rejectServer(id).done(function () {
+
+ Dashboard.hideLoadingMsg();
+ loadPage(page);
+
+ }).fail(function () {
+
+ showGeneralError();
+
+ });
+ }
+
function showServerMenu(elem) {
var card = $(elem).parents('.card');
var page = $(elem).parents('.page');
var id = card.attr('data-id');
+ var connectserverid = card.attr('data-connectserverid');
$('.serverMenu', page).popup("close").remove();
@@ -177,7 +195,7 @@
html += '
';
@@ -192,7 +210,7 @@
});
$('.btnDelete', flyout).on('click', function () {
- rejectInvitation(page, this.getAttribute('data-id'));
+ deleteServer(page, this.getAttribute('data-connectserverid'));
$('.serverMenu', page).popup("close").remove();
});
}
diff --git a/dashboard-ui/scripts/site.js b/dashboard-ui/scripts/site.js
index aeceb5c61..82772e9d0 100644
--- a/dashboard-ui/scripts/site.js
+++ b/dashboard-ui/scripts/site.js
@@ -1275,7 +1275,7 @@ var Dashboard = {
initializeApiClient(ApiClient);
- ConnectionManager.addApiClient(ApiClient, true);
+ ConnectionManager.addApiClient(ApiClient, true).fail(Dashboard.logout);
}
} else {
diff --git a/dashboard-ui/scripts/useredit.js b/dashboard-ui/scripts/useredit.js
index 93ee790ed..5ece045c9 100644
--- a/dashboard-ui/scripts/useredit.js
+++ b/dashboard-ui/scripts/useredit.js
@@ -26,7 +26,8 @@
$('#chkDisabled', page).checked(user.Configuration.IsDisabled || false).checkboxradio("refresh");
$('#chkIsHidden', page).checked(user.Configuration.IsHidden || false).checkboxradio("refresh");
- $('#chkEnableRemoteControlOtherUsers', page).checked(user.Configuration.EnableRemoteControlOfOtherUsers || false).checkboxradio("refresh");
+ $('#chkRemoteControlSharedDevices', page).checked(user.Configuration.EnableSharedDeviceControl);
+ $('#chkEnableRemoteControlOtherUsers', page).checked(user.Configuration.EnableRemoteControlOfOtherUsers).checkboxradio("refresh");
$('#chkEnableMediaPlayback', page).checked(user.Configuration.EnableMediaPlayback || false).checkboxradio("refresh");
$('#chkManageLiveTv', page).checked(user.Configuration.EnableLiveTvManagement || false).checkboxradio("refresh");
@@ -72,6 +73,7 @@
user.Configuration.EnableLiveTvAccess = $('#chkEnableLiveTvAccess', page).checked();
user.Configuration.EnableContentDeletion = $('#chkEnableContentDeletion', page).checked();
user.Configuration.EnableUserPreferenceAccess = !$('#chkDisableUserPreferences', page).checked();
+ user.Configuration.EnableSharedDeviceControl = $('#chkRemoteControlSharedDevices', page).checked();
ApiClient.updateUser(user).done(function () {
onSaveComplete(page, user);
diff --git a/dashboard-ui/scripts/userprofilespage.js b/dashboard-ui/scripts/userprofilespage.js
index fc1b1bc44..aaea643b2 100644
--- a/dashboard-ui/scripts/userprofilespage.js
+++ b/dashboard-ui/scripts/userprofilespage.js
@@ -402,10 +402,29 @@
function showInvitePopup(page) {
- $('#popupInvite', page).popup('open');
+ Dashboard.getCurrentUser().done(function (user) {
- $('#txtConnectUsername', page).val('');
+ if (user.ConnectUserId) {
+ $('#popupInvite', page).popup('open');
+ $('#txtConnectUsername', page).val('');
+ } else {
+
+ var msg = Globalize.translate('MessageConnectAccountRequiredToInviteGuest');
+
+ msg += '
';
+ msg += '
';
+ msg += '
' + Globalize.translate('ButtonLinkMyMediaBrowserAccount') + '';
+ msg += '
';
+
+ Dashboard.alert({
+ message: msg,
+ title: Globalize.translate('HeaderInviteGuest')
+ });
+
+ }
+
+ });
}
$(document).on('pageinit', "#userProfilesPage", function () {
diff --git a/dashboard-ui/thirdparty/apiclient/connectionmanager.js b/dashboard-ui/thirdparty/apiclient/connectionmanager.js
index c7bdee4f4..6fa93d2f0 100644
--- a/dashboard-ui/thirdparty/apiclient/connectionmanager.js
+++ b/dashboard-ui/thirdparty/apiclient/connectionmanager.js
@@ -94,7 +94,7 @@
apiClients.push(apiClient);
- apiClient.getPublicSystemInfo().done(function (systemInfo) {
+ return apiClient.getPublicSystemInfo().done(function (systemInfo) {
var server = credentialProvider.credentials().servers.filter(function (s) {
@@ -483,6 +483,7 @@
servers = servers.map(function (i) {
return {
ExchangeToken: i.AccessKey,
+ ConnectServerId: i.Id,
Id: i.SystemId,
Name: i.Name,
RemoteAddress: i.Url,
@@ -838,6 +839,40 @@
var url = "https://connect.mediabrowser.tv/service/serverAuthorizations?serverId=" + serverId + "&userId=" + self.connectUserId();
+ return $.ajax({
+ type: "DELETE",
+ url: url,
+ headers: {
+ "X-Connect-UserToken": self.connectToken()
+ }
+
+ }).done(function () {
+
+ var credentials = credentialProvider.credentials();
+
+ credentials.servers = credentials.servers.filter(function (s) {
+ return s.ConnectServerId != serverId;
+ });
+
+ credentialProvider.credentials(credentials);
+
+ });
+ };
+
+ self.rejectServer = function (serverId) {
+
+ if (!serverId) {
+ throw new Error("null serverId");
+ }
+ if (!self.connectToken()) {
+ throw new Error("null connectToken");
+ }
+ if (!self.connectUserId()) {
+ throw new Error("null connectUserId");
+ }
+
+ var url = "https://connect.mediabrowser.tv/service/serverAuthorizations?serverId=" + serverId + "&userId=" + self.connectUserId();
+
return $.ajax({
type: "DELETE",
url: url,
diff --git a/dashboard-ui/thirdparty/apiclient/credentials.js b/dashboard-ui/thirdparty/apiclient/credentials.js
index fd1689b9b..964278465 100644
--- a/dashboard-ui/thirdparty/apiclient/credentials.js
+++ b/dashboard-ui/thirdparty/apiclient/credentials.js
@@ -8,10 +8,11 @@
var self = this;
var credentials;
+ var key = 'servercredentials3';
function ensure() {
- credentials = credentials || JSON.parse(store.getItem('servercredentials') || '{}');
+ credentials = credentials || JSON.parse(store.getItem(key) || '{}');
credentials.servers = credentials.servers || [];
}
@@ -23,12 +24,12 @@
function set(data) {
credentials = data;
- store.setItem('servercredentials', JSON.stringify(get()));
+ store.setItem(key, JSON.stringify(get()));
}
self.clear = function () {
credentials = null;
- store.removeItem('servercredentials');
+ store.removeItem(key);
};
self.credentials = function (data) {
diff --git a/dashboard-ui/tvrecommended.html b/dashboard-ui/tvrecommended.html
index b62107605..4183d1c8d 100644
--- a/dashboard-ui/tvrecommended.html
+++ b/dashboard-ui/tvrecommended.html
@@ -31,14 +31,14 @@
-
+
${NoNextUpItemsMessage}
diff --git a/dashboard-ui/useredit.html b/dashboard-ui/useredit.html
index 34ff13747..919ea7b25 100644
--- a/dashboard-ui/useredit.html
+++ b/dashboard-ui/useredit.html
@@ -25,7 +25,7 @@
-
+
@@ -49,10 +49,19 @@
-
-
+
${HeaderAdvancedControl}
diff --git a/dashboard-ui/userprofiles.html b/dashboard-ui/userprofiles.html
index 7e46fc1ec..480f38498 100644
--- a/dashboard-ui/userprofiles.html
+++ b/dashboard-ui/userprofiles.html
@@ -17,7 +17,7 @@
-
+
@@ -27,7 +27,7 @@
-
+
${HeaderPendingInvitations}