3 # process/svc_acct_sm.cgi: Add/edit a mail alias (process form)
6 # http://server.name/path/svc_acct_sm.cgi
8 # Note: Should br run setuid root as user nobody.
10 # lots of crufty stuff from svc_acct still in here, and modifications are (unelegantly) disabled.
12 # ivan@voicenet.com 97-jan-6
14 # enabled modifications
16 # ivan@voicenet.com 97-may-7
18 # fixed removal of cust_svc record on modifications!
19 # ivan@voicenet.com 97-jun-5
21 # rewrite ivan@sisd.com 98-mar-15
23 # Changes to allow page to work at a relative position in server
24 # bmccane@maxbaud.net 98-apr-3
28 use CGI::Carp qw(fatalsToBrowser);
29 use FS::UID qw(cgisuidsetup);
30 use FS::Record qw(qsearchs);
33 my($req)=new CGI::Request; # create form object
34 cgisuidsetup($req->cgi);
36 $req->param('svcnum') =~ /^(\d*)$/ or die "Illegal svcnum!";
39 my($old)=qsearchs('svc_acct_sm',{'svcnum'=>$svcnum}) if $svcnum;
41 #unmunge domsvc and domuid
42 $req->param('domsvc',(split(/:/, $req->param('domsvc') ))[0] );
43 $req->param('domuid',(split(/:/, $req->param('domuid') ))[0] );
45 my($new) = create FS::svc_acct_sm ( {
47 ($_, scalar($req->param($_)));
48 } qw(svcnum pkgnum svcpart domuser domuid domsvc)
53 $error = $new->replace($old);
55 $error = $new->insert;
56 $svcnum = $new->getfield('svcnum');
60 $req->cgi->redirect("../../view/svc_acct_sm.cgi?$svcnum");
62 CGI::Base::SendHeaders(); # one guess
66 <TITLE>Error adding/editing mail alias</TITLE>
70 <H4>Error adding/editing mail alias</H4>
72 Your update did not occur because of the following error:
74 <P>Hit the <I>Back</I> button in your web browser, correct this mistake, and submit the form again.