Esempio n. 1
0
 def getVars(self):
     from MaKaC.conference import Conference, Material, Resource
     vars = WTemplated.getVars(self)
     if isinstance(self._rh._target, Conference):
         vars["type"] = "event"
         vars["url"] = quoteattr(
             str(urlHandlers.UHConfEnterAccessKey.getURL(self._rh._target)))
     elif isinstance(self._rh._target, Material):
         vars["type"] = "file"
         vars["url"] = quoteattr(
             str(
                 urlHandlers.UHMaterialEnterAccessKey.getURL(
                     self._rh._target)))
     elif isinstance(self._rh._target, Resource):
         vars["type"] = "file"
         vars["url"] = quoteattr(
             str(urlHandlers.UHFileEnterAccessKey.getURL(self._rh._target)))
     else:
         vars["type"] = "presentation"
         vars["url"] = quoteattr(
             str(
                 urlHandlers.UHConfEnterAccessKey.getURL(
                     self._rh._target.getConference())))
     vars["msg"] = self._msg
     return vars
Esempio n. 2
0
    def getVars(self):
        wvars = WTemplated.getVars(self)
        wvars['standalone'] = self._standalone
        room = wvars['room']

        wvars['attrs'] = {attr.attribute.name: attr for attr in room.attributes
                          if not attr.attribute.is_hidden or session.user.isRBAdmin()}

        wvars['owner_name'] = room.owner.getFullName()

        wvars['bookable_hours'] = room.bookable_hours.all()
        wvars['nonbookable_periods'] = room.nonbookable_periods.all()

        # URLs
        wvars['stats_url'] = UH.UHRoomBookingRoomStats.getURL(room)
        wvars['delete_room_url'] = url_for('rooms_admin.delete_room', room)
        wvars['modify_room_url'] = url_for('rooms_admin.modify_room', room)
        if not self._standalone:
            wvars['conference'] = self._rh._conf

        room_mapper = RoomMapperHolder().match({'placeName': self._rh._location.name}, exact=True)
        if room_mapper:
            wvars['show_on_map'] = room_mapper[0].getMapURL(self._rh._room.name)
        else:
            wvars['show_on_map'] = UH.UHRoomBookingMapOfRooms.getURL(roomID=self._rh._room.id)

        return wvars
Esempio n. 3
0
    def getVars(self):
        wvars = WTemplated.getVars(self)
        wvars['standalone'] = self._standalone
        room = wvars['room']

        wvars['attrs'] = {
            attr.attribute.name: attr
            for attr in room.attributes
            if not attr.attribute.is_hidden or rb_is_admin(session.user)
        }

        wvars['owner_name'] = room.owner.full_name

        wvars['bookable_hours'] = room.bookable_hours.all()
        wvars['nonbookable_periods'] = room.nonbookable_periods.all()

        # URLs
        wvars['stats_url'] = UH.UHRoomBookingRoomStats.getURL(room)
        wvars['delete_room_url'] = url_for('rooms_admin.delete_room', room)
        wvars['modify_room_url'] = url_for('rooms_admin.modify_room', room)
        if not self._standalone:
            wvars['conference'] = self._rh._conf

        wvars['show_on_map'] = room.map_url if room.map_url else url_for(
            'rooms.roomBooking-mapOfRooms', room)

        return wvars
Esempio n. 4
0
    def getVars(self):
        wvars = WTemplated.getVars(self)
        wvars["standalone"] = self._standalone
        room = wvars["room"]

        wvars["attrs"] = {
            attr.attribute.name: attr
            for attr in room.attributes
            if not attr.attribute.is_hidden or rb_is_admin(session.user)
        }

        wvars["owner_name"] = room.owner.full_name

        wvars["bookable_hours"] = room.bookable_hours.all()
        wvars["nonbookable_periods"] = room.nonbookable_periods.all()

        # URLs
        wvars["stats_url"] = UH.UHRoomBookingRoomStats.getURL(room)
        wvars["delete_room_url"] = url_for("rooms_admin.delete_room", room)
        wvars["modify_room_url"] = url_for("rooms_admin.modify_room", room)
        if not self._standalone:
            wvars["conference"] = self._rh._conf

        wvars["show_on_map"] = room.map_url if room.map_url else url_for("rooms.roomBooking-mapOfRooms", room)

        return wvars
Esempio n. 5
0
    def getVars(self):
        ph = PluginsHolder()

        tplVars = WTemplated.getVars(self)
        tplVars["epayment_htdocs"] = UHEPaymentHtdocs.getURL()
        tplVars["currency_data"] = ph.getPluginType('EPayment').getOption("customCurrency").getValue()
        return tplVars
Esempio n. 6
0
 def getVars(self):
     vars = WTemplated.getVars( self )
     vars['user'] = self._avatar
     vars['currentUser'] = self._rh._getUser()
     vars["tokens"] = Catalog.getIdx('user_oauth_request_token').get(self._avatar.getId(), [])
     vars["formatTimestamp"] = lambda ts: format_datetime(utctimestamp2date(ts), format='d/M/yyyy H:mm')
     return vars
