-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/user.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/user.controller.js
index 5979962128..6048edfa95 100644
--- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/user.controller.js
+++ b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/user.controller.js
@@ -1,10 +1,12 @@
angular.module("umbraco")
- .controller("Umbraco.Dialogs.UserController", function ($scope, $location, $timeout, userService, historyService, eventsService) {
+ .controller("Umbraco.Dialogs.UserController", function ($scope, $location, $timeout, userService, historyService, eventsService, externalLoginInfo, authResource) {
- $scope.user = userService.getCurrentUser();
$scope.history = historyService.getCurrent();
$scope.version = Umbraco.Sys.ServerVariables.application.version + " assembly: " + Umbraco.Sys.ServerVariables.application.assemblyVersion;
+ $scope.externalLoginProviders = externalLoginInfo.providers;
+ $scope.externalLinkLoginFormAction = Umbraco.Sys.ServerVariables.umbracoUrls.externalLinkLoginsUrl;
+
var evtHandlers = [];
evtHandlers.push(eventsService.on("historyService.add", function (e, args) {
$scope.history = args.all;
@@ -49,16 +51,49 @@ angular.module("umbraco")
}, 1000, false); // 1 second, do NOT execute a global digest
}
- //get the user
- userService.getCurrentUser().then(function (user) {
- $scope.user = user;
- if ($scope.user) {
- $scope.remainingAuthSeconds = $scope.user.remainingAuthSeconds;
- $scope.canEditProfile = _.indexOf($scope.user.allowedSections, "users") > -1;
- //set the timer
- updateTimeout();
+ function updateUserInfo() {
+ //get the user
+ userService.getCurrentUser().then(function (user) {
+ $scope.user = user;
+ if ($scope.user) {
+ $scope.remainingAuthSeconds = $scope.user.remainingAuthSeconds;
+ $scope.canEditProfile = _.indexOf($scope.user.allowedSections, "users") > -1;
+ //set the timer
+ updateTimeout();
+
+ authResource.getCurrentUserLinkedLogins().then(function(logins) {
+ //reset all to be un-linked
+ for (var provider in $scope.externalLoginProviders) {
+ $scope.externalLoginProviders[provider].linkedProviderKey = undefined;
+ }
+
+ //set the linked logins
+ for (var login in logins) {
+ var found = _.find($scope.externalLoginProviders, function (i) {
+ return i.authType == login;
+ });
+ if (found) {
+ found.linkedProviderKey = logins[login];
+ }
+ }
+ });
+ }
+ });
+ }
+
+ $scope.unlink = function (e, loginProvider, providerKey) {
+ var result = confirm("Are you sure you want to unlink this account?");
+ if (!result) {
+ e.preventDefault();
+ return;
}
- });
+
+ authResource.unlinkLogin(loginProvider, providerKey).then(function (a, b, c) {
+ updateUserInfo();
+ });
+ }
+
+ updateUserInfo();
//remove all event handlers
$scope.$on('$destroy', function () {
diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/user.html b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/user.html
index ff71cec524..8346acfabb 100644
--- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/user.html
+++ b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/user.html
@@ -1,48 +1,81 @@
-
-
\ No newline at end of file
diff --git a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj
index f51d61b15c..095cf28afc 100644
--- a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj
+++ b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj
@@ -151,7 +151,35 @@
False
..\packages\Lucene.Net.2.9.4.1\lib\net40\Lucene.Net.dll
+
+ ..\packages\Microsoft.AspNet.Identity.Core.2.2.0\lib\net45\Microsoft.AspNet.Identity.Core.dll
+ True
+
+
+ False
+ ..\packages\Microsoft.AspNet.Identity.Owin.2.2.0\lib\net45\Microsoft.AspNet.Identity.Owin.dll
+
+
+ ..\packages\Microsoft.Owin.3.0.1\lib\net45\Microsoft.Owin.dll
+ True
+
+
+ False
+ ..\packages\Microsoft.Owin.Host.SystemWeb.3.0.1\lib\net45\Microsoft.Owin.Host.SystemWeb.dll
+
+
+ False
+ ..\packages\Microsoft.Owin.Security.3.0.1\lib\net45\Microsoft.Owin.Security.dll
+
+
+ False
+ ..\packages\Microsoft.Owin.Security.Cookies.3.0.1\lib\net45\Microsoft.Owin.Security.Cookies.dll
+
+
+ False
+ ..\packages\Microsoft.Owin.Security.OAuth.3.0.1\lib\net45\Microsoft.Owin.Security.OAuth.dll
+
..\packages\Microsoft.Bcl.Async.1.0.165\lib\net45\Microsoft.Threading.Tasks.dll
@@ -178,6 +206,10 @@
False
..\packages\Newtonsoft.Json.6.0.4\lib\net45\Newtonsoft.Json.dll
+
+ ..\packages\Owin.1.0\lib\net40\Owin.dll
+ True
+
System
@@ -199,6 +231,7 @@
+
False
diff --git a/src/Umbraco.Web.UI/config/ClientDependency.config b/src/Umbraco.Web.UI/config/ClientDependency.config
index 246bff7cac..7b53338f12 100644
--- a/src/Umbraco.Web.UI/config/ClientDependency.config
+++ b/src/Umbraco.Web.UI/config/ClientDependency.config
@@ -10,7 +10,7 @@ NOTES:
* Compression/Combination/Minification is not enabled unless debug="false" is specified on the 'compiliation' element in the web.config
* A new version will invalidate both client and server cache and create new persisted files
-->
-
+