Initial revision
[freeside.git] / htdocs / docs / man / svc_acct_sm.txt
1 NAME
2     FS::svc_acct_sm - Object methods for svc_acct_sm records
3
4 SYNOPSIS
5       use FS::svc_acct_sm;
6
7       $record = create FS::svc_acct_sm \%hash;
8       $record = create FS::svc_acct_sm { 'column' => 'value' };
9
10       $error = $record->insert;
11
12       $error = $new_record->replace($old_record);
13
14       $error = $record->delete;
15
16       $error = $record->check;
17
18       $error = $record->suspend;
19
20       $error = $record->unsuspend;
21
22       $error = $record->cancel;
23
24 DESCRIPTION
25     An FS::svc_acct object represents a virtual mail alias.
26     FS::svc_acct inherits from FS::Record. The following fields are
27     currently supported:
28
29     svcnum - primary key (assigned automatcially for new accounts)
30     domsvc - svcnum of the virtual domain (see the FS::svc_domain manpage)
31     domuid - uid of the target account (see the FS::svc_acct manpage)
32     domuser - virtual username
33 METHODS
34     create HASHREF
35         Creates a new virtual mail alias. To add the virtual mail
36         alias to the database, see the section on "insert".
37
38     insert
39         Adds this virtual mail alias to the database. If there is an
40         error, returns the error, otherwise returns false.
41
42         The additional fields pkgnum and svcpart (see the
43         FS::cust_svc manpage) should be defined. An FS::cust_svc
44         record will be created and inserted.
45
46         If the configuration values (see the FS::Conf manpage)
47         shellmachine and qmailmachines exist, and domuser is `*'
48         (meaning a catch-all mailbox), the command:
49
50           [ -e $dir/.qmail-$qdomain-default ] || {
51             touch $dir/.qmail-$qdomain-default;
52             chown $uid:$gid $dir/.qmail-$qdomain-default;
53           }
54
55         is executed on shellmachine via ssh (see the section on
56         "EXTENSION ADDRESSES" in the dot-qmail manpage). This
57         behaviour can be surpressed by setting
58         $FS::svc_acct_sm::nossh_hack true.
59
60     delete
61         Deletes this virtual mail alias from the database. If there
62         is an error, returns the error, otherwise returns false.
63
64         The corresponding FS::cust_svc record will be deleted as
65         well.
66
67     replace OLD_RECORD
68         Replaces OLD_RECORD with this one in the database. If there
69         is an error, returns the error, otherwise returns false.
70
71     suspend
72         Just returns false (no error) for now.
73
74         Called by the suspend method of FS::cust_pkg (see the
75         FS::cust_pkg manpage).
76
77     unsuspend
78         Just returns false (no error) for now.
79
80         Called by the unsuspend method of FS::cust_pkg (see the
81         FS::cust_pkg manpage).
82
83     cancel
84         Just returns false (no error) for now.
85
86         Called by the cancel method of FS::cust_pkg (see the
87         FS::cust_pkg manpage).
88
89     check
90         Checks all fields to make sure this is a valid virtual mail
91         alias. If there is an error, returns the error, otherwise
92         returns false. Called by the insert and replace methods.
93
94         Sets any fixed values; see the FS::part_svc manpage.
95
96 BUGS
97     It doesn't properly override FS::Record yet.
98
99     The remote commands should be configurable.
100
101 SEE ALSO
102     the FS::Record manpage, the FS::Conf manpage, the FS::cust_svc
103     manpage, the FS::part_svc manpage, the FS::cust_pkg manpage, the
104     FS::svc_acct manpage, the FS::svc_domain manpage, the FS::SSH
105     manpage, the ssh manpage, the dot-qmail manpage, schema.html
106     from the base documentation.
107
108 HISTORY
109     ivan@voicenet.com 97-jul-16 - 21
110
111     rewrite ivan@sisd.com 98-mar-10
112
113     s/qsearchs/qsearch/ to eliminate warning ivan@sisd.com 98-apr-19
114
115     uses conf/shellmachine and has an nossh_hack ivan@sisd.com 98-
116     jul-14
117
118     s/\./:/g in .qmail-domain:com ivan@sisd.com 98-aug-13
119
120     pod, FS::Conf, moved .qmail file from check to insert 98-sep-23
121