예제 #1
0
 def setRegistration(self, srvid, mumbleid, name, email, password):
     import Murmur
     user = Murmur.RegisteredPlayer()
     user.playerid = mumbleid
     user.name = name.encode("UTF-8")
     user.email = email.encode("UTF-8")
     user.pw = password.encode("UTF-8")
     # update*r*egistration r is lowercase...
     return self._getIceServerObject(srvid).updateregistration(user)
예제 #2
0
    def update_channel_acl(self, id, channel_id):
        """ Update specific channel ACL
        """

        server = meta.getServer(id)

        # Return 404 if not found
        if server is None:
            return jsonify(message="Not Found"), 404

        origin_acl = server.getACL(channel_id)
        update_acls = origin_acl[0]
        update_groups = origin_acl[1]
        update_inherit = origin_acl[2]

        params = request.get_json()
        if "acls" in params and params['acls'] is not None:
            new_acls = []
            for props in params['acls']:
                new_acls.append(
                    Murmur.ACL(props['applyHere'], props['applySubs'],
                               props['inherited'], props['userid'],
                               props['group'], props['allow'], props['deny']))
            update_acls = new_acls

        if "groups" in params and params['groups'] is not None:
            new_groups = []
            for props in params['groups']:
                new_groups.append(
                    Murmur.Group(props['name'], props['inherited'],
                                 props['inherit'], props['inheritable'],
                                 props['add'], props['remove']))
            update_groups = new_groups

        if "inherit" in params and params['inherit'] is not None:
            update_inherit = bool(params['inherit'])

        server.setACL(channel_id, update_acls, update_groups, update_inherit)

        data = obj_to_dict(server.getACL(channel_id))
        return Response(json.dumps(data, sort_keys=True, indent=4),
                        mimetype='application/json')
예제 #3
0
 def newfunc(*args, **kws):
     if 'current' in kws:
         current = kws["current"]
     else:
         current = args[-1]
     
     if not current or 'secret' not in current.ctx or current.ctx['secret'] != cfg.ice.secret:
         error('Server transmitted invalid secret. Possible injection attempt.')
         raise Murmur.InvalidSecretException()
     
     return func(*args, **kws)
        def newfunc(*args, **kws):
            if "current" in kws:
                current = kws["current"]
            else:
                current = args[-1]

            if (not current or "secret" not in current.ctx
                    or current.ctx["secret"] != cfg.ice.secret):
                error(
                    "Server transmitted invalid secret. Possible injection attempt."
                )
                raise Murmur.InvalidSecretException()

            return func(*args, **kws)
예제 #5
0
    def setACL(self, srvid, channelid, acls, groups, inherit):
        import Murmur

        ice_acls = []

        for rule in acls:
            ice_rule = Murmur.ACL()
            ice_rule.applyHere = rule.applyHere
            ice_rule.applySubs = rule.applySubs
            ice_rule.inherited = rule.inherited
            ice_rule.playerid = rule.userid
            ice_rule.group = rule.group
            ice_rule.allow = rule.allow
            ice_rule.deny = rule.deny
            ice_acls.append(ice_rule)

        return self._getIceServerObject(srvid).setACL(channelid, ice_acls,
                                                      groups, inherit)