X-Git-Url: https://svn.cri.ensmp.fr/git/Plinn.git/blobdiff_plain/2e41b532233f96f4bc43eedbe5bcf1929d823a6c..08a12c7d87614be8332e8bb81532f0e5a2ce36db:/utils.py?ds=inline diff --git a/utils.py b/utils.py index aa91c8d..024c975 100755 --- a/utils.py +++ b/utils.py @@ -165,7 +165,11 @@ def _checkMemberPermission(userid, permission, obj, StringType = type('')): return 0 def getCPInfo(self) : - try: cp = _cb_decode(self.REQUEST['__cp']) + if self.REQUEST.RESPONSE.cookies.has_key('__cp') : + cp = self.REQUEST.RESPONSE.cookies['__cp']['value'] + else : + cp = self.REQUEST.get('__cp') + try: cp = _cb_decode(cp) except: return None return cp @@ -257,10 +261,12 @@ def getAdapterByInterface(ob, dotted_name, default=_marker) : else : return default +security.declarePublic('encodeQuopriEmail') def encodeQuopriEmail(name, email) : qpName = encodestring(name).replace('=\n', '') return '''"=?utf-8?q?%s?=" <%s>''' % (qpName, email) +security.declarePublic('encodeMailHeader') def encodeMailHeader(content) : s = encodestring(content).replace('=\n', '') s = s.replace('_', '=5F')