[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [cobalt-users] Perl to check whether a user is administrator



<snip>
> On Sun, 4 Aug 2002, Zhang Shiping wrote:
> 
> > Hi all,
> >
> > In RaQ4 a site can have many users and one of the user
> > can be the site administrator. I Perl script how to
> > check whether a user is or is not the administrator
> > for a site?
> >
> 
> Parse the /etc/passwd file.
</snip>

Not sure how that'd work to find a site admin!!

Use this perl code, direct port from part of the Cobalt GUI for the RaQ3, i'm assuing compatibility with RaQ4:

require Cobalt::User;
import Cobalt::User qw(user_authok);

$check=user_authok("USERNAME","site-adm");
print "The status for this user is $check";

$check will return 1 for a site admin, or 0 for not a site admin!


Regards,

Andy
andy@xxxxxxxxxx
http://www.raqpak.com/ <-- Raq/Qube unofficial PKGs and support advice