Changeset 1956
- Timestamp:
- 11/22/04 22:53:38 (20 years ago)
- Location:
- pykota/trunk
- Files:
-
- 5 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/bin/edpykota
r1809 r1956 24 24 # 25 25 # $Log$ 26 # Revision 1.82 2004/11/22 21:53:38 jalet 27 # Added the reject_unknown directive to pykota.conf to reject user/group 28 # creation if user or group is unknown to the system 29 # 26 30 # Revision 1.81 2004/10/12 15:37:00 jalet 27 31 # Now outputs the name of the offending user if a mere mortal tries to use … … 290 294 import os 291 295 import pwd 296 import grp 292 297 from pykota.tool import PyKotaTool, PyKotaToolError, crashed, N_ 293 298 from pykota.config import PyKotaConfigError … … 527 532 protoentry = getattr(self.storage, "get%s" % suffix)(options["prototype"]) 528 533 534 rejectunknown = self.config.getRejectUnknown() 529 535 printeradded = 0 530 536 printers = self.storage.getMatchingPrinters(options["printer"]) … … 620 626 # only remotely 621 627 if self.isValidName(entry.Name) : 622 entry = getattr(self.storage, "add%s" % suffix)(entry) 628 reject = 0 629 if rejectunknown : 630 if options["groups"] : 631 try : 632 grp.getgrnam(entry.Name) 633 except KeyError : 634 self.printInfo(_("Unknown group %s") % entry.Name, "error") 635 reject = 1 636 else : 637 try : 638 pwd.getpwnam(entry.Name) 639 except KeyError : 640 self.printInfo(_("Unknown user %s") % entry.Name, "error") 641 reject = 1 642 if not reject : 643 entry = getattr(self.storage, "add%s" % suffix)(entry) 623 644 else : 624 645 if options["groups"] : -
pykota/trunk/conf/pykota.conf.sample
r1931 r1956 216 216 # 'Domain2/jerome' and 'jerome' are different. 217 217 # winbind_separator: / 218 219 # When creating users or groups accounts, should we reject users 220 # or groups which are unknown from the system ? 221 # The default if unset is NO. This means that by default, you 222 # can create users or groups for which `getent passwd username` 223 # or `getent group groupname` returns nothing. 224 # 225 # Allowed values : Yes | No 226 # Default value : No 227 # 228 # reject_unknown: No 218 229 219 230 # Do we want to hide jobs' title, filename and options for privacy -
pykota/trunk/NEWS
r1952 r1956 22 22 PyKota NEWS : 23 23 24 - 1.21alpha8 : 25 26 - Added the new reject_unknown directive to reject the 27 creation of user or groups which are unknown to the system. 28 24 29 - 1.21alpha7 : 25 30 -
pykota/trunk/pykota/config.py
r1916 r1956 22 22 # 23 23 # $Log$ 24 # Revision 1.57 2004/11/22 21:53:38 jalet 25 # Added the reject_unknown directive to pykota.conf to reject user/group 26 # creation if user or group is unknown to the system 27 # 24 28 # Revision 1.56 2004/11/15 15:23:07 jalet 25 29 # Strips spaces just in case … … 558 562 return self.isTrue(self.getGlobalOption("utolower", ignore=1)) 559 563 564 def getRejectUnknown(self) : 565 """Returns 1 if we want to reject the creation of unknown users or groups, else 0.""" 566 return self.isTrue(self.getGlobalOption("reject_unknown", ignore=1)) 567 560 568 def getWinbindSeparator(self) : 561 569 """Returns the winbind separator's value if it is set, else None.""" -
pykota/trunk/pykota/version.py
r1952 r1956 22 22 # 23 23 24 __version__ = "1.21alpha 7_unofficial"24 __version__ = "1.21alpha8_unofficial" 25 25 26 26 __doc__ = """PyKota : a complete Printing Quota Solution for CUPS and LPRng."""