fixes #275 - use SCRIPT_FILENAME instead of DOCUMENT_ROOT to get htdocs portal path
This commit is contained in:
parent
1fd6b1c29f
commit
ddb84e6ef2
|
@ -27,7 +27,7 @@ my $manager = new Lemonldap::NG::Manager(
|
|||
|
||||
our $skin = $manager->{managerSkin};
|
||||
our $skin_dir = 'skins';
|
||||
our $main_dir = $ENV{DOCUMENT_ROOT};
|
||||
our $main_dir = $manager->{managerHtdocsPath};
|
||||
|
||||
my $template = HTML::Template->new(
|
||||
filename => "$main_dir/$skin_dir/$skin/manager.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 = $ENV{DOCUMENT_ROOT};
|
||||
my $main_dir = $cgi->{managerHtdocsPath};
|
||||
|
||||
my $template = HTML::Template->new(
|
||||
filename => "$main_dir/$skin_dir/$skin/sessions.tpl",
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
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
|
||||
|
@ -52,6 +53,10 @@ 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,6 +12,7 @@
|
|||
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
|
||||
|
@ -81,6 +82,10 @@ 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() ) {
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ use strict;
|
|||
my $portal = Lemonldap::NG::Portal::MailReset->new();
|
||||
|
||||
my $skin = $portal->{portalSkin};
|
||||
my $skin_dir = $ENV{DOCUMENT_ROOT} . "/skins";
|
||||
my $skin_dir = $portal->getApacheHtdocsPath() . "/skins";
|
||||
my $portal_url = $portal->{portal};
|
||||
|
||||
# Process
|
||||
|
|
|
@ -35,7 +35,7 @@ my $portal = Lemonldap::NG::Portal::SharedConf->new(
|
|||
);
|
||||
|
||||
my $skin = 'common';
|
||||
my $skin_dir = $ENV{DOCUMENT_ROOT} . '/skins';
|
||||
my $skin_dir = $portal->getApacheHtdocsPath() . '/skins';
|
||||
my $skin_file = 'saml2-metadata.tpl';
|
||||
my $metadata = Lemonldap::NG::Common::Conf::SAML::Metadata->new();
|
||||
print $portal->header('text/xml; charset=utf-8');
|
||||
|
|
|
@ -18,7 +18,7 @@ sub display {
|
|||
my $self = shift;
|
||||
|
||||
my $skin = $self->{portalSkin};
|
||||
my $skin_dir = $ENV{DOCUMENT_ROOT} . "/skins";
|
||||
my $skin_dir = $self->getApacheHtdocsPath() . "/skins";
|
||||
my ( $skinfile, %templateParams );
|
||||
my $http_error = $self->param('lmError');
|
||||
|
||||
|
|
|
@ -168,7 +168,7 @@ sub sendConfirmationMail {
|
|||
|
||||
# Use HTML template
|
||||
my $template = HTML::Template->new(
|
||||
filename => $ENV{DOCUMENT_ROOT} . "skins/common/mail_confirm.tpl",
|
||||
filename => $self->getApacheHtdocsPath() . "skins/common/mail_confirm.tpl",
|
||||
filter => sub { $self->translate_template(@_) }
|
||||
);
|
||||
$body = $template->output();
|
||||
|
@ -205,7 +205,7 @@ sub sendPasswordMail {
|
|||
|
||||
# Use HTML template
|
||||
my $template = HTML::Template->new(
|
||||
filename => $ENV{DOCUMENT_ROOT} . "skins/common/mail_password.tpl",
|
||||
filename => $self->getApacheHtdocsPath() . "skins/common/mail_password.tpl",
|
||||
filter => sub { $self->translate_template(@_) }
|
||||
);
|
||||
$body = $template->output();
|
||||
|
|
|
@ -11,6 +11,7 @@ use warnings;
|
|||
use Exporter 'import';
|
||||
|
||||
use warnings;
|
||||
use File::Basename;
|
||||
use MIME::Base64;
|
||||
use Lemonldap::NG::Common::CGI;
|
||||
use CGI::Cookie;
|
||||
|
@ -813,6 +814,15 @@ sub getApacheSession {
|
|||
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
|
||||
|
|
|
@ -154,7 +154,7 @@ sub loadService {
|
|||
# Create Lasso server with service metadata
|
||||
my $server = $self->createServer(
|
||||
$service_metadata->serviceToXML(
|
||||
$ENV{DOCUMENT_ROOT} . "/skins/common/saml2-metadata.tpl", $self
|
||||
$self->getApacheHtdocsPath() . "/skins/common/saml2-metadata.tpl", $self
|
||||
),
|
||||
$privateKeySig,
|
||||
$privateKeySigPwd,
|
||||
|
|
Loading…
Reference in New Issue
Block a user