documentation and webdemo updates
[freeside.git] / htdocs / docs / man / FS / svc_acct.html
index 0f8e5b4..524fe33 100644 (file)
 <HTML>
 <HEAD>
 <TITLE>FS::svc_acct - Object methods for svc_acct records</TITLE>
-<LINK REV="made" HREF="mailto:none">
+<LINK REV="made" HREF="mailto:perl@packages.debian.org">
 </HEAD>
 
 <BODY>
 
+<A NAME="__index__"></A>
 <!-- INDEX BEGIN -->
 
 <UL>
 
-       <LI><A HREF="#NAME">NAME</A>
-       <LI><A HREF="#SYNOPSIS">SYNOPSIS</A>
-       <LI><A HREF="#DESCRIPTION">DESCRIPTION</A>
-       <LI><A HREF="#METHODS">METHODS</A>
-       <LI><A HREF="#VERSION">VERSION</A>
-       <LI><A HREF="#BUGS">BUGS</A>
-       <LI><A HREF="#SEE_ALSO">SEE ALSO</A>
+       <LI><A HREF="#name">NAME</A></LI>
+       <LI><A HREF="#synopsis">SYNOPSIS</A></LI>
+       <LI><A HREF="#description">DESCRIPTION</A></LI>
+       <LI><A HREF="#methods">METHODS</A></LI>
+       <LI><A HREF="#version">VERSION</A></LI>
+       <LI><A HREF="#bugs">BUGS</A></LI>
+       <LI><A HREF="#see also">SEE ALSO</A></LI>
 </UL>
 <!-- INDEX END -->
 
 <HR>
 <P>
-<H1><A NAME="NAME">NAME</A></H1>
-<P>
-FS::svc_acct - Object methods for svc_acct records
-
+<H1><A NAME="name">NAME</A></H1>
+<P>FS::svc_acct - Object methods for svc_acct records</P>
 <P>
 <HR>
-<H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
-<P>
-<PRE>  use FS::svc_acct;
-</PRE>
-<P>
-<PRE>  $record = new FS::svc_acct \%hash;
-  $record = new FS::svc_acct { 'column' =&gt; 'value' };
-</PRE>
-<P>
-<PRE>  $error = $record-&gt;insert;
-</PRE>
-<P>
-<PRE>  $error = $new_record-&gt;replace($old_record);
-</PRE>
-<P>
-<PRE>  $error = $record-&gt;delete;
-</PRE>
-<P>
-<PRE>  $error = $record-&gt;check;
-</PRE>
-<P>
-<PRE>  $error = $record-&gt;suspend;
-</PRE>
-<P>
-<PRE>  $error = $record-&gt;unsuspend;
-</PRE>
-<P>
-<PRE>  $error = $record-&gt;cancel;
-</PRE>
+<H1><A NAME="synopsis">SYNOPSIS</A></H1>
+<PRE>
+  use FS::svc_acct;</PRE>
+<PRE>
+  $record = new FS::svc_acct \%hash;
+  $record = new FS::svc_acct { 'column' =&gt; 'value' };</PRE>
+<PRE>
+  $error = $record-&gt;insert;</PRE>
+<PRE>
+  $error = $new_record-&gt;replace($old_record);</PRE>
+<PRE>
+  $error = $record-&gt;delete;</PRE>
+<PRE>
+  $error = $record-&gt;check;</PRE>
+<PRE>
+  $error = $record-&gt;suspend;</PRE>
+<PRE>
+  $error = $record-&gt;unsuspend;</PRE>
+<PRE>
+  $error = $record-&gt;cancel;</PRE>
+<PRE>
+  %hash = $record-&gt;radius;</PRE>
 <P>
 <HR>
-<H1><A NAME="DESCRIPTION">DESCRIPTION</A></H1>
-<P>
-An FS::svc_acct object represents an account. FS::svc_acct inherits from
-FS::svc_Common. The following fields are currently supported:
-
+<H1><A NAME="description">DESCRIPTION</A></H1>
+<P>An FS::svc_acct object represents an account.  FS::svc_acct inherits from
+FS::svc_Common.  The following fields are currently supported:</P>
 <DL>
