Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Xavier Bachelot
lemonldap-ng
Commits
4c1574e0
Commit
4c1574e0
authored
Dec 03, 2009
by
Clément OUDOT
Browse files
Merge apply.conf in lemonldap-ng.ini
parent
0ea44c23
Changes
8
Hide whitespace changes
Inline
Side-by-side
build/lemonldap-ng/Makefile
View file @
4c1574e0
...
...
@@ -271,12 +271,7 @@ install_manager_site: install_conf_dir
rm
-rf
${RMANAGERDIR}
/imgs
;
\
ln
-s
$$
(
echo
${MANAGERDATADIR}
|
sed
-e
's/\/$$//'
)
${RMANAGERDIR}
/imgs
;
\
fi
# apply.conf install if erase configuration is wanted
@
if
[
"
$(ERASECONFIG)
"
-eq
"1"
]
;
then
\
mv
-f
${RMANAGERDIR}
/apply.conf
"
$(RCONFDIR)
"
;
\
fi
@
perl
-i
-pe
's/__DNSDOMAIN__/
$(DNSDOMAIN)
/g'
$(RCONFDIR)
/apply.conf
@
perl
-i
-pe
's#__APPLYCONFFILE__#
$(CONFDIR)
/apply.conf#'
${RMANAGERDIR}
/index.pl
@
perl
-i
-pe
's/__DNSDOMAIN__/
$(DNSDOMAIN)
/g'
$(RCONFDIR)
/
$(CONFFILENAME)
# Sessions explorer install
@
if
[
"
${MANAGERDIR}
"
!=
"
$(SESSIONSEXPLORERDIR)
"
]
;
then
mv
-f
${RMANAGERDIR}
/sessions.pl
$(RSESSIONSEXPLORERDIR)
;
fi
@
if
[
"
${MANAGERDIR}
/images/"
!=
"
${SESSIONSEXPLORERDATADIR}
/"
]
;
then
\
...
...
@@ -353,8 +348,6 @@ install_examples_site:
$(REXAMPLESDIR)
/manager/images
\
@rm
-rf
$$
(
find
$(REXAMPLESDIR)
-type
d
-name
.svn
)
@
perl
-i
-pe
's#__DIR__#
$(LASPPORTALDIR)
#g'
$(REXAMPLESDIR)
/portal/AuthLA/index.pl
@
perl
-i
-pe
's/__DNSDOMAIN__/
$(DNSDOMAIN)
/g'
$(REXAMPLESDIR)
/manager/apply.conf
@
perl
-i
-pe
's#__APPLYCONFFILE__#
$(CONFDIR)
/apply.conf#'
$(REXAMPLESDIR)
/manager/
*
.pl
@
perl
-i
-pe
's#__SKINDIR__#
$(PORTALDIR)
/skins#; \
s#__APPSXMLFILE__#
$(CONFDIR)
/apps-list.xml#; \
s#__SESSIONDIR__#
$(APACHESESSIONFILEDIR)
/#g;'
$(REXAMPLESDIR)
/portal/
*
.pl
...
...
modules/lemonldap-ng-common/lemonldap-ng.ini
View file @
4c1574e0
...
...
@@ -5,8 +5,15 @@
# You can set here configuration parameters that will be used only by
# local LemonLDAP::NG elements
#
# Parameters of section "all" are always read
# Section "all" is always read first before "portal", "handler"
# and "manager"
#
# Section "configuration" is used to load global configuration and set cache
# (replace old storage.conf file)
#
# Section "apply" is read by Manager to reload handlers
# (replace old apply.conf file)
#
# Other section are only read by the specific LemonLDAP::NG component
#==============================================================================
...
...
@@ -32,3 +39,5 @@ https = 0
dhtmlXTreeImageLocation
=
/imgs/
;protection = authenticate
[apply]
test1.__DNSDOMAIN__
=
http://test1.__DNSDOMAIN__/reload
modules/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/Constants.pm
View file @
4c1574e0
...
...
@@ -19,6 +19,7 @@ use constant CONFSECTION => "configuration";
use
constant
PORTALSECTION
=>
"
portal
";
use
constant
HANDLERSECTION
=>
"
handler
";
use
constant
MANAGERSECTION
=>
"
manager
";
use
constant
APPLYSECTION
=>
"
apply
";
our
%EXPORT_TAGS
=
(
'
all
'
=>
[
qw(
CONFIG_WAS_CHANGED
...
...
@@ -32,6 +33,7 @@ our %EXPORT_TAGS = ( 'all' => [ qw(
PORTALSECTION
HANDLERSECTION
MANAGERSECTION
APPLYSECTION
)
]
);
our
@EXPORT_OK
=
(
@
{
$EXPORT_TAGS
{'
all
'}
}
);
...
...
modules/lemonldap-ng-manager/example/apply.conf
deleted
100644 → 0
View file @
0ea44c23
test1
.
__
DNSDOMAIN__
http
://
test1
.
__
DNSDOMAIN__
/
reload
test2
.
__
DNSDOMAIN__
http
://
test2
.
__
DNSDOMAIN__
/
reload
modules/lemonldap-ng-manager/example/experimental.pl
View file @
4c1574e0
...
...
@@ -6,7 +6,6 @@ my $h = new Lemonldap::NG::Manager::Experimental(
{
jqueryUri
=>
'
/javascript/jquery/jquery.js
',
imagePath
=>
'
/images/
',
applyConfFile
=>
'
/etc/lemonldap-ng//apply.conf
',
cssFile
=>
'
theme/default.css
',
textareaW
=>
50
,
textareaH
=>
2
,
...
...
modules/lemonldap-ng-manager/example/index.pl
View file @
4c1574e0
...
...
@@ -6,7 +6,6 @@ my $h = new Lemonldap::NG::Manager(
{
# REQUIRED PARAMETERS
dhtmlXTreeImageLocation
=>
"
/imgs/
",
applyConfFile
=>
'
__APPLYCONFFILE__
',
cssFile
=>
'
theme/default.css
',
textareaW
=>
50
,
textareaH
=>
2
,
...
...
modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager.pm
View file @
4c1574e0
...
...
@@ -779,47 +779,57 @@ sub checkConf {
}
# Apply subroutines
# TODO: Credentials in
applyConfFile
# TODO: Credentials in
APPLYSECTION
## @method void print_apply()
# Call all Lemonldap::NG handlers declared in
$self->{applyConfFile}
file to
# Call all Lemonldap::NG handlers declared in
local ini
file to
# ask them to reload Lemonldap::NG configuration.
sub
print_apply
{
my
$self
=
shift
;
# Read APPLYSECTION from local ini file
my
$applyconf
=
$self
->
config
->
getLocalConf
(
APPLYSECTION
,
"",
0
);
# Test if section was read
print
$self
->
header
(
-
type
=>
"
text/html; charset=utf8
"
);
unless
(
-
r
$self
->
{
apply
C
onf
File
}
)
{
unless
(
ref
$
apply
c
onf
)
{
print
"
<h3>
"
.
&txt_canNotReadApplyConfFile
.
"
</h3>
";
return
;
}
# Call all reload routines on configured handlers
print
'
<h3>
'
.
&txt_result
.
'
: </h3><ul>
';
open
F
,
$self
->
{
applyConfFile
};
# Initiate User Agent
my
$ua
=
new
LWP::
UserAgent
(
requests_redirectable
=>
[]
);
$ua
->
timeout
(
10
);
while
(
<
F
>
)
{
local
$|
=
1
;
# pass blank lines and comments
next
if
(
/^$/
or
/^\s*#/
);
chomp
;
s/\r//
;
# each line must be like:
# host http(s)://vhost/request/
my
(
$host
,
$request
)
=
(
/^\s*([^\s]+)\s+([^\s]+)$/
);
unless
(
$host
and
$request
)
{
print
"
<li>
"
.
&txt_invalidLine
.
"
:
$_
</li>
";
next
;
}
# Loop on defined handlers in APPLYSECTION
foreach
my
$host
(
keys
%$applyconf
)
{
# Request must be like method://vhost/uri/
my
$request
=
$applyconf
->
{
$host
};
my
(
$method
,
$vhost
,
$uri
)
=
(
$request
=~
/^(https?):\/\/([^\/]+)(.*)$/
);
# If no vhost value, set
# - method to http
# - vhost to host
# - uri to request
unless
(
$vhost
)
{
$vhost
=
$host
;
$uri
=
$request
;
$method
=
"
http
";
$vhost
=
$host
;
$uri
=
$request
;
}
print
"
<li>
$host
...
";
# GET HTTP request on handlers
print
"
<li>
$host
...
";
my
$r
=
HTTP::
Request
->
new
(
'
GET
',
"
$method
://
$host$uri
",
HTTP::
Headers
->
new
(
Host
=>
$vhost
)
);
# Display responses
my
$response
=
$ua
->
request
(
$r
);
if
(
$response
->
code
!=
200
)
{
print
join
(
'
',
...
...
@@ -937,15 +947,6 @@ error logs.
=item * B<jsFile> (optional): the path to the file C<lemonldap-ng-manager.js>.
It is required only if this file is not in the same directory than your script.
=item * B<applyConfFile> (optional): the path to a file containing parameters
to make configuration reloaded by handlers. See C<reload> function in
L<Lemonldap::NG::Handler>. The configuration file must contains lines like:
# Comments if wanted
host http://virtual-host/reload-path
When this parameter is set, an "apply" button is added to the manager menu.
=back
=item * B<doall>: subroutine that provide headers and the full html code. Il
...
...
modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/_HTML.pm
View file @
4c1574e0
...
...
@@ -223,9 +223,7 @@ function onNodeSelect(nodeId) {
+button('$text{lastConf}','lastConf',nodeId)
+button('$text{deleteConf}','deleteConf',nodeId);
#;
if ( $self->{applyConfFile} ) {
print "but+=button('$text{applyConf}','applyConf',nodeId);";
}
print "but+=button('$text{applyConf}','applyConf',nodeId);";
print qq#
document.getElementById('buttons').innerHTML = but;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment