Changeset 3179 for pykota/branches
- Timestamp:
- 05/29/07 11:12:17 (17 years ago)
- Location:
- pykota/branches/specialauth
- Files:
-
- 4 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) -
pykota/branches/specialauth/pykota/storage.py
r3133 r3179 71 71 self.LifeTimePaid = None 72 72 self.Email = None 73 self.Password = None 73 74 self.OverCharge = 1.0 74 75 self.Payments = [] # TODO : maybe handle this smartly for SQL, for now just don't retrieve them -
pykota/branches/specialauth/pykota/storages/sql.py
r3165 r3179 36 36 user.LifeTimePaid = record.get("lifetimepaid") 37 37 user.Email = record.get("email") 38 user.Password = record.get("password") 38 39 user.Description = self.databaseToUserCharset(record.get("description")) 39 40 user.OverCharge = record.get("overcharge", 1.0) -
pykota/branches/specialauth/pykota/version.py
r3162 r3179 22 22 # 23 23 24 __version__ = "1.26alpha5_ unofficial"24 __version__ = "1.26alpha5_specialauth_unofficial" 25 25 26 26 __doc__ = "PyKota : a complete Printing Quota Solution for CUPS."