mirror of
https://github.com/nextcloud/passman.git
synced 2024-12-27 01:52:56 +08:00
Merge branch 'shareLinkPort'
This commit is contained in:
commit
900d154b87
1 changed files with 11 additions and 5 deletions
|
@ -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);
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -382,4 +388,4 @@
|
||||||
return total;
|
return total;
|
||||||
};
|
};
|
||||||
}]);
|
}]);
|
||||||
}());
|
}());
|
||||||
|
|
Loading…
Reference in a new issue