2 FS::svc_acct - Object methods for svc_acct records
7 $record = create FS::svc_acct \%hash;
8 $record = create 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::Record. 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 It doesn't properly override FS::Record yet.
132 The remote commands should be configurable.
134 The create method should set defaults from part_svc (like the
135 check method sets fixed values).
138 the FS::Record manpage, the FS::Conf manpage, the FS::cust_svc
139 manpage, the FS::part_svc manpage, the FS::cust_pkg manpage, the
140 FS::SSH manpage, the ssh manpage, the FS::svc_acct_pop manpage,
141 schema.html from the base documentation.
144 ivan@voicenet.com 97-jul-16 - 21
146 rewrite (among other things, now know about part_svc)
147 ivan@sisd.com 98-mar-8
149 Changed 'password' to '_password' because Pg6.3 reserves the
150 password word bmccane@maxbaud.net 98-apr-3
152 username length and shell no longer hardcoded ivan@sisd.com 98-
155 eww but needed: ignore uid duplicates for 'fax' and 'hylafax'
156 ivan@sisd.com 98-jun-29
158 $nossh_hack ivan@sisd.com 98-jul-13
160 protections against UID/GID of 0 for incorrectly-setup RDBMSs
161 (also in bin/svc_acct.export) ivan@sisd.com 98-jul-13
163 arbitrary radius attributes ivan@sisd.com 98-aug-13
165 /var/spool/freeside/conf/shellmachine ivan@sisd.com 98-aug-13
167 pod and FS::conf ivan@sisd.com 98-sep-22