Merge branch 'master' of github.com:nextcloud/passman

This commit is contained in:
brantje 2016-09-30 17:44:37 +02:00
commit 04b0261cd3
No known key found for this signature in database
GPG key ID: 5FF1D117F918687F
4 changed files with 69 additions and 13 deletions

View file

@ -77,9 +77,20 @@ class ShareController extends ApiController {
foreach ($groupsTmp as $group) { 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( $groups[] = array(
'text' => $group->getGID(), 'text' => $group->getGID(),
'uid' => $group->getGID(), 'uid' => $group->getGID(),
'users' => $final_users,
'type' => 'group' 'type' => 'group'
); );
} }

View file

@ -147,7 +147,7 @@
#app-content #app-content-wrapper #passman-controls { #app-content #app-content-wrapper #passman-controls {
border-bottom: 1px solid #c9c9c9; } border-bottom: 1px solid #c9c9c9; }
#app-content #app-content-wrapper .title { #app-content #app-content-wrapper .title {
width: calc( 100% - 370px); width: calc( 100% - 375px);
text-align: center; text-align: center;
display: inline-block; display: inline-block;
font-weight: bold; font-weight: bold;

View file

@ -105,20 +105,65 @@ angular.module('passmanApp')
var list = $scope.share_settings.credentialSharedWithUserAndGroup; var list = $scope.share_settings.credentialSharedWithUserAndGroup;
console.log(list); console.log(list);
for (var i = 0; i < list.length; i++){ for (var i = 0; i < list.length; i++){
ShareService.getVaultsByUser(list[i].userId).then(function(data){ if (list[i].type == "user") {
list[i].vaults = data; ShareService.getVaultsByUser(list[i].userId).then(function (data) {
console.log(data); list[i].vaults = data;
var start = new Date().getTime() / 1000;;
ShareService.cypherRSAStringWithPublicKeyBulkAsync(data, key)
.progress(function(data){
console.log(data); console.log(data);
}) var start = new Date().getTime() / 1000;
.then(function(result){ ;
console.log(result); ShareService.cypherRSAStringWithPublicKeyBulkAsync(data, key)
console.log("Took: " + ((new Date().getTime() / 1000) - start) + "s to cypher the string for user [" + data[0].user_id + "]"); .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;
} }
}]); }]);

View file

@ -6,7 +6,7 @@
border-bottom: 1px solid #c9c9c9 border-bottom: 1px solid #c9c9c9
} }
.title{ .title{
width: calc( 100% - 370px); width: calc( 100% - 375px);
text-align: center; text-align: center;
display: inline-block; display: inline-block;
font-weight: bold; font-weight: bold;