1 package FS::part_export::shellcommands_withdomain;
3 use vars qw(@ISA %info);
5 use FS::part_export::shellcommands;
7 @ISA = qw(FS::part_export::shellcommands);
9 tie my %options, 'Tie::IxHash',
10 'user' => { label=>'Remote username', default=>'root' },
11 'useradd' => { label=>'Insert command',
14 'useradd_stdin' => { label=>'Insert command STDIN',
16 #default=>"$_password\n$_password\n",
18 'useradd_no_queue' => { label => 'Run immediately',
21 'userdel' => { label=>'Delete command',
24 'userdel_stdin' => { label=>'Delete command STDIN',
28 'userdel_no_queue' => { label => 'Run immediately',
31 'usermod' => { label=>'Modify command',
34 'usermod_stdin' => { label=>'Modify command STDIN',
36 #default=>"$_password\n$_password\n",
38 'usermod_no_queue' => { label => 'Run immediately',
41 'usermod_pwonly' => { label=>'Disallow username, domain, uid, dir and RADIUS group changes',
44 'usermod_nousername' => { label=>'Disallow just username changes',
47 'suspend' => { label=>'Suspension command',
50 'suspend_stdin' => { label=>'Suspension command STDIN',
53 'suspend_no_queue' => { label => 'Run immediately',
56 'unsuspend' => { label=>'Unsuspension command',
59 'unsuspend_stdin' => { label=>'Unsuspension command STDIN',
62 'unsuspend_no_queue' => { label => 'Run immediately',
65 'crypt' => { label => 'Default password encryption',
66 type=>'select', options=>[qw(crypt md5)],
73 'desc' => 'Real-time export via remote SSH (vpopmail, ISPMan)',
74 'options' => \%options,
76 Run remote commands via SSH. username@domain (rather than just usernames) are
77 considered unique (also see shellcommands). You probably want this if the
78 commands you are running will accept a domain as a parameter, and will allow
79 the same username with different domains. You will need to
80 <a href="../docs/ssh.html">setup SSH for unattended operation</a>.
82 <BR><BR>Use these buttons for some useful presets:
84 <LI><INPUT TYPE="button" VALUE="vpopmail" onClick='
85 this.form.useradd.value = "/home/vpopmail/bin/vadduser $username\\\@$domain $quoted_password";
86 this.form.useradd_stdin.value = "";
87 this.form.userdel.value = "/home/vpopmail/bin/vdeluser $username\\\@$domain";
88 this.form.userdel_stdin.value="";
89 this.form.usermod.value = "/home/vpopmail/bin/vpasswd $new_username\\\@$new_domain $new_quoted_password";
90 this.form.usermod_stdin.value = "";
91 this.form.usermod_pwonly.checked = true;
93 <LI><INPUT TYPE="button" VALUE="ISPMan CLI" onClick='
94 this.form.useradd.value = "/usr/local/ispman/bin/ispman.addUser -d $domain -f $first -l $last -q $quota -p $quoted_password $username";
95 this.form.useradd_stdin.value = "";
96 this.form.userdel.value = "/usr/local/ispman/bin/ispman.delUser -d $domain $username";
97 this.form.userdel_stdin.value="";
98 this.form.usermod.value = "/usr/local/ispman/bin/ispman.passwd.user $new_username\\\@$new_domain $new_quoted_password";
99 this.form.usermod_stdin.value = "";
100 this.form.usermod_pwonly.checked = true;
102 <LI><INPUT TYPE="button" VALUE="MagicMail" onClick='
103 this.form.useradd.value = "/usr/bin/mm_create_email_service -e $svcnum -d $domain -u $username -p $quoted_password -f $first -l $last -m $svcnum -g EMAIL";
104 this.form.useradd_stdin.value = "";
105 this.form.useradd_no_queue.checked = 1;
106 this.form.userdel.value = "/usr/bin/mm_delete_user -e ${username}\\\@${domain}";
107 this.form.userdel_stdin.value = "";
108 this.form.suspend.value = "/usr/bin/mm_suspend_user -e ${username}\\\@${domain}";
109 this.form.suspend_stdin.value = "";
110 this.form.unsuspend.value = "/usr/bin/mm_activate_user -e ${username}\\\@${domain}";
111 this.form.unsuspend_stdin.value = "";
115 The following variables are available for interpolation (prefixed with
116 <code>new_</code> or <code>old_</code> for replace operations):
118 <LI><code>$username</code>
119 <LI><code>$domain</code>
120 <LI><code>$_password</code>
121 <LI><code>$quoted_password</code> - unencrypted password, already quoted for the shell (do not add additional quotes)
122 <LI><code>$crypt_password</code> - encrypted password, already quoted for the shell (do not add additional quotes)
123 <LI><code>$uid</code>
124 <LI><code>$gid</code>
125 <LI><code>$finger</code> - GECOS, already quoted for the shell (do not add additional quotes)
126 <LI><code>$first</code> - First name of GECOS, already quoted for the shell (do not add additional quotes)
127 <LI><code>$last</code> - Last name of GECOS, already quoted for the shell (do not add additional quotes)
128 <LI><code>$dir</code> - home directory
129 <LI><code>$shell</code>
130 <LI><code>$quota</code>
131 <LI><code>@radius_groups</code>
132 <LI>All other fields in <a href="../docs/schema.html#svc_acct">svc_acct</a> are also available.