/usr/share/perl5/CipUX/CAT/Web/Module/PerlVersion.pm is in libcipux-cat-web-perl 3.4.0.3-4.2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 | package CipUX::CAT::Web::Module::PerlVersion;
use warnings;
use strict;
use English qw( -no_match_vars);
use Log::Log4perl qw(get_logger :levels);
use base qw(CipUX::CAT::Web::Module CipUX::CAT::Web::L10N);
{
use version; our $VERSION = qv('3.4.0.3');
use re 'taint'; # Keep data captured by parentheses tainted
delete @ENV{qw(PATH IFS CDPATH ENV BASH_ENV)}; # Make %ENV safer
Readonly::Scalar my $NAME => 'perlversion';
Readonly::Scalar my $MODULE => 'perlversion.cgi';
sub register {
my $self = shift;
$self->set_module_name_register(
{ class => __PACKAGE__, name => $MODULE } );
# Merge and set the configuration
my $cfg_ar = $self->module_cfg;
$self->set_module_cfg_register(
{ cfg_ar => $cfg_ar, name => $MODULE } );
return 1;
}
sub module_cfg : CUMULATIVE(BASE FIRST) {
my $self = shift;
my $sdesc = 'Versions of CipUX Perl modules';
my $ldesc = 'List all versions of CipUX Perl ';
$ldesc .= 'modules installed on this server.';
my $module_hr = {};
$module_hr->{cipuxName} = $NAME;
$module_hr->{cipuxTemplateDir} = $NAME;
$module_hr->{cipuxIcon} = $NAME . '.png';
$module_hr->{cipuxShortDescription} = $sdesc;
$module_hr->{cipuxDescription} = $ldesc;
$module_hr->{cipuxTask} = ['NULL'];
return [$module_hr];
}
sub module {
my ( $self, $arg_r ) = @_;
my $rpc
= ( exists $arg_r->{rpc_obj} )
? $arg_r->{rpc_obj}
: $self->perr('rpc_obj');
my $lh
= ( exists $arg_r->{lh_obj} )
? $arg_r->{lh_obj}
: $self->perr('lh_obj');
my $c_hr
= ( exists $arg_r->{c_hr} )
? $arg_r->{c_hr}
: $self->perr('c_hr');
my $l = get_logger(__PACKAGE__);
$l->debug("module [$MODULE]");
my $path = "tpl/$c_hr->{cat_theme}/$NAME";
$l->debug("template path [$path]");
eval { require Module::List::Pluggable; };
if ($EVAL_ERROR) {
my $m = not_installed_msg($lh);
return $self->error( { module => $MODULE, msg => $m } );
}
my $data_ar = [ { name => 'CipUX', version => $CipUX::VERSION, }, ];
# get a list of all modules installed under a given point
# in perl's module namespace
my $plugins = Module::List::Pluggable::list_modules_under("CipUX");
Module::List::Pluggable::import_modules( "CipUX", { import => 0 } );
foreach my $p ( sort @{$plugins} ) {
# excl direct base classes
next if $p eq 'CipUX';
# gernally I would like to use Module::Info or
# Module::InstalledVersion but the have to much
# problems with -T
my $v = $lh->maketext('n.a.');
$v = $p->VERSION;
if ( not defined $v ) {
$v = $lh->maketext('unknown');
}
push @{$data_ar}, { name => $p, version => $v, };
}
return {
layout => "$path/layout.html",
layout_ar => [
{ begin_html => 1, },
{ body_ar => [ $lh->maketext('Perl module versions') ] },
{
tt2_hr => {
tpl => "$path/index.html",
param_hr => {
DATA => $data_ar,
MODULE => $MODULE,
PATH => $path,
lh => $lh,
},
}
},
{ footer_hr => { show_index_back => 1, }, },
{ end_html => 1, },
],
};
}
sub not_installed_msg {
my $lh = shift;
return $lh->maketext( 'To use this module, please install [_1]!',
'Module::List::Pluggable' );
}
}
1;
__END__
=pod
=head1 NAME
CipUX::CAT::Web::Module::PerlVersion - Lists all perl versions of CipUX
=head1 VERSION
This document describes CipUX::CAT::Web::Module::PerlVersion version 3.4.0.3
=head1 SYNOPSIS
This CAT Web module can be used to see installed CipUX Perl module versions.
=head1 DESCRIPTION
This CAT Web module can be used to see installed CipUX Perl module versions.
=head1 INTERFACE
=head2 module
Use this method to start the list.
=head1 DIAGNOSTICS
Throws the error
To use this module, please install Module::List::Pluggable!
if Module::List::Pluggable is not installed.
=head1 CONFIGURATION AND ENVIRONMENT
CipUX::CAT::Web::Module::PerlVersion requires no configuration files or
environment variables. However it merges its configuration from
CipUX::CAT::Web::Module and itself.
=head1 DEPENDENCIES
Log::Log4perl
CipUX::CAT::Web::Module
Module::List::Pluggable
=head1 INCOMPATIBILITIES
None reported.
=head1 BUGS AND LIMITATIONS
No bugs have been reported.
=head1 AUTHOR
Christian Kuelker C<< <christian.kuelker@cipworx.org> >>
=head1 LICENCE AND COPYRIGHT
Copyright (C) 2010, Christian Kuelker
C<< <christian.kuelker@cipworx.org> >>. All rights reserved.
This module is free software; you can redistribute it and/or modify it under
the GNU GPL licence version 2 or any later version.
=head1 DISCLAIMER OF WARRANTY
BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE
ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH
YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
NECESSARY SERVICING, REPAIR, OR CORRECTION.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE
LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL,
OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE
THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
=cut
|