CfgTie
view release on metacpan or search on metacpan
CfgTie2.tex view on Meta::CPAN
@item @code{Priority}
@vindex @code{Priority}
The scheduling priority for that user.
(Note: this requires that @code{BSD::Resource} be installed.)
@item @code{Quota}
@vindex @code{Quota}
@item @code{RUsage}
@vindex @code{RUsage}
The process resource consumption by the user.
Note: This requires that @code{BSD::Resource} be installed.
Returns a list reference of the form:
@example
[$usertime, $systemtime, $maxrss, $ixrss, $idrss, $isrss, $minflt,
$majflt, $nswap, $inblock, $oublock, $msgsnd, $msgrcv, $nsignals,
$nvcsw, $nivcsw]
@end example
@end table
Plus two (probably) obsolete fields:
@table @asis
@item @code{Password}
@vindex @code{Password}
This is the encrypted password, but will probably be obsolete.
@item @code{GCOS}
@vindex @code{GCOS}
@emph{General Electric Comprehensive Operating System} or
@emph{General Comprehensive Operating System}
field
This is now the user's full name under many Unix's, incl. Linux.
@end table
Each of these entries can be modified (even deleted), and they will be
reflected in the overall system. Additionally, the programmer can set any
other associated key, but this information will only be available to the
running Perl script.
@subsubheading Configuration Variables
@cindex Configuration Variables
@subsubheading Additional Routines
@cindex Additional Routines
@table @asis
@item @code{&CfgTie::TieUser'stat()}
@findex @code{&CfgTie::TieUser'stat()}
@item @code{&CfgTie::TieUser_id'stat()}
@findex @code{&CfgTie::TieUser_id'stat()}
Will return @code{stat}-like statistics information on the user database.
@end table
@subsubheading Adding or overiding methods for user records
@cindex Adding or overiding methods for user records
Lets say you wanted to change the default HTML handling to a different method.
To do this you need only include code like the following:
@example
package CfgTie::TieUser_rec;
sub HTML($)
@{
my $self=shift;
"<h1>".$Self->@{name@}."</h1>\n".
"<table border=0><tr><th align=right>\n".
join("</td></tr>\n<tr><th align=right>",
map @{$_."</th><td>".$self->@{$_@}@} (sort keys %@{$self@})
</td></tr><lt></table>C<\n>";
@}
@end example
If, instead, you wanted to add your own keys to the user records,
@code{CfgTie::TieUser::add_scalar(}@emph{$Name},@emph{$Package}@code{)}
Lets you add scalar keys to user records. The @emph{Name} specifies the key name
to be used; it will be made case-insensitve. The @emph{Package} specifies the name
of the package to be used when tie'ing the key to a value. (The @code{TIESCALAR}
is passed the user id as a parameter).
@code{CfgTie::TieUser::add_hash(}@emph{$Name},@emph{$Package}@code{)}
Lets you add hash keys to user records. The @emph{Name} specifies the key name
to be used; it will be made case insensitve. The @emph{Package} specifies the name
of the package to be used when tie'ing the key to a value. (The @code{TIEHASH}
is passed the user id as a parameter).
@subsubheading Miscellaneous
@cindex Miscellaneous
@code{$CfgTie::TieUser_rec'usermod} contains the path to the program @file{usermod}.
This can be modified as required.
@flindex usermod, usermod
@flindex usermo, usermod
@code{$CfgTie::TieUser_rec'useradd} contains the path to the program @file{useradd}.
This can be modified as required.
@flindex useradd, useradd
@flindex userad, useradd
@code{$CfgTie::TieUser_rec'userdel} contains the path to the program @file{userdel}.
This can be modified as required.
@flindex userdel, userdel
( run in 3.989 seconds using v1.01-cache-2.11-cpan-364913b4093 )