Esempio n. 7
0
 def getVars(self):
     wvars = WTemplated.getVars(self)
     wvars['createRoomMapperURL'] = urlHandlers.UHNewRoomMapper.getURL()
     wvars['searchRoomMappersURL'] = urlHandlers.UHRoomMappers.getURL()
     wvars['roomMappers'] = self._performSearch(
         self._criteria) if self._criteria else []
     return wvars
Esempio n. 8
0
    def getVars(self):
        wvars = WTemplated.getVars(self)
        wvars['standalone'] = self._standalone
        room = wvars['room']

        wvars['attrs'] = {attr.attribute.name: attr for attr in room.attributes
                          if not attr.attribute.is_hidden or rb_is_admin(session.user)}

        wvars['owner_name'] = room.owner.full_name

        wvars['bookable_hours'] = room.bookable_hours.all()
        wvars['nonbookable_periods'] = room.nonbookable_periods.all()

        # URLs
        wvars['stats_url'] = UH.UHRoomBookingRoomStats.getURL(room)
        wvars['delete_room_url'] = url_for('rooms_admin.delete_room', room)
        wvars['modify_room_url'] = url_for('rooms_admin.modify_room', room)
        if not self._standalone:
            wvars['conference'] = self._rh._conf

        room_mapper = RoomMapperHolder().match({'placeName': self._rh._location.name}, exact=True)
        if room_mapper:
            wvars['show_on_map'] = room_mapper[0].getMapURL(self._rh._room.name)
        else:
            wvars['show_on_map'] = UH.UHRoomBookingMapOfRooms.getURL(roomID=self._rh._room.id)

        return wvars
Esempio n. 9
0
 def getVars(self):
     wvars = WTemplated.getVars(self)
     wvars['user'] = self._avatar
     wvars['currentUser'] = self._rh._getUser()
     wvars["tokens"] = Catalog.getIdx('user_oauth_access_token').get(self._avatar.getId(), [])
     wvars["formatTimestamp"] = lambda ts: format_datetime(ts, format='d/M/yyyy H:mm')
     return wvars
Esempio n. 10
0
    def getVars(self):
        ph = PluginsHolder()

        tplVars = WTemplated.getVars(self)
        tplVars["epayment_htdocs"] = UHEPaymentHtdocs
        tplVars["currency_data"] = ph.getPluginType('EPayment').getOption(
            "customCurrency").getValue()
        return tplVars
Esempio n. 11
0
    def getVars(self):
        vars = WTemplated.getVars(self)

        newsModule = ModuleHolder().getById("news")
        vars["news"] = newsModule.getNewsItemsList()
        vars["tz"] = self._tz

        return vars
Esempio n. 12
0
 def getVars(self):
     wvars = WTemplated.getVars(self)
     ath = AccessTokenHolder()
     wvars["formatTimestamp"] = lambda ts: format_datetime(
         ts, format='d/M/yyyy H:mm')
     wvars['tokens'] = sorted(ath.getList(),
                              key=lambda t: t.getUser().getId())
     return wvars
Esempio n. 13
0
    def getVars(self):
        vars = WTemplated.getVars(self)

        newsModule = ModuleHolder().getById("news")
        vars["news"] = newsModule.getNewsItemsList()
        vars["tz"] = self._tz

        return vars
Esempio n. 14
0
 def getVars(self):
     wvars = WTemplated.getVars(self)
     wvars['name'] = self._roomMapper.getName()
     wvars['description'] = self._roomMapper.getDescription()
     wvars['url'] = self._roomMapper.getBaseMapURL()
     wvars['placeName'] = self._roomMapper.getPlaceName()
     wvars['regexps'] = self._roomMapper.getRegularExpressions()
     return wvars
Esempio n. 15
0
 def getVars( self ):
     from MaKaC.conference import Conference
     vars = WTemplated.getVars( self )
     vars["area"]= i18nformat(""" _("Authorisation") - """)
     vars["msg"] = _("The access to this page has been restricted by its owner and you are not authorised to view it")
     vars["contactInfo"] = ""
     if isinstance(self._rh._target, Conference):
         vars["contactInfo"] = self._rh._target.as_new.no_access_contact
     return vars
Esempio n. 16
0
    def getVars( self ):
        vars = WTemplated.getVars( self )

        vars["Conference"] = self._conf

        try:
            vars["Chatrooms"] = DBHelpers.getShowableRooms(self._conf)
        except Exception, e:
            vars["Chatrooms"] = None
Esempio n. 17
0
 def getVars(self):
     wvars = WTemplated.getVars(self)
     wvars['user'] = self._avatar
     wvars['currentUser'] = self._rh._getUser()
     wvars["tokens"] = Catalog.getIdx('user_oauth_access_token').get(
         self._avatar.getId(), [])
     wvars["formatTimestamp"] = lambda ts: format_datetime(
         ts, format='d/M/yyyy H:mm')
     return wvars
Esempio n. 18
0
    def getVars( self ):
        vars = WTemplated.getVars( self )

        vars["Conference"] = self._conf

        try:
            vars["Chatrooms"] = DBHelpers.getShowableRooms(self._conf)
        except Exception, e:
            vars["Chatrooms"] = None
