use warnings; use strict; use FindBin; use lib "$FindBin::RealBin/"; use BuagentAuth; my $auth_ok = 0; my $user = <>; chomp($user); my $pass = <>; chomp($pass); my $auth_ref = BuagentAuth::auth($user, $pass); print "auth_ok:" . $auth_ref->{auth_ok} . "\n"; if ($auth_ref->{auth_ok} == 1) { print "uid:" . $auth_ref->{uid} . "\n"; print "gid:" . $auth_ref->{gid} . "\n"; print "dir:home:" . $auth_ref->{homedir} . "\n"; } #### use warnings; use strict; use FindBin; use lib "$FindBin::RealBin/"; use BuagentAuth; my $auth_ok = 0; my $user = <>; chomp($user); my $pass = <>; chomp($pass); my @userdb; open(USERDB, '/etc/r1user') or die "The user doesn't exist: $!"; @userdb = ; my @r1user_ref = 0; my $t; foreach $t (@userdb) { if ($t =~ $user) { $r1user_ref = 1; } } my $auth_ref = BuagentAuth::auth($user, $pass); print "auth_ok:" . $auth_ref->{auth_ok} . "\n"; if ($auth_ref->{auth_ok} ==1) { print "uid:" . $auth_ref->{uid} . "\n"; print "gid:" . $auth_ref->{gid} . "\n"; print "dir:home:" . $auth_ref->{homedir} . "\n"; }