Show
Ignore:
Timestamp:
03/16/03 00:01:28 (21 years ago)
Author:
jalet
Message:

New mailto option in configuration file added.
No time to test this tonight (although it should work).

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/pykota/tool.py

    r844 r852  
    1515# 
    1616# $Log$ 
     17# Revision 1.27  2003/03/15 23:01:28  jalet 
     18# New mailto option in configuration file added. 
     19# No time to test this tonight (although it should work). 
     20# 
    1721# Revision 1.26  2003/03/09 23:58:16  jalet 
    1822# Comment 
     
    312316        admin = self.config.getAdmin(pname) 
    313317        adminmail = self.config.getAdminMail(pname) 
     318        mailto = self.config.getMailTo(pname) 
    314319        action = self.checkUserPQuota(username, pname) 
    315320        if action.startswith("POLICY_") : 
     
    318323            adminmessage = _("Print Quota exceeded for user %s on printer %s") % (username, pname) 
    319324            self.logger.log_message(adminmessage) 
    320             self.sendMessageToUser(admin, adminmail, username, _("Print Quota Exceeded"), _("You are not allowed to print anymore because\nyour Print Quota is exceeded on printer %s.") % pname) 
    321             self.sendMessageToAdmin(adminmail, _("Print Quota"), adminmessage) 
     325            if mailto in [ "BOTH", "USER" ] : 
     326                self.sendMessageToUser(admin, adminmail, username, _("Print Quota Exceeded"), _("You are not allowed to print anymore because\nyour Print Quota is exceeded on printer %s.") % pname) 
     327            if mailto in [ "BOTH", "ADMIN" ] : 
     328                self.sendMessageToAdmin(adminmail, _("Print Quota"), adminmessage) 
    322329        elif action == "WARN" :     
    323330            adminmessage = _("Print Quota soft limit exceeded for user %s on printer %s") % (username, pname) 
    324331            self.logger.log_message(adminmessage) 
    325             self.sendMessageToUser(admin, adminmail, username, _("Print Quota Exceeded"), _("You will soon be forbidden to print anymore because\nyour Print Quota is almost reached on printer %s.") % pname) 
    326             self.sendMessageToAdmin(adminmail, _("Print Quota"), adminmessage) 
     332            if mailto in [ "BOTH", "USER" ] : 
     333                self.sendMessageToUser(admin, adminmail, username, _("Print Quota Exceeded"), _("You will soon be forbidden to print anymore because\nyour Print Quota is almost reached on printer %s.") % pname) 
     334            if mailto in [ "BOTH", "ADMIN" ] : 
     335                self.sendMessageToAdmin(adminmail, _("Print Quota"), adminmessage) 
    327336        return action         
    328337