Esempio n. 19
0
 def getVars( self ):
     vars = WTemplated.getVars( self )
     vars["msg"] = self._msg
     redirectURL = ""
     if hasattr(self._rh, "_redirectURL"):
         redirectURL = self._rh._redirectURL
     vars["redirectURL"] = quoteattr(redirectURL)
     vars["url"] = quoteattr( str( urlHandlers.UHConfEnterModifKey.getURL(self._rh._target) ) )
     return vars
Esempio n. 20
0
    def getVars(self):
        wvars = WTemplated.getVars(self)

        wvars["body_title"] = self._getTitle()
        wvars["Conference"] = self._conf

        try:
            wvars["Chatrooms"] = DBHelpers.getShowableRooms(self._conf)
        except Exception, e:
            wvars["Chatrooms"] = None
Esempio n. 21
0
    def getVars(self):
        wvars = WTemplated.getVars(self)

        wvars["body_title"] = self._getTitle()
        wvars["Conference"] = self._conf

        try:
            wvars["Chatrooms"] = DBHelpers.getShowableRooms(self._conf)
        except Exception, e:
            wvars["Chatrooms"] = None
Esempio n. 22
0
 def getVars(self):
     vars = WTemplated.getVars(self)
     vars["msg"] = self._msg
     redirectURL = ""
     if hasattr(self._rh, "_redirectURL"):
         redirectURL = self._rh._redirectURL
     vars["redirectURL"] = quoteattr(redirectURL)
     vars["url"] = quoteattr(
         str(urlHandlers.UHConfEnterModifKey.getURL(self._rh._target)))
     return vars
Esempio n. 23
0
 def getVars( self ):
     vars = WTemplated.getVars( self )
     vars["Conference"] = self._conf
     try:
         chatrooms = list(DBHelpers.getChatroomList(self._conf))
         vars["Chatrooms"] = fossilize(chatrooms)
         if len(vars['Chatrooms']) is 0:
             vars['Chatrooms'] = None
     except Exception, e:
         vars["Chatrooms"] = None
         chatrooms = {}
Esempio n. 24
0
 def getVars( self ):
     vars = WTemplated.getVars( self )
     vars["Conference"] = self._conf
     try:
         chatrooms = list(DBHelpers.getChatroomList(self._conf))
         vars["Chatrooms"] = fossilize(chatrooms)
         if len(vars['Chatrooms']) is 0:
             vars['Chatrooms'] = None
     except Exception, e:
         vars["Chatrooms"] = None
         chatrooms = {}
Esempio n. 25
0
    def getVars(self):
        tplVars = WTemplated.getVars(self)

        smanager = SyncManager.getDBInstance()

        tplVars["trackData"], tplVars["lastAgentTS"] = self._calculateTrackData(smanager)
        tplVars["agents"] = smanager.getAllAgents()
        tplVars["currentTS"] = int_timestamp(nowutc())
        tplVars["granularity"] = smanager.getGranularity()

        return tplVars
Esempio n. 26
0
 def getVars(self):
     from MaKaC.conference import Conference
     vars = WTemplated.getVars(self)
     vars["area"] = i18nformat(""" _("Authorisation") - """)
     vars["msg"] = _(
         "The access to this page has been restricted by its owner and you are not authorised to view it"
     )
     vars["contactInfo"] = ""
     if isinstance(self._rh._target, Conference):
         vars["contactInfo"] = self._rh._target.as_new.no_access_contact
     return vars
Esempio n. 27
0
 def getVars( self ):
     from MaKaC.conference import Conference,Material, Resource
     vars = WTemplated.getVars( self )
     if isinstance(self._rh._target,Conference):
         vars["type"] = "event"
         vars["url"] = quoteattr( str( urlHandlers.UHConfEnterAccessKey.getURL(self._rh._target) ) )
     else:
         vars["type"] = "presentation"
         vars["url"] = quoteattr( str( urlHandlers.UHConfEnterAccessKey.getURL(self._rh._target.getConference()) ) )
     vars["msg"] = self._msg
     return vars
Esempio n. 28
0
    def getVars(self):
        tplVars = WTemplated.getVars(self)

        smanager = SyncManager.getDBInstance()

        tplVars['trackData'], tplVars['lastAgentTS'] = \
                              self._calculateTrackData(smanager)
        tplVars['agents'] = smanager.getAllAgents()
        tplVars['currentTS'] = int_timestamp(nowutc())
        tplVars['granularity'] = smanager.getGranularity()

        return tplVars
Esempio n. 29
0
    def getVars(self):
        tplVars = WTemplated.getVars(self)

        smanager = SyncManager.getDBInstance()

        tplVars['trackData'], tplVars['lastAgentTS'] = \
                              self._calculateTrackData(smanager)
        tplVars['agents'] = smanager.getAllAgents()
        tplVars['currentTS'] = int_timestamp(nowutc())
        tplVars['granularity'] = smanager.getGranularity()

        return tplVars
