234 | | def limitUserByQuota(self, userid) : |
235 | | """Limits a given user based on print quota.""" |
236 | | self.doQuery("UPDATE users SET limitby='quota' WHERE id=%s" % self.doQuote(userid)) |
237 | | |
238 | | def limitUserByBalance(self, userid) : |
239 | | """Limits a given user based on account balance.""" |
240 | | self.doQuery("UPDATE users SET limitby='balance' WHERE id=%s" % self.doQuote(userid)) |
| 237 | def limitUserBy(self, userid, limitby) : |
| 238 | """Limits a given user based either on print quota or on account balance.""" |
| 239 | self.doQuery("UPDATE users SET limitby=%s WHERE id=%s" % (self.doQuote(limitby), self.doQuote(userid))) |
| 240 | |
| 241 | def limitGroupBy(self, groupid, limitby) : |
| 242 | """Limits a given group based either on print quota or on sum of its users' account balances.""" |
| 243 | self.doQuery("UPDATE groups SET limitby=%s WHERE id=%s" % (self.doQuote(limitby), self.doQuote(groupid))) |