Show
Ignore:
Timestamp:
03/05/06 22:16:17 (18 years ago)
Author:
jerome
Message:

Combining cupspykota, pknotify and PyKotIcon? now work fine to check user's credentials.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/bin/pknotify

    r2785 r2786  
    6161                             user. Then pknotify will output the result. 
    6262                        
    63   -C | --checkauth           When --ask is used and an 'username' and a  
     63  -C | --checkauth           When --ask is used and both an 'username' and a 
    6464                             'password' are asked to the end user, then 
    6565                             pknotify will try to authenticate the user 
     
    6767                             will print "AUTH=YES", else "AUTH=NO". 
    6868                             If a field is missing, "AUTH=IMPOSSIBLE" will 
    69                              be printed. 
     69                             be printed. If the user is authenticated, then 
     70                             "USERNAME=xxxx" will be printed as well. 
    7071                              
    7172  -c | --confirm             Tells pknotify to ask for either a confirmation                        
     
    188189                result = server.askDatas(labels, varnames, varvalues)     
    189190                if result["isValid"] : 
    190                     for varname in varnames : 
    191                         result[varname] = result[varname].data 
    192                         if (varname != "password") : 
    193                             print "%s=%s" % (varname.upper(), result[varname]) 
     191                    authok = None 
    194192                    if options["checkauth"] : 
    195193                        if ("username" in varnames) and ("password" in varnames) : 
    196                             if self.checkAuth(result["username"], result["password"]) : 
    197                                 print "AUTH=YES" 
     194                            if self.checkAuth(result["username"].data, result["password"].data) : 
     195                                authok = "AUTH=YES" 
    198196                            else :     
    199                                 print "AUTH=NO" 
     197                                authok = "AUTH=NO" 
    200198                        else :         
    201                             print "AUTH=IMPOSSIBLE" 
     199                            authok = "AUTH=IMPOSSIBLE"         
     200                    for varname in varnames : 
     201                        if (varname != "password") \ 
     202                           and ((varname != "username") or (authok == "AUTH=YES")) : 
     203                            print "%s=%s" % (varname.upper(), result[varname].data) 
     204                    if authok is not None :         
     205                        print authok         
    202206            elif options["confirm"] : 
    203207                print server.showDialog(self.sanitizeMessage(arguments[0]), True)