-<DT><STRONG><A NAME="item_svcnum">svcnum - primary key (assigned automatcially for new accounts)</A></STRONG><DD>
-<DT><STRONG><A NAME="item_username">username</A></STRONG><DD>
-<DT><STRONG><A NAME="item__password">_password - generated if blank</A></STRONG><DD>
-<DT><STRONG><A NAME="item_popnum">popnum - Point of presence (see FS::svc_acct_pop)</A></STRONG><DD>
-<DT><STRONG><A NAME="item_uid">uid</A></STRONG><DD>
-<DT><STRONG><A NAME="item_gid">gid</A></STRONG><DD>
-<DT><STRONG><A NAME="item_finger">finger - GECOS</A></STRONG><DD>
-<DT><STRONG><A NAME="item_dir">dir - set automatically if blank (and uid is not)</A></STRONG><DD>
-<DT><STRONG><A NAME="item_shell">shell</A></STRONG><DD>
-<DT><STRONG><A NAME="item_quota">quota - (unimplementd)</A></STRONG><DD>
-<DT><STRONG><A NAME="item_slipip">slipip - IP address</A></STRONG><DD>
-<DT><STRONG><A NAME="item_radius_Radius_Attribute">radius_Radius_Attribute - Radius-Attribute</A></STRONG><DD>
+<DT><STRONG><A NAME="item_key">svcnum - primary key (assigned automatcially for new accounts)</A></STRONG><BR>
+<DD>
+<DT><STRONG><A NAME="item_username">username</A></STRONG><BR>
+<DD>
+<DT><STRONG><A NAME="item__password_%2D_generated_if_blank">_password - generated if blank</A></STRONG><BR>
+<DD>
+<DT><STRONG><A NAME="item_presence">popnum - Point of presence (see <A HREF=".././FS/svc_acct_pop.html">the FS::svc_acct_pop manpage</A>)</A></STRONG><BR>
+<DD>
+<DT><STRONG><A NAME="item_uid">uid</A></STRONG><BR>
+<DD>
+<DT><STRONG><A NAME="item_gid">gid</A></STRONG><BR>
+<DD>
+<DT><STRONG><A NAME="item_finger_%2D_GECOS">finger - GECOS</A></STRONG><BR>
+<DD>
+<DT><STRONG><A NAME="item_blank">dir - set automatically if blank (and uid is not)</A></STRONG><BR>
+<DD>
+<DT><STRONG><A NAME="item_shell">shell</A></STRONG><BR>
+<DD>
+<DT><STRONG><A NAME="item_quota_%2D_%28unimplementd%29">quota - (unimplementd)</A></STRONG><BR>
+<DD>
+<DT><STRONG><A NAME="item_slipip_%2D_IP_address">slipip - IP address</A></STRONG><BR>
+<DD>
+<DT><STRONG><A NAME="item_radius_Radius_Attribute_%2D_Radius%2DAttribute">radius_<EM>Radius_Attribute</EM> - <EM>Radius-Attribute</EM></A></STRONG><BR>
+<DD>
 </DL>
 <P>
 <HR>
-<H1><A NAME="METHODS">METHODS</A></H1>
+<H1><A NAME="methods">METHODS</A></H1>
 <DL>
-<DT><STRONG><A NAME="item_new">new HASHREF</A></STRONG><DD>
-<P>
-Creates a new account. To add the account to the database, see <A HREF="#insert">insert</A>.
-
-<DT><STRONG><A NAME="item_insert">insert</A></STRONG><DD>
-<P>
-Adds this account to the database. If there is an error, returns the error,
+<DT><STRONG><A NAME="item_new">new HASHREF</A></STRONG><BR>
+<DD>
+Creates a new account.  To add the account to the database, see <A HREF="#insert">insert</A>.
+<P></P>
+<DT><STRONG><A NAME="item_insert">insert</A></STRONG><BR>
+<DD>
+Adds this account to the database.  If there is an error, returns the error,
 otherwise returns false.
