Modify test & cookieExpiration value type (#1485)
This commit is contained in:
parent
7d67e6225d
commit
9c5997486f
|
@ -887,7 +887,7 @@ qr/(?:(?:https?):\/\/(?:(?:(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.]
|
|||
'type' => 'select'
|
||||
},
|
||||
'cookieExpiration' => {
|
||||
'type' => 'text'
|
||||
'type' => 'int'
|
||||
},
|
||||
'cookieName' => {
|
||||
'default' => 'lemonldap',
|
||||
|
|
|
@ -743,7 +743,7 @@ sub attributes {
|
|||
|
||||
# Cookies
|
||||
cookieExpiration => {
|
||||
type => 'text',
|
||||
type => 'int',
|
||||
documentation => 'Cookie expiration',
|
||||
flags => 'hp',
|
||||
},
|
||||
|
|
|
@ -253,14 +253,11 @@ sub tests {
|
|||
# Warn if cookie TTL is equal or lower than one hour
|
||||
cookieTTL => sub {
|
||||
return 1 unless ( defined $conf->{cookieExpiration} );
|
||||
if ( $conf->{cookieExpiration} =~ /^(\d+)s?$/ ) {
|
||||
return ( 1, "Cookie TTL should be higher than one hour" )
|
||||
unless ( $1 > 3600 );
|
||||
}
|
||||
if ( $conf->{cookieExpiration} =~ /^(\d+)m$/ ) {
|
||||
return ( 1, "Cookie TTL should be higher than one hour" )
|
||||
unless ( $1 > 60 );
|
||||
}
|
||||
return ( 0, "Cookie TTL must be higher than one minute" )
|
||||
unless ( $conf->{cookieExpiration} > 60 );
|
||||
return ( 1, "Cookie TTL should be higher or equal than one hour" )
|
||||
unless ( $conf->{cookieExpiration} >= 3600
|
||||
|| $conf->{cookieExpiration} == 0 );
|
||||
|
||||
# Return
|
||||
return 1;
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user