mirror of
https://github.com/myvesta/vesta.git
synced 2025-03-12 04:35:23 -07:00
add user package
This commit is contained in:
parent
650c3f8507
commit
9a1fde8cb3
bin
func
web
add/package
list/package
templates/admin
@ -55,10 +55,10 @@ is_package_valid "$package"
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Parsing package data
|
||||
package_data=$(cat $VESTA/data/packages/$package.pkg)
|
||||
pkg_data=$(cat $VESTA/data/packages/$package.pkg |grep -v TIME |grep -v DATE)
|
||||
|
||||
# Checking shell
|
||||
shell_conf=$(echo "$package_data" | grep 'SHELL' | cut -f 2 -d \')
|
||||
shell_conf=$(echo "$pkg_data" | grep 'SHELL' | cut -f 2 -d \')
|
||||
shell=$(/usr/bin/chsh --list-shells | grep -w "$shell_conf" |head -n1)
|
||||
|
||||
# Adding user
|
||||
@ -98,7 +98,7 @@ chmod -R a+x $HOMEDIR/$user
|
||||
|
||||
# Checking quota
|
||||
if [ ! -z "$DISK_QUOTA" ] && [ "$DISK_QUOTA" != 'no' ]; then
|
||||
DISK_QUOTA=$(echo "$package_data" | grep 'DISK_QUOTA' | cut -f 2 -d \')
|
||||
DISK_QUOTA=$(echo "$pkg_data" | grep 'DISK_QUOTA' | cut -f 2 -d \')
|
||||
#$BIN/v_add_user_quota "$user" "$DISK_QUOTA"
|
||||
fi
|
||||
|
||||
@ -169,7 +169,7 @@ fi
|
||||
echo "FNAME='$fname'
|
||||
LNAME='$lname'
|
||||
PACKAGE='$package'
|
||||
$package_data
|
||||
$pkg_data
|
||||
CONTACT='$email'
|
||||
CRON_REPORTS='yes'
|
||||
MD5='$(awk -v user=$user -F : 'user == $1 {print $2}' /etc/shadow)'
|
||||
|
74
bin/v_add_user_package
Executable file
74
bin/v_add_user_package
Executable file
@ -0,0 +1,74 @@
|
||||
#!/bin/bash
|
||||
# info: adding user package
|
||||
# options: pkg_dir package [rewrite]
|
||||
#
|
||||
# The function adds new user package to the system.
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Variable&Function #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Argument defenition
|
||||
pkg_dir=$1
|
||||
package=$2
|
||||
rewrite=$3
|
||||
|
||||
# Includes
|
||||
source $VESTA/conf/vesta.conf
|
||||
source $VESTA/func/main.sh
|
||||
|
||||
# Functions
|
||||
is_package_new() {
|
||||
if [ -e "$VESTA/data/packages/$package.pkg" ]; then
|
||||
echo "Error: package $package already exists."
|
||||
log_event "$E_EXISTS" "$EVENT"
|
||||
exit $E_EXISTS
|
||||
fi
|
||||
}
|
||||
|
||||
is_package_consistent() {
|
||||
source $pkg_dir/$package.pkg
|
||||
validate_format_int $WEB_DOMAINS
|
||||
validate_format_int $WEB_ALIASES
|
||||
validate_format_int $DNS_DOMAINS
|
||||
validate_format_int $DNS_RECORDS
|
||||
validate_format_int $MAIL_DOMAINS
|
||||
validate_format_int $MAIL_ACCOUNTS
|
||||
validate_format_int $DATABASES
|
||||
validate_format_int $CRON_JOBS
|
||||
validate_format_int $DISK_QUOTA
|
||||
validate_format_int $BACKUPS
|
||||
validate_format_shell $SHELL
|
||||
}
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Verifications #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
check_args '2' "$#" 'pkg_dir package' 'rewrite'
|
||||
validate_format 'pkg_dir' 'package'
|
||||
if [ "$rewrite" != 'yes' ]; then
|
||||
is_package_new
|
||||
fi
|
||||
is_package_valid "$pkg_dir"
|
||||
is_package_consistent
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Action #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
cp -f $pkg_dir/$package.pkg $VESTA/data/packages/
|
||||
chmod 644 $VESTA/data/packages/$package.pkg
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Vesta #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Logging
|
||||
log_event "$OK" "$EVENT"
|
||||
|
||||
exit
|
@ -32,7 +32,8 @@ is_package_avalable() {
|
||||
DISK_QUOTA='0'
|
||||
BANDWIDTH='0'
|
||||
|
||||
pkg_data=$(cat $VESTA/data/packages/$package.pkg)
|
||||
pkg_data=$(cat $VESTA/data/packages/$package.pkg |grep -v TIME |\
|
||||
grep -v DATE)
|
||||
eval $pkg_data
|
||||
|
||||
# Comparing user data with package
|
||||
|
92
bin/v_list_user_package
Executable file
92
bin/v_list_user_package
Executable file
@ -0,0 +1,92 @@
|
||||
#!/bin/bash
|
||||
# info: list user package
|
||||
# options: package [format]
|
||||
#
|
||||
# The function for getting the list of system ip parameters.
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Variable&Function #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Argument defenition
|
||||
package=$1
|
||||
PACKAGE=$package
|
||||
format=${2-shell}
|
||||
|
||||
# Includes
|
||||
source $VESTA/func/main.sh
|
||||
|
||||
# Json function
|
||||
json_list_package() {
|
||||
i=1
|
||||
fileds_count=$(echo "$fields" | wc -w)
|
||||
pkg_data=$(cat $VESTA/data/packages/$PACKAGE.pkg)
|
||||
echo '{'
|
||||
eval $pkg_data
|
||||
for field in $fields; do
|
||||
eval value=$field
|
||||
if [ $i -eq 1 ]; then
|
||||
echo -e "\t\"$value\": {"
|
||||
else
|
||||
if [ $fileds_count -eq $i ]; then
|
||||
echo -e "\t\t\"${field//$/}\": \"${value//,/, }\""
|
||||
else
|
||||
echo -e "\t\t\"${field//$/}\": \"${value//,/, }\","
|
||||
fi
|
||||
fi
|
||||
(( ++i))
|
||||
done
|
||||
if [ -n "$value" ]; then
|
||||
echo -e ' }'
|
||||
fi
|
||||
echo -e '}'
|
||||
}
|
||||
|
||||
# Shell function
|
||||
shell_list_package() {
|
||||
line=$(cat $VESTA/data/packages/$PACKAGE.pkg)
|
||||
eval $line
|
||||
for field in $fields; do
|
||||
eval key="$field"
|
||||
if [ -z "$key" ]; then
|
||||
key='NULL'
|
||||
fi
|
||||
echo "${field//$/}: $key "
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Verifications #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Checking args
|
||||
check_args '1' "$#" 'package [format]'
|
||||
validate_format 'package'
|
||||
is_package_valid
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Action #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Defining fileds to select
|
||||
fields='$PACKAGE $TEMPLATE $WEB_DOMAINS $WEB_ALIASES $DNS_DOMAINS $DNS_RECORDS
|
||||
$MAIL_DOMAINS $MAIL_ACCOUNTS $DATABASES $CRON_JOBS $DISK_QUOTA $BANDWIDTH
|
||||
$NS $SHELL $BACKUPS $TIME $DATE'
|
||||
|
||||
# Listing ip
|
||||
case $format in
|
||||
json) json_list_package ;;
|
||||
plain) shell_list_package ;;
|
||||
shell) shell_list_package | column -t ;;
|
||||
*) check_args '1' '0' 'ip [format]'
|
||||
esac
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Vesta #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
exit
|
@ -121,7 +121,10 @@ gen_password() {
|
||||
|
||||
# Package existance check
|
||||
is_package_valid() {
|
||||
if [ ! -e "$VESTA/data/packages/$package.pkg" ]; then
|
||||
if [ -z "$1" ]; then
|
||||
pkg_dir="$VESTA/data/packages"
|
||||
fi
|
||||
if [ ! -e "$pkg_dir/$package.pkg" ]; then
|
||||
echo "Error: package $package not exist"
|
||||
log_event "$E_NOTEXIST $EVENT"
|
||||
exit $E_NOTEXIST
|
||||
|
165
web/add/package/index.php
Normal file
165
web/add/package/index.php
Normal file
@ -0,0 +1,165 @@
|
||||
<?php
|
||||
// Init
|
||||
error_reporting(NULL);
|
||||
ob_start();
|
||||
session_start();
|
||||
$TAB = 'PACKAGE';
|
||||
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
|
||||
|
||||
if (empty($_SESSION['user'])) {
|
||||
header("Location: /login/");
|
||||
}
|
||||
|
||||
// Header
|
||||
include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html');
|
||||
|
||||
// Panel
|
||||
top_panel($user,$TAB);
|
||||
|
||||
// Are you admin?
|
||||
if ($_SESSION['user'] == 'admin') {
|
||||
if (!empty($_POST['ok'])) {
|
||||
// Check input
|
||||
if (empty($_POST['v_package'])) $errors[] = 'package';
|
||||
if (empty($_POST['v_template'])) $errors[] = 'template';
|
||||
if (empty($_POST['v_shell'])) $errrors[] = 'shell';
|
||||
if (!isset($_POST['v_web_domains'])) $errors[] = 'web domains';
|
||||
if (!isset($_POST['v_web_aliases'])) $errors[] = 'web aliases';
|
||||
if (!isset($_POST['v_dns_domains'])) $errors[] = 'dns domains';
|
||||
if (!isset($_POST['v_dns_records'])) $errors[] = 'dns records';
|
||||
if (!isset($_POST['v_mail_domains'])) $errors[] = 'mail domains';
|
||||
if (!isset($_POST['v_mail_accounts'])) $errors[] = 'mail accounts';
|
||||
if (!isset($_POST['v_databases'])) $errors[] = 'databases';
|
||||
if (!isset($_POST['v_cron_jobs'])) $errors[] = 'cron jobs';
|
||||
if (!isset($_POST['v_backups'])) $errors[] = 'backups';
|
||||
if (!isset($_POST['v_disk_quota'])) $errors[] = 'quota';
|
||||
if (!isset($_POST['v_bandwidth'])) $errors[] = 'bandwidth';
|
||||
if (empty($_POST['v_ns1'])) $errors[] = 'ns1';
|
||||
if (empty($_POST['v_ns2'])) $errors[] = 'ns2';
|
||||
|
||||
|
||||
// Protect input
|
||||
$v_package = escapeshellarg($_POST['v_package']);
|
||||
$v_template = escapeshellarg($_POST['v_template']);
|
||||
$v_shell = escapeshellarg($_POST['v_shell']);
|
||||
$v_web_domains = escapeshellarg($_POST['v_web_domains']);
|
||||
$v_web_aliases = escapeshellarg($_POST['v_web_aliases']);
|
||||
$v_dns_domains = escapeshellarg($_POST['v_dns_domains']);
|
||||
$v_dns_records = escapeshellarg($_POST['v_dns_records']);
|
||||
$v_mail_domains = escapeshellarg($_POST['v_mail_domains']);
|
||||
$v_mail_accounts = escapeshellarg($_POST['v_mail_accounts']);
|
||||
$v_databases = escapeshellarg($_POST['v_databases']);
|
||||
$v_cron_jobs = escapeshellarg($_POST['v_cron_jobs']);
|
||||
$v_backups = escapeshellarg($_POST['v_backups']);
|
||||
$v_disk_quota = escapeshellarg($_POST['v_disk_quota']);
|
||||
$v_bandwidth = escapeshellarg($_POST['v_bandwidth']);
|
||||
$v_ns1 = trim($_POST['v_ns1'], '.');
|
||||
$v_ns2 = trim($_POST['v_ns2'], '.');
|
||||
$v_ns3 = trim($_POST['v_ns3'], '.');
|
||||
$v_ns4 = trim($_POST['v_ns4'], '.');
|
||||
$v_ns = $v_ns1.",".$v_ns2;
|
||||
if (!empty($v_ns3)) $v_ns .= ",".$v_ns3;
|
||||
if (!empty($v_ns4)) $v_ns .= ",".$v_ns4;
|
||||
$v_ns = escapeshellarg($v_ns);
|
||||
$v_time = escapeshellarg(date('H:i:s'));
|
||||
$v_date = escapeshellarg(date('Y-m-d'));
|
||||
|
||||
// Check for errors
|
||||
if (!empty($errors[0])) {
|
||||
foreach ($errors as $i => $error) {
|
||||
if ( $i == 0 ) {
|
||||
$error_msg = $error;
|
||||
} else {
|
||||
$error_msg = $error_msg.", ".$error;
|
||||
}
|
||||
}
|
||||
$_SESSION['error_msg'] = "Error: field ".$error_msg." can not be blank.";
|
||||
} else {
|
||||
exec ('mktemp -d', $output, $return_var);
|
||||
$tmpdir = $output[0];
|
||||
unset($output);
|
||||
|
||||
// Create package
|
||||
$pkg = "TEMPLATE=".$v_template."\n";
|
||||
$pkg .= "WEB_DOMAINS=".$v_web_domains."\n";
|
||||
$pkg .= "WEB_ALIASES=".$v_web_aliases."\n";
|
||||
$pkg .= "DNS_DOMAINS=".$v_dns_domains."\n";
|
||||
$pkg .= "DNS_RECORDS=".$v_dns_records."\n";
|
||||
$pkg .= "MAIL_DOMAINS=".$v_mail_domains."\n";
|
||||
$pkg .= "MAIL_ACCOUNTS=".$v_mail_accounts."\n";
|
||||
$pkg .= "DATABASES=".$v_databases."\n";
|
||||
$pkg .= "CRON_JOBS=".$v_cron_jobs."\n";
|
||||
$pkg .= "DISK_QUOTA=".$v_disk_quota."\n";
|
||||
$pkg .= "BANDWIDTH=".$v_bandwidth."\n";
|
||||
$pkg .= "NS=".$v_ns."\n";
|
||||
$pkg .= "SHELL=".$v_shell."\n";
|
||||
$pkg .= "BACKUPS=".$v_backups."\n";
|
||||
$pkg .= "TIME=".$v_time."\n";
|
||||
$pkg .= "DATE=".$v_date."\n";
|
||||
|
||||
// Write package
|
||||
$fp = fopen($tmpdir."/".$_POST['v_package'].".pkg", 'w');
|
||||
fwrite($fp, $pkg);
|
||||
fclose($fp);
|
||||
|
||||
// Add new package
|
||||
if (empty($_SESSION['error_msg'])) {
|
||||
exec (VESTA_CMD."v_add_user_package ".$tmpdir." ".$v_package, $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = 'Error: vesta did not return any output.';
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
unset($output);
|
||||
}
|
||||
|
||||
// Remove tmpdir
|
||||
exec ('rm -rf '.$tmdir, $output, $return_var);
|
||||
unset($output);
|
||||
|
||||
// Check output
|
||||
if (empty($_SESSION['error_msg'])) {
|
||||
$_SESSION['ok_msg'] = "OK: package <b>".$_POST['v_package']."</b> has been created successfully.";
|
||||
unset($v_package);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
exec (VESTA_CMD."v_list_web_templates json", $output, $return_var);
|
||||
check_error($return_var);
|
||||
$templates = json_decode(implode('', $output), true);
|
||||
unset($output);
|
||||
|
||||
exec (VESTA_CMD."v_list_sys_shells json", $output, $return_var);
|
||||
check_error($return_var);
|
||||
$shells = json_decode(implode('', $output), true);
|
||||
unset($output);
|
||||
|
||||
// Set default values
|
||||
if (empty($v_template)) $v_template = 'default';
|
||||
if (empty($v_shell)) $v_shell = 'nologin';
|
||||
if (empty($v_web_domains)) $v_web_domains = "'0'";
|
||||
if (empty($v_web_aliases)) $v_web_aliases = "'0'";
|
||||
if (empty($v_dns_domains)) $v_dns_domains = "'0'";
|
||||
if (empty($v_dns_records)) $v_dns_records = "'0'";
|
||||
if (empty($v_mail_domains)) $v_mail_domains = "'0'";
|
||||
if (empty($v_mail_accounts)) $v_mail_accounts = "'0'";
|
||||
if (empty($v_databases)) $v_databases = "'0'";
|
||||
if (empty($v_cron_jobs)) $v_cron_jobs = "'0'";
|
||||
if (empty($v_backups)) $v_backups = "'0'";
|
||||
if (empty($v_disk_quota)) $v_disk_quota = "'0'";
|
||||
if (empty($v_bandwidth)) $v_bandwidth = "'0'";
|
||||
if (empty($v_ns1)) $v_ns1 = 'ns1.example.ltd';
|
||||
if (empty($v_ns2)) $v_ns2 = 'ns2.example.ltd';
|
||||
|
||||
|
||||
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/menu_add_package.html');
|
||||
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/add_package.html');
|
||||
unset($_SESSION['error_msg']);
|
||||
unset($_SESSION['ok_msg']);
|
||||
}
|
||||
|
||||
// Footer
|
||||
include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');
|
28
web/list/package/index.php
Normal file
28
web/list/package/index.php
Normal file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
// Init
|
||||
error_reporting(NULL);
|
||||
session_start();
|
||||
$TAB = 'PACKAGE';
|
||||
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
|
||||
|
||||
// Header
|
||||
include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html');
|
||||
|
||||
// Panel
|
||||
top_panel($user,$TAB);
|
||||
|
||||
// Data
|
||||
if ($_SESSION['user'] == 'admin') {
|
||||
|
||||
exec (VESTA_CMD."v_list_user_packages json", $output, $return_var);
|
||||
check_error($return_var);
|
||||
$data = json_decode(implode('', $output), true);
|
||||
$data = array_reverse($data);
|
||||
unset($output);
|
||||
|
||||
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/menu_packages.html');
|
||||
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_packages.html');
|
||||
}
|
||||
|
||||
// Footer
|
||||
include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');
|
82
web/templates/admin/add_package.html
Normal file
82
web/templates/admin/add_package.html
Normal file
@ -0,0 +1,82 @@
|
||||
<table class='data'>
|
||||
<tr class="data-add">
|
||||
<td class="data-dotted" style="padding: 0px 10px 0px 0px" width="150">
|
||||
<table class="data-col1">
|
||||
<tr><td style="padding: 18 0 4 18;"></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="data-dotted" width="830px" style="vertical-align:top;">
|
||||
<table width="830px"><tr>
|
||||
<td></td>
|
||||
</tr></table>
|
||||
|
||||
<table class="data-col2" width="830px">
|
||||
<form method="post" name="v_add_user">
|
||||
<tr><td class="add-text" style="padding: 10 0 0 2px;">Package Name</td></tr>
|
||||
<tr><td><input type="text" size="20" class="add-input" name="v_package" <?php if (!empty($v_package)) echo "value=".$v_package; ?> ></tr>
|
||||
<tr><td class="add-text" style="padding: 10px 0 0 2px;">Default Template</td></tr>
|
||||
<tr><td><select class="add-list" name="v_template">
|
||||
<?php
|
||||
foreach ($templates as $key => $value) {
|
||||
echo "\t\t\t\t<option value=\"".$value."\"";
|
||||
if ((!empty($v_template)) && ( $value == $_POST['v_template'])){
|
||||
echo 'selected' ;
|
||||
}
|
||||
echo ">".$value."</option>\n";
|
||||
}
|
||||
?>
|
||||
</select></td></tr>
|
||||
<tr><td class="add-text" style="padding: 10px 0 0 2px;">System Shell</td></tr>
|
||||
<tr><td><select class="add-list" name="v_shell">
|
||||
<?php
|
||||
foreach ($shells as $key => $value) {
|
||||
echo "\t\t\t\t<option value=\"".$value."\"";
|
||||
if ((!empty($v_shell)) && ( $value == $v_shell)){
|
||||
echo 'selected' ;
|
||||
}
|
||||
if ((!empty($v_shell)) && ( $value == $_POST['v_shell'])){
|
||||
echo 'selected' ;
|
||||
}
|
||||
echo ">".$value."</option>\n";
|
||||
}
|
||||
?>
|
||||
</select></td></tr>
|
||||
|
||||
<tr><td class="add-text" style="padding: 10px 0 0 2px;">Web Domains</td></tr>
|
||||
<tr><td><input type="text" size="20" class="add-input" name="v_web_domains" <?php if (!empty($v_web_domains)) echo "value=".$v_web_domains; ?>></tr>
|
||||
<tr><td class="add-text" style="padding: 10px 0 0 2px;">Web Aliases <span style="padding:0 0 0 6px; font-size: 10pt; color:#555;">(per domain)</span></td></tr>
|
||||
<tr><td><input type="text" size="20" class="add-input" name="v_web_aliases" <?php if (!empty($v_web_aliases)) echo "value=".$v_web_aliases; ?>></tr>
|
||||
<tr><td class="add-text" style="padding: 10px 0 0 2px;">DNS Domains</td></tr>
|
||||
<tr><td><input type="text" size="20" class="add-input" name="v_dns_domains" <?php if (!empty($v_dns_domains)) echo "value=".$v_dns_domains; ?>></tr>
|
||||
<tr><td class="add-text" style="padding: 10px 0 0 2px;">DNS Records <span style="padding:0 0 0 6px; font-size: 10pt; color:#555;">(per domain)</span></td></tr>
|
||||
<tr><td><input type="text" size="20" class="add-input" name="v_dns_records" <?php if (!empty($v_dns_records)) echo "value=".$v_dns_records; ?>></tr>
|
||||
<tr><td class="add-text" style="padding: 10px 0 0 2px;">Mail Domains</td></tr>
|
||||
<tr><td><input type="text" size="20" class="add-input" name="v_mail_domains" <?php if (!empty($v_mail_domains)) echo "value=".$v_mail_domains; ?>></tr>
|
||||
<tr><td class="add-text" style="padding: 10px 0 0 2px;">Mail Accounts <span style="padding:0 0 0 6px; font-size: 10pt; color:#555;">(per domain)</span></td></tr>
|
||||
<tr><td><input type="text" size="20" class="add-input" name="v_mail_accounts" <?php if (!empty($v_mail_accounts)) echo "value=".$v_mail_accounts; ?>></tr>
|
||||
<tr><td class="add-text" style="padding: 10px 0 0 2px;">Databases</td></tr>
|
||||
<tr><td><input type="text" size="20" class="add-input" name="v_databases" <?php if (!empty($v_databases)) echo "value=".$v_databases; ?>></tr>
|
||||
<tr><td class="add-text" style="padding: 10px 0 0 2px;">Cron Jobs</td></tr>
|
||||
<tr><td><input type="text" size="20" class="add-input" name="v_cron_jobs" <?php if (!empty($v_cron_jobs)) echo "value=".$v_cron_jobs; ?>></tr>
|
||||
<tr><td class="add-text" style="padding: 10px 0 0 2px;">Backups</td></tr>
|
||||
<tr><td><input type="text" size="20" class="add-input" name="v_backups" <?php if (!empty($v_backups)) echo "value=".$v_backups; ?>></tr>
|
||||
<tr><td class="add-text" style="padding: 10px 0 0 2px;">Disk Quota <span style="padding:0 0 0 6px; font-size: 10pt; color:#555;">(in Mb)</span></td></tr>
|
||||
<tr><td><input type="text" size="20" class="add-input" name="v_disk_quota" <?php if (!empty($v_disk_quota)) echo "value=".$v_disk_quota; ?>></tr>
|
||||
<tr><td class="add-text" style="padding: 10px 0 0 2px;">Bandwidth <span style="padding:0 0 0 6px; font-size: 10pt; color:#555;">(in Mb)</span></td></tr>
|
||||
<tr><td><input type="text" size="20" class="add-input" name="v_bandwidth" <?php if (!empty($v_bandwidth)) echo "value=".$v_bandwidth; ?>></tr>
|
||||
<tr><td class="add-text" style="padding: 10px 0 0 2px;">Name Servers</td></tr>
|
||||
<tr><td><input type="text" size="20" class="add-input" name="v_ns1" <?php if (!empty($v_ns1)) echo "value=".$v_ns1; ?>></tr>
|
||||
<tr><td><input type="text" size="20" class="add-input" name="v_ns2" <?php if (!empty($v_ns2)) echo "value=".$v_ns2; ?>></tr>
|
||||
<tr><td><input type="text" size="20" class="add-input" name="v_ns3" <?php if (!empty($v_ns3)) echo "value=".$v_ns3; ?>></tr>
|
||||
<tr><td><input type="text" size="20" class="add-input" name="v_ns4" <?php if (!empty($v_ns4)) echo "value=".$v_ns4; ?>></tr>
|
||||
|
||||
|
||||
<tr><td style="padding: 24px 0 0 0;">
|
||||
<input type="submit" name="ok" value="OK" class="add-button">
|
||||
</form>
|
||||
<input type="button" class="add-button" value="Cancel" onClick="location.href='/list/user/'">
|
||||
</td></tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
@ -37,7 +37,6 @@ foreach ($data as $key => $value) {
|
||||
<td class="data-dotted" width="830px" style="vertical-align:top;">
|
||||
<table width="830px"><tr>
|
||||
<td></td>
|
||||
<td class="data-controls" width="84px"><img src="/images/update.png" width="8px" height="8px"><a href="/propagate/package/?package=<?php echo $key ?>"> propagate</a></td>
|
||||
<td class="data-controls" width="50px"><img src="/images/edit.png" width="8px" height="8px"><a href="/edit/package/?package=<?php echo $key ?>"> edit</a></td>
|
||||
<td class="data-controls" width="70px">
|
||||
<img src="/images/delete.png" width="7px" height="7px">
|
||||
@ -58,9 +57,9 @@ foreach ($data as $key => $value) {
|
||||
<td class="counter-value"><?php echo $data[$key]['SHELL'] ?></td></tr>
|
||||
|
||||
<tr><td class="chart1" colspan=2 style="padding: 0 0 0 2px;">Bandwidth: <?php echo humanize_usage($data[$key]['BANDWIDTH']) ?>
|
||||
<div style="width:160px; height:6px; font-size:0;background-color:#c7d5b3;"><div style="width:100%; height:6px; background-color:#9bbb62; border-right:1px #9bbb62 solid;"></div></div></td></tr>
|
||||
<div style="width:160px; height:6px; font-size:0;background-color:#c7d5b3;"><div style="width:0%; height:6px; background-color:#9bbb62; border-right:1px #9bbb62 solid;"></div></div></td></tr>
|
||||
<tr><td class="chart1" colspan=2 style="padding: 0 0 0 2px;">Disk: <?php echo humanize_usage($data[$key]['DISK_QUOTA']) ?>
|
||||
<div style="width:160px; height:6px; font-size:0;background-color:#c7d5b3;"><div style="width:100%; height:6px; background-color:#9bbb62; border-right:1px #9bbb62 solid;"></div></div></td></tr>
|
||||
<div style="width:160px; height:6px; font-size:0;background-color:#c7d5b3;"><div style="width:0%; height:6px; background-color:#9bbb62; border-right:1px #9bbb62 solid;"></div></div></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td style="vertical-align:top;" width="320">
|
||||
|
15
web/templates/admin/menu_add_package.html
Normal file
15
web/templates/admin/menu_add_package.html
Normal file
@ -0,0 +1,15 @@
|
||||
<table class="sub-menu">
|
||||
<tr>
|
||||
<td style="padding: 14px 2px 24px 0;" ><a class="add-name"><b>Adding User Package</b></a>
|
||||
<?php
|
||||
if (!empty($_SESSION['error_msg'])) {
|
||||
echo "<a class=\"add-error\"> → ".$_SESSION['error_msg']."</a>";
|
||||
} else {
|
||||
if (!empty($_SESSION['ok_msg'])) {
|
||||
echo "<a class=\"add-ok\"> → ".$_SESSION['ok_msg']."</a>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
@ -1,7 +1,7 @@
|
||||
<table class="sub-menu">
|
||||
<tr>
|
||||
<td width="142px" style="padding: 16px 0 16px 6px">
|
||||
<button style="width:120px; padding: 2px 0px 2px 0px;" onclick="location.href='/add/user/'">Add Package</button>
|
||||
<button style="width:120px; padding: 2px 0px 2px 0px;" onclick="location.href='/add/package/'">Add Package</button>
|
||||
<td><a style="padding: 0 4px 0 12px" class="select-controls" href='javascript:checkedAll("vstobjects");'> toggle all </a>
|
||||
<select style="margin:0 0 0 0px">
|
||||
<option>apply to selected</option>
|
||||
|
@ -2,7 +2,7 @@
|
||||
<table class="top">
|
||||
<tr>
|
||||
<td width="196px"><p class="hostname"><?php echo exec('hostname') ?></p></td>
|
||||
<td width="88px"><b><a class="top-<?php if($TAB == 'PACKAGES' ) echo 's' ?>link" href="/list/packages/">Packages </a></b></td>
|
||||
<td width="88px"><b><a class="top-<?php if($TAB == 'PACKAGE' ) echo 's' ?>link" href="/list/package/">Packages </a></b></td>
|
||||
<td width="100px"><b><a class="top-<?php if($TAB == 'IP' ) echo 's' ?>link" href="/list/ip/">IP Adresses </a></b></td>
|
||||
<td width="110px"><b><a class="top-<?php if($TAB == 'RRD' ) echo 's' ?>link" href="/list/rrd/">RRD Graphics</a></b></td>
|
||||
<td width="78px"><b><a class="top-<?php if($TAB == 'STATS' ) echo 's' ?>link" href="/list/stats/">Statistics</a></b></td>
|
||||
|
Loading…
x
Reference in New Issue
Block a user