Portal's and manager's CGI scripts runnable in shell (Lemonldap-476)

environments/ppa-mbqj77/deployments/1
François-Xavier Deltombe 13 years ago
parent 0403c67939
commit 64f26a226a
  1. 8
      lemonldap-ng-common/lib/Lemonldap/NG/Common/CGI.pm
  2. 2
      lemonldap-ng-manager/example/index.pl
  3. 2
      lemonldap-ng-manager/example/notifications.pl
  4. 2
      lemonldap-ng-manager/example/sessions.pl
  5. 5
      lemonldap-ng-manager/lib/Lemonldap/NG/Manager.pm
  6. 5
      lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Notifications.pm
  7. 5
      lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Sessions.pm
  8. 10
      lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Simple.pm

@ -7,6 +7,7 @@ package Lemonldap::NG::Common::CGI;
use strict;
use File::Basename;
use MIME::Base64;
use Time::Local;
use CGI;
@ -132,6 +133,13 @@ sub setApacheUser {
$ENV{REMOTE_USER} = $user;
}
##@method string getApacheHtdocsPath()
# Return absolute path to the htdocs directory where the current script is
# @return path string
sub getApacheHtdocsPath {
return dirname( $ENV{SCRIPT_FILENAME} || $0 );
}
## @method void soapTest(string soapFunctions, object obj)
# Check if request is a SOAP request. If it is, launch
# Lemonldap::NG::Common::CGI::SOAPServer and exit. Else simply return.

@ -27,7 +27,7 @@ my $manager = new Lemonldap::NG::Manager(
our $skin = $manager->{managerSkin};
our $skin_dir = 'skins';
our $main_dir = $manager->{managerHtdocsPath};
our $main_dir = $manager->getApacheHtdocsPath;
my $template = HTML::Template->new(
filename => "$main_dir/$skin_dir/$skin/manager.tpl",

@ -33,7 +33,7 @@ my $skin = $cgi->{managerSkin} or $cgi->abort('managerSkin is not defined');
my $css = 'tree.css';
my $css_theme = 'ui-lightness';
my $skin_dir = 'skins';
my $main_dir = $cgi->{managerHtdocsPath};
my $main_dir = $cgi->getApacheHtdocsPath;
my $template = HTML::Template->new(
filename => "$main_dir/$skin_dir/$skin/notifications.tpl",

@ -31,7 +31,7 @@ my $skin = $cgi->{managerSkin} or $cgi->abort('managerSkin is not defined');
my $css = 'tree.css';
my $css_theme = 'ui-lightness';
my $skin_dir = 'skins';
my $main_dir = $cgi->{managerHtdocsPath};
my $main_dir = $cgi->getApacheHtdocsPath;
my $template = HTML::Template->new(
filename => "$main_dir/$skin_dir/$skin/sessions.tpl",

@ -6,7 +6,6 @@
package Lemonldap::NG::Manager;
use strict;
use File::Basename;
use Lemonldap::NG::Handler::CGI qw(:globalStorage :locationRules); #inherits
use Lemonldap::NG::Common::Conf; #link protected conf Configuration
use Lemonldap::NG::Common::Conf::Constants; #inherits
@ -53,10 +52,6 @@ sub new {
$self->{managerTreeJqueryCss} = "true"
unless defined $self->{managerTreeJqueryCss};
# Absolute path to the htdocs directory where is manager script.
my ( $mname, $mpath, $msuffix ) = fileparse( $ENV{SCRIPT_FILENAME} );
$self->{managerHtdocsPath} = $mpath;
# Save conf if ?data=
if ( my $rdata = $self->rparam('data') ) {

@ -12,7 +12,6 @@
package Lemonldap::NG::Manager::Notifications;
use strict;
use File::Basename;
use Lemonldap::NG::Handler::CGI qw(:globalStorage :locationRules);
use Lemonldap::NG::Portal::Notification;
use Lemonldap::NG::Common::Conf; #link protected conf Configuration
@ -107,10 +106,6 @@ sub new {
# Multi values separator
$self->{multiValuesSeparator} ||= '; ';
# Absolute path to the htdocs directory where is manager script.
my ( $mname, $mpath, $msuffix ) = fileparse( $ENV{SCRIPT_FILENAME} );
$self->{managerHtdocsPath} = $mpath;
# Now we're ready to display sessions. Choose display type
foreach my $k ( $self->param() ) {

@ -12,7 +12,6 @@
package Lemonldap::NG::Manager::Sessions;
use strict;
use File::Basename;
use Lemonldap::NG::Handler::CGI qw(:globalStorage :locationRules);
use Lemonldap::NG::Common::Apache::Session; #inherits
use Lemonldap::NG::Common::Conf; #link protected conf Configuration
@ -82,10 +81,6 @@ sub new {
# Multi values separator
$self->{multiValuesSeparator} ||= '; ';
# Absolute path to the htdocs directory where is manager script.
my ( $mname, $mpath, $msuffix ) = fileparse( $ENV{SCRIPT_FILENAME} );
$self->{managerHtdocsPath} = $mpath;
# Now we're ready to display sessions. Choose display type
foreach my $k ( $self->param() ) {

@ -11,7 +11,6 @@ use warnings;
use Exporter 'import';
use warnings;
use File::Basename;
use MIME::Base64;
use Lemonldap::NG::Common::CGI;
use CGI::Cookie;
@ -966,15 +965,6 @@ sub getPersistentSession {
return \%h;
}
##@method string getApacheHtdocsPath()
# Return the absolute path to the htdocs directory where is portal script.
# @return path string
sub getApacheHtdocsPath {
my $self = shift;
my ( $name, $path, $suffix ) = fileparse( $ENV{SCRIPT_FILENAME} );
return $path;
}
## @method protected string _md5hash(string s)
# Return md5(s)
# @param $s String to hash

Loading…
Cancel
Save