Esempio n. 30
0
File: api.py Progetto: bubbas/indico
 def getVars(self):
     minfo = HelperMaKaCInfo.getMaKaCInfoInstance()
     apiMode = minfo.getAPIMode()
     vars = WTemplated.getVars(self)
     vars['avatar'] = self._avatar
     vars['apiKey'] = self._avatar.getAPIKey()
     vars['isAdmin'] = self._rh._getUser().isAdmin()
     vars['signingEnabled'] = apiMode in (API_MODE_SIGNED, API_MODE_ONLYKEY_SIGNED, API_MODE_ALL_SIGNED)
     vars['persistentAllowed'] = minfo.isAPIPersistentAllowed()
     vars['apiPersistentEnableAgreement'] = minfo.getAPIPersistentEnableAgreement()
     vars['apiPersistentDisableAgreement'] = minfo.getAPIPersistentDisableAgreement()
     return vars
Esempio n. 31
0
 def getVars( self ):
     vars = WTemplated.getVars( self )
     vars["loginURL"] = ""
     if self._rh._getUser() is None:
         vars["loginURL"] = str(urlHandlers.UHSignIn.getURL(returnURL=self._rh.getCurrentURL()))
     vars["msg"] = self._msg
     redirectURL = ""
     if hasattr(self._rh, "_redirectURL"):
         redirectURL = self._rh._redirectURL
     vars["redirectURL"] = quoteattr(redirectURL)
     vars["url"] = quoteattr( str( urlHandlers.UHConfEnterModifKey.getURL(self._rh._target) ) )
     return vars
Esempio n. 32
0
 def getVars(self):
     minfo = HelperMaKaCInfo.getMaKaCInfoInstance()
     apiMode = minfo.getAPIMode()
     vars = WTemplated.getVars(self)
     vars['avatar'] = self._avatar
     vars['apiKey'] = self._avatar.getAPIKey()
     vars['isAdmin'] = self._rh._getUser().isAdmin()
     vars['signingEnabled'] = apiMode in (API_MODE_SIGNED, API_MODE_ONLYKEY_SIGNED, API_MODE_ALL_SIGNED)
     vars['persistentAllowed'] = minfo.isAPIPersistentAllowed()
     vars['apiPersistentEnableAgreement'] = minfo.getAPIPersistentEnableAgreement()
     vars['apiPersistentDisableAgreement'] = minfo.getAPIPersistentDisableAgreement()
     return vars
Esempio n. 33
0
File: api.py Progetto: bubbas/indico
 def getVars(self):
     minfo = HelperMaKaCInfo.getMaKaCInfoInstance()
     vars = WTemplated.getVars(self)
     vars['apiMode'] = minfo.getAPIMode()
     vars['httpsRequired'] = minfo.isAPIHTTPSRequired()
     vars['persistentAllowed'] = minfo.isAPIPersistentAllowed()
     vars['apiCacheTTL'] = minfo.getAPICacheTTL()
     vars['apiSignatureTTL'] = minfo.getAPISignatureTTL()
     vars['apiPersistentEnableAgreement'] = minfo.getAPIPersistentEnableAgreement()
     vars['apiPersistentDisableAgreement'] = minfo.getAPIPersistentDisableAgreement()
     vars['apiKeyUserAgreement'] = minfo.getAPIKeyUserAgreement()
     vars['apiPersistentUserAgreement'] = minfo.getAPIPersistentUserAgreement()
     return vars
Esempio n. 34
0
 def getVars(self):
     wvars = WTemplated.getVars(self)
     wvars['name'] = wvars['description'] = wvars['url'] = \
         wvars['placeName'] = wvars['regexps'] = wvars['locator'] = ''
     wvars['is_rb_active'] = Config.getInstance().getIsRoomBookingActive()
     if self._roomMapper:
         wvars['name'] = self._roomMapper.getName()
         wvars['description'] = self._roomMapper.getDescription()
         wvars['url'] = self._roomMapper.getBaseMapURL()
         wvars['placeName'] = self._roomMapper.getPlaceName()
         wvars['regexps'] = '\r\n'.join(self._roomMapper.getRegularExpressions())
         wvars['locator'] = self._roomMapper.getLocator().getWebForm()
     return wvars
Esempio n. 35
0
 def getVars( self ):
     vars = WTemplated.getVars( self )
     vars["area"]= i18nformat(""" _("Authorisation") - """)
     vars["msg"] = _("The access to this page has been restricted by its owner and you are not authorised to view it")
     if isinstance(self._rh._target, list):
         #only objects with Access Controler (e.g. we do not want to check this for RB reservertion target): Conferences, Contribs...
         contactInfo = [item.getAccessController().getAnyContactInfo() for item in self._rh._target if hasattr(item, 'getAccessController') ]
         vars["contactInfo"] = ";".join(contactInfo)
     elif self._rh._target is not None and hasattr(self._rh._target, 'getAccessController'): #only objects with Access Controler (e.g. we do not want to check this for RB reservertion target): Conferences, Contribs...
         vars["contactInfo"] = self._rh._target.getAccessController().getAnyContactInfo()
     else:
         vars["contactInfo"] = ""
     return vars
