%info = (
'svc' => 'svc_domain',
- 'desc' => 'Run remote commands via SSH, for domains.',
+ 'desc' => 'Run remote commands via SSH, for domains (qmail, ISPMan).',
'options' => \%options,
'notes' => <<'END'
Run remote commands via SSH, for domains. You will need to
this.form.useradd.value = "[ \"$uid\" -a \"$gid\" -a \"$dir\" -a \"$qdomain\" ] && [ -e $dir/.qmail-$qdomain-default ] || { touch $dir/.qmail-$qdomain-default; chown $uid:$gid $dir/.qmail-$qdomain-default; }";
this.form.userdel.value = "";
this.form.usermod.value = "";
+ <LI>
+ <INPUT TYPE="button" VALUE="ISPMan CLI" onClick='
+ this.form.useradd.value = "/usr/local/ispman/bin/ispman.addDomain -d $domain changeme";
+ this.form.userdel.value = "/usr/local/ispman/bin/ispman.deleteDomain -d $domain";
+ this.form.usermod.value = "";
'>
</UL>
The following variables are available for interpolation (prefixed with <code>new_</code> or <code>old_</code> for replace operations):
this.form.userdel.value = "rm /home/vpopmail/domains/$domain/$username/.qmail";
this.form.usermod.value = "mv /home/vpopmail/domains/$old_domain/$old_username/.qmail /home/vpopmail/domains/$new_domain/$new_username; [ \"$old_destination\" != \"$new_destination\" ] && { echo \"$new_destination\" > /home/vpopmail/domains/$new_domain/$new_username/.qmail; chown vpopmail:vchkpw /home/vpopmail/domains/$new_domain/$new_username/.qmail; }";
'>
+ <LI>
+ <INPUT TYPE="button" VALUE="ISPMan CLI" onClick='
+ this.form.useradd.value = "";
+ this.form.userdel.value = "";
+ this.form.usermod.value = "";
+ '>
</UL>
The following variables are available for interpolation (prefixed with
<code>new_</code> or <code>old_</code> for replace operations):
<LI><code>$uid</code>
<LI><code>$gid</code>
<LI><code>$finger</code> - GECOS, already quoted for the shell (do not add additional quotes)
+ <LI><code>$first</code> - First name of GECOS, already quoted for the shell (do not add additional quotes)
+ <LI><code>$last</code> - Last name of GECOS, already quoted for the shell (do not add additional quotes)
<LI><code>$dir</code> - home directory
<LI><code>$shell</code>
<LI><code>$quota</code>
$email = '';
}
+ $finger =~ /^(.*)\s+(\S+)$/ or $finger =~ /^((.*))$/;
+ ($first, $last ) = ( $1, $2 );
+ $first = shell_quote $first;
+ $last = shell_quote $last;
$finger = shell_quote $finger;
$quoted_password = shell_quote $_password;
$domain = $svc_acct->domain;
${"old_$_"} = $old->getfield($_) foreach $old->fields;
${"new_$_"} = $new->getfield($_) foreach $new->fields;
}
+ $new_finger =~ /^(.*)\s+(\S+)$/ or $finger =~ /^((.*))$/;
+ ($new_first, $new_last ) = ( $1, $2 );
+ $new_first = shell_quote $new_first;
+ $new_last = shell_quote $new_last;
$new_finger = shell_quote $new_finger;
$quoted_new__password = shell_quote $new__password; #old, wrong?
$new_quoted_password = shell_quote $new__password; #new, better?
%info = (
'svc' => 'svc_acct',
- 'desc' => 'Real-time export via remote SSH (vpopmail, etc.)',
+ 'desc' => 'Real-time export via remote SSH (vpopmail, ISPMan)',
'options' => \%options,
'notes' => <<'END'
Run remote commands via SSH. username@domain (rather than just usernames) are
<LI><INPUT TYPE="button" VALUE="vpopmail" onClick='
this.form.useradd.value = "/home/vpopmail/bin/vadduser $username\\\@$domain $quoted_password";
this.form.useradd_stdin.value = "";
- this.form.userdel.value = "/home/vpopmail/bin/vdeluser $username\\\@$domain"; this.form.userdel_stdin.value="";
+ this.form.userdel.value = "/home/vpopmail/bin/vdeluser $username\\\@$domain";
+ this.form.userdel_stdin.value="";
this.form.usermod.value = "/home/vpopmail/bin/vpasswd $new_username\\\@$new_domain $new_quoted_password";
this.form.usermod_stdin.value = "";
this.form.usermod_pwonly.checked = true;
'>
+ <LI><INPUT TYPE="button" VALUE="ISPMan CLI" onClick='
+ this.form.useradd.value = "/usr/local/ispman/bin/ispman.addUser -d $domain -f $first -l $last -q $quota -p $quoted_password $username";
+ this.form.useradd_stdin.value = "";
+ this.form.userdel.value = "/usr/local/ispman/bin/ispman.delUser -d $domain $username";
+ this.form.userdel_stdin.value="";
+ this.form.usermod.value = "/usr/local/ispman/bin/ispman.passwd.user $username\\\@$domain $new_quoted_password";
+ this.form.usermod_stdin.value = "";
+ this.form.usermod_pwonly.checked = true;
+ '>
</UL>
The following variables are available for interpolation (prefixed with
<LI><code>$uid</code>
<LI><code>$gid</code>
<LI><code>$finger</code> - GECOS, already quoted for the shell (do not add additional quotes)
+ <LI><code>$first</code> - First name of GECOS, already quoted for the shell (do not add additional quotes)
+ <LI><code>$last</code> - Last name of GECOS, already quoted for the shell (do not add additional quotes)
<LI><code>$dir</code> - home directory
<LI><code>$shell</code>
<LI><code>$quota</code>
'notes' => <<'END'
Run remote commands via SSH, for virtual web sites. You will need to
<a href="../docs/ssh.html">setup SSH for unattended operation</a>.
-<BR><BR>The following variables are available for interpolation (prefixed with
+<BR><BR>Use these buttons for some useful presets:
+<UL>
+ <LI>
+ <INPUT TYPE="button" VALUE="Maintain directories" onClick'
+ this.form.user.value = "root";
+ this.form.useradd.value = "mkdir /var/www/$zone; chown $username /var/www/$zone; ln -s /var/www/$zone $homedir/$zone";
+ this.form.userdel.value = "[ -n "$zone" ] && rm -rf /var/www/$zone; rm $homedir/$zone";
+ this.form.usermod.value = "[ -n "$old_zone" ] && rm $old_homedir/$old_zone; [ "$old_zone" != "$new_zone" -a -n "$new_zone" ] && mv /var/www/$old_zone /var/www/$new_zone; [ "$old_username" != "$new_username" ] && chown -R $new_username /var/www/$new_zone; ln -s /var/www/$new_zone $new_homedir/$new_zone";
+ '>
+ <LI>
+ <INPUT TYPE="button" VALUE="ISPMan CLI" onClick'
+ this.form.user.value = "root";
+ this.form.useradd.value = "/usr/local/ispman/ispman.addvhost -d $domain $zone";
+ this.form.userdel.value = "/usr/local/ispman/idpman.deletevhost -d $domain $zone";
+ this.form.usermod.value = "";
+ '>
+</UL>
+The following variables are available for interpolation (prefixed with
<code>new_</code> or <code>old_</code> for replace operations):
<UL>
- <LI><code>$zone</code>
+ <LI><code>$zone</code> - fully-qualified zone of this virtual host
+ <LI><code>$domain</code> - base domain
<LI><code>$username</code>
<LI><code>$homedir</code>
<LI>All other fields in <a href="../docs/schema.html#svc_www">svc_www</a>
}
my $domain_record = $svc_www->domain_record; # or die ?
my $zone = $domain_record->zone; # or die ?
+ my $domain = $domain_record->svc_domain->domain;
my $svc_acct = $svc_www->svc_acct; # or die ?
my $username = $svc_acct->username;
my $homedir = $svc_acct->dir; # or die ?
}
my $old_domain_record = $old->domain_record; # or die ?
my $old_zone = $old_domain_record->reczone; # or die ?
- unless ( $old_zone =~ /\.$/ ) {
- my $old_svc_domain = $old_domain_record->svc_domain; # or die ?
- $old_zone .= '.'. $old_svc_domain->domain;
- }
+ my $old_domain = $old_domain_record->svc_domain->domain;
+ $old_zone .= ".$old_domain" unless $old_zone =~ /\.$/;
my $old_svc_acct = $old->svc_acct; # or die ?
my $old_username = $old_svc_acct->username;
my $new_domain_record = $new->domain_record; # or die ?
my $new_zone = $new_domain_record->reczone; # or die ?
+ my $new_domain = $new_domain_record->svc_domain->domain;
unless ( $new_zone =~ /\.$/ ) {
my $new_svc_domain = $new_domain_record->svc_domain; # or die ?
$new_zone .= '.'. $new_svc_domain->domain;