[pybot-commits] CVS: pybot/pybot/modules infopack.py,1.12,1.13
Brought to you by:
niemeyer
From: Gustavo N. <nie...@us...> - 2003-08-27 18:03:58
|
Update of /cvsroot/pybot/pybot/pybot/modules In directory sc8-pr-cvs1:/tmp/cvs-serv778/pybot/modules Modified Files: infopack.py Log Message: Protect infopack help with permissions. Index: infopack.py =================================================================== RCS file: /cvsroot/pybot/pybot/pybot/modules/infopack.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** infopack.py 27 Aug 2003 17:57:28 -0000 1.12 --- infopack.py 27 Aug 2003 18:03:42 -0000 1.13 *************** *** 303,314 **** msg.answer("%:", "There's no infopack with that name.") else: ! for line in help: ! msg.answer("%:", line) return 1 def help_match(self, msg, match): something = match.group("something") found = 0 ! for pack in self.packs.values(): if pack.help_match(something): found = 1 --- 303,323 ---- msg.answer("%:", "There's no infopack with that name.") else: ! if mm.hasperm(msg, "infopack", name): ! for line in help: ! msg.answer("%:", line) ! else: ! msg.answer("%:", ["You have no permission to use that" ! "infopack", ! "You can't use that infopack"], ! [".", "!"]) return 1 def help_match(self, msg, match): something = match.group("something") + allowed = mm.permparams(msg, "infopack") found = 0 ! for name, pack in self.packs.items(): ! if name not in allowed: ! continue if pack.help_match(something): found = 1 *************** *** 458,462 **** allowed = mm.permparams(msg, "infopack") - found = 0 for name, pack in self.packs.items(): --- 467,470 ---- |