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
Julien Ledoux
lemonldap-ng
Commits
1e4c6da3
Commit
1e4c6da3
authored
Jan 27, 2017
by
Yadd
Browse files
Rename lmConf-*.js to lmConf-*.json (fix: #1090)
parent
c52bbcb5
Changes
14
Hide whitespace changes
Inline
Side-by-side
Makefile
View file @
1e4c6da3
...
...
@@ -193,7 +193,7 @@ MANAGERJSONDST=$(SRCMANAGERDIR)/site/static/struct.json \
$(SRCCOMMONDIR)
/lib/Lemonldap/NG/Common/Conf/ReConstants.pm
\
$(SRCCOMMONDIR)
/lib/Lemonldap/NG/Common/Conf/DefaultValues.pm
\
$(SRCCOMMONDIR)
/lib/Lemonldap/NG/Common/Conf/Constants.pm
\
_example/conf/lmConf-1.js
_example/conf/lmConf-1.js
on
# Javascript and CSS to minify
JSSRCFILES
:=
$(
shell
find
*
/site/static/js
$(SRCPORTALDIR)
/site/htdocs/static
-type
f
-name
'*.js'
!
-name
'*.min.js'
)
\
...
...
@@ -384,11 +384,11 @@ prepare_test_server:
INITDIR
=
`
pwd
`
/e2e-tests/conf/init
\
ETCDEFAULTDIR
=
`
pwd
`
/e2e-tests/conf/def
@
cp
-f
e2e-tests/index.
*
e2e-tests/conf/
@
cp
e2e-tests/lmConf-1.js e2e-tests/lemonldap-ng.ini e2e-tests/env.conf e2e-tests/test-nginx.conf e2e-tests/conf/
@
cp
e2e-tests/lmConf-1.js
on
e2e-tests/lemonldap-ng.ini e2e-tests/env.conf e2e-tests/test-nginx.conf e2e-tests/conf/
@
cp
e2e-tests/form.html e2e-tests/conf/site
@
perl
-i
-pe
'BEGIN{$$p=`pwd`;chomp $$p}s#__pwd__#$$p#;s#__port__#
$(TESTWEBSERVERPORT)
#;s#__FASTCGISOCKDIR__#
$(FASTCGISOCKDIR)
#;'
\
e2e-tests/conf/lemonldap-ng.ini
\
e2e-tests/conf/lmConf-1.js
\
e2e-tests/conf/lmConf-1.js
on
\
e2e-tests/conf/env.conf
\
e2e-tests/conf/test-nginx.conf
...
...
@@ -731,11 +731,11 @@ install_conf_dir: install_sessions_dir install_notif_dir install_captcha_dir
cp
-f
$(SRCCOMMONDIR)
/
$(CONFFILENAME)
$(RCONFDIR)
;
\
$(PERL)
-i
-pe
's#^dirName\s*=\s*.*#dirName =
$(FILECONFIGDIR)
#g'
$(RCONFDIR)
/
$(CONFFILENAME)
;
\
fi
@
cp
_example/conf/lmConf-1.js
$(RFILECONFIGDIR)
@
cp
_example/conf/lmConf-1.js
on
$(RFILECONFIGDIR)
@
$(PERL)
-i
-pe
's/__DNSDOMAIN__/
$(DNSDOMAIN)
/g;\
s#__SESSIONDIR__#
$(APACHESESSIONFILEDIR)
#g;\
s#__PSESSIONDIR__#
$(APACHEPSESSIONFILEDIR)
#g;\
s#__NOTIFICATIONDIR__#
$(APACHEFILENOTIFDIR)
#g;'
$(RFILECONFIGDIR)
/lmConf-1.js
s#__NOTIFICATIONDIR__#
$(APACHEFILENOTIFDIR)
#g;'
$(RFILECONFIGDIR)
/lmConf-1.js
on
@
if
[
"
$(APACHEUSER)
"
!=
""
]
;
then
\
chown
$(APACHEUSER)
$(RFILECONFIGDIR)
||
exit
1
;
\
if
[
"
$(APACHEGROUP)
"
!=
""
]
;
then
\
...
...
_example/conf/lmConf-1.js
→
_example/conf/lmConf-1.js
on
View file @
1e4c6da3
File moved
e2e-tests/lmConf-1.js
→
e2e-tests/lmConf-1.js
on
View file @
1e4c6da3
File moved
lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/Backends/File.pm
View file @
1e4c6da3
...
...
@@ -15,7 +15,7 @@ sub Lemonldap::NG::Common::Conf::_lock {
sub
Lemonldap
::NG::Common::Conf::_file {
my
(
$self
,
$cfgNum
)
=
@_
;
return
"
$self
->{dirName}/lmConf-
$cfgNum
.js
";
return
"
$self
->{dirName}/lmConf-
$cfgNum
.js
on
";
}
sub
prereq
{
...
...
@@ -40,7 +40,7 @@ sub available {
closedir
D
;
@conf
=
sort
{
$a
<=>
$b
}
map
{
/lmConf-(\d+)(?:\.js)?/
?
(
$
1
+
0
)
:
()
}
@conf
;
map
{
/lmConf-(\d+)(?:\.js
(?:on)
)?/
?
(
$
1
+
0
)
:
()
}
@conf
;
return
@conf
;
}
...
...
@@ -96,11 +96,17 @@ sub store {
sub
load
{
my
(
$self
,
$cfgNum
,
$fields
)
=
@_
;
my
$f
;
my
(
$f
,
$filename
)
;
if
(
-
e
$self
->
_file
(
$cfgNum
)
)
{
$filename
=
$self
->
_file
(
$cfgNum
);
}
elsif
(
-
e
"
$self
->{dirName}/lmConf-
$cfgNum
.js
"
)
{
$filename
=
"
$self
->{dirName}/lmConf-
$cfgNum
.js
";
}
if
(
$filename
)
{
local
$/
=
'';
my
$ret
;
unless
(
open
FILE
,
$
self
->
_file
(
$cfgNum
)
)
{
unless
(
open
FILE
,
$
filename
)
{
$
Lemonldap::NG::Common::Conf::
msg
.=
"
Read error: $!$@
";
return
undef
;
}
...
...
lemonldap-ng-common/t/02-Common-Conf-File.t
View file @
1e4c6da3
...
...
@@ -45,7 +45,7 @@ for ( my $i = 0 ; $i < @test ; $i++ ) {
$count
++
;
if
(
-
x
'
/usr/bin/file
'
)
{
eval
{
open
F
,
'
file t/lmConf-1.js |
';
open
F
,
'
file t/lmConf-1.js
on
|
';
$_
=
join
(
'',
<
F
>
);
close
F
;
ok
(
/(ascii|utf-?8)/si
,
"
File is $1 encoded
"
);
...
...
@@ -60,6 +60,6 @@ for ( my $i = 0 ; $i < @test ; $i++ ) {
$count
+=
2
;
}
#
unlink 't/lmConf-1.js';
unlink
'
t/lmConf-1.js
on
';
done_testing
(
$count
);
lemonldap-ng-handler/MANIFEST
View file @
1e4c6da3
...
...
@@ -48,7 +48,7 @@ t/61-Lemonldap-NG-Handler-PSGI-Server.t
t/62-Lemonldap-NG-Handler-Nginx.t
t/63-Lemonldap-NG-Handler-PSGI-Try.t
t/99-pod.t
t/lmConf-1.js
t/lmConf-1.js
on
t/sessions/lock/Apache-Session-f5eec18ebb9bc96352595e2d8ce962e8ecf7af7c9a98cb9a43f9cd181cf4b545.lock
t/test-psgi-lib.pm
t/test.pm
lemonldap-ng-handler/t/lmConf-1.js
→
lemonldap-ng-handler/t/lmConf-1.js
on
View file @
1e4c6da3
File moved
lemonldap-ng-manager/MANIFEST
View file @
1e4c6da3
...
...
@@ -171,7 +171,7 @@ t/50-notifications.t
t/80-attributes.t
t/90-translations.t
t/99-pod.t
t/conf/lmConf-1.js
t/conf/lmConf-1.js
on
t/jsonfiles/01-base-tree.json
t/jsonfiles/02-base-tree-all-nodes-opened.json
t/jsonfiles/12-modified.json
...
...
lemonldap-ng-manager/Makefile.PL
View file @
1e4c6da3
...
...
@@ -38,7 +38,7 @@ WriteMakefile(
:
()
),
clean
=>
{
FILES
=>
't/conf/lmConf-2.js'
,
FILES
=>
't/conf/lmConf-2.js
on
'
,
},
);
lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Build.pm
View file @
1e4c6da3
...
...
@@ -621,7 +621,7 @@ system.
managerConstantsFile => "lib/Lemonldap/NG/Common/Conf/ReConstants.pm",
managerAttributesFile => 'lib/Lemonldap/NG/Manager/Attributes.pm',
defaultValuesFile => "lib/Lemonldap/NG/Common/Conf/DefaultValues.pm",
firstLmConfFile => "_example/conf/lmConf-1.js",
firstLmConfFile => "_example/conf/lmConf-1.js
on
",
reverseTreeFile => "site/static/reverseTree.json",
);
...
...
@@ -679,7 +679,7 @@ constants used to read configuration;
parameters attributes used by the manager during configuration upload;
=item lmConf-1.js:
=item lmConf-1.js
on
:
first configuration in file format;
...
...
lemonldap-ng-manager/t/10-save-unchanged-conf.t
View file @
1e4c6da3
...
...
@@ -11,7 +11,7 @@ require 't/test-lib.pm';
my
@struct
=
qw[t/jsonfiles/01-base-tree.json t/jsonfiles/02-base-tree-all-nodes-opened.json]
;
my
@desc
=
(
'
Unopened conf
',
'
Unchanged conf with all nodes opened
'
);
my
$confFiles
=
[
'
t/conf/lmConf-1.js
',
'
t/conf/lmConf-2.js
'
];
my
$confFiles
=
[
'
t/conf/lmConf-1.js
on
',
'
t/conf/lmConf-2.js
on
'
];
sub
body
{
return
0
unless
(
@struct
);
...
...
@@ -19,7 +19,7 @@ sub body {
return
IO::
File
->
new
(
$t
,
'
r
'
);
}
# Delete lmConf-2.js if exists
# Delete lmConf-2.js
on
if exists
eval
{
unlink
$confFiles
->
[
1
];
};
mkdir
'
t/sessions
';
...
...
lemonldap-ng-manager/t/12-save-changed-conf.t
View file @
1e4c6da3
...
...
@@ -10,13 +10,13 @@ use Data::Dumper;
require
'
t/test-lib.pm
';
my
$struct
=
'
t/jsonfiles/12-modified.json
';
my
$confFiles
=
[
'
t/conf/lmConf-1.js
',
'
t/conf/lmConf-2.js
'
];
my
$confFiles
=
[
'
t/conf/lmConf-1.js
on
',
'
t/conf/lmConf-2.js
on
'
];
sub
body
{
return
IO::
File
->
new
(
$struct
,
'
r
'
);
}
# Delete lmConf-2.js if exists
# Delete lmConf-2.js
on
if exists
eval
{
unlink
$confFiles
->
[
1
];
};
mkdir
'
t/sessions
';
...
...
lemonldap-ng-manager/t/14-bad-changes-in-conf.t
View file @
1e4c6da3
...
...
@@ -14,7 +14,7 @@ sub body {
return
IO::
File
->
new
(
$struct
,
'
r
'
);
}
unlink
'
t/conf/lmConf-2.js
';
unlink
'
t/conf/lmConf-2.js
on
';
my
(
$res
,
$resBody
);
ok
(
$res
=
&client
->
_post
(
'
/confs/
',
'
cfgNum=1
',
&body
,
'
application/json
'
),
...
...
@@ -35,4 +35,4 @@ count(5);
done_testing
(
count
()
);
unlink
'
t/conf/lmConf-2.js
';
unlink
'
t/conf/lmConf-2.js
on
';
lemonldap-ng-manager/t/conf/lmConf-1.js
→
lemonldap-ng-manager/t/conf/lmConf-1.js
on
View file @
1e4c6da3
File moved
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