r4528: merge Fedora spec file fixes
[Samba.git] / examples / LDAP / smbldap-tools / smbldap-usershow.pl
blob173480d76c2742c5eaa59536bec0bf5107e12ee9
1 #!/usr/bin/perl -w
3 # This code was developped by IDEALX (http://IDEALX.org/) and
4 # contributors (their names can be found in the CONTRIBUTORS file).
6 # Copyright (C) 2001-2002 IDEALX
8 # This program is free software; you can redistribute it and/or
9 # modify it under the terms of the GNU General Public License
10 # as published by the Free Software Foundation; either version 2
11 # of the License, or (at your option) any later version.
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software
20 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
21 # USA.
23 # Purpose of smbldap-userdisplay : user (posix,shadow,samba) display
25 use strict;
26 use FindBin;
27 use FindBin qw($RealBin);
28 use lib "$RealBin/";
29 use smbldap_tools;
31 use Getopt::Std;
32 my %Options;
34 my $ok = getopts('?', \%Options);
36 if ( (!$ok) || (@ARGV < 1) || ($Options{'?'}) ) {
37 print "Usage: $0 [-?] username\n";
38 print " -? show this help message\n";
39 exit (1);
42 # Read only first @ARGV
43 my $user = $ARGV[0];
45 my $lines = read_user($user);
46 if (!defined($lines)) {
47 print "$0: user $user doesn't exist\n";
48 exit (1);
51 print "$lines\n";
53 exit(0);
55 ############################################################
57 =head1 NAME
59 smbldap-usershow.pl - Show a user account informations
61 =head1 SYNOPSIS
63 smbldap-usershow.pl login
65 =head1 DESCRIPTION
67 The smbldap-usershow.pl command displays the informations
68 associated with the login. The named user must exist.
70 =cut