@@ -7,37 +7,6 @@ angular.module('users').controller('SettingsController', ['$scope', '$http', '$l
77 // If user is not signed in then redirect back home
88 if ( ! $scope . user ) $location . path ( '/' ) ;
99
10- // Check if there are additional accounts
11- $scope . hasConnectedAdditionalSocialAccounts = function ( provider ) {
12- for ( var i in $scope . user . additionalProvidersData ) {
13- return true ;
14- }
15-
16- return false ;
17- } ;
18-
19- // Check if provider is already in use with current user
20- $scope . isConnectedSocialAccount = function ( provider ) {
21- return $scope . user . provider === provider || ( $scope . user . additionalProvidersData && $scope . user . additionalProvidersData [ provider ] ) ;
22- } ;
23-
24- // Remove a user social account
25- $scope . removeUserSocialAccount = function ( provider ) {
26- $scope . success = $scope . error = null ;
27-
28- $http . delete ( '/api/users/accounts' , {
29- params : {
30- provider : provider
31- }
32- } ) . success ( function ( response ) {
33- // If successful show success message and clear form
34- $scope . success = true ;
35- $scope . user = Authentication . user = response ;
36- } ) . error ( function ( response ) {
37- $scope . error = response . message ;
38- } ) ;
39- } ;
40-
4110 // Update a user profile
4211 $scope . updateUserProfile = function ( isValid ) {
4312 if ( isValid ) {
@@ -54,18 +23,5 @@ angular.module('users').controller('SettingsController', ['$scope', '$http', '$l
5423 $scope . submitted = true ;
5524 }
5625 } ;
57-
58- // Change user password
59- $scope . changeUserPassword = function ( ) {
60- $scope . success = $scope . error = null ;
61-
62- $http . post ( '/api/users/password' , $scope . passwordDetails ) . success ( function ( response ) {
63- // If successful show success message and clear form
64- $scope . success = true ;
65- $scope . passwordDetails = null ;
66- } ) . error ( function ( response ) {
67- $scope . error = response . message ;
68- } ) ;
69- } ;
7026 }
7127] ) ;
0 commit comments