Esempio n. 36
0
 def getVars(self):
     minfo = HelperMaKaCInfo.getMaKaCInfoInstance()
     vars = WTemplated.getVars(self)
     vars['apiMode'] = minfo.getAPIMode()
     vars['httpsRequired'] = minfo.isAPIHTTPSRequired()
     vars['persistentAllowed'] = minfo.isAPIPersistentAllowed()
     vars['apiCacheTTL'] = minfo.getAPICacheTTL()
     vars['apiSignatureTTL'] = minfo.getAPISignatureTTL()
     vars['apiPersistentEnableAgreement'] = minfo.getAPIPersistentEnableAgreement()
     vars['apiPersistentDisableAgreement'] = minfo.getAPIPersistentDisableAgreement()
     vars['apiKeyUserAgreement'] = minfo.getAPIKeyUserAgreement()
     vars['apiPersistentUserAgreement'] = minfo.getAPIPersistentUserAgreement()
     return vars
Esempio n. 37
0
 def getVars( self ):
     vars = WTemplated.getVars( self )
     vars["area"]= i18nformat(""" _("Authorisation") - """)
     vars["msg"] = _("The access to this page has been restricted by its owner and you are not authorised to view it")
     if isinstance(self._rh._target, list):
         #only objects with Access Controler (e.g. we do not want to check this for RB reservertion target): Conferences, Contribs...
         contactInfo = [item.getAccessController().getAnyContactInfo() for item in self._rh._target if hasattr(item, 'getAccessController') ]
         vars["contactInfo"] = ";".join(contactInfo)
     elif self._rh._target is not None and hasattr(self._rh._target, 'getAccessController'): #only objects with Access Controler (e.g. we do not want to check this for RB reservertion target): Conferences, Contribs...
         vars["contactInfo"] = self._rh._target.getAccessController().getAnyContactInfo()
     else:
         vars["contactInfo"] = ""
     return vars
Esempio n. 38
0
    def getVars(self):
        tplVars = WTemplated.getVars(self)

        smanager = SyncManager.getDBInstance()
        avtypes = AgentTypeInspector.getAvailableTypes()

        tplVars['syncManager'] = smanager
        tplVars['agents'] = smanager.getAllAgents()
        tplVars['availableTypes'] = avtypes.keys()
        tplVars['extraAgentOptions'] = dict(
            (typeName, typeClass._extraOptions)
            for (typeName, typeClass) in avtypes.iteritems())
        tplVars['agentTableData'] = dict((agentId, agent.fossilize()) for \
                                         (agentId, agent) in \
                                         smanager.getAllAgents().iteritems())
        return tplVars
Esempio n. 39
0
    def getVars(self):
        tplVars = WTemplated.getVars(self)

        smanager = SyncManager.getDBInstance()
        avtypes = AgentTypeInspector.getAvailableTypes()

        tplVars['syncManager'] = smanager
        tplVars['agents'] = smanager.getAllAgents()
        tplVars['availableTypes'] = avtypes.keys()
        tplVars['extraAgentOptions'] = dict((typeName, typeClass._extraOptions)
                                            for (typeName, typeClass) in
                                            avtypes.iteritems())
        tplVars['agentTableData'] = dict((agentId, agent.fossilize()) for \
                                         (agentId, agent) in \
                                         smanager.getAllAgents().iteritems())
        return tplVars
Esempio n. 40
0
    def getVars(self):
        wvars = WTemplated.getVars(self)
        urlParams = {'userId': wvars["userId"],
                     'callback': wvars["callback"],
                     'third_party_app': wvars["third_party_app"]}

        allowURL = urlHandlers.UHOAuthAuthorizeConsumer.getURL()
        allowURL.addParams(urlParams)
        allowURL.addParam('response', 'accept')
        refuseURL = urlHandlers.UHOAuthAuthorizeConsumer.getURL()
        refuseURL.addParams(urlParams)
        refuseURL.addParam('response', 'refuse')

        wvars["allowURL"] = str(allowURL)
        wvars["refuseURL"] = str(refuseURL)

        return wvars
Esempio n. 41
0
    def getVars(self):
        wvars = WTemplated.getVars(self)
        urlParams = {
            'userId': wvars["userId"],
            'callback': wvars["callback"],
            'third_party_app': wvars["third_party_app"]
        }

        allowURL = urlHandlers.UHOAuthAuthorizeConsumer.getURL()
        allowURL.addParams(urlParams)
        allowURL.addParam('response', 'accept')
        refuseURL = urlHandlers.UHOAuthAuthorizeConsumer.getURL()
        refuseURL.addParams(urlParams)
        refuseURL.addParam('response', 'refuse')

        wvars["allowURL"] = str(allowURL)
        wvars["refuseURL"] = str(refuseURL)

        return wvars
