From 5d717c8d4e741647bbd852ae8f98305fd0c9cdec Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Sun, 15 Jan 2012 12:48:31 +0200 Subject: [PATCH 01/11] New fav icon --- web/images/fav.ico | Bin 1179 -> 3599 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/web/images/fav.ico b/web/images/fav.ico index 7c26ae9dff9279abe5f7fffd2a833f99a72c018f..a1ef01996c2d643f3eab6a6601139100c0a9016b 100644 GIT binary patch delta 3580 zcmV#DdidNS%n{ zpeVR!L5hf4i&b1W?jPKzwS9W;?d|*5`@H9z=lsrj&kukR5+;%6f1+vtIZ}l@I@lkN zPe{bcy?_E0NZAR{$W9 z0N^4L=L-RlQUJ&HumpsYY5E(E}?0f1SyGDiY{y#)Yvj#!WnKwtoX znL;eg03bL507D)V%>y7z1E4U{zu>7~aD})?0RX_umCct+(lZpemCzb@^6=o|A>zVp zu|i=NDG+7}d$gBmT#Qe}DasDbeCIv0N+_it$*9xKJWZ$9cI@kwhWMmEscVe=_kOmi-BncMSln zhEKpwwg z=onn6low3K2mk;?pn)o|K?e-M6s*7woWUKuz!w5xe+EQA3?#rj5JCpzfE)^;7?wd9 zRKPme1hudO8lVxH;SjXJF*pt9;1XPc>u?taU>Kgl7`%oF1VP9M6Ja4bh!J9r*dopd z7nzO(B4J20l7OTj>4+3jBE`sZqynizYLQ(?Bl0bB6giDtK>Co|$RIL`{EECsF_eL_ zQ3KQhe|12)s2>`N#-MZ2bTkiLfR>_b(HgWKJ%F~Nr_oF3b#wrIijHG|(J>BYjM-sa zjE6;FiC7vY#};GdST$CUHDeuEH+B^pz@B062qXfFfD`NpUW5?BY=V%GM_5c)L#QR} zBeW8_2v-S%gfYS=B9o|3v?Y2H`NVi)I5gFH?u96Et<2CC!@_L(8Ns zf1}mVnrUZg_h>Kabh-)MgC0ef(3jF{=m+WN>4Wrl3=M`2gU3i>C>d)Rdl{z~w;3;) zOr{0Xmzl^^FxN60nP->}m~T~BD)uUT6_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vhe!Q6Q#nLe3z9h{CmE%{!}ua}3a@?4>lMasUO|r6;K#p8=-nlnvO3193)i9{NsMIL+FE>iwWtV>v^<7KhoDhq9D1rU<>~AgV?QEj z5lzn}vvF56x_E)4Ca36{R*xwv;*aGp6i$J6TQer^gkTm@N=M1PFunOJ`YS7)5>->g zZcWGJM`9?mF~fvY0TK8FV)ydWHLGwNTiOG?y95TPe=5(^NPk(Rf)bj4uTBj<1Z(| z7CDI*sH-~S7> C>b#2p From a0b61f6d0e03edb6518b51c4a7c3f8fa9d3c2148 Mon Sep 17 00:00:00 2001 From: larsz Date: Sun, 15 Jan 2012 18:52:14 +0200 Subject: [PATCH 02/11] fixed 1px gap on selected/hovered item in main navigation (issue #28), removed unused elements from main menu (previous plus-control, which has been hidden) --- web/css/main.css | 19 ++++++++--- web/images/section-status-sprite-7.png | Bin 0 -> 993 bytes web/index.html | 45 +++++++++++-------------- 3 files changed, 33 insertions(+), 31 deletions(-) create mode 100644 web/images/section-status-sprite-7.png diff --git a/web/css/main.css b/web/css/main.css index 3a25d37c..1679342e 100644 --- a/web/css/main.css +++ b/web/css/main.css @@ -3,7 +3,7 @@ Title : Vesta Author : Eugen Lobicov, eugen.lobicov@gmail.com created : November 27, 2009 -last updated : January 12, 2012 +last updated : January 15, 2012 - - - - - - - - - - - - - - - - - - */ html{ @@ -266,6 +266,7 @@ input::-moz-focus-inner{ float:left; margin-right:4px; } + /* .section .section-title .add-entry{ position:relative; top:2px; @@ -282,17 +283,20 @@ input::-moz-focus-inner{ background-position:-14px 0; cursor:pointer; } - + */ .section .section-devider{ position:absolute; left:0; bottom:0; z-index:10; - /*background:url(../images/section-status-sprite-5.gif) no-repeat -420px 115px; */ display:block; width:100%; height:3px; - background:url(../images/section-status-sprite-6.png) no-repeat -420px 100%; + + /*background:url(../images/section-status-sprite-5.gif) no-repeat -420px 115px; */ + /*background:url(../images/section-status-sprite-6.png) no-repeat -420px 100%;*/ + background:url(../images/section-status-sprite-7.png) no-repeat -136px 100%; + } .dnstpl-nav-item .section-title{ @@ -319,7 +323,9 @@ input::-moz-focus-inner{ cursor:pointer; } .primary-nav .active .section-devider{ - background-position:-283px 100%; + /*background-position:-283px 100%;*/ + background-position:-276px 100%; + height:6px; bottom:-3px; } @@ -597,6 +603,9 @@ input::-moz-focus-inner{ cursor:pointer; white-space:nowrap; } + .checkbox-selector:hover .checkbox{ + background-position:0 -90px; + } .checkbox-selector .selector-title:hover{ color:#2ea8bd; } diff --git a/web/images/section-status-sprite-7.png b/web/images/section-status-sprite-7.png new file mode 100644 index 0000000000000000000000000000000000000000..f17efb73b56d6f65d62fb2149a12f8f2e72b8400 GIT binary patch literal 993 zcmaJ=J#5oJ6uzpJD1{;+27acKyCGtq?Iw{;O-W*>4XUFkiIj|S>`P)=`;2`hZrRun z0~-_V&QdXSLkOlyER|5j(iKJ!LSjS;=QK$f2sha8J$>Kze(v3~N_lN@;no5GV6n8W zR{@yWWA=slS@!+uI2HPWGdE5sn@kT!-T&+6hTww#?uAMpwRv(T+KY17_#N_1zHHcFT2pchgoJ zZuK5qiB%@xVQRtH+wvnd*0`ar%IqX8aBv8rn;LgkRMV`$0tqop^C)Gb41yVv7v<$_ zHhTw3NJIjX1W`(fSyh%)gy86KEL-Sw)T&+_W`~|0x{RcLFR_aYVL5n_XOIDM=Nmg%Demgmpr;##5~H2qjUE1h7y` z!-nfSq#q5@rm2?vh+4jlOS;A}KJU7YigI!;zibrcq9Ti;A?6J^r(}#`UQ|#fyDW{l zIOUs~U@%0us VJy_sA)0Zxzf|60z5Av<2e*hy+JLdoZ literal 0 HcmV?d00001 diff --git a/web/index.html b/web/index.html index febb7127..92b4a2f3 100644 --- a/web/index.html +++ b/web/index.html @@ -82,7 +82,6 @@
User -  
0 users @@ -98,7 +97,6 @@
Web -  
0 web domains @@ -108,12 +106,24 @@ +
  • +
    +
    +
    + DNS +
    +
    + 0 dns domain(s) +
    +
    +
    + +
  • Mail -  
    0 mail domain(s) @@ -127,7 +137,6 @@
    DB -  
    0 databases @@ -137,44 +146,28 @@
  • -
  • +
  • - DNS -   + Cron
    - 0 dns domain(s) -
    -
    -
    - -
  • -
  • -
    -
    -
    - IP -   -
    -
    - 0 ip address(es) + 0 cron job(s) 0 suspended
  • -
  • +
  • - Cron -   + IP
    - 0 cron job(s) + 0 ip address(es) 0 suspended
    From 9ab2787e5e70d76c8e11fdd8fa38477eaefaf40e Mon Sep 17 00:00:00 2001 From: larsz Date: Sun, 15 Jan 2012 22:34:45 +0200 Subject: [PATCH 03/11] fixed width of custom select dropdown elements (issue #29) --- web/js/lib/custom-form-elements.js | 325 +++++++++++++++-------------- 1 file changed, 164 insertions(+), 161 deletions(-) diff --git a/web/js/lib/custom-form-elements.js b/web/js/lib/custom-form-elements.js index a68126b1..57c3c1f5 100644 --- a/web/js/lib/custom-form-elements.js +++ b/web/js/lib/custom-form-elements.js @@ -1,161 +1,164 @@ -/* - -CUSTOM FORM ELEMENTS - -Created by Ryan Fait -www.ryanfait.com - -The only things you may need to change in this file are the following -variables: checkboxHeight, radioHeight and selectWidth (lines 24, 25, 26) - -The numbers you set for checkboxHeight and radioHeight should be one quarter -of the total height of the image want to use for checkboxes and radio -buttons. Both images should contain the four stages of both inputs stacked -on top of each other in this order: unchecked, unchecked-clicked, checked, -checked-clicked. - -You may need to adjust your images a bit if there is a slight vertical -movement during the different stages of the button activation. - -The value of selectWidth should be the width of your select list image. - -Visit http://ryanfait.com/ for more information. - -*/ - -var checkboxHeight = "25"; -var radioHeight = "25"; -var selectWidth = "210"; - - -/* No need to change anything after this */ - - -document.write(''); - -var Custom = { - init: function() { - var inputs = document.getElementsByTagName("input"), span = Array(), textnode, option, active; - for(a = 0; a < inputs.length; a++) { - if((inputs[a].type == "checkbox" || inputs[a].type == "radio") && $(inputs[a]).hasClass("styled") && !$(inputs[a]).hasClass("style-applied")) { - $(inputs[a]).addClass('style-applied'); - span[a] = document.createElement("span"); - span[a].className = inputs[a].type; - if ($(inputs[a]).attr('class').indexOf('do_action_toggle_suspend') != -1) { - span[a].className += ' do_action_toggle_suspend'; // save toggle functionality - } - if ($(inputs[a]).attr('class').indexOf('do_action_toggle_batch_selector') != -1) { - span[a].className += ' do_action_toggle_batch_selector'; // save toggle functionality - } - - - if(inputs[a].checked == true) { - if(inputs[a].type == "checkbox") { - position = "0 -" + (checkboxHeight*2) + "px"; - span[a].style.backgroundPosition = position; - } else { - position = "0 -" + (radioHeight*2) + "px"; - span[a].style.backgroundPosition = position; - } - } - inputs[a].parentNode.insertBefore(span[a], inputs[a]); - inputs[a].onchange = Custom.clear; - if(!inputs[a].getAttribute("disabled")) { - span[a].onmousedown = Custom.pushed; - span[a].onmouseup = Custom.check; - } else { - span[a].className = span[a].className += " disabled"; - } - } - } - inputs = document.getElementsByTagName("select"); - try { - for(a = 0; a < inputs.length; a++) { - if($(inputs[a]).hasClass("styled")) { - option = inputs[a].getElementsByTagName("option"); - active = option[0].childNodes[0].nodeValue; - textnode = document.createTextNode(active); - for(b = 0; b < option.length; b++) { - if(option[b].selected == true) { - textnode = document.createTextNode(option[b].childNodes[0].nodeValue); - } - } - span[a] = document.createElement("span"); - span[a].className = "select"; - span[a].id = "select-" + inputs[a].name + a; - span[a].appendChild(textnode); - inputs[a].parentNode.insertBefore(span[a], inputs[a]); - inputs[a].id = inputs[a].name + a; - if(!inputs[a].getAttribute("disabled")) { - inputs[a].onchange = Custom.choose; - } else { - inputs[a].previousSibling.className = inputs[a].previousSibling.className += " disabled"; - } - } - } - document.onmouseup = Custom.clear; - } - catch(e){ /* */ } - }, - pushed: function() { - element = this.nextSibling; - if(element.checked == true && element.type == "checkbox") { - this.style.backgroundPosition = "0 -" + checkboxHeight*3 + "px"; - } else if(element.checked == true && element.type == "radio") { - this.style.backgroundPosition = "0 -" + radioHeight*3 + "px"; - } else if(element.checked != true && element.type == "checkbox") { - this.style.backgroundPosition = "0 -" + checkboxHeight + "px"; - } else { - this.style.backgroundPosition = "0 -" + radioHeight + "px"; - } - }, - check: function() { - element = this.nextSibling; - if(element.checked == true && element.type == "checkbox") { - this.style.backgroundPosition = "0 0"; - element.checked = false; - } else { - if(element.type == "checkbox") { - this.style.backgroundPosition = "0 -" + checkboxHeight*2 + "px"; - } else { - this.style.backgroundPosition = "0 -" + radioHeight*2 + "px"; - group = this.nextSibling.name; - inputs = document.getElementsByTagName("input"); - for(a = 0; a < inputs.length; a++) { - if(inputs[a].name == group && inputs[a] != this.nextSibling) { - inputs[a].previousSibling.style.backgroundPosition = "0 0"; - } - } - } - element.checked = true; - } - }, - clear: function() { - inputs = document.getElementsByTagName("input"); - for(var b = 0; b < inputs.length; b++) { - if(inputs[b].type == "checkbox" && inputs[b].checked == true && inputs[b].className == "styled") { - inputs[b].previousSibling.style.backgroundPosition = "0 -" + checkboxHeight*2 + "px"; - } else if(inputs[b].type == "checkbox" && inputs[b].className == "styled") { - inputs[b].previousSibling.style.backgroundPosition = "0 0"; - } else if(inputs[b].type == "radio" && inputs[b].checked == true && inputs[b].className == "styled") { - inputs[b].previousSibling.style.backgroundPosition = "0 -" + radioHeight*2 + "px"; - } else if(inputs[b].type == "radio" && inputs[b].className == "styled") { - inputs[b].previousSibling.style.backgroundPosition = "0 0"; - } - } - }, - choose: function() { - option = this.getElementsByTagName("option"); - for(d = 0; d < option.length; d++) { - if(option[d].selected == true) { - // - var expr = '#select-' + this.id; - fb.log(expr); - $(expr).text(option[d].childNodes[0].nodeValue); - // bad! - //document.getElementById("select" + this.name).childNodes[0].nodeValue = option[d].childNodes[0].nodeValue; - } - } - } -} -window.onload = Custom.init; +/* + +CUSTOM FORM ELEMENTS + +Created by Ryan Fait +www.ryanfait.com + +The only things you may need to change in this file are the following +variables: checkboxHeight, radioHeight and selectWidth (lines 24, 25, 26) + +The numbers you set for checkboxHeight and radioHeight should be one quarter +of the total height of the image want to use for checkboxes and radio +buttons. Both images should contain the four stages of both inputs stacked +on top of each other in this order: unchecked, unchecked-clicked, checked, +checked-clicked. + +You may need to adjust your images a bit if there is a slight vertical +movement during the different stages of the button activation. + +The value of selectWidth should be the width of your select list image. + +Visit http://ryanfait.com/ for more information. + +*/ + +var checkboxHeight = "25"; +var radioHeight = "25"; +var selectWidth = "230"; + + +/* No need to change anything after this */ + + +document.write(''); + +var Custom = { + init: function() { + var inputs = document.getElementsByTagName("input"), span = Array(), textnode, option, active; + for(a = 0; a < inputs.length; a++) { + if((inputs[a].type == "checkbox" || inputs[a].type == "radio") && $(inputs[a]).hasClass("styled") && !$(inputs[a]).hasClass("style-applied")) { + $(inputs[a]).addClass('style-applied'); + span[a] = document.createElement("span"); + span[a].className = inputs[a].type; + if ($(inputs[a]).attr('class').indexOf('do_action_toggle_suspend') != -1) { + span[a].className += ' do_action_toggle_suspend'; // save toggle functionality + } + if ($(inputs[a]).attr('class').indexOf('do_action_toggle_batch_selector') != -1) { + span[a].className += ' do_action_toggle_batch_selector'; // save toggle functionality + } + if ($(inputs[a]).attr('class').indexOf('do_action_toggle_ssl_support') != -1) { + span[a].className += ' do_action_toggle_ssl_support'; // save toggle functionality + } + + + if(inputs[a].checked == true) { + if(inputs[a].type == "checkbox") { + position = "0 -" + (checkboxHeight*2) + "px"; + span[a].style.backgroundPosition = position; + } else { + position = "0 -" + (radioHeight*2) + "px"; + span[a].style.backgroundPosition = position; + } + } + inputs[a].parentNode.insertBefore(span[a], inputs[a]); + inputs[a].onchange = Custom.clear; + if(!inputs[a].getAttribute("disabled")) { + span[a].onmousedown = Custom.pushed; + span[a].onmouseup = Custom.check; + } else { + span[a].className = span[a].className += " disabled"; + } + } + } + inputs = document.getElementsByTagName("select"); + try { + for(a = 0; a < inputs.length; a++) { + if($(inputs[a]).hasClass("styled")) { + option = inputs[a].getElementsByTagName("option"); + active = option[0].childNodes[0].nodeValue; + textnode = document.createTextNode(active); + for(b = 0; b < option.length; b++) { + if(option[b].selected == true) { + textnode = document.createTextNode(option[b].childNodes[0].nodeValue); + } + } + span[a] = document.createElement("span"); + span[a].className = "select"; + span[a].id = "select-" + inputs[a].name + a; + span[a].appendChild(textnode); + inputs[a].parentNode.insertBefore(span[a], inputs[a]); + inputs[a].id = inputs[a].name + a; + if(!inputs[a].getAttribute("disabled")) { + inputs[a].onchange = Custom.choose; + } else { + inputs[a].previousSibling.className = inputs[a].previousSibling.className += " disabled"; + } + } + } + document.onmouseup = Custom.clear; + } + catch(e){ /* */ } + }, + pushed: function() { + element = this.nextSibling; + if(element.checked == true && element.type == "checkbox") { + this.style.backgroundPosition = "0 -" + checkboxHeight*3 + "px"; + } else if(element.checked == true && element.type == "radio") { + this.style.backgroundPosition = "0 -" + radioHeight*3 + "px"; + } else if(element.checked != true && element.type == "checkbox") { + this.style.backgroundPosition = "0 -" + checkboxHeight + "px"; + } else { + this.style.backgroundPosition = "0 -" + radioHeight + "px"; + } + }, + check: function() { + element = this.nextSibling; + if(element.checked == true && element.type == "checkbox") { + this.style.backgroundPosition = "0 0"; + element.checked = false; + } else { + if(element.type == "checkbox") { + this.style.backgroundPosition = "0 -" + checkboxHeight*2 + "px"; + } else { + this.style.backgroundPosition = "0 -" + radioHeight*2 + "px"; + group = this.nextSibling.name; + inputs = document.getElementsByTagName("input"); + for(a = 0; a < inputs.length; a++) { + if(inputs[a].name == group && inputs[a] != this.nextSibling) { + inputs[a].previousSibling.style.backgroundPosition = "0 0"; + } + } + } + element.checked = true; + } + }, + clear: function() { + inputs = document.getElementsByTagName("input"); + for(var b = 0; b < inputs.length; b++) { + if(inputs[b].type == "checkbox" && inputs[b].checked == true && inputs[b].className == "styled") { + inputs[b].previousSibling.style.backgroundPosition = "0 -" + checkboxHeight*2 + "px"; + } else if(inputs[b].type == "checkbox" && inputs[b].className == "styled") { + inputs[b].previousSibling.style.backgroundPosition = "0 0"; + } else if(inputs[b].type == "radio" && inputs[b].checked == true && inputs[b].className == "styled") { + inputs[b].previousSibling.style.backgroundPosition = "0 -" + radioHeight*2 + "px"; + } else if(inputs[b].type == "radio" && inputs[b].className == "styled") { + inputs[b].previousSibling.style.backgroundPosition = "0 0"; + } + } + }, + choose: function() { + option = this.getElementsByTagName("option"); + for(d = 0; d < option.length; d++) { + if(option[d].selected == true) { + // + var expr = '#select-' + this.id; + fb.log(expr); + $(expr).text(option[d].childNodes[0].nodeValue); + // bad! + //document.getElementById("select" + this.name).childNodes[0].nodeValue = option[d].childNodes[0].nodeValue; + } + } + } +} +window.onload = Custom.init; From b81e5d4d1703723898e547faec4b6f7179c539d9 Mon Sep 17 00:00:00 2001 From: larsz Date: Sun, 15 Jan 2012 23:20:26 +0200 Subject: [PATCH 04/11] added styles to options in custom selects (related to issue #28) --- web/css/main.css | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/web/css/main.css b/web/css/main.css index 1679342e..b71885a1 100644 --- a/web/css/main.css +++ b/web/css/main.css @@ -1584,10 +1584,14 @@ input::-moz-focus-inner{ background-color:#FFFFCB; } .b-new-entry select.styled{ - top:10px; + top:0; } .b-new-entry option{ - font:14px arial,sans-serif; + padding:5px 5px 5px 8px; + font-family:Arial, Helvetica, sans-serif; + font-size:14px; + font-weight:bold; + color:#555; } .b-new-entry .form-options-group{} From 6628a9b3af57e2be7b8ed05f14f8fcac0ec77820 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Mon, 16 Jan 2012 13:34:23 +0200 Subject: [PATCH 05/11] change shell - improved verification --- bin/v_change_user_shell | 7 ++++--- func/shared.func | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/bin/v_change_user_shell b/bin/v_change_user_shell index 41cfb3b0..55b9f14b 100755 --- a/bin/v_change_user_shell +++ b/bin/v_change_user_shell @@ -40,9 +40,6 @@ is_user_suspended # Action # #----------------------------------------------------------# -# Changing user shell -update_user_value "$user" '$SHELL' "$shell" - # Get shell full path shell_path=$(/usr/bin/chsh --list-shells | grep -w "$shell" ) @@ -50,10 +47,14 @@ shell_path=$(/usr/bin/chsh --list-shells | grep -w "$shell" ) /usr/bin/chsh -s "$shell_path" "$user" >/dev/null 2>&1 + #----------------------------------------------------------# # Vesta # #----------------------------------------------------------# +# Changing user shell +update_user_value "$user" '$SHELL' "$shell" + # Logging log_event 'system' "$V_EVENT" diff --git a/func/shared.func b/func/shared.func index 168fadc5..d3ff3a66 100644 --- a/func/shared.func +++ b/func/shared.func @@ -61,10 +61,10 @@ format_validation() { # Checking shell check_shell=$(/usr/bin/chsh --list-shells | grep -w "$val" ) - if [ -z "$check_shell" ]; then + if [ -z "$1"] || [ -z "$check_shell" ]; then echo "Error: shell not found" - log_event 'debug' "$E_INVALID $V_EVENT" - exit $E_INVALID + log_event 'debug' "$E_NOTEXIST $V_EVENT" + exit $E_NOTEXIST fi } From 816cee7fadc6a31fccfff15c2d08952c577b5260 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Mon, 16 Jan 2012 17:05:20 +0200 Subject: [PATCH 06/11] improved cron validation --- func/shared.func | 63 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/func/shared.func b/func/shared.func index d3ff3a66..fb97674a 100644 --- a/func/shared.func +++ b/func/shared.func @@ -263,6 +263,64 @@ format_validation() { fi } + # Define minute/hour/day/month validator + format_mhd() { + val="$1" + digit=$val + limit=60 + + if [ "$var" = 'day' ]; then + limit=31 + fi + if [ "$var" = 'month' ]; then + limit=12 + fi + if [ "$var" = 'wday' ]; then + limit=7 + fi + + letters=$(echo "$val"|grep -c "[a-Z]") + lslash=$(echo "$val"| grep "^/") + if [ -z "$val" ] || [ 0 -ne "$letters" ] || [ -n "$lslash" ]; then + echo "Error: $var is out of range" + log_event 'debug' "$E_INVALID $V_EVENT" + exit $E_INVALID + fi + + special_chars=$(echo "$val" | \ + grep -c "[!|@|#|$|^|&|(|)|+|=|{|}|:|,|.|<|>|?|\|\"|'|;|%| ]" ) + if [[ 0 -ne "$special_chars" ]] || [ 5 -le ${#val} ]; then + echo "Error: $var is out of range" + log_event 'debug' "$E_INVALID $V_EVENT" + exit $E_INVALID + fi + + star=$(echo "$val" |grep '*') + if [ ! -z "$star" ]; then + slash=$(echo $val |grep "^*/") + if [ "$val" != '*' ] && [ -z "$slash" ]; then + echo "Error: $var is out of range" + log_event 'debug' "$E_INVALID $V_EVENT" + exit $E_INVALID + else + if [ -n "$slash" ]; then + digit=$(echo $val | cut -f 2 -d / ) + fi + if [ "$val" = '*' ]; then + digit=0 + fi + fi + fi + + if [ "$limit" -lt "$digit" ]; then + echo "Error: $var is out of range" + log_event 'debug' "$E_INVALID $V_EVENT" + exit $E_INVALID + fi + } + + + # Defining format_ext function format_ext() { val="$1" @@ -313,6 +371,7 @@ format_validation() { ssl) format_usr "$v" ;; domain) format_dom "$v" ;; database) format_db "$v" ;; + day) format_mhd "$v" ;; db_user) format_dbu "$v" ;; dvalue) format_dvl "$v" ;; fname) format_usr "$v" ;; @@ -328,6 +387,7 @@ format_validation() { ns8) format_dom "$v" ;; email) format_eml "$v" ;; extentions) format_ext "$v" ;; + hour) format_mhd "$v" ;; host) format_usr "$v" ;; interface) format_ifc "$v" ;; ip) format_ip "$v" ;; @@ -337,6 +397,8 @@ format_validation() { mask) format_ip "$v" ;; max_usr) format_int "$v" ;; max_db) format_int "$v" ;; + min) format_mhd "$v" ;; + month) format_mhd "$v" ;; lname) format_usr "$v" ;; owner) format_usr "$v" ;; package) format_usr "$v" ;; @@ -349,6 +411,7 @@ format_validation() { template) format_usr "$v" ;; ttl) format_int "$v" ;; user) format_usr "$v" ;; + wday) format_mhd "$v" ;; esac done } From 7717f0be5cfdffae92b095d7953b9e5fbab8d1a3 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Mon, 16 Jan 2012 17:55:00 +0200 Subject: [PATCH 07/11] Added CHARSET key into database db. --- bin/v_add_db_base | 4 ++-- bin/v_list_db_base | 2 +- bin/v_list_db_bases | 5 +++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/bin/v_add_db_base b/bin/v_add_db_base index e84a5421..60527014 100755 --- a/bin/v_add_db_base +++ b/bin/v_add_db_base @@ -23,7 +23,7 @@ db_password=$4 type=$5 host=$6 encoding=${7-UTF8} - +encoding=$(echo "$encoding" |tr '[:lower:]' '[:upper:]') # Importing variables source $VESTA/conf/vars.conf source $V_CONF/vesta.conf @@ -89,7 +89,7 @@ increase_user_value "$user" '$U_DATABASES' # Adding db to db conf v_str="DB='$database' USER='$db_user' HOST='$host' TYPE='$type'" -v_str="$v_str U_DISK='0' SUSPEND='no' DATE='$V_DATE'" +v_str="$v_str LOCALE='$encoding' U_DISK='0' SUSPEND='no' DATE='$V_DATE'" echo "$v_str">>$V_USERS/$user/db.conf # Hiding password diff --git a/bin/v_list_db_base b/bin/v_list_db_base index 93ffe0f1..2005c51c 100755 --- a/bin/v_list_db_base +++ b/bin/v_list_db_base @@ -107,7 +107,7 @@ is_db_valid conf=$V_USERS/$user/db.conf # Defining fileds to select -fields='$DB $USER $HOST $TYPE $U_DISK $SUSPEND $DATE' +fields='$DB $USER $HOST $TYPE $CHARSET $U_DISK $SUSPEND $DATE' # Listing database case $format in diff --git a/bin/v_list_db_bases b/bin/v_list_db_bases index 33200c42..051b8f4e 100755 --- a/bin/v_list_db_bases +++ b/bin/v_list_db_bases @@ -40,13 +40,14 @@ is_user_valid conf=$V_USERS/$user/db.conf # Defining fileds to select -fields='$DB $USER $HOST $TYPE $U_DISK $SUSPEND $DATE' +fields='$DB $USER $HOST $TYPE $CHARSET $U_DISK $SUSPEND $DATE' # Listing databases case $format in json) json_list ;; plain) nohead=1; shell_list ;; - shell) shell_list | column -t ;; + shell) fields='$DB $USER $HOST $TYPE $U_DISK $DATE'; + shell_list | column -t ;; *) check_args '1' '0' 'user [format]' esac From bee05e99bc372270da5200d692c112db343dc429 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Mon, 16 Jan 2012 22:54:59 +0200 Subject: [PATCH 08/11] fixed logging in v_add_db_base --- bin/v_add_db_base | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/v_add_db_base b/bin/v_add_db_base index 60527014..a3c6c978 100755 --- a/bin/v_add_db_base +++ b/bin/v_add_db_base @@ -94,6 +94,7 @@ echo "$v_str">>$V_USERS/$user/db.conf # Hiding password V_EVENT="$V_DATE $V_SCRIPT $user $database $db_user ***** $type $host" +V_EVENT="$V_EVENT $encoding" # Logging log_history "$V_EVENT" "v_delete_db_base $user $database" From f18ea956210a67819ceef94215c2d37d0fceb230 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Mon, 16 Jan 2012 23:16:30 +0200 Subject: [PATCH 09/11] replaced key LOCALE with CHARSET --- bin/v_add_db_base | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/v_add_db_base b/bin/v_add_db_base index a3c6c978..896ec90c 100755 --- a/bin/v_add_db_base +++ b/bin/v_add_db_base @@ -89,7 +89,7 @@ increase_user_value "$user" '$U_DATABASES' # Adding db to db conf v_str="DB='$database' USER='$db_user' HOST='$host' TYPE='$type'" -v_str="$v_str LOCALE='$encoding' U_DISK='0' SUSPEND='no' DATE='$V_DATE'" +v_str="$v_str CHARSET='$encoding' U_DISK='0' SUSPEND='no' DATE='$V_DATE'" echo "$v_str">>$V_USERS/$user/db.conf # Hiding password From 973334d109a8ad975bee326063d70929af61b906 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Mon, 16 Jan 2012 23:16:48 +0200 Subject: [PATCH 10/11] new test cases --- test/test_actions.sh | 48 +++++++++++++++++++++++++++++++++++--------- 1 file changed, 38 insertions(+), 10 deletions(-) diff --git a/test/test_actions.sh b/test/test_actions.sh index 1e4396bd..c57df4fb 100755 --- a/test/test_actions.sh +++ b/test/test_actions.sh @@ -6,14 +6,14 @@ V_BIN="$VESTA/bin" V_TEST="$VESTA/test" # Define functions -tmp_user() { +random() { MATRIX='0123456789' - LENGTH=4 + LENGTH=$1 while [ ${n:=1} -le $LENGTH ]; do rand="$rand${MATRIX:$(($RANDOM%${#MATRIX})):1}" let n+=1 done - echo "tmp_$rand" + echo "$rand" } echo_result() { @@ -25,8 +25,8 @@ echo_result() { echo -n 'FAILED' echo -n ']' echo -ne '\r\n' - echo "$4" - echo "RETURN VALUE $2" + echo ">>> $4" + echo ">>> RETURN VALUE $2" cat $3 else echo -n ' OK ' @@ -36,54 +36,63 @@ echo_result() { } # Create random username -user=$(tmp_user) +user="tmp_$(random 4)" while [ ! -z "$(grep "^$user:" /etc/passwd)" ]; do - user=$(tmp_user) + user="tmp_$(random 4)" done # Create random tmpfile tmpfile=$(mktemp -p /tmp ) + # Add new user cmd="v_add_user $user $user $user@vestacp.com default Super Test" $cmd > $tmpfile 2>> $tmpfile echo_result "Adding new user $user" "$?" "$tmpfile" "$cmd" + # Change system shell cmd="v_change_user_shell $user bash" $cmd > $tmpfile 2>> $tmpfile echo_result "Changing system shell to /bin/bash" "$?" "$tmpfile" "$cmd" + # Change name servers cmd="v_change_user_ns $user ns0.com ns1.com ns2.com ns3.com" $cmd > $tmpfile 2>> $tmpfile echo_result "Changing nameservers" "$?" "$tmpfile" "$cmd" + # Add cron job cmd="v_add_cron_job $user 1 1 1 1 1 echo" $cmd > $tmpfile 2>> $tmpfile echo_result "Adding cron job" "$?" "$tmpfile" "$cmd" + # Suspend cron job cmd="v_suspend_cron_job $user 1" $cmd > $tmpfile 2>> $tmpfile echo_result "Suspending cron job" "$?" "$tmpfile" "$cmd" + # Unsuspend cron job cmd="v_unsuspend_cron_job $user 1" $cmd > $tmpfile 2>> $tmpfile echo_result "Unsuspending cron job" "$?" "$tmpfile" "$cmd" + # Delete cron job cmd="v_delete_cron_job $user 1" $cmd > $tmpfile 2>> $tmpfile echo_result "Deleting cron job" "$?" "$tmpfile" "$cmd" + # Add cron job cmd="v_add_cron_job $user 1 1 1 1 1 echo 1" $cmd > $tmpfile 2>> $tmpfile echo_result "Adding cron job" "$?" "$tmpfile" "$cmd" + # Add cron job cmd="v_add_cron_job $user 1 1 1 1 1 echo 1" $cmd > $tmpfile 2>> $tmpfile @@ -94,9 +103,28 @@ else fi echo_result "Dublicate cron job check" "$retval" "$tmpfile" "$cmd" -# Check ip -#cat /proc/net/dev|cut -f 1 -d :|tail -n1 -#v_add_sys_ip 192.168.11.11 255.255.255.255 venet0 ekho + +# List network interfaces +cmd="v_list_sys_interfaces plain" +interface=$($cmd 2> $tmpfile | head -n 1) +if [ -z "$interface" ]; then + echo_result "Listing network interfaces" "1" "$tmpfile" "$cmd" +else + echo_result "Listing network interfaces" "0" "$tmpfile" "$cmd" +fi + + +# Add new ip address +cmd="v_add_sys_ip 198.18.0.123 255.255.255.255 $interface $user" +$cmd > $tmpfile 2>> $tmpfile +echo_result "Adding ip 198.18.0.123" "$?" "$tmpfile" "$cmd" + + +# Delete ip address +cmd="v_delete_sys_ip 198.18.0.123" +$cmd > $tmpfile 2>> $tmpfile +echo_result "Deleting ip 198.18.0.123" "$?" "$tmpfile" "$cmd" + # Delete new user cmd="v_delete_user $user" From b48f7399fdc85d831923b1004f9d5a4cbffb775b Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Mon, 16 Jan 2012 23:55:03 +0200 Subject: [PATCH 11/11] fixed next year calculation for dns domain --- bin/v_add_dns_domain | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/v_add_dns_domain b/bin/v_add_dns_domain index 38baf6d0..537bc2fe 100755 --- a/bin/v_add_dns_domain +++ b/bin/v_add_dns_domain @@ -19,7 +19,7 @@ domain=$(idn -t --quiet -u "$2" ) domain_idn=$(idn -t --quiet -a "$domain") ip=$3 template=${4-default} -next_year=$(date +F -d "+ 1 year") +next_year=$(date +%F -d "+ 1 year") exp=${5-$next_year} soa=$6 ttl=${7-14400}