Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/passman.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorbrantje <brantje@gmail.com>2016-10-21 13:39:03 +0300
committerbrantje <brantje@gmail.com>2016-10-21 14:12:45 +0300
commit085c128cfa07248410be37bf1f345a3d9ff6d25c (patch)
tree782233886bdfcb50334d6f068341bea3092d3668 /js
parent56b5a6851b3da1bb03e9f6ff6be0b58481bc4c37 (diff)
Use port numbers
Signed-off-by: brantje <brantje@gmail.com>
Diffstat (limited to 'js')
-rw-r--r--js/app/controllers/share.js16
1 files changed, 11 insertions, 5 deletions
diff --git a/js/app/controllers/share.js b/js/app/controllers/share.js
index 8d37aaf3..1915b3ff 100644
--- a/js/app/controllers/share.js
+++ b/js/app/controllers/share.js
@@ -134,7 +134,7 @@
};
if (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 {
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.applyShare = function () {
$scope.sharing_complete = false;
@@ -295,7 +302,7 @@
};
ShareService.createPublicSharedCredential(shareObj).then(function () {
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 () {
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);
});
}
@@ -382,4 +388,4 @@
return total;
};
}]);
-}()); \ No newline at end of file
+}());