Esempio n. 42
0
 def getVars( self ):
     from MaKaC.conference import Conference,Material, Resource
     vars = WTemplated.getVars( self )
     vars["loginURL"] = ""
     if self._rh._getUser() is None:
         vars["loginURL"] = str(urlHandlers.UHSignIn.getURL(returnURL=self._rh.getCurrentURL()))
     if isinstance(self._rh._target,Conference):
         vars["type"] = "event"
         vars["url"] = quoteattr( str( urlHandlers.UHConfEnterAccessKey.getURL(self._rh._target) ) )
     elif isinstance(self._rh._target,Material):
         vars["type"] = "file"
         vars["url"] = quoteattr( str( urlHandlers.UHMaterialEnterAccessKey.getURL(self._rh._target) ) )
     elif isinstance(self._rh._target,Resource):
         vars["type"] = "file"
         vars["url"] = quoteattr( str( urlHandlers.UHFileEnterAccessKey.getURL(self._rh._target) ) )
     else:
         vars["type"] = "presentation"
         vars["url"] = quoteattr( str( urlHandlers.UHConfEnterAccessKey.getURL(self._rh._target.getConference()) ) )
     vars["msg"] = self._msg
     return vars
Esempio n. 43
0
File: rooms.py Progetto: fph/indico
    def getVars(self):
        wvars = WTemplated.getVars(self)
        wvars['standalone'] = self._standalone
        room = wvars['room']

        wvars['attrs'] = {attr.attribute.name: attr for attr in room.attributes
                          if not attr.attribute.is_hidden or rb_is_admin(session.user)}

        wvars['owner_name'] = room.owner.full_name

        wvars['bookable_hours'] = room.bookable_hours.all()
        wvars['nonbookable_periods'] = room.nonbookable_periods.all()

        # URLs
        wvars['stats_url'] = UH.UHRoomBookingRoomStats.getURL(room)
        wvars['delete_room_url'] = url_for('rooms_admin.delete_room', room)
        wvars['modify_room_url'] = url_for('rooms_admin.modify_room', room)
        if not self._standalone:
            wvars['conference'] = self._rh._conf

        wvars['show_on_map'] = room.map_url if room.map_url else url_for('rooms.roomBooking-mapOfRooms', room)

        return wvars
Esempio n. 44
0
    def getVars(self):
        wvars = WTemplated.getVars(self)
        ch = ConsumerHolder()

        wvars['consumers'] = sorted(ch.getList(), key=lambda c: c.getName())
        return wvars
Esempio n. 45
0
 def getVars(self):
     wvars = WTemplated.getVars(self)
     wvars['mapOfRoomsWidgetURL'] = UH.UHRoomBookingMapOfRoomsWidget.getURL(None, **self._params)
     return wvars
Esempio n. 46
0
 def getVars( self ):
     vars = WTemplated.getVars( self )
     vars["goBack"] = self._goBack
     return vars
Esempio n. 47
0
    def getVars( self ):
        vars = WTemplated.getVars( self )
        ex = sys.exc_info()[1]
        vars["msg"] = self.htmlText( str( ex ) )
        vars["area"]= ""
        ty, ex, tb = sys.exc_info()
        tracebackList = traceback.format_list( traceback.extract_tb( tb ) )
        rh = self._rh.__class__
        url = request.url.encode('utf-8')
        params = []
        for (k,v) in self._rh.getRequestParams().items():
            if k.strip() != "password":
                params.append("""%s = %s""" % (self.htmlText(k), self.htmlText(v)))
        headers = []
        for k, v in request.headers.iteritems():
            headers.append("""%s: %s""" % (self.htmlText(k), self.htmlText(v)))
        userHTML = """-- none --"""
        vars["userEmail"] = ""
        av = self._rh.getAW().getUser()
        if av:
            userHTML = self.htmlText( "%s <%s>"%( av.getFullName(), av.getEmail() ) )
            vars["userEmail"] = quoteattr( av.getEmail() )
        vars["reportURL"] = quoteattr( str( urlHandlers.UHErrorReporting.getURL() ) )
        details = ""
        show_details = Config.getInstance().getDebug()
        if not show_details:
            try:
                show_details = session.user and session.user.is_admin
            except Exception:
                # We are handling some error so we cannot know if accessing the session user works
                # If it fails we simply don't show details...
                pass
        if show_details:
            details = """
<table class="errorDetailsBox">
    <tr>
        <td>ERROR DETAILS</td>
    </tr>
    <tr>
        <td><br></td>
    </tr>
    <tr>
        <td nowrap align="right"><b>Exception type:</b></td>
        <td>%s</td>
    </tr>
    <tr>
        <td nowrap align="right" valign="top"><b>Exception message:</b></td>
        <td>%s</td>
    </tr>
    """%( self.htmlText( str(ty) ), self.htmlText( str(ex) ))

            if hasattr(ex, 'problematic_templates') and hasattr(ex, 'template_tracebacks'):
                for i in range(len(ex.problematic_templates)):
                    details +="""
    <tr>
        <td nowrap align="right" valign="top"><b>Traceback for<br>%s.tpl:</b></td>
        <td>%s</td>
    </tr>
                """%(ex.problematic_templates[i], "<br>".join(ex.template_tracebacks[i]))

            details +="""
    <tr>
        <td valign="top" nowrap align="right"><b>Traceback:</b></td>
        <td><pre>%s</pre></td>
    </tr>
    <tr>
        <td nowrap align="right"><b>Request handler:</b></td>
        <td>%s</td>
    </tr>
    <tr>
        <td nowrap align="right"><b>URL:</b></td>
        <td>%s</td>
    </tr>
    <tr>
        <td nowrap align="right" valign="top"><b>Params:</b></td>
        <td>%s</td>
    </tr>
    <tr>
        <td valign="top" nowrap align="right"><b>HTTP headers:</b></td>
        <td><pre>%s</pre></td>
    </tr>
    <tr>
        <td nowrap align="right"><b>Logged user:</b></td>
        <td>%s</td>
    </tr>
</table>
            """%("\n".join( tracebackList ), rh.__name__, url, "<br>".join(params), \
                    "\n".join( headers ), userHTML )
        vars["errorDetails"] = details
        vars["reportMsg"] = quoteattr(json.dumps({'request_info': get_request_info(),
                                                  'traceback': traceback.format_exc()}))
        return vars
