def getConferenceStatus(self, id): self.is_my_pin(id) c.pin = id confMonitor = app_globals.confMonitor if not confMonitor.conferences.has_key(id): return "<b>There is no one in this conference.</b>" return render('/component/main/monitor.html')
def index(self): c.confs = Session.query(ModeratorPin).filter(ModeratorPin.username == session.get('username')).all() oConfs = Session.query(ModeratorPin).filter(ModeratorPin.extraAdmin == session.get('username')).all() c.oConfs = {} for conf in oConfs: if c.oConfs.has_key(conf.username): c.oConfs[conf.username].append(conf) else: c.oConfs[conf.username] = [conf,] return render('/derived/main/reports_select.html')
def getConferenceStatus(self, id): self.is_my_pin(id) c.pin = id con = ESL.ESLconnection(config.get("esl.host"), config.get("esl.port"), config.get("esl.pass")) c.members = [] if con.connected(): cmd = "%s xml_list" % str(id) conf = con.api("conference", cmd) if conf.getBody().startswith("Conference %s not found\n" % id): log.info("Conference is not active: %s" % conf.getBody()) return "<b>There is no one in this conference.</b>" else: dom = parseString(conf.getBody()) for confs in dom.childNodes: for conf in confs.childNodes: if conf.nodeType == conf.ELEMENT_NODE: c.member_count, c.locked = parseConference(conf) for members in conf.childNodes: if members.nodeType == conf.ELEMENT_NODE and members.localName == "members": for member in members.childNodes: if member.nodeType == conf.ELEMENT_NODE and member.localName == "member": c.members.append(parseMember(member)) return render("/component/main/monitor.html")
ddate_to = datetime(ds[0], ds[1], ds[2] , 23, 59, 59) stmt = stmt.filter(and_(Conference.created >= ddate_from, Conference.ended <= ddate_to)) except ValueError, e: log.warning('User has supplied the wrong time format, disregarding filter: %s %s' % (date_from, date_to)) h.flash('Invalid date format.') redirect(url(controller='main/reports', action='index')) if conf_name: stmt = stmt.filter(Conference.name == conf_name) try: c.confs = stmt.all() except Exception, e: print e return render('/derived/main/reports_gen.html') def report_detail(self, id): """Generate a detailed report from the conference""" try: c.conf = Session.query(Conference).join(ModeratorPin).filter(Conference.id == id).one() except NoResultFound, e: log.critical(e) self.is_my_pin(c.conf.owner) c.actions = Session.query(ConferenceAction).join(Conference).filter(Conference.id == id).all() return render('/derived/main/reports_detail.html') def dl_recording(self, id): """Download the recording for a conference""" try:
def new_pin_form(self): c.moderator_pin = request.params.get('moderator_pin') c.participant_pin = request.params.get('participant_pin') return render('derived/main/new_pin/new_pin.html')
else: h.flash('Cannot delete PIN of an active conference..') redirect(request.headers.get('REFERER', url(controller='main/new_pin', action='index'))) h.flash('Could not delete the PIN.') redirect(request.headers.get('REFERER', url(controller='main/new_pin', action='index'))) def changeNoteForm(self, id): """ Display the form to change the note """ try: c.pin = Session.query(ModeratorPin).get(id) except Exception, e: log.critical('Could not fetch the pin because: %s' % e) h.flash('Could not find PIN.') redirect(url(controller='main/new_pin', action='index')) return render('derived/main/new_pin/changeNoteForm.html') def changeNote(self, id): """ Change the note """ try: pin = Session.query(ModeratorPin).get(id) except Exception, e: log.critical('Could not fetch the pin because: %s' % e) h.flash('Could not find PIN.') redirect(url(controller='main/new_pin', action='index')) pin.note = request.params.get('note') or None Session.commit() h.flash('Note changed.') redirect(url(controller='main/new_pin', action='index'))
def index(self): """This is the index landpage""" c.domains = [] for d in config["domains"].split(","): c.domains.append(d) return render("/component/index.html")
class AdminController(BaseController): requires_auth = True def index(self): # Check if this user is really an admin... self.checkAdmin() c.users = [] try: c.users = Session.query(ModeratorPin.username, ModeratorPin.domain).distinct().all() except SQLAlchemyError, e: log.critical('Something went wrong... %s' % e) return render('/derived/main/admin/index.html') def admin_user(self): """Administrate a certain user""" self.checkAdmin() c.username = request.params.get('username').split('@')[0] c.domain = request.params.get('username').split('@')[1] try: # Get the user conferences c.pins = Session.query(ModeratorPin).filter(and_(ModeratorPin.username==c.username, ModeratorPin.domain==c.domain)).all() except SQLAlchemyError, e: log.critical("Could not fetch: %s" % e) return render('/derived/main/admin/admin_user.html')