Changeset 2786 for pykota/trunk
- Timestamp:
- 03/05/06 22:16:17 (19 years ago)
- Location:
- pykota/trunk/bin
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/bin/cupspykota
r2766 r2786 295 295 self.logdebug("Launching subprocess [%s] to overwrite the job ticket." \ 296 296 % jobticketcommand) 297 self.regainPriv() 297 298 inputfile = os.popen(jobticketcommand, "r") 298 299 for line in inputfile.xreadlines() : 299 300 line = line.strip() 300 if line == "DENY":301 self.logdebug("Seen DENY command.")301 if line in ("DENY", "AUTH=NO", "AUTH=IMPOSSIBLE") : 302 self.logdebug("Seen %s command." % line) 302 303 action = "DENY" 303 304 elif line == "CANCEL" : … … 313 314 action = None 314 315 inputfile.close() 316 self.dropPriv() 315 317 316 318 # now overwrite the job's ticket if new data was supplied -
pykota/trunk/bin/pknotify
r2785 r2786 61 61 user. Then pknotify will output the result. 62 62 63 -C | --checkauth When --ask is used and an 'username' and a63 -C | --checkauth When --ask is used and both an 'username' and a 64 64 'password' are asked to the end user, then 65 65 pknotify will try to authenticate the user … … 67 67 will print "AUTH=YES", else "AUTH=NO". 68 68 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. 70 71 71 72 -c | --confirm Tells pknotify to ask for either a confirmation … … 188 189 result = server.askDatas(labels, varnames, varvalues) 189 190 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 194 192 if options["checkauth"] : 195 193 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" 198 196 else : 199 print"AUTH=NO"197 authok = "AUTH=NO" 200 198 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 202 206 elif options["confirm"] : 203 207 print server.showDialog(self.sanitizeMessage(arguments[0]), True)