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'] = url_for('rooms.roomBooking-roomStats', 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
def getVars( self ): from indico.modules.events.legacy import LegacyConference vars = WTemplated.getVars( self ) vars["area"]= _("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, LegacyConference): vars["contactInfo"] = self._rh._target.as_event.no_access_contact return vars
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'] = url_for('rooms.roomBooking-roomStats', room) wvars['delete_room_url'] = url_for('rooms_admin.delete_room', room) wvars['modify_room_url'] = url_for('rooms_admin.modify_room', room) wvars['show_on_map'] = room.map_url if room.map_url else url_for('rooms.roomBooking-mapOfRooms', room) return wvars
def getVars(self): wvars = WTemplated.getVars(self) wvars['mapOfRoomsWidgetURL'] = url_for( 'rooms.roomBooking-mapOfRoomsWidget', **self._params) return wvars
def getVars(self): vars = WTemplated.getVars(self) vars["supportEmail"] = Config.getInstance().getPublicSupportEmail() return vars
def getVars(self): vars = WTemplated.getVars(self) vars["supportEmail"] = config.PUBLIC_SUPPORT_EMAIL return vars
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 request.values.iteritems(): 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"] = "" try: user = session.user user_name = user and user.full_name user_email = user and user.email user_is_admin = user and user.is_admin except Exception: # Yuck! But we are handling an error and we don't know if we # can access the user or its attributes... user_is_admin = False else: if user: userHTML = self.htmlText(u'{} <{}>'.format( user_name, user_email).encode('utf-8')) vars["userEmail"] = quoteattr(user_email.encode('utf-8')) vars["reportURL"] = quoteattr(url_for('misc.errors')) details = "" if config.DEBUG or user_is_admin: 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
def getVars(self): vars = WTemplated.getVars(self) vars["goBack"] = self._goBack return vars
def getVars(self): vars = WTemplated.getVars(self) vars["msg"] = self._msg return vars
def getVars(self): vars = WTemplated.getVars(self) vars["postURL"] = quoteattr(url_for('misc.errors')) vars["dstEmail"] = quoteattr(self._dstMail) vars["reportMsg"] = quoteattr(self._msg) return vars
def getVars(self): vars = WTemplated.getVars(self) return vars
def getVars(self): vars = WTemplated.getVars(self) vars["url"] = url_for('event.conferenceDisplay-accessKey', self._rh._target) vars["msg"] = self._msg return vars
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(url_for('misc.errors')) 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