equal
deleted
inserted
replaced
50 def publish(self, rset=None): |
50 def publish(self, rset=None): |
51 req = self._cw |
51 req = self._cw |
52 if 'custom_css' in req.form: |
52 if 'custom_css' in req.form: |
53 req.add_css(req.form['custom_css']) |
53 req.add_css(req.form['custom_css']) |
54 embedded_url = req.form['url'] |
54 embedded_url = req.form['url'] |
55 allowed = self._cw.config['embed-allowed'] |
55 allowed = self._cw.vreg.config['embed-allowed'] |
56 _ = req._ |
56 _ = req._ |
57 if allowed is None or not allowed.match(embedded_url): |
57 if allowed is None or not allowed.match(embedded_url): |
58 body = '<h2>%s</h2><h3>%s</h3>' % ( |
58 body = '<h2>%s</h2><h3>%s</h3>' % ( |
59 _('error while embedding page'), |
59 _('error while embedding page'), |
60 _('embedding this url is forbidden')) |
60 _('embedding this url is forbidden')) |
80 def entity_has_embedable_url(entity): |
80 def entity_has_embedable_url(entity): |
81 """return 1 if the entity provides an allowed embedable url""" |
81 """return 1 if the entity provides an allowed embedable url""" |
82 url = entity.embeded_url() |
82 url = entity.embeded_url() |
83 if not url or not url.strip(): |
83 if not url or not url.strip(): |
84 return 0 |
84 return 0 |
85 allowed = entity.config['embed-allowed'] |
85 allowed = entity._cw.vreg.config['embed-allowed'] |
86 if allowed is None or not allowed.match(url): |
86 if allowed is None or not allowed.match(url): |
87 return 0 |
87 return 0 |
88 return 1 |
88 return 1 |
89 |
89 |
90 |
90 |