CfgTie

 view release on metacpan or  search on metacpan

CfgTie2.tex  view on Meta::CPAN


@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

@flindex userde, userdel

Not all keys are supported on all systems.

This may transparently use a shadow tie in the future.

@subsubheading When the changes are reflected to /etc/passwd

@cindex When the changes are reflected to /etc/passwd

@subheading FILES

@file{/etc/passwd}
@file{/etc/group}
@file{/etc/shadow}

@flindex passwd, /etc/passwd

@flindex etc, /etc/passwd

@flindex group, /etc/group

@flindex etc, /etc/group

@flindex shadow, /etc/shadow

@flindex etc, /etc/shadow

@subheading SEE ALSO


@menu

* CfgTie-Cfgfile::	
 
* CfgTie-TieAliases::	
  
* CfgTie-TieGeneric::	


* CfgTie-TieGroup::	

* CfgTie-TieHost::	
     
* CfgTie-TieMTab::	


* CfgTie-TieNamed::	

* CfgTie-TieNet::	
      
* CfgTie-TiePh::	


* CfgTie-TieProto::	

* CfgTie-TieRCService::	

* CfgTie-TieRsrc::	


* CfgTie-TieServ::	
 
* CfgTie-TieShadow::	



( run in 3.048 seconds using v1.01-cache-2.11-cpan-364913b4093 )