Changeset 2524 for pykota/trunk/cgi-bin

Show
Ignore:
Timestamp:
09/29/05 13:39:17 (19 years ago)
Author:
jerome
Message:

More complete output for pykotme

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/cgi-bin/pykotme.cgi

    r2381 r2524  
    167167                    user = self.storage.getUser(remuser) 
    168168                    if user.Exists : 
    169                         for printer in printers : 
    170                             upquota = self.storage.getUserPQuota(user, printer) 
    171                             if upquota.Exists : 
    172                                 cost = upquota.computeJobPrice(jobsize) 
    173                                 self.body += "<p>%s</p>" % (_("Cost on printer %s : %.2f") % (printer.Name, cost)) 
     169                        if user.LimitBy == "noprint" : 
     170                            self.body += "<p>%s</p>" % _("Your account settings forbid you to print at this time.") 
     171                        else :     
     172                            for printer in printers : 
     173                                upquota = self.storage.getUserPQuota(user, printer) 
     174                                if upquota.Exists : 
     175                                    if printer.MaxJobSize and (jobsize > printer.MaxJobSize) : 
     176                                        msg = _("You are not allowed to print so many pages on printer %s at this time.") % printer.Name 
     177                                    else :     
     178                                        cost = upquota.computeJobPrice(jobsize) 
     179                                        msg = _("Cost on printer %s : %.2f") % (printer.Name, cost) 
     180                                        if printer.PassThrough : 
     181                                            msg = "%s (%s)" % (msg, _("won't be charged, printer is in passthrough mode")) 
     182                                        elif user.LimitBy == "nochange" :     
     183                                            msg = "%s (%s)" % (msg, _("won't be charged, your account is immutable")) 
     184                                    self.body += "<p>%s</p>" % msg 
    174185                except : 
    175186                    self.body += '<p><font color="red">%s</font></p>' % self.crashed("CGI Error").replace("\n", "<br />")