From c3346131a0d3963786861ea7add9bf9627a3016a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Oudot?= Date: Thu, 25 Feb 2016 10:38:36 +0000 Subject: [PATCH] zimbraUrl and zimbraSsoUrl are not standard URLs (#943) --- .../lib/Lemonldap/NG/Manager/Attributes.pm | 36 +++++++++---------- .../Lemonldap/NG/Manager/Build/Attributes.pm | 4 +-- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Attributes.pm b/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Attributes.pm index 5883971b4..dd6cc2407 100644 --- a/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Attributes.pm +++ b/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Attributes.pm @@ -30,12 +30,12 @@ sub types { 'basic', 'unicode2iso', 'iso2unicode', 'groupMatch' ); - push @cf, defined $conf->{'customFunctions'} + push @cf, defined $$conf{'customFunctions'} ? map( { my $f = $_; $f =~ s/\w+:://g; $f, $_; - } split( /\s+/, $conf->{'customFunctions'}, 0 ) ) + } split( /\s+/, $$conf{'customFunctions'}, 0 ) ) : (); foreach my $f (@cf) { $s = "sub $f {1} $s"; @@ -79,8 +79,8 @@ qr/^(?:(?:(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][-a- 'form' => 'text', 'test' => sub { my ( $val, $conf ) = @_; - if ( defined $conf->{'exportedVars'}{$val} - or defined $conf->{'macros'}{$val} ) + if ( defined $$conf{'exportedVars'}{$val} + or defined $$conf{'macros'}{$val} ) { return 1; } @@ -210,7 +210,7 @@ qr/^(?:(?:\-+\s*BEGIN\s+(?:PUBLIC\s+KEY|CERTIFICATE)\s*\-+\r?\n)?[a-zA-Z0-9\/\+\ 'test' => sub { my $test = grep( { $_ eq $_[0]; } - map( { $_->{'k'}; } @{ $_[2]{'select'}; } ) ); + map( { $$_{'k'}; } @{ $_[2]{'select'}; } ) ); return $test ? 1 : ( 0, "Invalid value '$_[0]' for this select" ); @@ -840,12 +840,12 @@ qr/^(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][-a-zA-Z0- 'basic', 'unicode2iso', 'iso2unicode', 'groupMatch' ); - push @cf, defined $conf->{'customFunctions'} + push @cf, defined $$conf{'customFunctions'} ? map( { my $f = $_; $f =~ s/\w+:://g; $f, $_; - } split( /\s+/, $conf->{'customFunctions'}, 0 ) ) + } split( /\s+/, $$conf{'customFunctions'}, 0 ) ) : (); foreach my $f (@cf) { $s = "sub $f {1} $s"; @@ -869,12 +869,12 @@ qr/^(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][-a-zA-Z0- 'basic', 'unicode2iso', 'iso2unicode', 'groupMatch' ); - push @cf, defined $conf->{'customFunctions'} + push @cf, defined $$conf{'customFunctions'} ? map( { my $f = $_; $f =~ s/\w+:://g; $f, $_; - } split( /\s+/, $conf->{'customFunctions'}, 0 ) ) + } split( /\s+/, $$conf{'customFunctions'}, 0 ) ) : (); foreach my $f (@cf) { $s = "sub $f {1} $s"; @@ -1075,7 +1075,7 @@ qr/^(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][-a-zA-Z0- 'default' => 'ldap://localhost', 'test' => sub { my $l = shift(); - my @s = split( /[\s,]+/, $l, 0 ); + my (@s) = split( /[\s,]+/, $l, 0 ); foreach my $s (@s) { return 0, qq[Bad ldap uri "$s"] unless $s =~ @@ -1147,12 +1147,12 @@ qr/^(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][-a-zA-Z0- 'basic', 'unicode2iso', 'iso2unicode', 'groupMatch' ); - push @cf, defined $conf->{'customFunctions'} + push @cf, defined $$conf{'customFunctions'} ? map( { my $f = $_; $f =~ s/\w+:://g; $f, $_; - } split( /\s+/, $conf->{'customFunctions'}, 0 ) ) + } split( /\s+/, $$conf{'customFunctions'}, 0 ) ) : (); foreach my $f (@cf) { $s = "sub $f {1} $s"; @@ -1183,12 +1183,12 @@ qr/^(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][-a-zA-Z0- 'basic', 'unicode2iso', 'iso2unicode', 'groupMatch' ); - push @cf, defined $conf->{'customFunctions'} + push @cf, defined $$conf{'customFunctions'} ? map( { my $f = $_; $f =~ s/\w+:://g; $f, $_; - } split( /\s+/, $conf->{'customFunctions'}, 0 ) ) + } split( /\s+/, $$conf{'customFunctions'}, 0 ) ) : (); foreach my $f (@cf) { $s = "sub $f {1} $s"; @@ -1798,12 +1798,12 @@ qr/^(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][-a-zA-Z0- 'basic', 'unicode2iso', 'iso2unicode', 'groupMatch' ); - push @cf, defined $conf->{'customFunctions'} + push @cf, defined $$conf{'customFunctions'} ? map( { my $f = $_; $f =~ s/\w+:://g; $f, $_; - } split( /\s+/, $conf->{'customFunctions'}, 0 ) ) + } split( /\s+/, $$conf{'customFunctions'}, 0 ) ) : (); foreach my $f (@cf) { $s = "sub $f {1} $s"; @@ -2778,10 +2778,10 @@ qr/(?:(?:https?):\/\/(?:(?:(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.] 'type' => 'text' }, 'zimbraSsoUrl' => { - 'type' => 'url' + 'type' => 'text' }, 'zimbraUrl' => { - 'type' => 'url' + 'type' => 'text' } }; } diff --git a/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Build/Attributes.pm b/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Build/Attributes.pm index 9490f7562..9aba147bd 100644 --- a/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Build/Attributes.pm +++ b/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Build/Attributes.pm @@ -1054,8 +1054,8 @@ sub attributes { ], default => '', }, - zimbraUrl => { type => 'url', }, - zimbraSsoUrl => { type => 'url', }, + zimbraUrl => { type => 'text', }, + zimbraSsoUrl => { type => 'text', }, # Sympa sympaSecret => { type => 'text', },