Gantry
view release on metacpan or search on metacpan
lib/Gantry/Control.pm view on Meta::CPAN
my $sth = db_query( $dbh, 'Get users info',
'SELECT id, password, first_name, last_name, email, ',
'active FROM auth_users WHERE user_name = ',
sql_str( $name ) );
my ( $id, $passwd, $first, $last, $email, $active ) = db_next( $sth );
db_finish( $sth );
# act like C's getpwuid
return( $id || 0, $active || 0, $passwd || '', $first || '',
$last || '', $email || '' );
} # END get_pwnam
#-------------------------------------------------
# get_pwuid( $dbh, $uid )
#-------------------------------------------------
sub get_pwuid {
my ( $dbh, $uid ) = @_;
lib/Gantry/Control.pm view on Meta::CPAN
my $sth = db_query( $dbh, 'Get users info',
'SELECT user_name, password, first_name, last_name, ',
'email, active FROM auth_users WHERE id = ',
sql_num( $uid ) );
my ( $uname, $passwd, $first, $last, $email, $active ) = db_next( $sth );
db_finish( $sth );
# act like C's getpwuid
return( $uname || '', $active || 0, $passwd || '', $first || '',
$last || '', $email || '' );
} # END get_pwuid
#-------------------------------------------------
# get_usrgrp( $dbh, $uid )
#-------------------------------------------------
sub get_usrgrp {
my ( $dbh, $uid ) = @_;
lib/Gantry/Control.pm view on Meta::CPAN
=item @user_info = get_pwnam( $dbh, $user_name )
This emulates C's getpwnam save it operates on the database. The return
values are, in this order: Users database id, a boolean for the active
status of the user, the users password ( as kept in the database ), the
users first name, the users last name, and the users email address.
=item @user_info = get_pwuid( $dbh, $user_id )
This emulates C's getpwuid save it operates on the database. The return
values are, in this order: Users username, a boolean for the active
status of the user, the users password ( as kept in the database ), the
users first name, the users last name, and the users email address.
=item $grp = get_usrgrp( $dbh, $uid )
This function takes the database handle and a users id. It returns a
hash reference of group ids to their name that the user is in.
=back
( run in 0.246 second using v1.01-cache-2.11-cpan-8d75d55dd25 )