ASNMTAP
view release on metacpan or search on metacpan
applications/htmlroot/cgi-bin/admin/crontabs.pl view on Meta::CPAN
use warnings; # Must be used in test mode only. This reduces a little process speed
#use diagnostics; # Must be used in test mode only. This reduces a lot of process speed
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
BEGIN { if ( $ENV{ASNMTAP_PERL5LIB} ) { eval 'use lib ( "$ENV{ASNMTAP_PERL5LIB}" )'; } }
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
use DBI;
use CGI;
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
use ASNMTAP::Asnmtap::Applications::CGI v3.002.003;
use ASNMTAP::Asnmtap::Applications::CGI qw(:APPLICATIONS :CGI :SADMIN :DBREADWRITE :DBTABLES);
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
use vars qw($PROGNAME);
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
$PROGNAME = "crontabs.pl";
my $prgtext = "Crontabs";
my $version = do { my @r = (q$Revision: 3.002.003$ =~ /\d+/g); sprintf "%d."."%03d" x $#r, @r }; # must be all on one line or MakeMaker will get confused.
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# URL Access Parameters
my $cgi = new CGI;
my $pagedir = (defined $cgi->param('pagedir')) ? $cgi->param('pagedir') : '<NIHIL>'; $pagedir =~ s/\+/ /g;
my $pageset = (defined $cgi->param('pageset')) ? $cgi->param('pageset') : 'admin'; $pageset =~ s/\+/ /g;
my $debug = (defined $cgi->param('debug')) ? $cgi->param('debug') : 'F';
my $pageNo = (defined $cgi->param('pageNo')) ? $cgi->param('pageNo') : 1;
my $pageOffset = (defined $cgi->param('pageOffset')) ? $cgi->param('pageOffset') : 0;
my $orderBy = (defined $cgi->param('orderBy')) ? $cgi->param('orderBy') : 'lineNumber asc, uKey asc, groupName asc, title asc';
my $action = (defined $cgi->param('action')) ? $cgi->param('action') : 'listView';
my $CcatalogID = (defined $cgi->param('catalogID')) ? $cgi->param('catalogID') : $CATALOGID;
my $CcatalogIDreload = (defined $cgi->param('catalogIDreload')) ? $cgi->param('catalogIDreload') : 0;
my $ClineNumber = (defined $cgi->param('lineNumber')) ? $cgi->param('lineNumber') : '00';
my $CuKey = (defined $cgi->param('uKey')) ? $cgi->param('uKey') : 'none';
my $CcollectorDaemon = (defined $cgi->param('collectorDaemon')) ? $cgi->param('collectorDaemon') : 'none';
my $Carguments = (defined $cgi->param('arguments')) ? $cgi->param('arguments') : '';
my $Cminute = (defined $cgi->param('minute')) ? $cgi->param('minute') : '*';
my $Chour = (defined $cgi->param('hour')) ? $cgi->param('hour') : '*';
my $CdayOfTheMonth = (defined $cgi->param('dayOfTheMonth')) ? $cgi->param('dayOfTheMonth') : '*';
my $CmonthOfTheYear = (defined $cgi->param('monthOfTheYear')) ? $cgi->param('monthOfTheYear') : '*';
my $CdayOfTheWeek = (defined $cgi->param('dayOfTheWeek')) ? $cgi->param('dayOfTheWeek') : '*';
my $CnoOffline = (defined $cgi->param('noOffline')) ? $cgi->param('noOffline') : '';
my $Cactivated = (defined $cgi->param('activated')) ? $cgi->param('activated') : 'off';
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
my $htmlTitle = $APPLICATION;
# Init parameters
my ($rv, $dbh, $sth, $sql, $numberRecordsIntoQuery, $nextAction, $formDisabledAll, $formDisabledPrimaryKey, $submitButton, $uKeySelect);
# User Session and Access Control
my ($sessionID, $iconAdd, $iconDelete, $iconDetails, $iconEdit, $iconQuery, $iconTable, $errorUserAccessControl, undef, undef, undef, undef, undef, undef, undef, undef, undef, undef, undef, $subTitle) = user_session_and_access_control (1, 'admin', $c...
# Serialize the URL Access Parameters into a string
my $urlAccessParameters = "pagedir=$pagedir&pageset=$pageset&debug=$debug&CGISESSID=$sessionID&pageNo=$pageNo&pageOffset=$pageOffset&orderBy=$orderBy&action=$action&catalogID=$CcatalogID&catalogIDreload=$CcatalogIDreload&lineNumber=$ClineNumber&uKey=...
# Debug information
print "<pre>pagedir : $pagedir<br>pageset : $pageset<br>debug : $debug<br>CGISESSID : $sessionID<br>page no : $pageNo<br>page offset : $pageOffset<br>order by : $orderBy<br>action ...
if ( defined $sessionID and ! defined $errorUserAccessControl ) {
my ($catalogIDSelect, $collectorDaemonSelect, $matchingCrontabs, $navigationBar);
my $urlWithAccessParameters = $ENV{SCRIPT_NAME} . "?pagedir=$pagedir&pageset=$pageset&debug=$debug&CGISESSID=$sessionID&catalogID=$CcatalogID";
# open connection to database and query data
$rv = 1;
$dbh = DBI->connect("dbi:mysql:$DATABASE:$SERVERNAMEREADWRITE:$SERVERPORTREADWRITE", "$SERVERUSERREADWRITE", "$SERVERPASSREADWRITE" ) or $rv = error_trap_DBI(*STDOUT, "Cannot connect to the database", $debug, $pagedir, $pageset, $htmlTitle, $subTit...
if ($dbh and $rv) {
$formDisabledAll = $formDisabledPrimaryKey = '';
if ($action eq 'duplicateView' or $action eq 'insertView') {
$htmlTitle = "Insert Crontab";
$submitButton = "Insert";
$nextAction = "insert" if ($rv);
$CcatalogID = $CATALOGID if ($action eq 'insertView');
} elsif ($action eq 'insert') {
$htmlTitle = "Check if Crontab $ClineNumber, $CuKey from $CcatalogID exist before to insert";
$sql = "select collectorDaemon from $SERVERTABLCRONTABS WHERE catalogID = '$CcatalogID' and lineNumber='$ClineNumber' and uKey='$CuKey'";
($rv, $numberRecordsIntoQuery) = do_action_DBI ($rv, $dbh, $sql, $pagedir, $pageset, $htmlTitle, $subTitle, $sessionID, $debug);
if ( $numberRecordsIntoQuery ) {
$htmlTitle = "Crontab $ClineNumber, $CuKey from $CcatalogID exist already";
$nextAction = "insertView";
} else {
$htmlTitle = "Crontab $ClineNumber, $CuKey from $CcatalogID inserted";
my $dummyActivated = ($Cactivated eq 'on') ? 1 : 0;
$sql = 'INSERT INTO ' .$SERVERTABLCRONTABS. ' SET catalogID="' .$CcatalogID. '", lineNumber="' .$ClineNumber. '", uKey="' .$CuKey. '", collectorDaemon="' .$CcollectorDaemon. '", arguments="' .$Carguments. '", minute="' .$Cminute. '", hour="' ...
$dbh->do ( $sql ) or $rv = error_trap_DBI(*STDOUT, "Cannot dbh->do: $sql", $debug, $pagedir, $pageset, $htmlTitle, $subTitle, 3600, '', $sessionID);
$nextAction = "listView" if ($rv);
}
} elsif ($action eq 'crontabView') {
$htmlTitle = "Selected crontabs to be listed";
$submitButton = "Crontabs";
$nextAction = "crontab" if ($rv);
} elsif ($action eq 'deleteView') {
$formDisabledPrimaryKey = $formDisabledAll = 'disabled';
$htmlTitle = "Delete crontab $ClineNumber, $CuKey from $CcatalogID";
$submitButton = "Delete";
$nextAction = "delete" if ($rv);
} elsif ($action eq 'delete') {
$htmlTitle = "Crontab $ClineNumber, $CuKey from $CcatalogID deleted";
$sql = 'DELETE FROM ' .$SERVERTABLCRONTABS. ' WHERE catalogID="' .$CcatalogID. '" and lineNumber="' .$ClineNumber. '" and uKey="' .$CuKey. '"';
$dbh->do ( $sql ) or $rv = error_trap_DBI(*STDOUT, "Cannot dbh->do: $sql", $debug, $pagedir, $pageset, $htmlTitle, $subTitle, 3600, '', $sessionID);
$nextAction = "listView" if ($rv);
} elsif ($action eq 'displayView') {
$formDisabledPrimaryKey = $formDisabledAll = 'disabled';
$htmlTitle = "Display crontab $ClineNumber, $CuKey from $CcatalogID";
$nextAction = "listView" if ($rv);
} elsif ($action eq 'editView') {
$formDisabledPrimaryKey = 'disabled';
$htmlTitle = "Edit crontab $ClineNumber, $CuKey from $CcatalogID";
$submitButton = "Edit";
$nextAction = "edit" if ($rv);
} elsif ($action eq 'edit') {
$htmlTitle = "Crontab $ClineNumber, $CuKey from $CcatalogID updated";
my $dummyActivated = ($Cactivated eq 'on') ? 1 : 0;
$sql = 'UPDATE ' .$SERVERTABLCRONTABS. ' SET catalogID="' .$CcatalogID. '", lineNumber="' .$ClineNumber. '", uKey="' .$CuKey. '", collectorDaemon="' .$CcollectorDaemon. '", arguments="' .$Carguments. '", minute="' .$Cminute. '", hour="' .$Chour...
$dbh->do ( $sql ) or $rv = error_trap_DBI(*STDOUT, "Cannot dbh->do: $sql", $debug, $pagedir, $pageset, $htmlTitle, $subTitle, 3600, '', $sessionID);
$nextAction = "listView" if ($rv);
} elsif ($action eq 'listView' or $action eq 'crontab') {
my ($sqlWhereCount, $sqlWhereList, $urlWithAccessParametersQuery);
$sqlWhereCount = $sqlWhereList = $urlWithAccessParametersQuery = '';
if ( $CcatalogIDreload ) {
$pageNo = 1;
$pageOffset = 0;
}
if ($action eq 'crontab') {
$htmlTitle = "All selected crontabs listed";
$nextAction = "crontab";
$sqlWhereCount = "where $SERVERTABLCRONTABS.activated=";
$sqlWhereCount .= ($Cactivated eq 'on') ? '1' : '0';
$sqlWhereCount .= " and $SERVERTABLCRONTABS.catalogID='$CcatalogID'";
$sqlWhereCount .= " and $SERVERTABLCRONTABS.uKey='$CuKey'" if ($CuKey ne 'none');
$sqlWhereCount .= " and $SERVERTABLCRONTABS.collectorDaemon='$CcollectorDaemon'" if ($CcollectorDaemon ne 'none');
$sqlWhereList = "$SERVERTABLCRONTABS.activated=";
$sqlWhereList .= ($Cactivated eq 'on') ? '1' : '0';
$sqlWhereList .= " and $SERVERTABLCRONTABS.catalogID='$CcatalogID'";
$sqlWhereList .= " and $SERVERTABLCRONTABS.uKey='$CuKey'" if ($CuKey ne 'none');
$sqlWhereList .= " and $SERVERTABLCRONTABS.collectorDaemon='$CcollectorDaemon'" if ($CcollectorDaemon ne 'none');
$sqlWhereList .= " and";
$urlWithAccessParametersQuery = "&activated=$Cactivated&catalogID=$CcatalogID&uKey=$CuKey&collectorDaemon=$CcollectorDaemon";
} else {
$htmlTitle = "All crontabs listed";
$nextAction = "listView";
$sqlWhereCount = "where $SERVERTABLCRONTABS.catalogID='$CcatalogID'";
$sqlWhereList = " $SERVERTABLCRONTABS.catalogID='$CcatalogID' and";
$urlWithAccessParametersQuery = "&catalogID=$CcatalogID";
}
$sql = "select catalogID, catalogName from $SERVERTABLCATALOG where not catalogID = '$CATALOGID' and activated = '1' order by catalogName asc";
($rv, $catalogIDSelect, undef) = create_combobox_from_DBI ($rv, $dbh, $sql, 1, '', $CcatalogID, 'catalogID', $CATALOGID, '-Parent-', '', 'onChange="javascript:submitForm();"', $pagedir, $pageset, $htmlTitle, $subTitle, $sessionID, $debug);
$sql = "select SQL_NO_CACHE count(lineNumber) from $SERVERTABLCRONTABS $sqlWhereCount";
($rv, $numberRecordsIntoQuery) = do_action_DBI ($rv, $dbh, $sql, $pagedir, $pageset, $htmlTitle, $subTitle, $sessionID, $debug);
$navigationBar = record_navigation_bar ($pageNo, $numberRecordsIntoQuery, $RECORDSONPAGE, $ENV{SCRIPT_NAME} . "?pagedir=$pagedir&pageset=$pageset&debug=$debug&CGISESSID=$sessionID&action=$nextAction&orderBy=$orderBy$urlWithAcces...
$navigationBar .= record_navigation_bar_alpha ($rv, $dbh, $SERVERTABLCRONTABS, 'uKey', "catalogID = '$CcatalogID'", $numberRecordsIntoQuery, $RECORDSONPAGE, $ENV{SCRIPT_NAME} . "?pagedir=$pagedir&pageset=$pageset&debug=$debug&CGISES...
my ($catalogID, $lineNumber, $uKey, $groupName, $minute, $hour, $dayOfTheMonth, $monthOfTheYear, $dayOfTheWeek, $noOffline, $activated, $title);
$sql = "select $SERVERTABLCRONTABS.catalogID, $SERVERTABLCRONTABS.lineNumber, $SERVERTABLCRONTABS.uKey, $SERVERTABLCLLCTRDMNS.groupName, $SERVERTABLCRONTABS.minute, $SERVERTABLCRONTABS.hour, $SERVERTABLCRONTABS.dayOfTheMonth, $SERVERTABLCRONTAB...
$sth = $dbh->prepare( $sql ) or $rv = error_trap_DBI(*STDOUT, "Cannot dbh->prepare: $sql", $debug, $pagedir, $pageset, $htmlTitle, $subTitle, 3600, '', $sessionID);
$sth->execute() or $rv = error_trap_DBI(*STDOUT, "Cannot sth->execute: $sql", $debug, $pagedir, $pageset, $htmlTitle, $subTitle, 3600, '', $sessionID) if $rv;
$sth->bind_columns( \$catalogID, \$lineNumber, \$uKey, \$groupName, \$minute, \$hour, \$dayOfTheMonth, \$monthOfTheYear, \$dayOfTheWeek, \$noOffline, \$activated, \$title ) or $rv = error_trap_DBI(*STDOUT, "Cannot sth->bind_columns: $sql", $deb...
if ( $rv ) {
my $actionPressend = ($iconAdd or $iconDelete or $iconDetails or $iconEdit) ? 1 : 0;
my $actionHeader = ($actionPressend) ? "<th>Action</th>" : '';
$urlWithAccessParameters = $ENV{SCRIPT_NAME} . "?pagedir=$pagedir&pageset=$pageset&debug=$debug&CGISESSID=$sessionID&pageNo=1&pageOffset=0&action=$nextAction$urlWithAccessParametersQuery";
$matchingCrontabs = "\n <table align=\"center\" border=0 cellpadding=1 cellspacing=1 bgcolor='$COLORSTABLE{TABLE}'>\n <tr><th><a href=\"$urlWithAccessParameters&action=listView&orderBy=catalogID desc, lineNumber asc, uKey ...
$matchingCrontabs .= "<th><a href=\"$urlWithAccessParameters&action=listView&orderBy=title desc, groupName asc\"><IMG SRC=\"$IMAGESURL/$ICONSRECORD{up}\" ALT=\"Up\" BORDER=0></a> Title <a href=\"$urlWithAccessParameters&action=lis...
$urlWithAccessParameters = $ENV{SCRIPT_NAME} . "?pagedir=$pagedir&pageset=$pageset&debug=$debug&CGISESSID=$sessionID&pageNo=$pageNo&pageOffset=$pageOffset";
if ( $sth->rows ) {
while( $sth->fetch() ) {
my $actionSkip = ( ( $catalogID eq $CATALOGID ) ? 0 : 1 );
my $actionItem = ($actionPressend) ? "<td align=\"left\"> " : '';
my $urlWithAccessParametersAction = "$urlWithAccessParameters&catalogID=$CcatalogID&lineNumber=$lineNumber&uKey=$uKey&orderBy=$orderBy&action";
$actionItem .= "<a href=\"$urlWithAccessParametersAction=displayView\"><img src=\"$IMAGESURL/$ICONSRECORD{details}\" title=\"Display Crontabs\" alt=\"Display Crontabs\" border=\"0\"></a> " if ($iconDetails);
$actionItem .= "<a href=\"$urlWithAccessParametersAction=duplicateView\"><img src=\"$IMAGESURL/$ICONSRECORD{duplicate}\" title=\"Duplicate Crontabs\" alt=\"Duplicate Crontabs\" border=\"0\"></a> " if ($iconAdd);
unless ( $actionSkip ) {
$actionItem .= "<a href=\"$urlWithAccessParametersAction=editView\"><img src=\"$IMAGESURL/$ICONSRECORD{edit}\" title=\"Edit Crontabs\" alt=\"Edit Crontabs\" border=\"0\"></a> " if ($iconEdit);
$actionItem .= "<a href=\"$urlWithAccessParametersAction=deleteView\"><img src=\"$IMAGESURL/$ICONSRECORD{delete}\" title=\"Delete Crontabs\" alt=\"Delete Crontabs\" border=\"0\"></a> " if ($iconDelete);
}
$actionItem .= "</td>" if ($actionPressend);
$matchingCrontabs .= " <tr bgcolor=\"$COLORSTABLE{STARTBLOCK}\"><td>$catalogID-$lineNumber-$uKey</td><td>$groupName</td><td>$title</td><td>$minute $hour $dayOfTheMonth $monthOfTheYear $dayOfTheWeek</td><td>$noOffline</td><td>$activ...
}
$urlWithAccessParameters = $ENV{SCRIPT_NAME} . "?pagedir=$pagedir&pageset=$pageset&debug=$debug&CGISESSID=$sessionID&pageNo=1&pageOffset=0&catalogID=$CcatalogID";
} else {
$matchingCrontabs .= " <tr><td colspan=\"7\">No records found for any crontab</td></tr>\n";
}
$matchingCrontabs .= " <tr><td colspan=\"7\">$navigationBar</td></tr>\n" if ($navigationBar);
$matchingCrontabs .= " </table>\n";
$sth->finish() or $rv = error_trap_DBI(*STDOUT, "Cannot sth->finish: $sql", $debug, $pagedir, $pageset, $htmlTitle, $subTitle, 3600, '', $sessionID);
}
}
if ($action eq 'deleteView' or $action eq 'displayView' or $action eq 'duplicateView' or $action eq 'editView') {
$sql = "select catalogID, lineNumber, uKey, collectorDaemon, arguments, minute, hour, dayOfTheMonth, monthOfTheYear, dayOfTheWeek, noOffline, activated from $SERVERTABLCRONTABS where catalogID='$CcatalogID' and lineNumber='$ClineNumber' and uKe...
$sth = $dbh->prepare( $sql ) or $rv = error_trap_DBI(*STDOUT, "Cannot dbh->prepare: $sql", $debug, $pagedir, $pageset, $htmlTitle, $subTitle, 3600, '', $sessionID);
$sth->execute() or $rv = error_trap_DBI(*STDOUT, "Cannot sth->execute: $sql", $debug, $pagedir, $pageset, $htmlTitle, $subTitle, 3600, '', $sessionID) if $rv;
if ( $rv ) {
($CcatalogID, $ClineNumber, $CuKey, $CcollectorDaemon, $Carguments, $Cminute, $Chour, $CdayOfTheMonth, $CmonthOfTheYear, $CdayOfTheWeek, $CnoOffline, $Cactivated) = $sth->fetchrow_array() or $rv = error_trap_DBI(*STDOUT, "Cannot $sth->fetchro...
$CcatalogID = $CATALOGID if ($action eq 'duplicateView');
$Cactivated = ($Cactivated == 1) ? 'on' : 'off';
$sth->finish() or $rv = error_trap_DBI(*STDOUT, "Cannot sth->finish: $sql", $debug, $pagedir, $pageset, $htmlTitle, $subTitle, 3600, '', $sessionID);
}
}
if ($action eq 'insertView' or $action eq 'deleteView' or $action eq 'displayView' or $action eq 'duplicateView' or $action eq 'editView' or $action eq 'crontabView') {
if ($CuKey eq 'none' or $action eq 'duplicateView') {
$sql = "select uKey, concat( title, ' (', $SERVERTABLENVIRONMENT.label, ')' ) as optionValueTitle from $SERVERTABLPLUGINS, $SERVERTABLENVIRONMENT where catalogID = '$CcatalogID' and $SERVERTABLPLUGINS.environment = $SERVERTABLENVIRONMENT.envi...
} else {
$sql = "select uKey, concat( title, ' (', $SERVERTABLENVIRONMENT.label, ')' ) from $SERVERTABLPLUGINS, $SERVERTABLENVIRONMENT where uKey = '$CuKey' and catalogID = '$CcatalogID' and $SERVERTABLPLUGINS.environment = $SERVERTABLENVIRONMENT.envi...
}
($rv, $uKeySelect, $htmlTitle) = create_combobox_from_DBI ($rv, $dbh, $sql, 1, $nextAction, $CuKey, 'uKey', 'none', '-Select-', $formDisabledPrimaryKey, '', $pagedir, $pageset, $htmlTitle, $subTitle, $sessionID, $debug);
$sql = "select collectorDaemon, groupName from $SERVERTABLCLLCTRDMNS where catalogID = '$CcatalogID' order by groupName";
($rv, $collectorDaemonSelect, undef) = create_combobox_from_DBI ($rv, $dbh, $sql, 1, '', $CcollectorDaemon, 'collectorDaemon', 'none', '-Select-', $formDisabledAll, '', $pagedir, $pageset, $htmlTitle, $subTitle, $sessionID, $debug);
}
$dbh->disconnect or $rv = error_trap_DBI(*STDOUT, "Sorry, the database was unable to add your entry.", $debug, $pagedir, $pageset, $htmlTitle, $subTitle, 3600, '', $sessionID);
}
if ( $rv ) {
# HTML - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
if ($action eq 'duplicateView' or $action eq 'editView' or $action eq 'insertView' or $action eq 'crontabView') {
print_header (*STDOUT, $pagedir, $pageset, $htmlTitle, $subTitle, 3600, '', 'F', '', $sessionID);
my $crontabFormatDigits = '(?:[0-9]{1,2})';
my $crontabValueDigitsMin = '(?:[0-9]|[1-5][0-9])';
my $crontabValueDigitsHour = '(?:[0-9]|1[0-9]|2[0-3])';
my $crontabValueDigitsDayOfMonth = '(?:[1-9]|[1-2][0-9]|3[0-1])';
my $crontabValueDigitsMonthOfYear = '(?:[1-9]|1[0-2])';
my $crontabValueDigitsDayOfWeek = '(?:[0-6])';
print <<HTML;
<script language="JavaScript1.2" type="text/javascript">
function validateForm() {
var objectRegularExpressionLineNumberFormat = /\^\\d\\d\$/;
// example: 1,2,5-9,12-16/n,19|*|*/n
var objectRegularExpressionCrontabFormat = /\^(?:(?:\\*\\/$crontabFormatDigits){1,1}|$crontabFormatDigits(?:[,-]$crontabFormatDigits(?:\\/$crontabFormatDigits)?)\*){1,1}\$/;
// min (0-59)
var objectRegularExpressionMinuteValue = /\^(?:(?:\\*\\/$crontabValueDigitsMin){1,1}|$crontabValueDigitsMin(?:[,-]$crontabValueDigitsMin(?:\\/$crontabValueDigitsMin)?)\*){1,1}\$/;
// hour (0-23)
var objectRegularExpressionHourValue = /\^(?:(?:\\*\\/$crontabValueDigitsHour){1,1}|$crontabValueDigitsHour(?:[,-]$crontabValueDigitsHour(?:\\/$crontabValueDigitsHour)?)\*){1,1}\$/;
// day of month (1-31)
var objectRegularExpressionDayOfTheMontValue = /\^(?:(?:\\*\\/$crontabFormatDigits){1,1}|$crontabFormatDigits(?:[,-]$crontabFormatDigits(?:\\/$crontabFormatDigits)?)\*){1,1}\$/;
// month of year (1-12)
var objectRegularExpressionMontOfTheYearValue = /\^(?:(?:\\*\\/$crontabValueDigitsMonthOfYear){1,1}|$crontabValueDigitsMonthOfYear(?:[,-]$crontabValueDigitsMonthOfYear(?:\\/$crontabValueDigitsMonthOfYear)?)\*){1,1}\$/;
// day of week (0-6)
var objectRegularExpressionDayOfTheWeekValue = /\^(?:(?:\\*\\/$crontabValueDigitsDayOfWeek){1,1}|$crontabValueDigitsDayOfWeek(?:[,-]$crontabValueDigitsDayOfWeek(?:\\/$crontabValueDigitsDayOfWeek)?)\*){1,1}\$/;
HTML
if ( $action ne 'crontabView' ) {
print <<HTML;
if ( document.crontabs.collectorDaemon.options[document.crontabs.collectorDaemon.selectedIndex].value == 'none' ) {
document.crontabs.collectorDaemon.focus();
alert('Please create/select a crontab collectorDaemon!');
return false;
}
HTML
}
if ($action eq 'duplicateView' or $action eq 'insertView') {
print <<HTML;
if ( document.crontabs.lineNumber.value == null || document.crontabs.lineNumber.value == '' ) {
document.crontabs.lineNumber.focus();
alert('Please enter a line number!');
return false;
} else {
if ( ! objectRegularExpressionLineNumberFormat.test(document.crontabs.lineNumber.value) ) {
document.crontabs.lineNumber.focus();
( run in 0.848 second using v1.01-cache-2.11-cpan-39bf76dae61 )