Programmatic rename is at the wrong level of abstraction
Motivation
We need to be able to rename a user's account silently, for example during register.
Current Implementation
I took a look at Manage.pm which implements the
RenameCgiScript functionality.
One thing I noticed is that rename's level of abstraction is wrong:
RenameCgiScript says:
TWiki::UI::Manage::rename( $web, $topic, $userName, $query );
Then Manage::rename combines the extraction of the parameters with the implementation of the routine. This is not okay, because what if the parameters are not formed by an end user query but rather from a programmatic invocation? Surely I in register am not supposed to create a mock
CGI query when I am not coming in from
CGI?
Proposal
I submit that something
RenameCgiScript ought to have extract all parameters, and something else should actually do the rename. Given we have UI in TWiki::UI::Manage it is okay for manage to know about
CGI but in that case it should not have the actual rename functionality in it: this should be in a deeper layer such as TWiki::SubSystem::Topic::rename({named params=>values});
However, if I implement this I will not have time to finish
RegisterCgiScriptRewrite ...
--
MartinCleaver - 08 Oct 2004