|
|
@ -31,9 +31,7 @@ define([
|
|
|
|
|
|
|
|
|
|
|
|
if (typeof(ctx.pinUsage) === 'object') {
|
|
|
|
if (typeof(ctx.pinUsage) === 'object') {
|
|
|
|
// pass pin.usage, pin.limit, and pin.plan if supplied
|
|
|
|
// pass pin.usage, pin.limit, and pin.plan if supplied
|
|
|
|
Object.keys(ctx.pinUsage).forEach(function (k) {
|
|
|
|
data.sender.quota = ctx.pinUsage;
|
|
|
|
data.sender[k] = ctx.pinUsage[k];
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
data.id = id;
|
|
|
|
data.id = id;
|
|
|
@ -45,11 +43,14 @@ define([
|
|
|
|
data.sender.blockLocation = privateData.blockLocation || '';
|
|
|
|
data.sender.blockLocation = privateData.blockLocation || '';
|
|
|
|
data.sender.teams = Object.keys(teams).map(function (key) {
|
|
|
|
data.sender.teams = Object.keys(teams).map(function (key) {
|
|
|
|
var team = teams[key];
|
|
|
|
var team = teams[key];
|
|
|
|
if (!teams) { return; }
|
|
|
|
if (!team) { return; }
|
|
|
|
var ret = {};
|
|
|
|
var ret = {};
|
|
|
|
['edPublic', 'owner', 'viewer', 'hasSecondaryKey', 'validKeys'].forEach(function (k) {
|
|
|
|
['channel', 'roster', 'numberPads', 'numberSf', 'edPublic', 'curvePublic', 'owner', 'viewer', 'hasSecondaryKey', 'validKeys'].forEach(function (k) {
|
|
|
|
ret[k] = team[k];
|
|
|
|
ret[k] = team[k];
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
if (ctx.teamsUsage && ctx.teamsUsage[key]) {
|
|
|
|
|
|
|
|
ret.quota = ctx.teamsUsage[key];
|
|
|
|
|
|
|
|
}
|
|
|
|
return ret;
|
|
|
|
return ret;
|
|
|
|
}).filter(Boolean);
|
|
|
|
}).filter(Boolean);
|
|
|
|
|
|
|
|
|
|
|
@ -430,12 +431,13 @@ define([
|
|
|
|
]);
|
|
|
|
]);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
var create = function (common, isAdmin, pinUsage) {
|
|
|
|
var create = function (common, isAdmin, pinUsage, teamsUsage) {
|
|
|
|
var ui = {};
|
|
|
|
var ui = {};
|
|
|
|
var ctx = {
|
|
|
|
var ctx = {
|
|
|
|
common: common,
|
|
|
|
common: common,
|
|
|
|
isAdmin: isAdmin,
|
|
|
|
isAdmin: isAdmin,
|
|
|
|
pinUsage: pinUsage || false,
|
|
|
|
pinUsage: pinUsage || false,
|
|
|
|
|
|
|
|
teamsUsage: teamsUsage || false,
|
|
|
|
adminKeys: Array.isArray(ApiConfig.adminKeys)? ApiConfig.adminKeys.slice(): [],
|
|
|
|
adminKeys: Array.isArray(ApiConfig.adminKeys)? ApiConfig.adminKeys.slice(): [],
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|