view data/plugin/action/ @ 599:31ef7dc6168a

bbb: action submit_bbb_start_meeting introduced and similar code from submit_bbb_create_meeting amd bbb_create removed. Meetings have to be started by the responsible moderator before someone else can join.
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Thu, 14 Jun 2012 09:38:07 +0200
parents 0b31dafef3cf
children 2aa75cf87a0d
line wrap: on
line source
# -*- coding: utf-8 -*-
    MoinMoin - Create a Meeting for bigbluebutton (

    @copyright: 2012 MoinMoin:ReimarBauer
    @license: GNU GPL, see COPYING for details.

from MoinMoin.PageEditor import PageEditor
from MoinMoin.Page import Page
import bbb_settings

def execute(pagename, request):
    Creates a bigbluebutton meeting and stores the definitions on a wiki sub page.
    This page is protected by acls for the responsible user. 
    It requires a bbb_admin_group defined in Only a user of this 
    group is allowed to use this action. On same directory as you need
    a "" module with the SALT and the BBB_API_URL.

    Example Call by using

    || Meeting Name: || <<FormText(meeting_name,maxlength=50)>> ||
    || Meeting ID || <<FormText(meeting_id,maxlength=50)>> ||
    || Moderator Passwort: || <<FormText(moderator_password,maxlength=50)>> ||
    || Attendee Passwort: || <<FormText(attendee_password,maxlength=50)>> ||
    ||<-2:> <<FormSubmit(Send)>> ||

    username =
    groups = request.groups
    msg, state = ("Sorry you have not enough priviledges", "error")
        bbb_admin_group = groups.get(request.cfg.bbb_admin_group, [])
    except AttributeError:
        request.theme.add_msg(msg, state)
        Page(request, pagename).send_page()

    if request.user.valid and username in bbb_admin_group:
        _ = request.getText

        attendee_password = request.form["attendee_password"]
        moderator_password = request.form["moderator_password"]

        if not attendee_password.strip() or not moderator_password.strip():
            msg, state = ("Sorry, we don't support empty passwords!", "error")
            request.theme.add_msg(msg, state)
            Page(request, pagename).send_page()

        sub_pagename = u'%s/%s' % (pagename, request.form["meeting_name"])
        keyval = "\n".join([' %s:: %s' % (key, value) for key, value in request.form.iteritems() if not (key.startswith('labels') or key.startswith('action') or key.startswith('doit'))])
        result = """#acl %(username)s:admin,read,write,delete,revert %(bbb_admin_group)s:read All:
#format bbb_create
 responsible:: %(username)s
%(keyval)s""" % {"username": username,
                 "keyval": keyval,

        if request.user.may.write(sub_pagename):
                # We write without acl check
                PageEditor(request, sub_pagename)._write_file(result, action='SAVE')
                msg, state = (_(u"OK!"), "info")
            except PageEditor.SaveError:
                msg, state = (_(u"A severe error occured:"), "error")
    request.theme.add_msg(msg, state)
    Page(request, sub_pagename).send_page()