|
|
@ -52,13 +52,16 @@ define([
|
|
|
|
var oldIds = Object.keys(folders);
|
|
|
|
var oldIds = Object.keys(folders);
|
|
|
|
nThen(function (waitFor) {
|
|
|
|
nThen(function (waitFor) {
|
|
|
|
Object.keys(drive.sharedFolders).forEach(function (fId) {
|
|
|
|
Object.keys(drive.sharedFolders).forEach(function (fId) {
|
|
|
|
|
|
|
|
var sfData = drive.sharedFolders[id] || {};
|
|
|
|
|
|
|
|
var parsed = Hash.parsePadUrl(sfData.href);
|
|
|
|
|
|
|
|
var secret = Hash.getSecrets('drive', parsed.hash, sfData.password);
|
|
|
|
sframeChan.query('Q_DRIVE_GETOBJECT', {
|
|
|
|
sframeChan.query('Q_DRIVE_GETOBJECT', {
|
|
|
|
sharedFolder: fId
|
|
|
|
sharedFolder: fId
|
|
|
|
}, waitFor(function (err, newObj) {
|
|
|
|
}, waitFor(function (err, newObj) {
|
|
|
|
folders[fId] = folders[fId] || {};
|
|
|
|
folders[fId] = folders[fId] || {};
|
|
|
|
copyObjectValue(folders[fId], newObj);
|
|
|
|
copyObjectValue(folders[fId], newObj);
|
|
|
|
if (manager && oldIds.indexOf(fId) === -1) {
|
|
|
|
if (manager && oldIds.indexOf(fId) === -1) {
|
|
|
|
manager.addProxy(fId, folders[fId]);
|
|
|
|
manager.addProxy(fId, folders[fId], null, secret.keys.secondaryKey);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}));
|
|
|
|
}));
|
|
|
|
});
|
|
|
|
});
|
|
|
@ -260,13 +263,21 @@ define([
|
|
|
|
$limitContainer.attr('title', Messages.team_quota);
|
|
|
|
$limitContainer.attr('title', Messages.team_quota);
|
|
|
|
}, true);
|
|
|
|
}, true);
|
|
|
|
driveAPP.team = id;
|
|
|
|
driveAPP.team = id;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Provide secondaryKey
|
|
|
|
|
|
|
|
var teamData = (proxy.teams || {})[id];
|
|
|
|
|
|
|
|
var secret;
|
|
|
|
|
|
|
|
if (teamData) {
|
|
|
|
|
|
|
|
secret = Hash.getSecrets('team', teamData.hash, teamData.password);
|
|
|
|
|
|
|
|
}
|
|
|
|
var drive = DriveUI.create(common, {
|
|
|
|
var drive = DriveUI.create(common, {
|
|
|
|
proxy: proxy,
|
|
|
|
proxy: proxy,
|
|
|
|
folders: folders,
|
|
|
|
folders: folders,
|
|
|
|
updateObject: updateObject,
|
|
|
|
updateObject: updateObject,
|
|
|
|
updateSharedFolders: updateSharedFolders,
|
|
|
|
updateSharedFolders: updateSharedFolders,
|
|
|
|
APP: driveAPP,
|
|
|
|
APP: driveAPP,
|
|
|
|
edPublic: APP.teamEdPublic
|
|
|
|
edPublic: APP.teamEdPublic,
|
|
|
|
|
|
|
|
editKey: secret && secret.keys.secondaryKey
|
|
|
|
});
|
|
|
|
});
|
|
|
|
APP.drive = drive;
|
|
|
|
APP.drive = drive;
|
|
|
|
driveAPP.refresh = drive.refresh;
|
|
|
|
driveAPP.refresh = drive.refresh;
|
|
|
|