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 'userdel' => { label=>'Delete command',
21 'userdel_stdin' => { label=>'Delete command STDIN',
25 'usermod' => { label=>'Modify command',
28 'usermod_stdin' => { label=>'Modify command STDIN',
30 #default=>"$_password\n$_password\n",
32 'usermod_pwonly' => { label=>'Disallow username changes',
35 'suspend' => { label=>'Suspension command',
38 'suspend_stdin' => { label=>'Suspension command STDIN',
41 'unsuspend' => { label=>'Unsuspension command',
44 'unsuspend_stdin' => { label=>'Unsuspension command STDIN',
51 'desc' => 'Real-time export via remote SSH (vpopmail, ISPMan)',
52 'options' => \%options,
54 Run remote commands via SSH. username@domain (rather than just usernames) are
55 considered unique (also see shellcommands). You probably want this if the
56 commands you are running will accept a domain as a parameter, and will allow
57 the same username with different domains. You will need to
58 <a href="../docs/ssh.html">setup SSH for unattended operation</a>.
60 <BR><BR>Use these buttons for some useful presets:
62 <LI><INPUT TYPE="button" VALUE="vpopmail" onClick='
63 this.form.useradd.value = "/home/vpopmail/bin/vadduser $username\\\@$domain $quoted_password";
64 this.form.useradd_stdin.value = "";
65 this.form.userdel.value = "/home/vpopmail/bin/vdeluser $username\\\@$domain";
66 this.form.userdel_stdin.value="";
67 this.form.usermod.value = "/home/vpopmail/bin/vpasswd $new_username\\\@$new_domain $new_quoted_password";
68 this.form.usermod_stdin.value = "";
69 this.form.usermod_pwonly.checked = true;
71 <LI><INPUT TYPE="button" VALUE="ISPMan CLI" onClick='
72 this.form.useradd.value = "/usr/local/ispman/bin/ispman.addUser -d $domain -f $first -l $last -q $quota -p $quoted_password $username";
73 this.form.useradd_stdin.value = "";
74 this.form.userdel.value = "/usr/local/ispman/bin/ispman.delUser -d $domain $username";
75 this.form.userdel_stdin.value="";
76 this.form.usermod.value = "/usr/local/ispman/bin/ispman.passwd.user $username\\\@$domain $new_quoted_password";
77 this.form.usermod_stdin.value = "";
78 this.form.usermod_pwonly.checked = true;
82 The following variables are available for interpolation (prefixed with
83 <code>new_</code> or <code>old_</code> for replace operations):
85 <LI><code>$username</code>
86 <LI><code>$domain</code>
87 <LI><code>$_password</code>
88 <LI><code>$quoted_password</code> - unencrypted password quoted for the shell
89 <LI><code>$crypt_password</code> - encrypted password
92 <LI><code>$finger</code> - GECOS, already quoted for the shell (do not add additional quotes)
93 <LI><code>$first</code> - First name of GECOS, already quoted for the shell (do not add additional quotes)
94 <LI><code>$last</code> - Last name of GECOS, already quoted for the shell (do not add additional quotes)
95 <LI><code>$dir</code> - home directory
96 <LI><code>$shell</code>
97 <LI><code>$quota</code>
98 <LI><code>@radius_groups</code>
99 <LI>All other fields in <a href="../docs/schema.html#svc_acct">svc_acct</a> are also available.