Merge branch 'shareLinkPort'

This commit is contained in:
brantje 2016-10-21 15:55:27 +02:00
commit 900d154b87
No known key found for this signature in database
GPG key ID: 5FF1D117F918687F

View file

@ -134,7 +134,7 @@
}; };
if (enc_key) { if (enc_key) {
var hash = window.btoa($scope.storedCredential.guid + '<::>' + enc_key); var hash = window.btoa($scope.storedCredential.guid + '<::>' + enc_key);
$scope.share_link = $location.$$protocol + '://' + $location.$$host + OC.generateUrl('apps/passman/share/public#') + hash; $scope.share_link = getShareLink(hash);
} }
} else { } else {
var obj = { var obj = {
@ -271,6 +271,13 @@
} }
}); });
var getShareLink = function(hash){
var port;
var defaultPort = ($location.$$protocol === 'http') ? 80 : 443;
port = (defaultPort !== $location.$$port) ? ':'+ $location.$$port : '';
return $location.$$protocol + '://' + $location.$$host + port + OC.generateUrl('apps/passman/share/public#') + hash;
};
$scope.sharing_complete = true; $scope.sharing_complete = true;
$scope.applyShare = function () { $scope.applyShare = function () {
$scope.sharing_complete = false; $scope.sharing_complete = false;
@ -295,7 +302,7 @@
}; };
ShareService.createPublicSharedCredential(shareObj).then(function () { ShareService.createPublicSharedCredential(shareObj).then(function () {
var hash = window.btoa($scope.storedCredential.guid + '<::>' + enc_key); var hash = window.btoa($scope.storedCredential.guid + '<::>' + enc_key);
$scope.share_link = $location.$$protocol + '://' + $location.$$host + OC.generateUrl('apps/passman/share/public#') + hash; $scope.share_link = getShareLink(hash);
}); });
} }
@ -353,8 +360,7 @@
}; };
ShareService.createPublicSharedCredential(shareObj).then(function () { ShareService.createPublicSharedCredential(shareObj).then(function () {
var hash = window.btoa($scope.storedCredential.guid + '<::>' + key); var hash = window.btoa($scope.storedCredential.guid + '<::>' + key);
$scope.share_link = $location.$$protocol + '://' + $location.$$host + OC.generateUrl('apps/passman/share/public#') + hash; $scope.share_link = getShareLink(hash);
}); });
} }