Ready for 7.10.29 development.
This commit is contained in:
commit
c806f99b7b
4236 changed files with 1217679 additions and 0 deletions
48
lib/WebGUI/Macro/Execute.pm
Normal file
48
lib/WebGUI/Macro/Execute.pm
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
package WebGUI::Macro::Execute;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
# WebGUI is Copyright 2001-2009 Plain Black Corporation.
|
||||
#-------------------------------------------------------------------
|
||||
# Please read the legal notices (docs/legal.txt) and the license
|
||||
# (docs/license.txt) that came with this distribution before using
|
||||
# this software.
|
||||
#-------------------------------------------------------------------
|
||||
# http://www.plainblack.com info@plainblack.com
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
use strict;
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Package WebGUI::Macro::Execute
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
Allows a content manager or administrator to execute an external program.
|
||||
|
||||
=head2 process ( system_call )
|
||||
|
||||
=head3 system_call
|
||||
|
||||
The system call to execute. STDOUT from the call will be captured and
|
||||
returned. Calls containing the words passwd, shadow or .conf will
|
||||
be blocked and an error message returned instead.
|
||||
|
||||
=cut
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my $session = shift;
|
||||
my @param = @_;
|
||||
if ($param[0] =~ /passwd/ || $param[0] =~ /shadow/ || $param[0] =~ /\.conf/) {
|
||||
my $i18n = WebGUI::International->new($session, 'Macro_Execute');
|
||||
return $i18n->get('execute error');
|
||||
} else {
|
||||
return `$param[0]`;
|
||||
}
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue