sub UserNamePresent { my ($userName); $userName = &GetParam("username",""); if( $userName eq "" ) { return 0; } return 1; }
..... And in the DoEdit subroutine, after all of the local variable decl ...
if (!&UserNamePresent()) { print &GetHeader("", T('Editing Denied'), ""); print Ts('Editing not allowed on %1 without a username. Please set your Preferences.', $SiteName); print &GetCommonFooter(); return; }
[I know, I know, I know, the fact that I've created a separate UserNamePresent subroutine could be viewed as overengineering, but I wanted to leave room for expansion in case someone wants to add more features later...]
if (!UserNamePresent() && ($id ne $SandBox)) { print &GetHeader("", T('Editing Denied'), ""); print Tss('Editing %1 on %2 not allowed without a username. Please set your preferences.', $id, $SiteName); print &GetCommonFooter(); return; }
so editting the sandbox is always allowed to guests, thus increasing the 'great, let's play' factor without sacrificing the purpose of this patch. -Jurriaan (Dec 6, 2003)