mirror of
https://github.com/nextcloud/passman.git
synced 2025-10-06 11:35:50 +08:00
Merge branch 'master' of github.com:nextcloud/passman
This commit is contained in:
commit
04b0261cd3
4 changed files with 69 additions and 13 deletions
|
@ -77,9 +77,20 @@ class ShareController extends ApiController {
|
|||
|
||||
|
||||
foreach ($groupsTmp as $group) {
|
||||
$group_users = $group->getUsers();
|
||||
$final_users = [];
|
||||
foreach ($group_users as $user){
|
||||
$final_users[] = [
|
||||
'text' => $user->getDisplayName(),
|
||||
'uid' => $user->getUID(),
|
||||
'type' => 'user'
|
||||
];
|
||||
}
|
||||
|
||||
$groups[] = array(
|
||||
'text' => $group->getGID(),
|
||||
'uid' => $group->getGID(),
|
||||
'users' => $final_users,
|
||||
'type' => 'group'
|
||||
);
|
||||
}
|
||||
|
|
|
@ -147,7 +147,7 @@
|
|||
#app-content #app-content-wrapper #passman-controls {
|
||||
border-bottom: 1px solid #c9c9c9; }
|
||||
#app-content #app-content-wrapper .title {
|
||||
width: calc( 100% - 370px);
|
||||
width: calc( 100% - 375px);
|
||||
text-align: center;
|
||||
display: inline-block;
|
||||
font-weight: bold;
|
||||
|
|
|
@ -105,20 +105,65 @@ angular.module('passmanApp')
|
|||
var list = $scope.share_settings.credentialSharedWithUserAndGroup;
|
||||
console.log(list);
|
||||
for (var i = 0; i < list.length; i++){
|
||||
ShareService.getVaultsByUser(list[i].userId).then(function(data){
|
||||
list[i].vaults = data;
|
||||
console.log(data);
|
||||
var start = new Date().getTime() / 1000;;
|
||||
ShareService.cypherRSAStringWithPublicKeyBulkAsync(data, key)
|
||||
.progress(function(data){
|
||||
if (list[i].type == "user") {
|
||||
ShareService.getVaultsByUser(list[i].userId).then(function (data) {
|
||||
list[i].vaults = data;
|
||||
console.log(data);
|
||||
})
|
||||
.then(function(result){
|
||||
console.log(result);
|
||||
console.log("Took: " + ((new Date().getTime() / 1000) - start) + "s to cypher the string for user [" + data[0].user_id + "]");
|
||||
var start = new Date().getTime() / 1000;
|
||||
;
|
||||
ShareService.cypherRSAStringWithPublicKeyBulkAsync(data, key)
|
||||
.progress(function (data) {
|
||||
console.log(data);
|
||||
})
|
||||
.then(function (result) {
|
||||
console.log(result);
|
||||
console.log("Took: " + ((new Date().getTime() / 1000) - start) + "s to cypher the string for user [" + data[0].user_id + "]");
|
||||
});
|
||||
});
|
||||
});
|
||||
list[i].processed = true;
|
||||
}
|
||||
else if (list[i].type == "group"){
|
||||
for (var x = 0; x < list[i].users.length; x++){
|
||||
if ($scope.isUserReady(list[i].users[x].userId)){
|
||||
continue;
|
||||
}
|
||||
ShareService.getVaultsByUser(list[i].userId).then(function (data) {
|
||||
list[i].vaults = data;
|
||||
console.log(data);
|
||||
var start = new Date().getTime() / 1000;
|
||||
;
|
||||
ShareService.cypherRSAStringWithPublicKeyBulkAsync(data, key)
|
||||
.progress(function (data) {
|
||||
console.log(data);
|
||||
})
|
||||
.then(function (result) {
|
||||
console.log(result);
|
||||
console.log("Took: " + ((new Date().getTime() / 1000) - start) + "s to cypher the string for user [" + data[0].user_id + "]");
|
||||
});
|
||||
});
|
||||
list[i].processed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
};
|
||||
|
||||
$scope.isUserReady = function (userId){
|
||||
var list = $scope.share_settings.credentialSharedWithUserAndGroup;
|
||||
for (var i = 0; i < list.length; i++){
|
||||
if (list[i].type == "user"){
|
||||
if (list[i].userId == userId && list[i].ready){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if (list[i].type == "group"){
|
||||
for (var x = 0; x < list[i].users.length; x++){
|
||||
if (list[i].users[x].userId == userId && list[i].users[x].ready){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}]);
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
border-bottom: 1px solid #c9c9c9
|
||||
}
|
||||
.title{
|
||||
width: calc( 100% - 370px);
|
||||
width: calc( 100% - 375px);
|
||||
text-align: center;
|
||||
display: inline-block;
|
||||
font-weight: bold;
|
||||
|
|
Loading…
Add table
Reference in a new issue