2009-02-05 18:05:18 +01:00
|
|
|
## @file
|
|
|
|
# SOAP wrapper used to restrict exported functions
|
|
|
|
|
|
|
|
## @class
|
|
|
|
# SOAP wrapper used to restrict exported functions
|
|
|
|
package Lemonldap::NG::Common::CGI::SOAPService;
|
|
|
|
|
2009-02-08 18:12:42 +01:00
|
|
|
require SOAP::Lite;
|
|
|
|
|
2010-11-20 16:05:40 +01:00
|
|
|
our $VERSION = '1.0.0';
|
2009-06-08 18:29:13 +02:00
|
|
|
|
2009-02-05 18:05:18 +01:00
|
|
|
## @cmethod Lemonldap::NG::Common::CGI::SOAPService new(object obj,string @func)
|
|
|
|
# Constructor
|
|
|
|
# @param $obj object which will be called for SOAP authorizated methods
|
2009-02-17 16:22:42 +01:00
|
|
|
# @param @func authorizated methods
|
2009-02-05 18:05:18 +01:00
|
|
|
# @return Lemonldap::NG::Common::CGI::SOAPService object
|
|
|
|
sub new {
|
2010-03-01 21:32:28 +01:00
|
|
|
my ( $class, $obj, @func ) = @_;
|
|
|
|
s/.*::// foreach (@func);
|
|
|
|
return bless { obj => $obj, func => \@func }, $class;
|
2009-02-05 18:05:18 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
## @method datas AUTOLOAD()
|
|
|
|
# Call the wanted function with the object given to the constructor.
|
|
|
|
# AUTOLOAD() is a magic method called by Perl interpreter fon non existent
|
|
|
|
# functions. Here, we use it to call the wanted function (given by $AUTOLOAD)
|
|
|
|
# if it is authorizated
|
|
|
|
# @return datas provided by the exported function
|
|
|
|
sub AUTOLOAD {
|
|
|
|
my $self = shift;
|
|
|
|
$AUTOLOAD =~ s/.*:://;
|
2010-03-01 21:32:28 +01:00
|
|
|
if ( grep { $_ eq $AUTOLOAD } @{ $self->{func} } ) {
|
2009-02-08 18:12:42 +01:00
|
|
|
my $tmp = $self->{obj}->$AUTOLOAD(@_);
|
2010-03-01 21:32:28 +01:00
|
|
|
unless ( ref($tmp) and ref($tmp) eq 'SOAP::Data' ) {
|
2009-02-08 18:12:42 +01:00
|
|
|
$tmp = SOAP::Data->name( result => $tmp );
|
|
|
|
}
|
|
|
|
return $tmp;
|
2009-02-05 18:05:18 +01:00
|
|
|
}
|
2010-03-01 21:32:28 +01:00
|
|
|
elsif ( $AUTOLOAD ne 'DESTROY' ) {
|
2009-04-04 09:36:42 +02:00
|
|
|
die "$AUTOLOAD is not an authorizated function";
|
2009-02-05 18:05:18 +01:00
|
|
|
}
|
|
|
|
1;
|
|
|
|
}
|
|
|
|
|
|
|
|
1;
|
|
|
|
|
2009-03-03 07:21:52 +01:00
|
|
|
__END__
|
|
|
|
|
|
|
|
=head1 NAME
|
|
|
|
|
2010-01-03 09:09:59 +01:00
|
|
|
=encoding utf8
|
|
|
|
|
2009-03-03 07:21:52 +01:00
|
|
|
Lemonldap::NG::Common::CGI::SOAPService - Wrapper for all SOAP functions of
|
|
|
|
Lemonldap::NG CGIs.
|
|
|
|
|
|
|
|
=head1 SYNOPSIS
|
|
|
|
|
|
|
|
See L<Lemonldap::NG::Common::CGI>
|
|
|
|
|
|
|
|
=head1 DESCRIPTION
|
|
|
|
|
|
|
|
Private class used by L<Lemonldap::NG::Common::CGI> to control SOAP functions
|
|
|
|
access.
|
|
|
|
|
|
|
|
=head1 SEE ALSO
|
|
|
|
|
2010-10-26 11:34:00 +02:00
|
|
|
L<http://lemonldap-ng.org/>, L<Lemonldap::NG::Common::CGI>
|
2009-03-03 07:21:52 +01:00
|
|
|
|
|
|
|
=head1 AUTHOR
|
|
|
|
|
2013-01-31 06:33:10 +01:00
|
|
|
=over
|
|
|
|
|
|
|
|
=item Clement Oudot, E<lt>clem.oudot@gmail.comE<gt>
|
|
|
|
|
|
|
|
=item Xavier Guimard, E<lt>x.guimard@free.frE<gt>
|
|
|
|
|
|
|
|
=back
|
|
|
|
|
|
|
|
=head1 BUG REPORT
|
|
|
|
|
|
|
|
Use OW2 system to report bug or ask for features:
|
|
|
|
L<http://jira.ow2.org>
|
|
|
|
|
|
|
|
=head1 DOWNLOAD
|
|
|
|
|
|
|
|
Lemonldap::NG is available at
|
|
|
|
L<http://forge.objectweb.org/project/showfiles.php?group_id=274>
|
2009-03-03 07:21:52 +01:00
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE
|
|
|
|
|
2013-01-31 06:33:10 +01:00
|
|
|
=over
|
|
|
|
|
|
|
|
=item Copyright (C) 2009, 2010 by Xavier Guimard, E<lt>x.guimard@free.frE<gt>
|
|
|
|
|
|
|
|
=item Copyright (C) 2010, 2012 by Clement Oudot, E<lt>clem.oudot@gmail.comE<gt>
|
|
|
|
|
|
|
|
=back
|
2009-03-03 07:21:52 +01:00
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or modify
|
2013-01-31 06:33:10 +01:00
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2, or (at your option)
|
|
|
|
any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program. If not, see L<http://www.gnu.org/licenses/>.
|
2009-03-03 07:21:52 +01:00
|
|
|
|
|
|
|
=cut
|