Changeset 2232 for pykota/trunk/cgi-bin

Show
Ignore:
Timestamp:
05/05/05 23:52:49 (19 years ago)
Author:
jerome
Message:

Improved stability in pykotme and pykotme.cgi
Now uses real userid instead of effective userid in pykotme and pykosd,
to allow user root to check his own account instead of user pykota's one
(since we drop priviledges early).
Better setup instructions for pykotme.cgi

Location:
pykota/trunk/cgi-bin
Files:
2 modified

Legend:

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

    r2229 r2232  
    145145                try :     
    146146                    user = self.storage.getUser(remuser) 
    147                     for printer in printers : 
    148                         upquota = self.storage.getUserPQuota(user, printer) 
    149                         cost = upquota.computeJobPrice(jobsize) 
    150                         self.body += "<p>%s</p>" % (_("Cost on printer %s : %.2f") % (printer.Name, cost)) 
     147                    if user.Exists : 
     148                        for printer in printers : 
     149                            upquota = self.storage.getUserPQuota(user, printer) 
     150                            if upquota.Exists : 
     151                                cost = upquota.computeJobPrice(jobsize) 
     152                                self.body += "<p>%s</p>" % (_("Cost on printer %s : %.2f") % (printer.Name, cost)) 
    151153                except : 
    152154                    self.body += '<p><font color="red">%s</font></p>' % self.crashed("CGI Error").replace("\n", "<br />") 
  • pykota/trunk/cgi-bin/README

    r2153 r2232  
    2525Be sure to restrict access to these CGI scripts as necessary. 
    2626 
    27 For now, pykotme.cgi doesn't need any restriction. 
    28  
    2927If you protect access to printquota.cgi or dumpykota.cgi with  
    3028username+password authentication, the REMOTE_USER CGI environment variable 
     
    3533If no username+password authentication takes place, then access 
    3634is completely unrestricted. 
     35 
     36If you don't protect access to pykotme.cgi with username+password 
     37authentication, then only the job's size will be displayed 
     38to you. This is due to the cost of a print job on a particular printer 
     39depending on the user because of the overcharging factor's value.  
     40So if you want pykotme.cgi to produce complete web quotes, you must  
     41ensure that the user logs in from his web browser whenever he uses  
     42this CGI script. 
    3743 
    3844You must ensure that the user your web server runs as can read