Esempio n. 48
0
    def getVars(self):
        vars = WTemplated.getVars(self)
        ex = sys.exc_info()[1]
        vars["msg"] = self.htmlText(str(ex))
        vars["area"] = ""
        ty, ex, tb = sys.exc_info()
        tracebackList = traceback.format_list(traceback.extract_tb(tb))
        rh = self._rh.__class__
        url = request.url.encode('utf-8')
        params = []
        for (k, v) in self._rh.getRequestParams().items():
            if k.strip() != "password":
                params.append("""%s = %s""" %
                              (self.htmlText(k), self.htmlText(v)))
        headers = []
        for k, v in request.headers.iteritems():
            headers.append("""%s: %s""" % (self.htmlText(k), self.htmlText(v)))
        userHTML = """-- none --"""
        vars["userEmail"] = ""
        av = self._rh.getAW().getUser()
        if av:
            userHTML = self.htmlText("%s <%s>" %
                                     (av.getFullName(), av.getEmail()))
            vars["userEmail"] = quoteattr(av.getEmail())
        vars["reportURL"] = quoteattr(
            str(urlHandlers.UHErrorReporting.getURL()))
        details = ""
        show_details = Config.getInstance().getDebug()
        if not show_details:
            try:
                show_details = session.user and session.user.is_admin
            except Exception:
                # We are handling some error so we cannot know if accessing the session user works
                # If it fails we simply don't show details...
                pass
        if show_details:
            details = """
<table class="errorDetailsBox">
    <tr>
        <td>ERROR DETAILS</td>
    </tr>
    <tr>
        <td><br></td>
    </tr>
    <tr>
        <td nowrap align="right"><b>Exception type:</b></td>
        <td>%s</td>
    </tr>
    <tr>
        <td nowrap align="right" valign="top"><b>Exception message:</b></td>
        <td>%s</td>
    </tr>
    """ % (self.htmlText(str(ty)), self.htmlText(str(ex)))

            if hasattr(ex, 'problematic_templates') and hasattr(
                    ex, 'template_tracebacks'):
                for i in range(len(ex.problematic_templates)):
                    details += """
    <tr>
        <td nowrap align="right" valign="top"><b>Traceback for<br>%s.tpl:</b></td>
        <td>%s</td>
    </tr>
                """ % (ex.problematic_templates[i], "<br>".join(
                        ex.template_tracebacks[i]))

            details +="""
    <tr>
        <td valign="top" nowrap align="right"><b>Traceback:</b></td>
        <td><pre>%s</pre></td>
    </tr>
    <tr>
        <td nowrap align="right"><b>Request handler:</b></td>
        <td>%s</td>
    </tr>
    <tr>
        <td nowrap align="right"><b>URL:</b></td>
        <td>%s</td>
    </tr>
    <tr>
        <td nowrap align="right" valign="top"><b>Params:</b></td>
        <td>%s</td>
    </tr>
    <tr>
        <td valign="top" nowrap align="right"><b>HTTP headers:</b></td>
        <td><pre>%s</pre></td>
    </tr>
    <tr>
        <td nowrap align="right"><b>Logged user:</b></td>
        <td>%s</td>
    </tr>
</table>
            """%("\n".join( tracebackList ), rh.__name__, url, "<br>".join(params), \
                    "\n".join( headers ), userHTML )
        vars["errorDetails"] = details
        vars["reportMsg"] = quoteattr(
            json.dumps({
                'request_info': get_request_info(),
                'traceback': traceback.format_exc()
            }))
        return vars
