[PyCS-devel] New feature in CVS: database based aliases and rewrite rules
Status: Alpha
Brought to you by:
myelin
|
From: Georg B. <gb...@mu...> - 2002-12-09 11:56:35
|
Hi! I just checked in the ability to add aliases to user records in the database and to automatically generate corresponding rewrite rules. Added are some commands to pycsadm as follows: pycsadm.py alias simple 0000004 xgwskba - this sets a new alias in the http://muensterland.org/xgwskba format pycsadm.py alias manila 0000004 xgwskba - this sets a new alias in the http://xgwskba.muensterland.org format The corresponding rewrite rules (both the redirect when entering the old usernumber format and the rewrite from the alias to the usernumber format) are generated automatically. What is not generated is the manila style rewrite, as that is only one rule in the rewrite.conf (the other two rules are generated for every alias). pycsadm.py alias del 0000004 - this deletes the alias and the corresponding rewrite rules pycsadm.py list aliases - this lists all in-database aliases (not aliases from the pycs.conf!) pycsadm.py list rewrites - this lists all defined rewrite rules (only the descriptional string, both in-database and pycs.conf!) Both pycs.conf/rewrite.conf and in-database aliases continue to work together - actually my muensterland.org currently has two .conf-aliases and one in-database alias. So if you don't use the feature, as always, nothing changes for you (hopefully). This is in preparation for web-based configuration interfaces and maybe someday user-defined aliasing. Most of the actual code is in pycs_settings.py. pycsAdmin.py and pycs.py just use the code that's in pycs_settings.py. A little change was needed for pycs_rewrite_handler.py to enable reloading the rewrite rules after changing something in the database without the need to reload the whole config. bye, Georg |