-
-<P>
-The additional fields pkgnum and svcpart (see <A HREF="../FS/cust_svc.html">FS::cust_svc</A>) should be defined. An FS::cust_svc record will be created and inserted.
-
-<P>
-If the configuration value (see <A HREF="../FS/Conf.html">FS::Conf</A>) shellmachine exists, and the username, uid, and dir fields are defined,
-the command
-
-<P>
-<PRE>  useradd -d $dir -m -s $shell -u $uid $username
-</PRE>
-<P>
-is executed on shellmachine via ssh. This behaviour can be surpressed by
-setting $FS::svc_acct::nossh_hack true.
-
-<DT><STRONG><A NAME="item_delete">delete</A></STRONG><DD>
-<P>
-Deletes this account from the database. If there is an error, returns the
+<P>The additional fields pkgnum and svcpart (see <A HREF=".././FS/cust_svc.html">the FS::cust_svc manpage</A>) should be 
+defined.  An FS::cust_svc record will be created and inserted.</P>
+<P>If the configuration value (see <A HREF=".././FS/Conf.html">the FS::Conf manpage</A>) shellmachine exists, and the 
+username, uid, and dir fields are defined, the <CODE>command(s)</CODE> specified in
+the shellmachine-useradd configuration are exectued on shellmachine via ssh.
+This behaviour can be surpressed by setting $FS::svc_acct::nossh_hack true.
+If the shellmachine-useradd configuration file does not exist,</P>
+<PRE>
+  useradd -d $dir -m -s $shell -u $uid $username</PRE>
+<P>is the default.  If the shellmachine-useradd configuration file exists but
+it empty,</P>
+<PRE>
+  cp -pr /etc/skel $dir; chown -R $uid.$gid $dir</PRE>
+<P>is the default instead.  Otherwise the contents of the file are treated as
+a double-quoted perl string, with the following variables available:
+$username, $uid, $gid, $dir, and $shell.</P>
+<P></P>
+<DT><STRONG><A NAME="item_delete">delete</A></STRONG><BR>
+<DD>
+Deletes this account from the database.  If there is an error, returns the
 error, otherwise returns false.
-
-<P>
-The corresponding FS::cust_svc record will be deleted as well.
-
-<P>
-If the configuration value (see <A HREF="../FS/Conf.html">FS::Conf</A>) shellmachine exists, the command:
-
-<P>
-<PRE>  userdel $username
-</PRE>
-<P>
-is executed on shellmachine via ssh. This behaviour can be surpressed by
-setting $FS::svc_acct::nossh_hack true.
-
-<DT><STRONG><A NAME="item_replace">replace OLD_RECORD</A></STRONG><DD>
-<P>
-Replaces OLD_RECORD with this one in the database. If there is an error,
+<P>The corresponding FS::cust_svc record will be deleted as well.</P>
+<P>If the configuration value (see <A HREF=".././FS/Conf.html">the FS::Conf manpage</A>) shellmachine exists, the
+<CODE>command(s)</CODE> specified in the shellmachine-userdel configuration file are
+executed on shellmachine via ssh.  This behavior can be surpressed by setting
+$FS::svc_acct::nossh_hack true.  If the shellmachine-userdel configuration
+file does not exist,</P>
+<PRE>
+  userdel $username</PRE>
+<P>is the default.  If the shellmachine-userdel configuration file exists but
+is empty,</P>
+<PRE>
+  rm -rf $dir</PRE>
+<P>is the default instead.  Otherwise the contents of the file are treated as a
+double-quoted perl string, with the following variables available:
+$username and $dir.</P>
+<P></P>
+<DT><STRONG><A NAME="item_replace_OLD_RECORD">replace OLD_RECORD</A></STRONG><BR>
+<DD>
+Replaces OLD_RECORD with this one in the database.  If there is an error,
 returns the error, otherwise returns false.
