#!/usr/bin/perl -wT # # TWiki Collaboration Platform, http://TWiki.org/ # # Copyright (C) 2002-2004 Peter Thoeny, peter@thoeny.com # # For licensing info read license.txt file in the TWiki root. # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details, published at # http://www.gnu.org/copyleft/gpl.html # # The manage script is used to manage some actions like creating # a new web. # #usage example: # # #C h a n g e # # #
# BEGIN { # Set default current working directory if( $ENV{"SCRIPT_FILENAME"} && $ENV{"SCRIPT_FILENAME"} =~ /^(.+)\/[^\/]+$/ ) { chdir $1; } # Set library paths in @INC at compile time unshift @INC, '.'; require 'setlib.cfg'; } use CGI::Carp qw( fatalsToBrowser ); use CGI; use TWiki::UI::Manage; my $query = new CGI; my $action = $query->param( 'action' ) || ""; my $thePathInfo = $query->path_info(); my $theUrl = $query->url; my $theRemoteUser = $query->remote_user(); my $theTopic = $query->param( 'topic' ); # initialization has to be done differently for each because it is passed # different parameters, oddly. if( $action eq "createweb" ) { my( $topic, $webName, $dummy, $userName ) = TWiki::initialize( $thePathInfo, $theRemoteUser, $theTopic, $theUrl, $query ); TWiki::UI::Manage::createWeb( $webName, $topic, $userName, $query ); } elsif( $action eq "changePassword" ) { my $wikiName = $query->param( 'username' ); my $topicName = $query->param( 'TopicName' ); my ( $topic, $webName ) = TWiki::initialize( $thePathInfo, $wikiName, $topicName, $theUrl, $query ); TWiki::UI::Manage::changePassword( $webName, $topic, $query ); } elsif( $action eq "deleteUserAccount" ) { my $wikiName = $query->param( 'username' ); my $topicName = $query->param( 'TopicName' ); my ( $topic, $webName ) = TWiki::initialize( $thePathInfo, $wikiName, $topicName, $theUrl, $query ); TWiki::UI::Manage::removeUser($webName, $topic, $wikiName, $query); } elsif( $action eq "relockrcs" ) { TWiki::UI::Manage::relockRcsFiles(); } elsif( $action ) { my( $topic, $webName, $dummy, $userName ) = TWiki::initialize( $thePathInfo, $theRemoteUser, $theTopic, $theUrl, $query ); TWiki::UI::oops( "", "", "manage", TWiki::UI::Manage::_template("msg_unrecognized_action"), $action ); } else { my( $topic, $webName, $dummy, $userName ) = TWiki::initialize( $thePathInfo, $theRemoteUser, $theTopic, $theUrl, $query ); TWiki::UI::oops( "", "", "manage", TWiki::UI::Manage::_template("msg_missing_action") ); }