Mercurial > p > roundup > code
comparison roundup/admin.py @ 902:b0d3d3535998
Bugger it. Here's the current shape of the new security implementation.
Still to do:
. call the security funcs from cgi and mailgw
. change shipped templates to include correct initialisation and remove
the old config vars
... that seems like a lot. The bulk of the work has been done though. Honest :)
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Thu, 25 Jul 2002 07:14:06 +0000 |
| parents | de3da99a7c02 |
| children | 23c9d4f86380 |
comparison
equal
deleted
inserted
replaced
| 901:31a62bcb9c80 | 902:b0d3d3535998 |
|---|---|
| 14 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS | 14 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS |
| 15 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" | 15 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" |
| 16 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, | 16 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, |
| 17 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. | 17 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
| 18 # | 18 # |
| 19 # $Id: admin.py,v 1.18 2002-07-18 11:17:30 gmcm Exp $ | 19 # $Id: admin.py,v 1.19 2002-07-25 07:14:05 richard Exp $ |
| 20 | 20 |
| 21 import sys, os, getpass, getopt, re, UserDict, shlex, shutil | 21 import sys, os, getpass, getopt, re, UserDict, shlex, shutil |
| 22 try: | 22 try: |
| 23 import csv | 23 import csv |
| 24 except ImportError: | 24 except ImportError: |
| 369 designators = args[1].split(',') | 369 designators = args[1].split(',') |
| 370 l = [] | 370 l = [] |
| 371 for designator in designators: | 371 for designator in designators: |
| 372 # decode the node designator | 372 # decode the node designator |
| 373 try: | 373 try: |
| 374 classname, nodeid = roundupdb.splitDesignator(designator) | 374 classname, nodeid = hyperdb.splitDesignator(designator) |
| 375 except roundupdb.DesignatorError, message: | 375 except hyperdb.DesignatorError, message: |
| 376 raise UsageError, message | 376 raise UsageError, message |
| 377 | 377 |
| 378 # get the class | 378 # get the class |
| 379 cl = self.get_class(classname) | 379 cl = self.get_class(classname) |
| 380 try: | 380 try: |
| 409 | 409 |
| 410 # now do the set for all the nodes | 410 # now do the set for all the nodes |
| 411 for designator in designators: | 411 for designator in designators: |
| 412 # decode the node designator | 412 # decode the node designator |
| 413 try: | 413 try: |
| 414 classname, nodeid = roundupdb.splitDesignator(designator) | 414 classname, nodeid = hyperdb.splitDesignator(designator) |
| 415 except roundupdb.DesignatorError, message: | 415 except hyperdb.DesignatorError, message: |
| 416 raise UsageError, message | 416 raise UsageError, message |
| 417 | 417 |
| 418 # get the class | 418 # get the class |
| 419 cl = self.get_class(classname) | 419 cl = self.get_class(classname) |
| 420 | 420 |
| 535 if len(args) < 1: | 535 if len(args) < 1: |
| 536 raise UsageError, _('Not enough arguments supplied') | 536 raise UsageError, _('Not enough arguments supplied') |
| 537 | 537 |
| 538 # decode the node designator | 538 # decode the node designator |
| 539 try: | 539 try: |
| 540 classname, nodeid = roundupdb.splitDesignator(args[0]) | 540 classname, nodeid = hyperdb.splitDesignator(args[0]) |
| 541 except roundupdb.DesignatorError, message: | 541 except hyperdb.DesignatorError, message: |
| 542 raise UsageError, message | 542 raise UsageError, message |
| 543 | 543 |
| 544 # get the class | 544 # get the class |
| 545 cl = self.get_class(classname) | 545 cl = self.get_class(classname) |
| 546 | 546 |
| 745 Lists the journal entries for the node identified by the designator. | 745 Lists the journal entries for the node identified by the designator. |
| 746 ''' | 746 ''' |
| 747 if len(args) < 1: | 747 if len(args) < 1: |
| 748 raise UsageError, _('Not enough arguments supplied') | 748 raise UsageError, _('Not enough arguments supplied') |
| 749 try: | 749 try: |
| 750 classname, nodeid = roundupdb.splitDesignator(args[0]) | 750 classname, nodeid = hyperdb.splitDesignator(args[0]) |
| 751 except roundupdb.DesignatorError, message: | 751 except hyperdb.DesignatorError, message: |
| 752 raise UsageError, message | 752 raise UsageError, message |
| 753 | 753 |
| 754 try: | 754 try: |
| 755 print self.db.getclass(classname).history(nodeid) | 755 print self.db.getclass(classname).history(nodeid) |
| 756 except KeyError: | 756 except KeyError: |
| 795 if len(args) < 1: | 795 if len(args) < 1: |
| 796 raise UsageError, _('Not enough arguments supplied') | 796 raise UsageError, _('Not enough arguments supplied') |
| 797 designators = args[0].split(',') | 797 designators = args[0].split(',') |
| 798 for designator in designators: | 798 for designator in designators: |
| 799 try: | 799 try: |
| 800 classname, nodeid = roundupdb.splitDesignator(designator) | 800 classname, nodeid = hyperdb.splitDesignator(designator) |
| 801 except roundupdb.DesignatorError, message: | 801 except hyperdb.DesignatorError, message: |
| 802 raise UsageError, message | 802 raise UsageError, message |
| 803 try: | 803 try: |
| 804 self.db.getclass(classname).retire(nodeid) | 804 self.db.getclass(classname).retire(nodeid) |
| 805 except KeyError: | 805 except KeyError: |
| 806 raise UsageError, _('no such class "%(classname)s"')%locals() | 806 raise UsageError, _('no such class "%(classname)s"')%locals() |
| 1129 tool = AdminTool() | 1129 tool = AdminTool() |
| 1130 sys.exit(tool.main()) | 1130 sys.exit(tool.main()) |
| 1131 | 1131 |
| 1132 # | 1132 # |
| 1133 # $Log: not supported by cvs2svn $ | 1133 # $Log: not supported by cvs2svn $ |
| 1134 # Revision 1.18 2002/07/18 11:17:30 gmcm | |
| 1135 # Add Number and Boolean types to hyperdb. | |
| 1136 # Add conversion cases to web, mail & admin interfaces. | |
| 1137 # Add storage/serialization cases to back_anydbm & back_metakit. | |
| 1138 # | |
| 1134 # Revision 1.17 2002/07/14 06:05:50 richard | 1139 # Revision 1.17 2002/07/14 06:05:50 richard |
| 1135 # . fixed the date module so that Date(". - 2d") works | 1140 # . fixed the date module so that Date(". - 2d") works |
| 1136 # | 1141 # |
| 1137 # Revision 1.16 2002/07/09 04:19:09 richard | 1142 # Revision 1.16 2002/07/09 04:19:09 richard |
| 1138 # Added reindex command to roundup-admin. | 1143 # Added reindex command to roundup-admin. |