-
-<P>
-If the configuration value (see <A HREF="../FS/Conf.html">FS::Conf</A>) shellmachine exists, and the dir field has changed, the command:
-
-<P>
-<PRE>  [ -d $old_dir ] &amp;&amp; (
+<P>If the configuration value (see <A HREF=".././FS/Conf.html">the FS::Conf manpage</A>) shellmachine exists, and the 
+dir field has changed, the <CODE>command(s)</CODE> specified in the shellmachine-usermod
+configuraiton file are executed on shellmachine via ssh.  This behavior can
+be surpressed by setting $FS::svc-acct::nossh_hack true.  If the
+shellmachine-userdel configuration file does not exist or is empty, :</P>
+<PRE>
+  [ -d $old_dir ] &amp;&amp; mv $old_dir $new_dir || (
     chmod u+t $old_dir;
-    umask 022;
     mkdir $new_dir;
     cd $old_dir;
     find . -depth -print | cpio -pdm $new_dir;
     chmod u-t $new_dir;
     chown -R $uid.$gid $new_dir;
     rm -rf $old_dir
-  )
-</PRE>
-<P>
-is executed on shellmachine via ssh. This behaviour can be surpressed by
-setting $FS::svc_acct::nossh_hack true.
-
-<DT><STRONG><A NAME="item_suspend">suspend</A></STRONG><DD>
-<P>
-Suspends this account by prefixing *SUSPENDED* to the password. If there is
+  )</PRE>
+<P>is executed on shellmachine via ssh.  This behaviour can be surpressed by
+setting $FS::svc_acct::nossh_hack true.</P>
+<P></P>
+<DT><STRONG><A NAME="item_suspend">suspend</A></STRONG><BR>
+<DD>
+Suspends this account by prefixing *SUSPENDED* to the password.  If there is an
+error, returns the error, otherwise returns false.
+<P>Called by the suspend method of FS::cust_pkg (see <A HREF=".././FS/cust_pkg.html">the FS::cust_pkg manpage</A>).</P>
+<P></P>
+<DT><STRONG><A NAME="item_unsuspend">unsuspend</A></STRONG><BR>
+<DD>
+Unsuspends this account by removing *SUSPENDED* from the password.  If there is
 an error, returns the error, otherwise returns false.
-
-<P>
-Called by the suspend method of FS::cust_pkg (see <A HREF="../FS/cust_pkg.html">FS::cust_pkg</A>).
-
-<DT><STRONG><A NAME="item_unsuspend">unsuspend</A></STRONG><DD>
-<P>
-Unsuspends this account by removing *SUSPENDED* from the password. If there
-is an error, returns the error, otherwise returns false.
-
-<P>
-Called by the unsuspend method of FS::cust_pkg (see <A HREF="../FS/cust_pkg.html">FS::cust_pkg</A>).
-
-<DT><STRONG><A NAME="item_cancel">cancel</A></STRONG><DD>
-<P>
+<P>Called by the unsuspend method of FS::cust_pkg (see <A HREF=".././FS/cust_pkg.html">the FS::cust_pkg manpage</A>).</P>
+<P></P>
+<DT><STRONG><A NAME="item_cancel">cancel</A></STRONG><BR>
+<DD>
 Just returns false (no error) for now.
