Index: TMOS-Accounts/bin/la-web-directory
===================================================================
--- /LATMOS-Accounts/bin/la-web-directory	(revision 867)
+++ 	(revision )
@@ -1,177 +1,0 @@
-#!/usr/bin/perl
-
-use strict;
-use warnings;
-use LATMOS::Accounts;
-use Getopt::Long;
-use Pod::Usage;
-use POSIX qw(strftime);
-
-=head1 NAME
-
-    la-web-directory - Generate directory file for website
-
-=head1 SYNOPSIS
-
-    la-web-directory
-
-=cut
-
-GetOptions(
-    'c|config=s'        => \my $config,
-    'b|base=s'          => \my $base,
-    'wo-unexp|no-unexp' => \my $nounexp,
-    'with-unexp'        => \my $unexp,
-    'noexpire'          => \my $noexpire,
-    'filter=s'          => \my @filters,
-    'help'              => sub { pod2usage(0) },
-) or pod2usage();
-
-=head1 OPTIONS
-
-=over 4
-
-=item -c|--config configdir
-
-Use this configuration directory instead of the default one.
-
-=item -b|--base basename
-
-Query this specific base instead of the default one.
-
-=item --with-unexp
-
-Take into account all objects (even non propagated ones, with attribute 'exported'=0)
-
-=item --wo-unexp
-
-Take into account only propagated objects (attribute 'exported'=1) (default)
-
-=item --noexpire
-
-Exclude expired accounts
-
-=cut
-
-
-my $LA = LATMOS::Accounts->new($config, noacl => 1);
-my $labase = $base ? $LA->base($base) : $LA->default_base;
-$labase && $labase->load or die "Cannot load base";
-
-$labase->unexported($unexp ? 1 : 0);
-my %users;
-my $now = strftime('%Y/%m/%d', gmtime);
-my @depts = $labase->search_objects('group', 'sutype=dpmt');
-
-foreach my $user (sort $labase->search_objects('user',
-            @filters ? @filters : 'sn=*')) {
-    my $ouser = $labase->get_object('user', $user) or next;
-    $ouser->get_attributes('sn') or next;
-    if ($noexpire && (my $expdate = $ouser->get_attributes('expireText'))) {
-        if ($now gt $expdate) {
-            next;
-        }
-    }
-
-# On ne prend que le personnel LATMOS et les heberges, sauf Novimet
-
-    my $company = $ouser->get_attributes('company');
-    my $contrat = $ouser->get_attributes('contratType') || '';
-    if ($company){
-        if (($company ne "LATMOS")&&($contrat ne "heberges")) {
-            next;
-        }
-        if ($company eq "Novimet") {
-            next;
-        }
-    } else {
-        if ((!$contrat)||($contrat ne "heberges")) {
-            next;
-        }
-    }
-
-    my @oaddress;
-
-    if ($labase->is_supported_object('address')) {
-        @oaddress =
-            sort { $a->get_attributes('isMainAddress') ? 0 : 1 }
-            grep { $_ } (
-            map { $labase->get_object('address', $_) }
-                $ouser->get_attributes('otheraddress'),
-            );
-    } else {
-        @oaddress = ($ouser);
-    }
-
-    # Si c'est un heberge, on place departement a "EXT"
-
-    my $department;
-
-    if ($contrat eq "heberges") {
-        $department = "EXT";
-    } else {
-        # On recherche les departements en plus de l'attribut "department"
-        # en scrutant l'ensemble des groupes de l'utilisateur
-        my @userdepts;
-        foreach my $gr ($ouser->get_attributes('memberOf')) {
-            grep { $_ eq $gr } (@depts) and push(@userdepts, $gr);
-        } 
-        $department = join(' ', @userdepts);
-    }
-
-    my @fmtaddr;
-    foreach (0, 1) {
-        if ($oaddress[$_]) {
-
-            my $city;
-            if (my $site = $oaddress[$_]->get_attributes('site')) {
-                $city = $labase->get_object('site',
-                    $site)->get_attributes('siteNick');
-            }
-            if (!$city) {
-                $city = $oaddress[$_]->get_attributes('l') || '';
-                $city =~s/Paris */PAR/g;
-                $city =~s/Guyancourt */GUY/g;
-                $city =~s/VÃ©lizy-Villacoublay */VEL/g;
-                $city =~s/VerriÃšres le Buisson */VLB/g;
-                $city =~s/St Maur des FossÃ©s */STM/g;
-            }
-            my $office = $oaddress[$_]->get_attributes('physicalDeliveryOfficeName');
-            push(@fmtaddr, join('-', grep { defined($_) } ($city || '', $office)));
-        }
-    }
-
-    my $line = join('|', map { $_ || '' } (
-            $ouser->get_attributes('sn'),
-            $ouser->get_attributes('givenName'),
-            $department,
-            $fmtaddr[0] || '',
-            $fmtaddr[1] || '',
-            map {
-                my $l = $_ || '';
-                $l =~s/ *([0-9])/$1/g;
-                $l =~s/\(//g;
-                $l =~s/\)//g;
-                $l =~s/\+33//g;
-                $l
-            } (
-                ($oaddress[0] ? $oaddress[0]->get_attributes('telephoneNumber') : ''),
-                ($oaddress[1] ? $oaddress[1]->get_attributes('telephoneNumber') : ''),
-            ),
-            $ouser->get_attributes('mail'),
-            $ouser->get_attributes('nickname'),
-            $ouser->get_attributes('snNative') || '',
-            $ouser->get_attributes('givenNameNative') || '',
-            $ouser->get_attributes('wWWHomePage') || '',
-            $ouser->get_attributes('halReference') || '',
-        ));
-        $line =~s/:1/:01/g;
-
-    $users{$ouser->get_attributes('sn')}{$ouser->get_attributes('givenName')} = $line;
-}
-
-foreach my $sn (sort keys %users) {
-    foreach my $givenName (sort keys %{$users{$sn}}) {
-        print "$users{$sn}{$givenName}\n";
-    }
-}
Index: /LATMOS-Accounts/lib/LATMOS/Accounts.pm
===================================================================
--- /LATMOS-Accounts/lib/LATMOS/Accounts.pm	(revision 867)
+++ /LATMOS-Accounts/lib/LATMOS/Accounts.pm	(revision 868)
@@ -148,5 +148,5 @@
     my ($self, $section) = @_;
     # this method perform a cache
-    $self->_load_base($section);
+    $self->_load_base($section || $self->default_base_name);
 }
 
@@ -171,6 +171,5 @@
 sub default_base {
     my ($self) = @_;
-    my $default = $self->default_base_name or return;
-    $self->base($default);
+    $self->base();
 }
 
