5 =head1 NAME $RCSfile: processfilesystem.cgi,v $
15 Andrew DeFaria <Andrew@ClearSCM.com>
23 Mon Oct 25 11:10:47 PDT 2008
27 $Date: 2011/02/14 14:52:40 $
33 Usage processfileystem.cgi: [-u|sage] [-ve|rbose] [-d|ebug]
35 system=<system> filesystem=<filesystem>
38 -u|sage: Displays usage
40 -d|ebug: Output debug messages
42 action: "edit" or "delete" to edit or delete the filesystem
44 filesystem: Filesystem to delete
48 This script edits or deletes a filessystem from Clearadm
57 use CGI qw (:standard :cgi-lib *table start_Tr end_Tr);
58 use CGI::Carp 'fatalsToBrowser';
60 use lib "$FindBin::Bin/lib", "$FindBin::Bin/../lib";
67 my $VERSION = '$Revision: 1.4 $';
68 ($VERSION) = ($VERSION =~ /\$Revision: (.*) /);
74 usage => sub { Usage },
75 verbose => sub { set_verbose },
76 debug => sub { set_debug },
77 ) or Usage 'Invalid parameter';
80 verbose "$FindBin::Script v$VERSION";
82 $clearadm = Clearadm->new;
86 my $title = 'Process Filesystem: '
87 . ucfirst $opts{system}
88 . ":$opts{filesystem}";
92 unless ($opts{'delete.x'} or $opts{'edit.x'} or $opts{action}) {
93 displayError 'Action not defined!';
98 unless ($opts{system}) {
99 displayError 'System not defined!';
104 unless ($opts{filesystem}) {
105 displayError 'System not defined!';
112 if ($opts{'delete.x'}) {
113 ($err, $msg) = $clearadm->DeleteFilesystem ($opts{system}, $opts{filesystem});
115 if ($msg !~ /Records deleted/) {
116 displayError "Unable to delete $opts{system}:$opts{filesystem}\n$msg";
120 }, 'Filesystem ' . ucfirst $opts{system} . ":$opts{filesystem} deleted";
122 } elsif ($opts{'edit.x'}) {
125 }, 'Edit Filesystem: ', ucfirst $opts{system} . ":$opts{filesystem}";
127 editFilesystem ($opts{system}, $opts{filesystem});
128 } elsif ($opts{action} eq 'Post') {
129 delete $opts{action};
130 delete $opts{'edit.x'}
132 delete $opts{'edit.y'}
135 ($err, $msg) = $clearadm->UpdateFilesystem (
142 displayError "$msg (Status: $err)";
144 display h1 {class => 'center'}, ucfirst $opts{system} . ":$opts{filesystem} updated";
146 displayFilesystem ($opts{system});
149 displayError "Unknown action - $opts{action}";
156 =head1 CONFIGURATION AND ENVIRONMENT
158 DEBUG: If set then $debug is set to this level.
160 VERBOSE: If set then $verbose is set to this level.
162 TRACE: If set then $trace is set to this level.
170 L<CGI::Carp|CGI::Carp>
174 L<Getopt::Long|Getopt::Long>
176 =head2 ClearSCM Perl Modules
190 <a href="http://clearscm.com/php/scm_man.php?file=clearadm/lib/Clearadm.pm">Clearadm</a><br>
191 <a href="http://clearscm.com/php/scm_man.php?file=clearadm/lib/ClearadmWeb.pm">ClearadmWeb</a><br>
192 <a href="http://clearscm.com/php/scm_man.php?file=lib/Display.pm">Display</a><br>
193 <a href="http://clearscm.com/php/scm_man.php?file=lib/Utils.pm">Utils</a><br>
198 =head1 BUGS AND LIMITATIONS
200 There are no known bugs in this script
202 Please report problems to Andrew DeFaria <Andrew@ClearSCM.com>.
204 =head1 LICENSE AND COPYRIGHT
206 Copyright (c) 2010, ClearSCM, Inc. All rights reserved.