Changeset 2805 for pykota/trunk/bin/pknotify
- Timestamp:
- 03/25/06 23:02:08 (19 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/bin/pknotify
r2804 r2805 226 226 server = xmlrpclib.ServerProxy("http://%s:%s" % (self.destination, self.port)) 227 227 if options["ask"] : 228 try : 229 denyafter = int(options["denyafter"]) 230 if denyafter < 1 : 231 raise ValueError 232 except (ValueError, TypeError) : 233 denyafter = 1 228 234 labels = [] 229 235 varnames = [] … … 238 244 varnames.append(varname) 239 245 varvalues[varname] = self.sanitizeMessage(varvalue) 240 result = server.askDatas(labels, varnames, varvalues) 241 if result["isValid"] : 242 authok = None 243 if options["checkauth"] : 246 247 passnumber = 1 248 authok = None 249 while (authok != "AUTH=YES") and (passnumber <= denyafter) : 250 result = server.askDatas(labels, varnames, varvalues) 251 if not options["checkauth"] : 252 break 253 if result["isValid"] : 244 254 if ("username" in varnames) and ("password" in varnames) : 245 255 if self.checkAuth(self.UTF8ToUserCharset(result["username"].data[:]), … … 250 260 else : 251 261 authok = "AUTH=IMPOSSIBLE" 262 passnumber += 1 263 264 if result["isValid"] : 252 265 for varname in varnames : 253 266 if (varname != "password") \ … … 276 289 try : 277 290 defaults = { \ 278 "denyafter" : 0,279 291 "timeout" : 0, 280 292 } … … 300 312 options["quit"] = options["q"] or options["quit"] 301 313 options["checkauth"] = options["C"] or options["checkauth"] 302 options["denyafter"] = options["D"] or options["denyafter"] or defaults["denyafter"]314 options["denyafter"] = options["D"] or options["denyafter"] 303 315 options["timeout"] = options["t"] or options["timeout"] or defaults["timeout"] 304 316