2 FS::svc_acct - Object methods for svc_acct records
7 $record = new FS::svc_acct \%hash;
8 $record = new FS::svc_acct { 'column' => 'value' };
10 $error = $record->insert;
12 $error = $new_record->replace($old_record);
14 $error = $record->delete;
16 $error = $record->check;
18 $error = $record->suspend;
20 $error = $record->unsuspend;
22 $error = $record->cancel;
25 An FS::svc_acct object represents an account. FS::svc_acct
26 inherits from FS::svc_Common. The following fields are currently
29 svcnum - primary key (assigned automatcially for new accounts)
31 _password - generated if blank
32 popnum - Point of presence (see the FS::svc_acct_pop manpage)
36 dir - set automatically if blank (and uid is not)
38 quota - (unimplementd)
40 radius_*Radius_Attribute* - *Radius-Attribute*
43 Creates a new account. To add the account to the database,
44 see the section on "insert".
47 Adds this account to the database. If there is an error,
48 returns the error, otherwise returns false.
50 The additional fields pkgnum and svcpart (see the
51 FS::cust_svc manpage) should be defined. An FS::cust_svc
52 record will be created and inserted.
54 If the configuration value (see the FS::Conf manpage)
55 shellmachine exists, and the username, uid, and dir fields
56 are defined, the command
58 useradd -d $dir -m -s $shell -u $uid $username
60 is executed on shellmachine via ssh. This behaviour can be
61 surpressed by setting $FS::svc_acct::nossh_hack true.
64 Deletes this account from the database. If there is an
65 error, returns the error, otherwise returns false.
67 The corresponding FS::cust_svc record will be deleted as
70 If the configuration value (see the FS::Conf manpage)
71 shellmachine exists, the command:
75 is executed on shellmachine via ssh. This behaviour can be
76 surpressed by setting $FS::svc_acct::nossh_hack true.
79 Replaces OLD_RECORD with this one in the database. If there
80 is an error, returns the error, otherwise returns false.
82 If the configuration value (see the FS::Conf manpage)
83 shellmachine exists, and the dir field has changed, the
91 find . -depth -print | cpio -pdm $new_dir;
93 chown -R $uid.$gid $new_dir;
97 is executed on shellmachine via ssh. This behaviour can be
98 surpressed by setting $FS::svc_acct::nossh_hack true.
101 Suspends this account by prefixing *SUSPENDED* to the
102 password. If there is an error, returns the error, otherwise
105 Called by the suspend method of FS::cust_pkg (see the
106 FS::cust_pkg manpage).
109 Unsuspends this account by removing *SUSPENDED* from the
110 password. If there is an error, returns the error, otherwise
113 Called by the unsuspend method of FS::cust_pkg (see the
114 FS::cust_pkg manpage).
117 Just returns false (no error) for now.
119 Called by the cancel method of FS::cust_pkg (see the
120 FS::cust_pkg manpage).
123 Checks all fields to make sure this is a valid service. If
124 there is an error, returns the error, otherwise returns
125 false. Called by the insert and replace methods.
127 Sets any fixed values; see the FS::part_svc manpage.
130 $Id: svc_acct.txt,v 1.3 1999-02-09 09:38:11 ivan Exp $
133 The remote commands should be configurable.
135 The bits which ssh should fork before doing so.
137 The $recref stuff in sub check should be cleaned up.
140 the FS::svc_Common manpage, the FS::Record manpage, the FS::Conf
141 manpage, the FS::cust_svc manpage, the FS::part_svc manpage, the
142 FS::cust_pkg manpage, the FS::SSH manpage, the ssh manpage, the
143 FS::svc_acct_pop manpage, schema.html from the base
147 ivan@voicenet.com 97-jul-16 - 21
149 rewrite (among other things, now know about part_svc)
150 ivan@sisd.com 98-mar-8
152 Changed 'password' to '_password' because Pg6.3 reserves the
153 password word bmccane@maxbaud.net 98-apr-3
155 username length and shell no longer hardcoded ivan@sisd.com 98-
158 eww but needed: ignore uid duplicates for 'fax' and 'hylafax'
159 ivan@sisd.com 98-jun-29
161 $nossh_hack ivan@sisd.com 98-jul-13
163 protections against UID/GID of 0 for incorrectly-setup RDBMSs
164 (also in bin/svc_acct.export) ivan@sisd.com 98-jul-13
166 arbitrary radius attributes ivan@sisd.com 98-aug-13
168 /var/spool/freeside/conf/shellmachine ivan@sisd.com 98-aug-13
170 pod and FS::conf ivan@sisd.com 98-sep-22
172 $Log: svc_acct.txt,v $
173 Revision 1.3 1999-02-09 09:38:11 ivan
174 regenerated perl api docs from embedded pod
175 Revision 1.6 1999/01/25 12:26:15 ivan yet
178 Revision 1.5 1999/01/18 21:58:09 ivan esthetic: eq and ne were
179 used in a few places instead of == and !=
181 Revision 1.4 1998/12/30 00:30:45 ivan svc_ stuff is more
182 properly OO - has a common superclass FS::svc_Common
184 Revision 1.2 1998/11/13 09:56:55 ivan change configuration file
185 layout to support multiple distinct databases (with own set of
186 config files, export, etc.)