Changeset 1806 for pykota/trunk/pykota

Show
Ignore:
Timestamp:
10/12/04 10:58:53 (20 years ago)
Author:
jalet
Message:

Now warnpykota only warns users who have already printed, to not confuse
users who have just opened their account.

Location:
pykota/trunk/pykota
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/pykota/storages/ldapstorage.py

    r1790 r1806  
    2222# 
    2323# $Log$ 
     24# Revision 1.84  2004/10/12 08:58:53  jalet 
     25# Now warnpykota only warns users who have already printed, to not confuse 
     26# users who have just opened their account. 
     27# 
    2428# Revision 1.83  2004/10/07 21:14:28  jalet 
    2529# Hopefully final fix for data encoding to and from the database 
     
    522526            groupnames = [record[1]["pykotaGroupName"][0] for record in result] 
    523527        return groupnames 
     528         
     529    def getUserNbJobsFromHistory(self, user) : 
     530        """Returns the number of jobs the user has in history.""" 
     531        result = self.doSearch("(&(pykotaUserName=%s)(objectClass=pykotaJob))" % user.Name, None, base=self.info["jobbase"]) 
     532        return len(result) 
    524533         
    525534    def getUserFromBackend(self, username) :     
  • pykota/trunk/pykota/storages/sql.py

    r1792 r1806  
    2222# 
    2323# $Log$ 
     24# Revision 1.58  2004/10/12 08:58:53  jalet 
     25# Now warnpykota only warns users who have already printed, to not confuse 
     26# users who have just opened their account. 
     27# 
    2428# Revision 1.57  2004/10/10 10:12:21  jalet 
    2529# Improved SQL queries for groups. Same work has to be done for groups print quotas. 
     
    184188            groupnames = [record["groupname"] for record in result] 
    185189        return groupnames 
     190         
     191    def getUserNbJobsFromHistory(self, user) : 
     192        """Returns the number of jobs the user has in history.""" 
     193        result = self.doSearch("SELECT COUNT(*) FROM jobhistory WHERE userid=%s" % self.doQuote(user.ident)) 
     194        if result : 
     195            return result[0]["count"] 
     196        return 0 
    186197         
    187198    def getUserFromBackend(self, username) :     
  • pykota/trunk/pykota/version.py

    r1791 r1806  
    2222# 
    2323 
    24 __version__ = "1.20alpha23_unofficial" 
     24__version__ = "1.20alpha24_unofficial" 
    2525 
    2626__doc__ = """PyKota : a complete Printing Quota Solution for CUPS and LPRng."""