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
LemonLDAP NG
lemonldap-ng
Commits
f7df1db2
Commit
f7df1db2
authored
Jan 27, 2017
by
Yadd
Browse files
Hide some warnings
parent
abb49f7b
Changes
6
Hide whitespace changes
Inline
Side-by-side
lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Attributes.pm
View file @
f7df1db2
...
...
@@ -44,7 +44,7 @@ sub types {
BEGIN
{
$
{
^
WARNING_BITS
}
=
"
\x54\x55\x55\x55\x15\x55\x55\x55\x55\x55\x5
5
\x55\x55\x55\x55\x55\x55
";
"
\x54\x55\x55\x55\x15\x55\x55\x55\x55\x55\x5
1
\x55\x55\x55\x55\x55\x55
";
}
eval
"
$s
$val
";
return
$@
?
(
1
,
"
__badExpression__: $@
"
)
:
1
;
...
...
@@ -833,7 +833,7 @@ qr/^(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][-a-zA-Z0-
BEGIN
{
$
{
^
WARNING_BITS
}
=
"
\x54\x55\x55\x55\x15\x55\x55\x55\x55\x55\x5
5
\x55\x55\x55\x55\x55\x55
";
"
\x54\x55\x55\x55\x15\x55\x55\x55\x55\x55\x5
1
\x55\x55\x55\x55\x55\x55
";
}
eval
$s
;
return
$@
?
(
1
,
"
__badExpression__: $@
"
)
:
1
;
...
...
@@ -914,7 +914,7 @@ qr/^(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][-a-zA-Z0-
BEGIN
{
$
{
^
WARNING_BITS
}
=
"
\x54\x55\x55\x55\x15\x55\x55\x55\x55\x55\x5
5
\x55\x55\x55\x55\x55\x55
";
"
\x54\x55\x55\x55\x15\x55\x55\x55\x55\x55\x5
1
\x55\x55\x55\x55\x55\x55
";
}
eval
"
$s
$val
";
return
$@
?
(
1
,
"
__badExpression__: $@
"
)
:
1
;
...
...
@@ -949,7 +949,7 @@ qr/^(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][-a-zA-Z0-
BEGIN
{
$
{
^
WARNING_BITS
}
=
"
\x54\x55\x55\x55\x15\x55\x55\x55\x55\x55\x5
5
\x55\x55\x55\x55\x55\x55
";
"
\x54\x55\x55\x55\x15\x55\x55\x55\x55\x55\x5
1
\x55\x55\x55\x55\x55\x55
";
}
eval
"
$s
$val
";
return
$@
?
(
1
,
"
__badExpression__: $@
"
)
:
1
;
...
...
@@ -1273,7 +1273,7 @@ qr/^(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][-a-zA-Z0-
BEGIN
{
$
{
^
WARNING_BITS
}
=
"
\x54\x55\x55\x55\x15\x55\x55\x55\x55\x55\x5
5
\x55\x55\x55\x55\x55\x55
";
"
\x54\x55\x55\x55\x15\x55\x55\x55\x55\x55\x5
1
\x55\x55\x55\x55\x55\x55
";
}
eval
$s
;
return
$@
?
(
1
,
"
__badExpression__: $@
"
)
:
1
;
...
...
@@ -1319,7 +1319,7 @@ qr/^(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][-a-zA-Z0-
BEGIN
{
$
{
^
WARNING_BITS
}
=
"
\x54\x55\x55\x55\x15\x55\x55\x55\x55\x55\x5
5
\x55\x55\x55\x55\x55\x55
";
"
\x54\x55\x55\x55\x15\x55\x55\x55\x55\x55\x5
1
\x55\x55\x55\x55\x55\x55
";
}
eval
"
$s
$val
";
return
$@
?
(
1
,
"
__badExpression__: $@
"
)
:
1
;
...
...
@@ -1957,7 +1957,7 @@ qr/^(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][-a-zA-Z0-
BEGIN
{
$
{
^
WARNING_BITS
}
=
"
\x54\x55\x55\x55\x15\x55\x55\x55\x55\x55\x5
5
\x55\x55\x55\x55\x55\x55
";
"
\x54\x55\x55\x55\x15\x55\x55\x55\x55\x55\x5
1
\x55\x55\x55\x55\x55\x55
";
}
eval
"
$s
$val
";
return
$@
?
(
1
,
"
__badExpression__: $@
"
)
:
1
;
...
...
lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Build/Attributes.pm
View file @
f7df1db2
...
...
@@ -25,7 +25,7 @@ my $perlExpr = sub {
foreach
my
$f
(
@cf
)
{
$s
=
"
sub
$f
{1}
$s
";
}
no
warnings
'
redefine
';
no
warnings
(
'
redefine
'
,
'
uninitialized
'
)
;
eval
"
$s
$val
";
return
$@
?
(
1
,
"
__badExpression__: $@
"
)
:
(
1
);
};
...
...
@@ -426,13 +426,13 @@ sub attributes {
# Security
formTimeout
=>
{
default
=>
120
,
type
=>
'
int
',
default
=>
120
,
type
=>
'
int
',
documentation
=>
'
Token timeout for forms
',
},
requireToken
=>
{
default
=>
1
,
type
=>
'
bool
',
default
=>
1
,
type
=>
'
bool
',
documentation
=>
'
Enable token for forms
',
},
cda
=>
{
...
...
@@ -1041,7 +1041,7 @@ sub attributes {
foreach
my
$f
(
@cf
)
{
$s
=
"
sub
$f
{1}
$s
";
}
no
warnings
'
redefine
';
no
warnings
(
'
redefine
'
,
'
uninitialized
'
)
;
eval
$s
;
return
$@
?
(
1
,
"
__badExpression__: $@
"
)
:
(
1
);
},
...
...
@@ -1075,7 +1075,7 @@ sub attributes {
foreach
my
$f
(
@cf
)
{
$s
=
"
sub
$f
{1}
$s
";
}
no
warnings
'
redefine
';
no
warnings
(
'
redefine
'
,
'
uninitialized
'
)
;
eval
$s
;
return
$@
?
(
1
,
"
__badExpression__: $@
"
)
:
(
1
);
}
...
...
lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Conf/Tests.pm
View file @
f7df1db2
...
...
@@ -186,13 +186,16 @@ sub tests {
$
Lemonldap::NG::Handler::PSGI::API::
tsv
->
{
sessionStorageModule
};
return
1
if
(
(
$gc
and
$gc
eq
$conf
->
{
globalStorage
}
)
or
$conf
->
{
globalStorage
}
eq
'
Lemonldap::NG::Common::Apache::Session::
SOAP
'
);
or
$conf
->
{
globalStorage
}
=~
/^
Lemonldap::NG::Common::Apache::Session::
/
);
eval
"
use
$conf
->{globalStorage}
";
return
(
-
1
,
"
Unknown package
$conf
->{globalStorage}
"
)
if
(
$@
);
eval
{
tie
%h
,
$conf
->
{
globalStorage
},
undef
,
$conf
->
{
globalStorageOptions
};
tie
%h
,
'
Lemonldap::NG::Common::Apache::Session
',
undef
,
{
%
{
$conf
->
{
globalStorageOptions
}
},
backend
=>
$conf
->
{
globalStorage
}
};
};
return
(
-
1
,
"
Unable to create a session ($@)
"
)
if
(
$@
or
not
tied
(
%h
)
);
...
...
@@ -200,8 +203,11 @@ sub tests {
$h
{
a
}
=
1
;
$id
=
$h
{
_session_id
}
or
return
(
-
1
,
'
No _session_id
'
);
untie
(
%h
);
tie
%h
,
$conf
->
{
globalStorage
},
$id
,
$conf
->
{
globalStorageOptions
};
tie
%h
,
'
Lemonldap::NG::Common::Apache::Session
',
$id
,
{
%
{
$conf
->
{
globalStorageOptions
}
},
backend
=>
$conf
->
{
globalStorage
}
};
};
return
(
-
1
,
"
Unable to insert datas ($@)
"
)
if
(
$@
);
return
(
-
1
,
"
Unable to recover data stored
"
)
...
...
@@ -210,7 +216,7 @@ sub tests {
return
(
-
1
,
"
Unable to delete session ($@)
"
)
if
(
$@
);
return
(
-
1
,
'
All sessions may be lost and you must restart all your Apache servers
'
)
if
(
$conf
->
{
globalStorage
}
ne
$gc
);
)
if
(
$gc
and
$conf
->
{
globalStorage
}
ne
$gc
);
return
1
;
},
...
...
lemonldap-ng-manager/t/10-save-unchanged-conf.t
View file @
f7df1db2
...
...
@@ -21,6 +21,7 @@ sub body {
# Delete lmConf-2.js if exists
eval
{
unlink
$confFiles
->
[
1
];
};
mkdir
'
t/sessions
';
# Try to save an unmodified conf
while
(
my
$body
=
&body
()
)
{
...
...
@@ -48,6 +49,7 @@ while ( my $body = &body() ) {
#print STDERR Dumper($resBody);
count
(
6
);
}
eval
{
unlink
$confFiles
->
[
1
];
};
eval
{
unlink
$confFiles
->
[
1
];
rmdir
'
t/sessions
';
};
done_testing
(
count
()
);
lemonldap-ng-manager/t/12-save-changed-conf.t
View file @
f7df1db2
...
...
@@ -18,6 +18,7 @@ sub body {
# Delete lmConf-2.js if exists
eval
{
unlink
$confFiles
->
[
1
];
};
mkdir
'
t/sessions
';
my
(
$res
,
$resBody
);
ok
(
$res
=
&client
->
_post
(
'
/confs/
',
'
cfgNum=1
',
&body
,
'
application/json
'
),
...
...
@@ -76,6 +77,7 @@ ok( @c2 == 13, '13 keys changed or created in conf 2' )
count
(
5
);
unlink
$confFiles
->
[
1
];
eval
{
rmdir
'
t/sessions
';
};
done_testing
(
count
()
);
sub
changes
{
...
...
lemonldap-ng-manager/t/14-bad-changes-in-conf.t
View file @
f7df1db2
...
...
@@ -24,8 +24,10 @@ ok( $resBody = from_json( $res->[2]->[0] ), "Result body contains JSON text" );
ok
(
$resBody
->
{
result
}
==
0
,
"
JSON response contains
\"
result:0
\"
"
)
or
print
STDERR
Dumper
(
$res
);
ok
(
$resBody
->
{
details
}
->
{
__errors__
}
and
@
{
$resBody
->
{
details
}
->
{
__errors__
}
}
==
1
,
(
$resBody
->
{
details
}
->
{
__errors__
}
and
@
{
$resBody
->
{
details
}
->
{
__errors__
}
}
==
1
),
'
1 error detected
'
)
or
print
STDERR
Dumper
(
$resBody
);
...
...
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