Mercurial > psgxs
comparison modules/mod_manage.js @ 47:0d3f18bb1d36
Remove usage of fdsq.js in modules.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Thu, 10 Mar 2011 16:13:49 +0100 |
parents | 023f767662d3 |
children | c979c4d0932b |
comparison
equal
deleted
inserted
replaced
46:3126f8d6a5e3 | 47:0d3f18bb1d36 |
---|---|
33 if (!nodeID || nodeID == '') | 33 if (!nodeID || nodeID == '') |
34 return makeError(response, errors.nodeid_required.n); | 34 return makeError(response, errors.nodeid_required.n); |
35 if (!storage.existsNode(nodeID)) | 35 if (!storage.existsNode(nodeID)) |
36 return makeError(response, errors.node_does_not_exist.n); | 36 return makeError(response, errors.node_does_not_exist.n); |
37 | 37 |
38 var affil = storage.getAffiliation(toBareJID(to), nodeID); | 38 var affil = storage.getAffiliation(JID.toBare(to), nodeID); |
39 if (affil != 'super-owner' && affil != 'owner') | 39 if (affil != 'super-owner' && affil != 'owner') |
40 return makeError(response, errors.forbidden.n); | 40 return makeError(response, errors.forbidden.n); |
41 | 41 |
42 response.c('pubsub', {xmlns: NS.PUBSUB_OWNER}) | 42 response.c('pubsub', {xmlns: NS.PUBSUB_OWNER}) |
43 .c('subscriptions', {node: nodeID}); | 43 .c('subscriptions', {node: nodeID}); |
65 return makeError(response, errors.nodeid_required.n); | 65 return makeError(response, errors.nodeid_required.n); |
66 if (!storage.existsNode(nodeID)) | 66 if (!storage.existsNode(nodeID)) |
67 return makeError(response, errors.node_does_not_exist.n); | 67 return makeError(response, errors.node_does_not_exist.n); |
68 | 68 |
69 var affils = storage.getAffiliationsFromNodeID(nodeID); | 69 var affils = storage.getAffiliationsFromNodeID(nodeID); |
70 var affil = affils[toBareJID(to)]; | 70 var affil = affils[JID.toBare(to)]; |
71 if (affil != 'super-owner' && affil != 'owner') | 71 if (affil != 'super-owner' && affil != 'owner') |
72 return makeError(response, errors.owner.manage_affiliations.retrieve_list.entity_is_not_an_owner.n); | 72 return makeError(response, errors.owner.manage_affiliations.retrieve_list.entity_is_not_an_owner.n); |
73 | 73 |
74 response.c('pubsub', {xmlns: NS.PUBSUB_OWNER}) | 74 response.c('pubsub', {xmlns: NS.PUBSUB_OWNER}) |
75 .c('affiliations', {node: nodeID}); | 75 .c('affiliations', {node: nodeID}); |
95 if (!nodeID) | 95 if (!nodeID) |
96 return makeError(response, errors.nodeid_required.n); | 96 return makeError(response, errors.nodeid_required.n); |
97 if (!storage.existsNode(nodeID)) | 97 if (!storage.existsNode(nodeID)) |
98 return makeError(response, errors.node_does_not_exist.n); | 98 return makeError(response, errors.node_does_not_exist.n); |
99 | 99 |
100 var affil = storage.getAffiliation(toBareJID(to), nodeID); | 100 var affil = storage.getAffiliation(JID.toBare(to), nodeID); |
101 if (affil != 'super-owner' && affil != 'owner') | 101 if (affil != 'super-owner' && affil != 'owner') |
102 return makeError(response, errors.forbidden.n); | 102 return makeError(response, errors.forbidden.n); |
103 | 103 |
104 var e = false; | 104 var e = false; |
105 var tags2 = []; | 105 var tags2 = []; |
147 if (!nodeID) | 147 if (!nodeID) |
148 return makeError(response, errors.nodeid_required.n); | 148 return makeError(response, errors.nodeid_required.n); |
149 if (!storage.existsNode(nodeID)) | 149 if (!storage.existsNode(nodeID)) |
150 return makeError(response, errors.node_does_not_exist.n); | 150 return makeError(response, errors.node_does_not_exist.n); |
151 | 151 |
152 var affil = storage.getAffiliation(toBareJID(to), nodeID); | 152 var affil = storage.getAffiliation(JID.toBare(to), nodeID); |
153 if (affil != 'super-owner' && affil != 'owner') | 153 if (affil != 'super-owner' && affil != 'owner') |
154 return makeError(response, errors.forbidden.n); | 154 return makeError(response, errors.forbidden.n); |
155 | 155 |
156 var e = false; | 156 var e = false; |
157 for (i in request.children) { | 157 for (i in request.children) { |