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) {
$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'
);
}

View file

@ -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;

View file

@ -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;
}
}]);

View file

@ -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;