-
-<P>
-Called by the cancel method of FS::cust_pkg (see <A HREF="../FS/cust_pkg.html">FS::cust_pkg</A>).
-
-<DT><STRONG><A NAME="item_check">check</A></STRONG><DD>
-<P>
-Checks all fields to make sure this is a valid service. If there is an
-error, returns the error, otherwise returns false. Called by the insert and
-replace methods.
-
-<P>
-Sets any fixed values; see <A HREF="../FS/part_svc.html">FS::part_svc</A>.
-
-</DL>
+<P>Called by the cancel method of FS::cust_pkg (see <A HREF=".././FS/cust_pkg.html">the FS::cust_pkg manpage</A>).</P>
+<P></P>
+<DT><STRONG><A NAME="item_check">check</A></STRONG><BR>
+<DD>
+Checks all fields to make sure this is a valid service.  If there is an error,
+returns the error, otherwise returns false.  Called by the insert and replace
+methods.
+<P>Sets any fixed values; see <A HREF=".././FS/part_svc.html">the FS::part_svc manpage</A>.</P>
+<P></P>
+<DT><STRONG><A NAME="item_radius">radius</A></STRONG><BR>
+<DD>
+Depriciated, use radius_reply instead.
+<P></P>
+<DT><STRONG><A NAME="item_radius_reply">radius_reply</A></STRONG><BR>
+<DD>
+Returns key/value pairs, suitable for assigning to a hash, for any RADIUS
+reply attributes of this record.
+<P>Note that this is now the preferred method for reading RADIUS attributes - 
+accessing the columns directly is discouraged, as the column names are
+expected to change in the future.</P>
+<P></P>
+<DT><STRONG><A NAME="item_radius_check">radius_check</A></STRONG><BR>
+<DD>
+Returns key/value pairs, suitable for assigning to a hash, for any RADIUS
+check attributes of this record.
+<P>Accessing RADIUS attributes directly is not supported and will break in the
+future.</P>
+<P></P></DL>
 <P>
 <HR>
-<H1><A NAME="VERSION">VERSION</A></H1>
-<P>
-$Id: svc_acct.html,v 1.2 2000-03-03 18:22:43 ivan Exp $
-
+<H1><A NAME="version">VERSION</A></H1>
+<P>$Id: svc_acct.html,v 1.3 2001-04-23 12:40:31 ivan Exp $</P>
 <P>
 <HR>
-<H1><A NAME="BUGS">BUGS</A></H1>
-<P>
-The remote commands should be configurable.
-
-<P>
-The bits which ssh should fork before doing so.
-
-<P>
-The <CODE>$recref</CODE> stuff in sub check should be cleaned up.
-
+<H1><A NAME="bugs">BUGS</A></H1>
+<P>The bits which ssh should fork before doing so (or maybe queue jobs for a
+daemon).</P>
+<P>The $recref stuff in sub check should be cleaned up.</P>
+<P>The suspend, unsuspend and cancel methods update the database, but not the
+current object.  This is probably a bug as it's unexpected and
+counterintuitive.</P>
 <P>
 <HR>
-<H1><A NAME="SEE_ALSO">SEE ALSO</A></H1>
-<P>
-<A HREF="../FS/svc_Common.html">FS::svc_Common</A>, <A HREF="../FS/Record.html">FS::Record</A>, <A HREF="../FS/Conf.html">FS::Conf</A>, <A HREF="../FS/cust_svc.html">FS::cust_svc</A>,
-<A HREF="../FS/part_svc.html">FS::part_svc</A>, <A HREF="../FS/cust_pkg.html">FS::cust_pkg</A>, <A HREF="../FS/SSH.html">FS::SSH</A>, <EM>ssh</EM>, <A HREF="../FS/svc_acct_pop.html">FS::svc_acct_pop</A>, schema.html from the base documentation.
+<H1><A NAME="see also">SEE ALSO</A></H1>
+<P><A HREF=".././FS/svc_Common.html">the FS::svc_Common manpage</A>, <A HREF=".././FS/Record.html">the FS::Record manpage</A>, <A HREF=".././FS/Conf.html">the FS::Conf manpage</A>, <A HREF=".././FS/cust_svc.html">the FS::cust_svc manpage</A>,
+<A HREF=".././FS/part_svc.html">the FS::part_svc manpage</A>, <A HREF=".././FS/cust_pkg.html">the FS::cust_pkg manpage</A>, <A HREF="../Net/SSH.html">the Net::SSH manpage</A>, <EM>ssh</EM>, <A HREF=".././FS/svc_acct_pop.html">the FS::svc_acct_pop manpage</A>,
+schema.html from the base documentation.</P>
 
 </BODY>