### ### Copyright 2000-2007 University of Illinois Board of Trustees ### All rights reserved. ### ### PSGConf::Action::GenerateFile::ftpaccess - action to generate ftpaccess ### ### Campus Information Technologies and Educational Services ### University of Illinois at Urbana-Champaign ### package PSGConf::Action::GenerateFile::ftpaccess; use strict; use PSGConf::Action::GenerateFile; our @ISA = qw(PSGConf::Action::GenerateFile); ############################################################################### ### generate method ############################################################################### sub generate { my ($self, $fh, $psgconf) = @_; ### print classes map { print $fh "class\t$_\n"; } @{$self->{classes}}; ### print autogroups map { print $fh "autogroup\t$_\t$self->{autogroups}->{$_}\n"; } sort keys %{$self->{autogroups}}; ### print limits map { print $fh "limit\t$_\n"; } @{$self->{limits}}; ### print options map { print $fh "$_\t$self->{options}->{$_}\n"; } sort keys %{$self->{options}}; ### print messages map { print $fh "message\t$self->{messages}->{$_}\t$_\n"; } sort keys %{$self->{messages}}; ### print readme map { print $fh "readme\t$self->{readmes}->{$_}\t$_\n"; } sort keys %{$self->{readmes}}; ### print uploads map { print $fh "upload\t$_\t$self->{uploads}->{$_}\n"; } sort keys %{$self->{uploads}}; ### print literal config text print $fh "\n$self->{literal}\n" if (defined($self->{literal})); return 1; } ############################################################################### ### documentation ############################################################################### 1; __END__ =head1 NAME PSGConf::Action::GenerateFile::ftpaccess - generate ftpaccess file =head1 SYNOPSIS use PSGConf::Action::GenerateFile::ftpaccess; $psgconf->register_actions( PSGConf::Action::GenerateFile::ftpaccess->new( 'name' => '/etc/ftpaccess', 'classes' => [ ... ], 'limits' => [ ... ], 'autogroup' => { ... }, 'options' => { ... }, 'messages' => { ... }, 'readmes' => { ... }, 'uploads' => { ... }, 'literal_config' => '...', ... ), ... ); =head1 DESCRIPTION The B module provides a B action class for generating the B F file. The B class is derived from the B class, but it defines/overrides the following methods: =over 4 =item generate() Generates the F file. =back In addition to the attributes supported by the B class, the B class supports the following attributes: =over 4 =item I A list of class definitions. =item I A hash mapping group names to class definitions. =item I A list of limit definitions. =item I A hash mapping options to their values. =item I A hash mapping a directory to a given message file. =item I A hash mapping a directory to a given README file. =item I A hash mapping a directory to an upload statement. =item I Literal text to be appended to the file. =back =head1 BUGS The attributes are not well organized or laid out. They expose too much of the file format to the caller. The I attribute is an ugly hack. =head1 SEE ALSO L L L =cut