Changeset 3179 for pykota/branches/specialauth/bin/pknotify
- Timestamp:
- 05/29/07 11:12:17 (17 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/branches/specialauth/bin/pknotify
r3144 r3179 38 38 hasPAM = 1 39 39 40 from pykota.tool import Tool, PyKotaToolError, PyKotaCommandLineError, crashed, N_40 from pykota.tool import PyKotaTool, PyKotaToolError, PyKotaCommandLineError, crashed, N_ 41 41 42 42 __doc__ = N_("""pknotify v%(__version__)s (c) %(__years__)s %(__author__)s … … 157 157 __str__ = __repr__ 158 158 159 class PyKotaNotify( Tool) :159 class PyKotaNotify(PyKotaTool) : 160 160 """A class for pknotify.""" 161 161 def sanitizeMessage(self, msg) : … … 176 176 return response 177 177 178 def checkAuth (self, username, password) :179 """Checks if we could authenticate an username with a password ."""178 def checkAuthPAM(self, username, password) : 179 """Checks if we could authenticate an username with a password through PAM.""" 180 180 if not hasPAM : 181 181 raise PyKotaToolError, _("You MUST install PyPAM for this functionnality to work !") … … 200 200 self.dropPriv() 201 201 return retcode 202 203 def checkAuthDB(self, username, password) : 204 """Checks if we could authenticate an username with a password through PyKota's DB with clear text passwords.""" 205 user = self.storage.getUser(username) 206 if user.Exists : 207 if password == user.Password : 208 return True 209 return False 210 211 def checkAuth(self, username, password) : 212 """Checks if we could authenticate an username with a password through PyKota's DB.""" 213 return self.checkAuthDB(username, password) 202 214 203 215 def alarmHandler(self, signum, frame) : … … 372 384 retcode = -1 373 385 386 try : 387 notifier.storage.close() 388 except (TypeError, NameError, AttributeError) : 389 pass 390 374 391 sys.exit(retcode)