3 <TITLE>FS::svc_acct - Object methods for svc_acct records</TITLE>
4 <LINK REV="made" HREF="mailto:none">
13 <LI><A HREF="#NAME">NAME</A>
14 <LI><A HREF="#SYNOPSIS">SYNOPSIS</A>
15 <LI><A HREF="#DESCRIPTION">DESCRIPTION</A>
16 <LI><A HREF="#METHODS">METHODS</A>
17 <LI><A HREF="#VERSION">VERSION</A>
18 <LI><A HREF="#BUGS">BUGS</A>
19 <LI><A HREF="#SEE_ALSO">SEE ALSO</A>
25 <H1><A NAME="NAME">NAME</A></H1>
27 FS::svc_acct - Object methods for svc_acct records
31 <H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
33 <PRE> use FS::svc_acct;
36 <PRE> $record = new FS::svc_acct \%hash;
37 $record = new FS::svc_acct { 'column' => 'value' };
40 <PRE> $error = $record->insert;
43 <PRE> $error = $new_record->replace($old_record);
46 <PRE> $error = $record->delete;
49 <PRE> $error = $record->check;
52 <PRE> $error = $record->suspend;
55 <PRE> $error = $record->unsuspend;
58 <PRE> $error = $record->cancel;
62 <H1><A NAME="DESCRIPTION">DESCRIPTION</A></H1>
64 An FS::svc_acct object represents an account. FS::svc_acct inherits from
65 FS::svc_Common. The following fields are currently supported:
68 <DT><STRONG><A NAME="item_svcnum">svcnum - primary key (assigned automatcially for new accounts)</A></STRONG><DD>
69 <DT><STRONG><A NAME="item_username">username</A></STRONG><DD>
70 <DT><STRONG><A NAME="item__password">_password - generated if blank</A></STRONG><DD>
71 <DT><STRONG><A NAME="item_popnum">popnum - Point of presence (see FS::svc_acct_pop)</A></STRONG><DD>
72 <DT><STRONG><A NAME="item_uid">uid</A></STRONG><DD>
73 <DT><STRONG><A NAME="item_gid">gid</A></STRONG><DD>
74 <DT><STRONG><A NAME="item_finger">finger - GECOS</A></STRONG><DD>
75 <DT><STRONG><A NAME="item_dir">dir - set automatically if blank (and uid is not)</A></STRONG><DD>
76 <DT><STRONG><A NAME="item_shell">shell</A></STRONG><DD>
77 <DT><STRONG><A NAME="item_quota">quota - (unimplementd)</A></STRONG><DD>
78 <DT><STRONG><A NAME="item_slipip">slipip - IP address</A></STRONG><DD>
79 <DT><STRONG><A NAME="item_radius_Radius_Attribute">radius_Radius_Attribute - Radius-Attribute</A></STRONG><DD>
83 <H1><A NAME="METHODS">METHODS</A></H1>
85 <DT><STRONG><A NAME="item_new">new HASHREF</A></STRONG><DD>
87 Creates a new account. To add the account to the database, see <A HREF="#insert">insert</A>.
89 <DT><STRONG><A NAME="item_insert">insert</A></STRONG><DD>
91 Adds this account to the database. If there is an error, returns the error,
92 otherwise returns false.
95 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.
98 If the configuration value (see <A HREF="../FS/Conf.html">FS::Conf</A>) shellmachine exists, and the username, uid, and dir fields are defined,
102 <PRE> useradd -d $dir -m -s $shell -u $uid $username
105 is executed on shellmachine via ssh. This behaviour can be surpressed by
106 setting $FS::svc_acct::nossh_hack true.
108 <DT><STRONG><A NAME="item_delete">delete</A></STRONG><DD>
110 Deletes this account from the database. If there is an error, returns the
111 error, otherwise returns false.
114 The corresponding FS::cust_svc record will be deleted as well.
117 If the configuration value (see <A HREF="../FS/Conf.html">FS::Conf</A>) shellmachine exists, the command:
120 <PRE> userdel $username
123 is executed on shellmachine via ssh. This behaviour can be surpressed by
124 setting $FS::svc_acct::nossh_hack true.
126 <DT><STRONG><A NAME="item_replace">replace OLD_RECORD</A></STRONG><DD>
128 Replaces OLD_RECORD with this one in the database. If there is an error,
129 returns the error, otherwise returns false.
132 If the configuration value (see <A HREF="../FS/Conf.html">FS::Conf</A>) shellmachine exists, and the dir field has changed, the command:
135 <PRE> [ -d $old_dir ] && (
140 find . -depth -print | cpio -pdm $new_dir;
142 chown -R $uid.$gid $new_dir;
147 is executed on shellmachine via ssh. This behaviour can be surpressed by
148 setting $FS::svc_acct::nossh_hack true.
150 <DT><STRONG><A NAME="item_suspend">suspend</A></STRONG><DD>
152 Suspends this account by prefixing *SUSPENDED* to the password. If there is
153 an error, returns the error, otherwise returns false.
156 Called by the suspend method of FS::cust_pkg (see <A HREF="../FS/cust_pkg.html">FS::cust_pkg</A>).
158 <DT><STRONG><A NAME="item_unsuspend">unsuspend</A></STRONG><DD>
160 Unsuspends this account by removing *SUSPENDED* from the password. If there
161 is an error, returns the error, otherwise returns false.
164 Called by the unsuspend method of FS::cust_pkg (see <A HREF="../FS/cust_pkg.html">FS::cust_pkg</A>).
166 <DT><STRONG><A NAME="item_cancel">cancel</A></STRONG><DD>
168 Just returns false (no error) for now.
171 Called by the cancel method of FS::cust_pkg (see <A HREF="../FS/cust_pkg.html">FS::cust_pkg</A>).
173 <DT><STRONG><A NAME="item_check">check</A></STRONG><DD>
175 Checks all fields to make sure this is a valid service. If there is an
176 error, returns the error, otherwise returns false. Called by the insert and
180 Sets any fixed values; see <A HREF="../FS/part_svc.html">FS::part_svc</A>.
185 <H1><A NAME="VERSION">VERSION</A></H1>
187 $Id: svc_acct.html,v 1.2 2000-03-03 18:22:43 ivan Exp $
191 <H1><A NAME="BUGS">BUGS</A></H1>
193 The remote commands should be configurable.
196 The bits which ssh should fork before doing so.
199 The <CODE>$recref</CODE> stuff in sub check should be cleaned up.
203 <H1><A NAME="SEE_ALSO">SEE ALSO</A></H1>
205 <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>,
206 <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.