ispman/bin ispman.userInfo,1.4,1.5
Pedro Algarvio <[email protected]> Mon, 02 Oct 2006 19:36:59 +0000
| Newsgroups | gmane.comp.isp.ispman.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/ispman/ispman/bin
In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv31093/bin
Modified Files:
ispman.userInfo
Log Message:
Now consistent with most cli tools. GetOpt was removed, un-necessary.
Index: ispman.userInfo
===================================================================
RCS file: /cvsroot/ispman/ispman/bin/ispman.userInfo,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- ispman.userInfo 30 May 2004 23:35:32 -0000 1.4
+++ ispman.userInfo 2 Oct 2006 19:36:56 -0000 1.5
@@ -3,10 +3,8 @@
use FindBin;
unshift @INC,
( $FindBin::Bin, "$FindBin::Bin/../lib", "$FindBin::Bin/../conf" );
- use Getopt::Std;
- getopt( 'du', \%opts );
- unless ( $opts{'d'} && $opts{'u'} ) {
- print "Usage: $FindBin::Script -d domain -u username \n";
+ unless ( $ARGV[0] && $ARGV[0] =~ m/\w+@\w+\..*/ ) {
+ print "Usage: $FindBin::Script user\@domain.tld\n";
exit;
}
}
@@ -15,7 +13,13 @@
my $ispman = ISPMan->new();
-my $dn = $ispman->getUserDN( $opts{'d'}, $opts{'u'} );
+( $user, $domain ) = split( '@', $ARGV[0] );
+$ispmanDomain = $domain;
+
+$domain =~ s/\./_/g;
+$uid = join '_', ( $user, $domain );
+
+my $dn = $ispman->getUserDN( $ispmanDomain, $uid );
my $entry = $ispman->getEntry($dn);
$ispman->dumpEntry($entry);
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV