From: <de...@de...> - 2012-02-15 05:02:13
|
Author: PeterThoeny Date: 2012-02-14 23:02:06 -0600 (Tue, 14 Feb 2012) New Revision: 22618 Trac url: http://develop.twiki.org/trac/changeset/22618 Modified: twiki/trunk/core/lib/TWiki/UI/Manage.pm Log: Item6846: Disable rename/deletion of system webs (TWiki and Main) Modified: twiki/trunk/core/lib/TWiki/UI/Manage.pm =================================================================== --- twiki/trunk/core/lib/TWiki/UI/Manage.pm 2012-02-15 02:47:09 UTC (rev 22617) +++ twiki/trunk/core/lib/TWiki/UI/Manage.pm 2012-02-15 05:02:06 UTC (rev 22618) @@ -548,6 +548,13 @@ my $query = $session->{request}; my $cUID = $session->{user}; + if ( $oldWeb eq $TWiki::cfg{SystemWebName} || $oldWeb eq $TWiki::cfg{UsersWebName} ) { + # can't rename the TWiki or Main web + throw TWiki::OopsException + ( 'attention', def => 'system_web_name', + params => [ $oldWeb ] ); + } + # If the user is not allowed to rename anything in the current web - stop here TWiki::UI::checkAccess( $session, $oldWeb, undef, 'RENAME', $session->{user} ); |