]> git.proxmox.com Git - pmg-api.git/commitdiff
LDAPCache.pm: fix argument passing
authorDietmar Maurer <dietmar@proxmox.com>
Tue, 14 Feb 2017 16:15:32 +0000 (17:15 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Tue, 14 Feb 2017 16:15:32 +0000 (17:15 +0100)
PMG/LDAPCache.pm

index 5bc60dfbe5da2795db61fbcf4869b458d822ca14..0f8ca0002e9521ed77f604493f50b7a07cfcea4a 100755 (executable)
@@ -36,16 +36,14 @@ my $ldapcache = {};
 my @dbs = ('users', 'dnames', 'groups', 'mails', 'accounts', 'memberof');
 
 sub new {
-    my ($self) = @_;
+    my ($self, %args) = @_;
 
     my $type   = ref($self) || $self;
 
-    my %args = @_;
-
-    die "undefine ldap id" if !$args{id};
+    die "undefined ldap id" if !$args{id};
 
     my $id = $args{id};
-    $id =~ s/^server_//;
+    $id =~ s/^ldap_//;
 
     if ($ldapcache->{$id}) {
        $self = $ldapcache->{$id};
@@ -110,7 +108,7 @@ sub lockdir {
 sub delete {
     my ($class, $id) = @_;
 
-    $id =~ s/^server_//;
+    $id =~ s/^ldap_//;
 
     if (my $lock = lockdir($id)) {
        delete $ldapcache->{$id};