« OpenInteract2/Manage/Website/InstallPackageData.pm
↑ Summary
OpenInteract2/Manage/Website/InstallPackageStructure.pm »
| 1 | package OpenInteract2::Manage::Website::InstallPackageSecurity; | ||
| 2 | |||
| 3 | # $Id: InstallPackageSecurity.pm,v 1.10 2005/03/17 14:58:04 sjn Exp $ | ||
| 4 | |||
| 5 | 87 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 87 | ▶ | use base qw( OpenInteract2::Manage::Website ); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | 87 | ▶ | use OpenInteract2::Context qw( CTX ); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | 0 | ▶ | use OpenInteract2::SQLInstall; |
|
Subroutine
BEGIN: called CC=1 SCAR=2.6
| |||
| 9 | |||
| 10 | $OpenInteract2::Manage::Website::InstallPackageSecurity::VERSION = sprintf("%d.%02d", q$Revision: 1.10 $ =~ /(\d+)\.(\d+)/); | ||
| 11 | |||
| 12 | sub get_name { | ||
| 13 | return 'install_sql_security'; | ||
| 14 | } | ||
| 15 | |||
| 16 | sub get_brief_description { | ||
| 17 | return 'Install the security for one or more packages to a website'; | ||
| 18 | } | ||
| 19 | |||
| 20 | sub get_parameters { | ||
| 21 | my ( $self ) = @_; | ||
| 22 | return { | ||
| 23 | website_dir => $self->_get_website_dir_param, | ||
| 24 | package => $self->_get_package_param, | ||
| 25 | }; | ||
| 26 | } | ||
| 27 | |||
| 28 | sub run_task { | ||
| 29 | my ( $self ) = @_; | ||
| 30 | my $repository = CTX->repository; | ||
| 31 | |||
| 32 | PACKAGE: | ||
| 33 | foreach my $package_name ( @{ $self->param( 'package' ) } ) { | ||
| 34 | my $action = 'install security'; | ||
| 35 | my $installer = $self->_get_package_installer( | ||
| 36 | $action, $repository, $package_name ); | ||
| 37 | next PACKAGE unless ( $installer ); | ||
| 38 | $installer->install_security; | ||
| 39 | my @install_status = $installer->get_status; | ||
| 40 | for ( @install_status ) { | ||
| 41 | $_->{action} = $action; | ||
| 42 | $_->{package} = $package_name; | ||
| 43 | } | ||
| 44 | $self->_add_status( @install_status ); | ||
| 45 | } | ||
| 46 | } | ||
| 47 | |||
| 48 | OpenInteract2::Manage->register_factory_type( get_name() => __PACKAGE__ ); | ||
| 49 | |||
| 50 | 1; | ||
| 51 | |||
| 52 | __END__ | ||