Esempio n. 49
0
    def getVars( self ):
        vars = WTemplated.getVars( self )
        ex = sys.exc_info()[1]
        vars["msg"] = self.htmlText( str( ex ) )
        vars["area"]= ""
        ty, ex, tb = sys.exc_info()
        tracebackList = traceback.format_list( traceback.extract_tb( tb ) )
        rh = self._rh.__class__
        url = str( self._rh.getRequestURL() )
        params = []
        for (k,v) in self._rh.getRequestParams().items():
            if k.strip() != "password":
                params.append( """%s = %s"""%(self.htmlText(k), \
                                                self.htmlText(str(v))))
        headers = []
        for (k,v) in self._rh.getRequestHTTPHeaders().items():
            headers.append( """%s: %s"""%(self.htmlText(k),\
                                            self.htmlText(str(v))))
        userHTML = """-- none --"""
        vars["userEmail"] = ""
        av = self._rh.getAW().getUser()
        if av:
            userHTML = self.htmlText( "%s <%s>"%( av.getFullName(), av.getEmail() ) )
            vars["userEmail"] = quoteattr( av.getEmail() )
        vars["reportURL"] = quoteattr( str( urlHandlers.UHErrorReporting.getURL() ) )
        details = ""
        if HelperMaKaCInfo.getMaKaCInfoInstance().isDebugActive():
            details = """
<table class="errorDetailsBox">
    <tr>
        <td>ERROR DETAILS</td>
    </tr>
    <tr>
        <td><br></td>
    </tr>
    <tr>
        <td nowrap align="right"><b>Exception type:</b></td>
        <td>%s</td>
    </tr>
    <tr>
        <td nowrap align="right" valign="top"><b>Exception message:</b></td>
        <td>%s</td>
    </tr>
    """%( self.htmlText( str(ty) ), self.htmlText( str(ex) ))

            if hasattr(ex, 'problematic_templates') and hasattr(ex, 'template_tracebacks'):
                for i in range(len(ex.problematic_templates)):
                    details +="""
    <tr>
        <td nowrap align="right" valign="top"><b>Traceback for<br>%s.tpl:</b></td>
        <td>%s</td>
    </tr>
                """%(ex.problematic_templates[i], "<br>".join(ex.template_tracebacks[i]))

            details +="""
    <tr>
        <td valign="top" nowrap align="right"><b>Traceback:</b></td>
        <td><pre>%s</pre></td>
    </tr>
    <tr>
        <td nowrap align="right"><b>Request handler:</b></td>
        <td>%s</td>
    </tr>
    <tr>
        <td nowrap align="right"><b>URL:</b></td>
        <td>%s</td>
    </tr>
    <tr>
        <td nowrap align="right" valign="top"><b>Params:</b></td>
        <td>%s</td>
    </tr>
    <tr>
        <td valign="top" nowrap align="right"><b>HTTP headers:</b></td>
        <td><pre>%s</pre></td>
    </tr>
    <tr>
        <td nowrap align="right"><b>Logged user:</b></td>
        <td>%s</td>
    </tr>
</table>
            """%("\n".join( tracebackList ), rh.__name__, url, "<br>".join(params), \
                    "\n".join( headers ), userHTML )
        vars["errorDetails"] = details
        userStr = """-- "none" --"""
        if av:
            userStr = "[%s] %s <%s>"%(av.getId(), av.getFullName(), av.getEmail() )
        report = ["exception message => %s"%str( ex ), \
                    "exception type => %s" %str(ty), \
                    "traceback => \n%s"%"\n".join(tracebackList), \
                    "request handler => %s"%self._rh.__class__, \
                    "url => %s"%str( self._rh.getRequestURL() ), \
                    "parameters => \n%s"%"\n".join(params), \
                    "headers => \n%s"%"\n".join(headers), \
                    "user => %s"%userStr ]
        vars["reportMsg"] = quoteattr( "\n".join( report ) )
        return vars
Esempio n. 50
0
 def getVars(self):
     vars = WTemplated.getVars(self)
     vars["msg"] = self._msg
     vars["urlbase"] = Config.getInstance().getBaseURL()
     return vars
Esempio n. 51
0
 def getVars(self):
     vars = WTemplated.getVars(self)
     vars["postURL"] = quoteattr(str(urlHandlers.UHErrorReporting.getURL()))
     vars["dstEmail"] = quoteattr(self._dstMail)
     vars["reportMsg"] = quoteattr(self._msg)
     return vars
Esempio n. 52
0
    def getVars(self):
        vars = WTemplated.getVars(self)

        return vars
Esempio n. 53
0
 def getVars(self):
     vars = WTemplated.getVars(self)
     vars["errorTitle"] = "%s" % self._ex[0]
     vars["errorText"] = "%s" % self._ex[1]
     return vars
Esempio n. 54
0
 def getVars(self):
     wvars = WTemplated.getVars(self)
     ath = AccessTokenHolder()
     wvars["formatTimestamp"] = lambda ts: format_datetime(ts, format='d/M/yyyy H:mm')
     wvars['tokens'] = sorted(ath.getList(), key=lambda t: t.getUser().getId())
     return wvars
Esempio n. 55
0
 def getVars( self ):
     vars = WTemplated.getVars( self )
     vars["msg"] = self._msg
     return vars
Esempio n. 56
0
 def getVars(self):
     vars = WTemplated.getVars(self)
     vars["msg"] = self._msg
     return vars
Esempio n. 57
0
 def getVars(self):
     vars = WTemplated.getVars(self)
     vars["goBack"] = self._goBack
     return vars