diff --git a/bin/v-add-user-favourites b/bin/v-add-user-favourites index d6a92aa2..53620d57 100755 --- a/bin/v-add-user-favourites +++ b/bin/v-add-user-favourites @@ -13,6 +13,8 @@ user=$1 system=$(echo "$2" |tr '[:lower:]' '[:upper:]') object=$3 +email=$3 +id=$3 # Includes source $VESTA/func/main.sh @@ -24,7 +26,13 @@ source $VESTA/conf/vesta.conf #----------------------------------------------------------# check_args '3' "$#" 'USER SYSTEM OBJECT' -validate_format 'user' 'system' 'object' +validate_format 'user' 'system' +case $system in + MAIL_ACC) validate_format 'email' ;; + CRON) validate_format 'id' ;; + DNS_REC) validate_format 'id' ;; + *) validate_format 'object' +esac is_object_valid 'user' 'USER' "$user" is_object_unsuspended 'user' 'USER' "$user" @@ -33,7 +41,9 @@ case $system in USER) check='ok' ;; WEB) check='ok' ;; DNS) check='ok' ;; + DNS_REC) check='ok' ;; MAIL) check='ok' ;; + MAIL_ACC) check='ok' ;; DB) check='ok' ;; CRON) check='ok' ;; BACKUP) check='ok' ;; @@ -52,7 +62,9 @@ esac USER='' WEB='' DNS='' +DNS_REC='' MAIL='' +MAIL_ACC='' DB='' CRON='' BACKUP='' @@ -89,7 +101,9 @@ eval $system=$value echo "USER='$USER' WEB='$WEB' DNS='$DNS' +DNS_REC='$DNS_REC' MAIL='$MAIL' +MAIL_ACC='$MAIL_ACC' DB='$DB' CRON='$CRON' BACKUP='$BACKUP' diff --git a/bin/v-delete-user-favourites b/bin/v-delete-user-favourites index 5c69b889..cd515e95 100755 --- a/bin/v-delete-user-favourites +++ b/bin/v-delete-user-favourites @@ -13,6 +13,8 @@ user=$1 system=$(echo "$2" |tr '[:lower:]' '[:upper:]') object=$3 +email=$3 +id=$3 # Includes source $VESTA/func/main.sh @@ -24,7 +26,12 @@ source $VESTA/conf/vesta.conf #----------------------------------------------------------# check_args '3' "$#" 'USER SYSTEM OBJECT' -validate_format 'user' 'system' 'object' +case $system in + MAIL_ACC) validate_format 'email' ;; + CRON) validate_format 'id' ;; + DNS_REC) validate_format 'id' ;; + *) validate_format 'object' +esac is_object_valid 'user' 'USER' "$user" is_object_unsuspended 'user' 'USER' "$user" @@ -33,7 +40,9 @@ case $system in USER) check='ok' ;; WEB) check='ok' ;; DNS) check='ok' ;; + DNS_REC) check='ok' ;; MAIL) check='ok' ;; + MAIL_ACC) check='ok' ;; DB) check='ok' ;; CRON) check='ok' ;; BACKUP) check='ok' ;; @@ -52,7 +61,9 @@ esac USER='' WEB='' DNS='' +DNS_REC='' MAIL='' +MAIL_ACC='' DB='' CRON='' BACKUP='' @@ -89,7 +100,9 @@ eval $system=$value echo "USER='$USER' WEB='$WEB' DNS='$DNS' +DNS_REC='$DNS_REC' MAIL='$MAIL' +MAIL_ACC='$MAIL_ACC' DB='$DB' CRON='$CRON' BACKUP='$BACKUP' diff --git a/bin/v-list-user-favourites b/bin/v-list-user-favourites index 6117d26e..8e1b8dee 100755 --- a/bin/v-list-user-favourites +++ b/bin/v-list-user-favourites @@ -36,9 +36,9 @@ json_list_favourites() { fi (( ++i)) done - if [ -n "$value" ]; then + #if [ -n "$value" ]; then echo -e ' }' - fi + #fi echo -e '}' } @@ -74,7 +74,9 @@ is_object_valid 'user' 'USER' "$user" USER='' WEB='' DNS='' +DNS_REC='' MAIL='' +MAIL_ACC='' DB='' CRON='' BACKUP='' @@ -84,7 +86,8 @@ FIREWALL='' # Defining fileds to select OBJ='Favourites' -fields='$OBJ $USER $WEB $DNS $MAIL $DB $CRON $BACKUP $IP $PACKAGE $FIREWALL' +fields='$OBJ $USER $WEB $DNS $DNS_REC $MAIL $MAIL_ACC $DB $CRON $BACKUP + $IP $PACKAGE $FIREWALL' # Listing favourites case $format in diff --git a/func/main.sh b/func/main.sh index a97f5000..2873f704 100644 --- a/func/main.sh +++ b/func/main.sh @@ -916,7 +916,7 @@ validate_format(){ ns2) validate_format_domain "$arg" 'name_server';; ns3) validate_format_domain "$arg" 'name_server';; ns4) validate_format_domain "$arg" 'name_server';; - object) validate_format_domain_alias "$arg" 'object';; + object) validate_format_name_s "$arg" 'object';; package) validate_format_name "$arg" "$arg_name" ;; password) validate_format_password "$arg" ;; port) validate_format_int "$arg" 'port' ;; diff --git a/web/add/favorite/index.php b/web/add/favorite/index.php new file mode 100644 index 00000000..5cfe582d --- /dev/null +++ b/web/add/favorite/index.php @@ -0,0 +1,65 @@ +
'; + +// Init +error_reporting(NULL); +ob_start(); +session_start(); + + +// mail_acc +// firewall + +include($_SERVER['DOCUMENT_ROOT']."/inc/main.php"); + +// Check POST request +//if (!empty($_POST['ok'])) { + + // Check token +// if ((!isset($_POST['token'])) || ($_SESSION['token'] != $_POST['token'])) { +// header('location: /login/'); +// exit(); +// } + + + // v-list-user-favourites + // v-delete-user-favourites admin web test0011.com + + // Protect input +// $v_section = escapeshellarg($_POST['v_section']); +// $v_unit_id = escapeshellarg($_POST['v_unit_id']); + + $v_section = escapeshellarg($_REQUEST['v_section']); + $v_unit_id = escapeshellarg($_REQUEST['v_unit_id']); + +// $v_section = 'web'; +// $v_unit_id = 'test0011.com'; + + + echo VESTA_CMD."v-add-user-favourites ".$_SESSION['user']." ".$v_section." ".$v_unit_id; + + echo ' - '; + + // Add cron job + exec (VESTA_CMD."v-add-user-favourites ".$_SESSION['user']." ".$v_section." ".$v_unit_id, $output, $return_var); + check_return_code($return_var,$output); + + var_dump($return_var); + echo '
--------------------
'; + + var_dump($output); + echo '
--------------------
'; + + +/* + echo '
favorites:
'; + + // Data + exec (VESTA_CMD."v-list-user-favourites $user json", $output, $return_var); + $data = json_decode(implode('', $output), true); + $data = array_reverse($data,true); + print_r($data); +*/ +//} +?> \ No newline at end of file diff --git a/web/css/styles.min.css b/web/css/styles.min.css index 571a0061..b0b34898 100644 --- a/web/css/styles.min.css +++ b/web/css/styles.min.css @@ -1890,8 +1890,8 @@ div.l-content > div.l-separator:nth-of-type(4) { width: 36px; height: 36px; background-position: -216px 560px; - display: none; cursor: pointer; + display: none; } .l-unit--starred .l-icon-star { display: inline-block; @@ -1912,7 +1912,7 @@ div.l-content > div.l-separator:nth-of-type(4) { } .l-unit:hover .l-icon-star { - /*display: inline-block;*/ + display: inline-block; } @@ -2144,6 +2144,13 @@ div.l-content > div.l-separator:nth-of-type(4) { .step-top { padding-top: 42px; } +.step-top-small { + padding-top: 22px; +} +.jump-top { + margin-top: -60px; +} + .data a { text-decoration: none; } @@ -2341,14 +2348,30 @@ a.vst-text:active b{ .additional-control.ftp-remove-user { padding: 2px 0 0 0; } + +.additional-control.delete:hover, .additional-control.ftp-remove-user:hover { background-color: #FF3438; border-color: #FF3438; } +.additional-control.delete:active, .additional-control.ftp-remove-user:active { background-color: #FF5F5F; border-color: #FF5F5F; } +.additional-control.add:hover { + background-color: #9FBF0C; + border-color: #9FBF0C; +} +.additional-control.add:active{ + background-color: #c0e60f; + border-color: #c0e60f; +} + +.additional-control.remove-ns { + display: none; +} + .data .step-left { padding-left: 50px; } @@ -2478,6 +2501,23 @@ td.hint { .data-dotted { vertical-align: top; } +.mail-infoblock-td { + vertical-align: top; +} +.mail-infoblock { + padding-top: 76px; + margin-left: -100px; + font-size: 12px; + color: #777; +} +.mail-infoblock td { + color: #777; + font-size: 14px; + height: 20px; + padding-right: 25px; + font-weight: normal; +} + :focus {outline:none;} ::-moz-focus-inner {border:0;} diff --git a/web/delete/favorite/index.php b/web/delete/favorite/index.php new file mode 100644 index 00000000..0b61b2c4 --- /dev/null +++ b/web/delete/favorite/index.php @@ -0,0 +1,19 @@ +'; + + + error_reporting(NULL); + ob_start(); + session_start(); + + include($_SERVER['DOCUMENT_ROOT']."/inc/main.php"); + + $v_section = escapeshellarg($_REQUEST['v_section']); + $v_unit_id = escapeshellarg($_REQUEST['v_unit_id']); + + exec (VESTA_CMD."v-delete-user-favourites ".$_SESSION['user']." ".$v_section." ".$v_unit_id, $output, $return_var); + check_return_code($return_var,$output); + + +?> \ No newline at end of file diff --git a/web/list/favorites/index.php b/web/list/favorites/index.php new file mode 100644 index 00000000..1c30fa66 --- /dev/null +++ b/web/list/favorites/index.php @@ -0,0 +1,25 @@ + Favorites:
'; + + // Data + exec (VESTA_CMD."v-list-user-favourites ".$_SESSION['user']." json", $output, $return_var); + + +// print_r(implode('', $output)); +// $json = '{ "Favourites": { "USER": "", "WEB": "bulletfarm.com", "DNS": "", "MAIL": "", "DB": "", "CRON": "", "BACKUP": "", "IP": "", "PACKAGE": "", "FIREWALL": ""}}'; +// $data = json_decode($json, true); + + + $data = json_decode(implode('', $output).'}', true); + $data = array_reverse($data,true); + + print_r($data); +// $data = array_reverse($data,true); + +// $data = json_decode(implode('', $output), true); + +?> \ No newline at end of file diff --git a/web/templates/admin/list_cron.html b/web/templates/admin/list_cron.html index 4a1198c8..524af349 100644 --- a/web/templates/admin/list_cron.html +++ b/web/templates/admin/list_cron.html @@ -79,7 +79,9 @@ } ?> -
+
diff --git a/web/templates/admin/list_db.html b/web/templates/admin/list_db.html index 7e0c64bb..61763255 100644 --- a/web/templates/admin/list_db.html +++ b/web/templates/admin/list_db.html @@ -109,7 +109,9 @@ ?> -
+
diff --git a/web/templates/admin/list_dns.html b/web/templates/admin/list_dns.html index 23c078f1..34fc39ef 100644 --- a/web/templates/admin/list_dns.html +++ b/web/templates/admin/list_dns.html @@ -69,7 +69,9 @@ } ?> -
+
diff --git a/web/templates/admin/list_dns_rec.html b/web/templates/admin/list_dns_rec.html index 6bc95b11..f12500fa 100644 --- a/web/templates/admin/list_dns_rec.html +++ b/web/templates/admin/list_dns_rec.html @@ -67,7 +67,8 @@ ?> -
+
@@ -96,6 +97,9 @@
+
+ +
diff --git a/web/templates/admin/list_firewall.html b/web/templates/admin/list_firewall.html index b1d515d7..324b4996 100644 --- a/web/templates/admin/list_firewall.html +++ b/web/templates/admin/list_firewall.html @@ -72,7 +72,9 @@ } ?> -
+
diff --git a/web/templates/admin/list_ip.html b/web/templates/admin/list_ip.html index c5d1a662..f095a7c1 100644 --- a/web/templates/admin/list_ip.html +++ b/web/templates/admin/list_ip.html @@ -60,7 +60,10 @@ ++$i; ?> -
+
diff --git a/web/templates/admin/list_mail.html b/web/templates/admin/list_mail.html index 17a6ba23..73ee54e1 100644 --- a/web/templates/admin/list_mail.html +++ b/web/templates/admin/list_mail.html @@ -86,7 +86,9 @@ ?> -
"> +
">
diff --git a/web/templates/admin/list_mail_acc.html b/web/templates/admin/list_mail_acc.html index b9de6318..253e0194 100644 --- a/web/templates/admin/list_mail_acc.html +++ b/web/templates/admin/list_mail_acc.html @@ -82,7 +82,9 @@ ?> -
+
" + v_unit_id="" v_section="mail_acc" sort-date="" sort-name="" sort-disk="" +sort-star="">
diff --git a/web/templates/admin/list_packages.html b/web/templates/admin/list_packages.html index 111bd21a..65d19fa4 100644 --- a/web/templates/admin/list_packages.html +++ b/web/templates/admin/list_packages.html @@ -56,7 +56,9 @@ ?> -
+
diff --git a/web/templates/admin/list_user.html b/web/templates/admin/list_user.html index 97e4a6c5..1d70c1e3 100644 --- a/web/templates/admin/list_user.html +++ b/web/templates/admin/list_user.html @@ -81,7 +81,9 @@ } ?> -
+
diff --git a/web/templates/admin/list_web.html b/web/templates/admin/list_web.html index 4919a3da..c2da185a 100644 --- a/web/templates/admin/list_web.html +++ b/web/templates/admin/list_web.html @@ -115,10 +115,10 @@ } ?> -
+sort-name="" sort-bandwidth="" sort-disk="" sort-star="">
diff --git a/web/templates/user/list_cron.html b/web/templates/user/list_cron.html index 6ba70842..a91caafc 100644 --- a/web/templates/user/list_cron.html +++ b/web/templates/user/list_cron.html @@ -80,7 +80,8 @@ ?> -
+
diff --git a/web/templates/user/list_db.html b/web/templates/user/list_db.html index 52ac74f8..dff13d0d 100644 --- a/web/templates/user/list_db.html +++ b/web/templates/user/list_db.html @@ -109,7 +109,9 @@ ?> -
+
diff --git a/web/templates/user/list_dns.html b/web/templates/user/list_dns.html index 6c1c8909..432d0d83 100644 --- a/web/templates/user/list_dns.html +++ b/web/templates/user/list_dns.html @@ -70,7 +70,9 @@ } ?> -
+
diff --git a/web/templates/user/list_dns_rec.html b/web/templates/user/list_dns_rec.html index 0c862287..6a7a8270 100644 --- a/web/templates/user/list_dns_rec.html +++ b/web/templates/user/list_dns_rec.html @@ -67,7 +67,8 @@ ?> -
+
@@ -96,6 +97,9 @@
+
+ +
diff --git a/web/templates/user/list_mail.html b/web/templates/user/list_mail.html index c011bacf..e45c2eb6 100644 --- a/web/templates/user/list_mail.html +++ b/web/templates/user/list_mail.html @@ -86,7 +86,9 @@ ?> -
+
diff --git a/web/templates/user/list_mail_acc.html b/web/templates/user/list_mail_acc.html index 8517adba..d510445a 100644 --- a/web/templates/user/list_mail_acc.html +++ b/web/templates/user/list_mail_acc.html @@ -83,7 +83,9 @@ ?> -
+
" v_unit_id="" v_section="mail_acc" +sort-date="" sort-name="" sort-disk="" +sort-star="">
diff --git a/web/templates/user/list_user.html b/web/templates/user/list_user.html index cceb2de2..cdf2c2d8 100644 --- a/web/templates/user/list_user.html +++ b/web/templates/user/list_user.html @@ -81,7 +81,9 @@ } ?> -
+
diff --git a/web/templates/user/list_web.html b/web/templates/user/list_web.html index 34e98bbd..3ee9c16b 100644 --- a/web/templates/user/list_web.html +++ b/web/templates/user/list_web.html @@ -119,7 +119,9 @@ -
+