Show
Ignore:
Timestamp:
03/25/06 22:22:07 (18 years ago)
Author:
jerome
Message:

Ensures that all texts sent by pknotify to a remote pykoticon server
are UTF-8 encoded.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/bin/pknotify

    r2802 r2804  
    152152    def sanitizeMessage(self, msg) : 
    153153        """Replaces \\n and returns a messagee in xmlrpclib Binary format.""" 
    154         return xmlrpclib.Binary(msg.replace("\\n", "\n")) 
     154        return xmlrpclib.Binary(self.userCharsetToUTF8(msg.replace("\\n", "\n"))) 
    155155         
    156156    def convPAM(self, auth, queries=[], userdata=None) : 
     
    243243                    if options["checkauth"] : 
    244244                        if ("username" in varnames) and ("password" in varnames) : 
    245                             if self.checkAuth(result["username"].data, result["password"].data) : 
     245                            if self.checkAuth(self.UTF8ToUserCharset(result["username"].data[:]),  
     246                                              self.UTF8ToUserCharset(result["password"].data[:])) : 
    246247                                authok = "AUTH=YES" 
    247248                            else :     
     
    252253                        if (varname != "password") \ 
    253254                           and ((varname != "username") or (authok in (None, "AUTH=YES"))) : 
    254                             print "%s=%s" % (varname.upper(), result[varname].data) 
     255                            print "%s=%s" % (varname.upper(), self.UTF8ToUserCharset(result[varname].data[:])) 
    255256                    if authok is not None :         
    256257                        print authok         
     
    275276    try : 
    276277        defaults = { \ 
    277                      "denyafter" : 1, 
     278                     "denyafter" : 0, 
    278279                     "timeout" : 0, 
    279280                   }