فهرست منبع

refactoring: log_event(), is_format_valid()

Serghey Rodin 9 سال پیش
والد
کامیت
e05dca61a6
100فایلهای تغییر یافته به همراه379 افزوده شده و 306 حذف شده
  1. 2 2
      bin/v-acknowledge-user-notification
  2. 1 1
      bin/v-activate-vesta-license
  3. 11 12
      bin/v-add-backup-host
  4. 9 4
      bin/v-add-cron-job
  5. 2 2
      bin/v-add-cron-reports
  6. 1 1
      bin/v-add-cron-restart-job
  7. 7 2
      bin/v-add-cron-vesta-autoupdate
  8. 9 8
      bin/v-add-database
  9. 11 7
      bin/v-add-database-host
  10. 18 13
      bin/v-add-dns-domain
  11. 2 2
      bin/v-add-dns-on-web-alias
  12. 9 4
      bin/v-add-dns-record
  13. 3 3
      bin/v-add-domain
  14. 8 3
      bin/v-add-firewall-ban
  15. 2 2
      bin/v-add-firewall-chain
  16. 10 5
      bin/v-add-firewall-rule
  17. 12 7
      bin/v-add-mail-account
  18. 2 2
      bin/v-add-mail-account-alias
  19. 2 2
      bin/v-add-mail-account-autoreply
  20. 3 3
      bin/v-add-mail-account-forward
  21. 3 3
      bin/v-add-mail-account-fwd-only
  22. 9 4
      bin/v-add-mail-domain
  23. 2 2
      bin/v-add-mail-domain-antispam
  24. 2 2
      bin/v-add-mail-domain-antivirus
  25. 2 2
      bin/v-add-mail-domain-catchall
  26. 2 2
      bin/v-add-mail-domain-dkim
  27. 1 1
      bin/v-add-remote-dns-domain
  28. 8 3
      bin/v-add-remote-dns-host
  29. 1 1
      bin/v-add-remote-dns-record
  30. 1 1
      bin/v-add-sys-firewall
  31. 11 6
      bin/v-add-sys-ip
  32. 1 1
      bin/v-add-sys-quota
  33. 1 1
      bin/v-add-sys-sftp-jail
  34. 11 7
      bin/v-add-user
  35. 6 6
      bin/v-add-user-favourites
  36. 7 2
      bin/v-add-user-notification
  37. 15 15
      bin/v-add-user-package
  38. 4 4
      bin/v-add-web-domain-ftp
  39. 3 3
      bin/v-add-web-domain-httpauth
  40. 2 2
      bin/v-add-web-domain-stats-user
  41. 1 1
      bin/v-backup-users
  42. 8 3
      bin/v-change-cron-job
  43. 2 2
      bin/v-change-database-host-password
  44. 6 6
      bin/v-change-database-owner
  45. 2 2
      bin/v-change-database-password
  46. 2 2
      bin/v-change-database-user
  47. 2 2
      bin/v-change-dns-domain-exp
  48. 2 2
      bin/v-change-dns-domain-ip
  49. 2 2
      bin/v-change-dns-domain-soa
  50. 2 2
      bin/v-change-dns-domain-tpl
  51. 2 2
      bin/v-change-dns-domain-ttl
  52. 8 3
      bin/v-change-dns-record
  53. 2 2
      bin/v-change-dns-record-id
  54. 3 3
      bin/v-change-domain-owner
  55. 9 4
      bin/v-change-firewall-rule
  56. 2 2
      bin/v-change-mail-account-password
  57. 3 3
      bin/v-change-mail-account-quota
  58. 2 2
      bin/v-change-mail-domain-catchall
  59. 1 1
      bin/v-change-remote-dns-domain-exp
  60. 1 1
      bin/v-change-remote-dns-domain-soa
  61. 1 1
      bin/v-change-remote-dns-domain-ttl
  62. 2 2
      bin/v-change-sys-config-value
  63. 2 2
      bin/v-change-sys-hostname
  64. 3 3
      bin/v-change-sys-ip-name
  65. 3 3
      bin/v-change-sys-ip-nat
  66. 2 2
      bin/v-change-sys-ip-owner
  67. 4 4
      bin/v-change-sys-ip-status
  68. 3 3
      bin/v-change-sys-language
  69. 2 2
      bin/v-change-sys-timezone
  70. 2 2
      bin/v-change-user-contact
  71. 4 4
      bin/v-change-user-language
  72. 2 2
      bin/v-change-user-name
  73. 8 8
      bin/v-change-user-ns
  74. 11 16
      bin/v-change-user-package
  75. 2 2
      bin/v-change-user-password
  76. 2 2
      bin/v-change-user-shell
  77. 2 2
      bin/v-change-user-template
  78. 3 3
      bin/v-change-web-domain-ftp-password
  79. 4 4
      bin/v-change-web-domain-ftp-path
  80. 3 3
      bin/v-change-web-domain-httpauth
  81. 1 1
      bin/v-check-user-password
  82. 1 1
      bin/v-deactivate-vesta-license
  83. 2 2
      bin/v-delete-backup-host
  84. 2 2
      bin/v-delete-cron-job
  85. 2 2
      bin/v-delete-cron-reports
  86. 1 1
      bin/v-delete-cron-restart-job
  87. 1 1
      bin/v-delete-cron-vesta-autoupdate
  88. 2 2
      bin/v-delete-database
  89. 2 2
      bin/v-delete-database-host
  90. 2 2
      bin/v-delete-databases
  91. 2 2
      bin/v-delete-dns-domain
  92. 2 2
      bin/v-delete-dns-domains
  93. 2 2
      bin/v-delete-dns-domains-src
  94. 2 2
      bin/v-delete-dns-on-web-alias
  95. 2 2
      bin/v-delete-dns-record
  96. 2 2
      bin/v-delete-domain
  97. 2 2
      bin/v-delete-firewall-ban
  98. 2 2
      bin/v-delete-firewall-chain
  99. 2 2
      bin/v-delete-firewall-rule
  100. 2 2
      bin/v-delete-mail-account

+ 2 - 2
bin/v-acknowledge-user-notification

@@ -23,7 +23,7 @@ source $VESTA/conf/vesta.conf
 #----------------------------------------------------------#
 
 check_args '2' "$#" 'USER NOTIFICATION'
-validate_format 'user' 'nid'
+is_format_valid 'user' 'nid'
 is_object_valid 'user' 'USER' "$user"
 
 
@@ -61,6 +61,6 @@ if [ "$notice" = 'no' ]; then
 fi
 
 # Logging
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 1 - 1
bin/v-activate-vesta-license

@@ -62,6 +62,6 @@ if [ "$module" = 'SFTPJAIL' ]; then
 fi
 
 # Logging
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 11 - 12
bin/v-add-backup-host

@@ -94,7 +94,7 @@ EOF
 
 if [ "$type" != 'local' ];then
     check_args '4' "$#" "TYPE HOST USERNAME PASSWORD [PATH] [PORT]"
-    validate_format 'host'
+    is_format_valid 'host'
     is_password_valid
     if [ "$type" = 'sftp' ]; then
         which expect >/dev/null 2>&1
@@ -117,7 +117,7 @@ if [ "$type" = 'ftp' ]; then
         grep -i -e failed -e error -e "can't" -e "not conn" -e "incorrect")
     if [ ! -z "$ferror" ]; then
         echo "Error: can't login to ftp $user@$host"
-        log_event "$E_CONNECT" "$EVENT"
+        log_event "$E_CONNECT" "$ARGUMENTS"
         exit $E_CONNECT
     fi
 
@@ -129,7 +129,7 @@ if [ "$type" = 'ftp' ]; then
         echo "$ftp_result"
         rm -rf $tmpdir
         echo "Error: can't create $ftmpdir folder on the ftp"
-        log_event "$E_FTP" "$EVENT"
+        log_event "$E_FTP" "$ARGUMENTS"
         exit $E_FTP
     fi
 fi
@@ -145,7 +145,7 @@ if [ "$type" = 'sftp' ]; then
             $E_CONNECT) echo "Error: can't login to sftp $user@$host";;
             $E_FTP) echo "Error: can't create temp folder on the sftp host";;
         esac
-        log_event "$rc" "$EVENT"
+        log_event "$rc" "$ARGUMENTS"
         exit "$rc"
     fi
 fi
@@ -153,13 +153,12 @@ fi
 
 # Adding backup host
 if [ $type != 'local' ]; then
-    echo "HOST='$host'
-    USERNAME='$user'
-    PASSWORD='$password'
-    BPATH='$path'
-    PORT='$port'
-    TIME='$TIME'
-    DATE='$DATE'" > $VESTA/conf/$type.backup.conf
+    time_n_date=$(date +'%T %F')
+    time=$(echo "$time_n_date" |cut -f 1 -d \ )
+    date=$(echo "$time_n_date" |cut -f 2 -d \ )
+    str="HOST='$host'\nUSERNAME='$user'\nPASSWORD='$password'"
+    str="$str\nBPATH='$path'\nPORT='$port'\nTIME='$time'\nDATE='$date'"
+    echo -e "$str" > $VESTA/conf/$type.backup.conf
     chmod 660 $VESTA/conf/$type.backup.conf
 fi
 
@@ -181,6 +180,6 @@ else
 fi
 
 # Logging
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 9 - 4
bin/v-add-cron-job

@@ -34,13 +34,13 @@ A7="$command"
 #----------------------------------------------------------#
 
 check_args '7' "$#" 'USER MIN HOUR DAY MONTH WDAY COMMAND [JOB] [RESTART]'
-validate_format 'user' 'min' 'hour' 'day' 'month' 'wday' 'command'
+is_format_valid 'user' 'min' 'hour' 'day' 'month' 'wday' 'command'
 is_system_enabled "$CRON_SYSTEM" 'CRON_SYSTEM'
 is_object_valid 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"
 is_package_full 'CRON_JOBS'
 get_next_cronjob
-validate_format 'job'
+is_format_valid 'job'
 is_object_new 'cron' 'JOB' "$job"
 
 
@@ -48,9 +48,14 @@ is_object_new 'cron' 'JOB' "$job"
 #                       Action                             #
 #----------------------------------------------------------#
 
+# Generating timestamp
+time_n_date=$(date +'%T %F')
+time=$(echo "$time_n_date" |cut -f 1 -d \ )
+date=$(echo "$time_n_date" |cut -f 2 -d \ )
+
 # Concatenating cron string
 str="JOB='$job' MIN='$min' HOUR='$hour' DAY='$day' MONTH='$month' WDAY='$wday'"
-str="$str CMD='$command' SUSPENDED='no' TIME='$TIME' DATE='$DATE'"
+str="$str CMD='$command' SUSPENDED='no' TIME='$time' DATE='$date'"
 
 # Adding to crontab
 echo "$str" >> $VESTA/data/users/$user/cron.conf
@@ -78,6 +83,6 @@ check_result $? "Cron restart failed" >/dev/null
 
 # Logging
 log_history "added cron job $job"
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 2 - 2
bin/v-add-cron-reports

@@ -23,7 +23,7 @@ source $VESTA/conf/vesta.conf
 #----------------------------------------------------------#
 
 check_args '1' "$#" 'USER'
-validate_format 'user'
+is_format_valid 'user'
 is_system_enabled "$CRON_SYSTEM" 'CRON_SYSTEM'
 is_object_valid 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"
@@ -50,6 +50,6 @@ check_result $? "Cron restart failed" >/dev/null
 
 # Logging
 log_history "enabled cron reporting"
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 1 - 1
bin/v-add-cron-restart-job

@@ -38,6 +38,6 @@ fi
 #----------------------------------------------------------#
 
 # Logging
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 7 - 2
bin/v-add-cron-vesta-autoupdate

@@ -34,6 +34,11 @@ fi
 #                       Action                             #
 #----------------------------------------------------------#
 
+# Generating timestamp
+time_n_date=$(date +'%T %F')
+time=$(echo "$time_n_date" |cut -f 1 -d \ )
+date=$(echo "$time_n_date" |cut -f 2 -d \ )
+
 # Define time somewhere at night
 min=$(gen_password '012345' '2')
 hour=$(gen_password '1234567' '1')
@@ -44,7 +49,7 @@ command='sudo /usr/local/vesta/bin/v-update-sys-vesta-all'
 
 # Concatenating cron string
 str="JOB='$job' MIN='$min' HOUR='$hour' DAY='$day' MONTH='$month' WDAY='$wday'"
-str="$str CMD='$command' SUSPENDED='no' TIME='$TIME' DATE='$DATE'"
+str="$str CMD='$command' SUSPENDED='no' TIME='$time' DATE='$date'"
 
 # Adding to crontab
 echo "$str" >> $VESTA/data/users/$user/cron.conf
@@ -72,6 +77,6 @@ check_result $? "Cron restart failed" >/dev/null
 
 # Logging
 log_history "added cron job $job"
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 9 - 8
bin/v-add-database

@@ -36,14 +36,14 @@ source $VESTA/conf/vesta.conf
 #----------------------------------------------------------#
 
 check_args '4' "$#" 'USER DATABASE DBUSER DBPASS [TYPE] [HOST] [CHARSET]'
-validate_format 'user' 'database' 'dbuser' 'charset'
+is_format_valid 'user' 'database' 'dbuser' 'charset'
 is_system_enabled "$DB_SYSTEM" 'DB_SYSTEM'
 is_type_valid "$DB_SYSTEM" "$type"
 is_object_valid 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"
 is_object_new 'db' 'DB' "$database"
 get_next_dbhost
-is_object_valid "../../../conf/$type" 'DBHOST' "$host"
+is_object_valid "../../../conf/$type" 'HOST' "$host"
 is_object_unsuspended "../../../conf/$type" 'DBHOST' "$host"
 #is_charset_valid
 is_package_full 'DATABASES'
@@ -66,14 +66,15 @@ esac
 #                       Vesta                              #
 #----------------------------------------------------------#
 
-# Update time and date
-DATE=$(date +%F)
-TIME=$(date +%T)
+# Generating timestamp
+time_n_date=$(date +'%T %F')
+time=$(echo "$time_n_date" |cut -f 1 -d \ )
+date=$(echo "$time_n_date" |cut -f 2 -d \ )
 
 # Adding db to db conf
 str="DB='$database' DBUSER='$dbuser' MD5='$md5' HOST='$host' TYPE='$type'"
-str="$str CHARSET='$charset' U_DISK='0' SUSPENDED='no' TIME='$TIME'"
-str="$str DATE='$DATE'"
+str="$str CHARSET='$charset' U_DISK='0' SUSPENDED='no' TIME='$time'"
+str="$str DATE='$date'"
 echo "$str" >> $USER_DATA/db.conf
 chmod 660 $USER_DATA/db.conf
 
@@ -83,6 +84,6 @@ increase_user_value "$user" '$U_DATABASES'
 
 # Logging
 log_history "added $type database $database"
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 11 - 7
bin/v-add-database-host

@@ -38,7 +38,7 @@ is_mysql_host_alive() {
     rm $mycnf
     if [ '0' -ne "$?" ]; then
         echo "Error: MySQL connection to $host failed"
-        log_event "$E_CONNECT" "$EVENT"
+        log_event "$E_CONNECT" "$ARGUMENTS"
         exit $E_CONNECT
     fi
 }
@@ -48,7 +48,7 @@ is_pgsql_host_alive() {
     psql -h $host -U $dbuser -c "SELECT VERSION()" > /dev/null 2>&1
     if [ '0' -ne "$?" ]; then
         echo "Error: PostgreSQL connection to $host failed"
-        log_event "$E_CONNECT" "$EVENT"
+        log_event "$E_CONNECT" "$ARGUMENTS"
         exit $E_CONNECT
     fi
 }
@@ -60,7 +60,7 @@ is_pgsql_host_alive() {
 
 args_usage='TYPE HOST DBUSER DBPASS [MAX_DB] [CHARSETS] [TPL]'
 check_args '4' "$#" "$args_usage"
-validate_format 'host' 'dbuser' 'max_db' 'charsets' 'template'
+is_format_valid 'host' 'dbuser' 'max_db' 'charsets' 'template'
 #is_system_enabled "$DB_SYSTEM" 'DB_SYSTEM'
 #is_type_valid "$DB_SYSTEM" "$type"
 is_dbhost_new
@@ -76,19 +76,23 @@ esac
 #                       Action                             #
 #----------------------------------------------------------#
 
+# Generating timestamp
+time_n_date=$(date +'%T %F')
+time=$(echo "$time_n_date" |cut -f 1 -d \ )
+date=$(echo "$time_n_date" |cut -f 2 -d \ )
+
 # Concatenating db host string
 case $type in
     mysql) str="HOST='$host' USER='$dbuser' PASSWORD='$dbpass'";
            str="$str CHARSETS='$charsets' MAX_DB='$max_db' U_SYS_USERS=''";
-           str="$str U_DB_BASES='0' SUSPENDED='no' TIME='$TIME' DATE='$DATE'";;
+           str="$str U_DB_BASES='0' SUSPENDED='no' TIME='$time' DATE='$date'";;
     pgsql) str="HOST='$host' USER='$dbuser' PASSWORD='$dbpass'";
            str="$str CHARSETS='$charsets' TPL='$template' MAX_DB='$max_db'";
            str="$str U_SYS_USERS='' U_DB_BASES='0' SUSPENDED='no'";
-           str="$str TIME='$TIME' DATE='$DATE'";;
+           str="$str TIME='$time' DATE='$date'";;
 esac
 
 
-
 #----------------------------------------------------------#
 #                       Vesta                              #
 #----------------------------------------------------------#
@@ -110,6 +114,6 @@ else
 fi
 
 # Logging
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 18 - 13
bin/v-add-dns-domain

@@ -41,7 +41,7 @@ source $VESTA/conf/vesta.conf
 #----------------------------------------------------------#
 
 check_args '3' "$#" 'USER DOMAIN IP [NS1] [NS2] [NS3] [..] [NS8] [RESTART]'
-validate_format 'user' 'domain' 'ip'
+is_format_valid 'user' 'domain' 'ip'
 is_system_enabled "$DNS_SYSTEM" 'DNS_SYSTEM'
 is_object_valid 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"
@@ -52,37 +52,37 @@ is_dns_template_valid
 
 if [ ! -z "$ns1" ]; then
     ns1=$(echo $4 | sed -e 's/\.*$//g' -e 's/^\.*//g')
-    validate_format 'ns1'
+    is_format_valid 'ns1'
 fi
 if [ ! -z "$ns2" ]; then
     ns2=$(echo $5 | sed -e 's/\.*$//g' -e 's/^\.*//g')
-    validate_format 'ns2'
+    is_format_valid 'ns2'
 fi
 
 if [ ! -z "$ns3" ]; then
     ns3=$(echo $6 | sed -e 's/\.*$//g' -e 's/^\.*//g')
-    validate_format 'ns3'
+    is_format_valid 'ns3'
 fi
 if [ ! -z "$ns4" ]; then
     ns4=$(echo $7 | sed -e 's/\.*$//g' -e 's/^\.*//g')
-    validate_format 'ns4'
+    is_format_valid 'ns4'
 fi
 if [ ! -z "$ns5" ]; then
     ns5=$(echo $8 | sed -e 's/\.*$//g' -e 's/^\.*//g')
-    validate_format 'ns5'
+    is_format_valid 'ns5'
 fi
 if [ ! -z "$ns6" ]; then
     ns6=$(echo $9 | sed -e 's/\.*$//g' -e 's/^\.*//g')
-    validate_format 'ns6'
+    is_format_valid 'ns6'
 fi
 if [ ! -z "$ns7" ]; then
     ns7=$(echo ${10} | sed -e 's/\.*$//g' -e 's/^\.*//g')
-    validate_format 'ns7'
+    is_format_valid 'ns7'
 fi
 
 if [ ! -z "$ns8" ]; then
     ns8=$(echo ${11} | sed -e 's/\.*$//g' -e 's/^\.*//g')
-    validate_format 'ns8'
+    is_format_valid 'ns8'
 fi
 
 
@@ -127,6 +127,11 @@ if [ -z "$ns8" ]; then
     template_data=$(echo "$template_data" |grep -v %ns8%)
 fi
 
+# Generating timestamp
+time_n_date=$(date +'%T %F')
+time=$(echo "$time_n_date" |cut -f 1 -d \ )
+date=$(echo "$time_n_date" |cut -f 2 -d \ )
+
 # Adding dns zone to the user config
 echo "$template_data" |\
     sed -e "s/%ip%/$ip/g" \
@@ -140,8 +145,8 @@ echo "$template_data" |\
         -e "s/%ns6%/$ns6/g" \
         -e "s/%ns7%/$ns7/g" \
         -e "s/%ns8%/$ns8/g" \
-        -e "s/%time%/$TIME/g" \
-        -e "s/%date%/$DATE/g" > $USER_DATA/dns/$domain.conf
+        -e "s/%time%/$time/g" \
+        -e "s/%date%/$date/g" > $USER_DATA/dns/$domain.conf
 
 chmod 660 $USER_DATA/dns/$domain.conf
 records="$(wc -l $USER_DATA/dns/$domain.conf |cut -f 1 -d ' ')"
@@ -149,7 +154,7 @@ records="$(wc -l $USER_DATA/dns/$domain.conf |cut -f 1 -d ' ')"
 # Adding dns.conf record
 dns_rec="DOMAIN='$domain' IP='$ip' TPL='$template' TTL='$ttl' EXP='$exp'"
 dns_rec="$dns_rec SOA='$soa' SERIAL='$serial' SRC='' RECORDS='$records'"
-dns_rec="$dns_rec SUSPENDED='no' TIME='$TIME' DATE='$DATE'"
+dns_rec="$dns_rec SUSPENDED='no' TIME='$time' DATE='$date'"
 
 echo "$dns_rec" >> $USER_DATA/dns.conf
 chmod 660 $USER_DATA/dns.conf
@@ -200,6 +205,6 @@ fi
 
 # Logging
 log_history "added dns domain $domain"
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 2 - 2
bin/v-add-dns-on-web-alias

@@ -26,7 +26,7 @@ source $VESTA/conf/vesta.conf
 #----------------------------------------------------------#
 
 check_args '3' "$#" 'USER ALIAS IP [RESTART]'
-validate_format 'user' 'alias' 'ip'
+is_format_valid 'user' 'alias' 'ip'
 is_system_enabled "$DNS_SYSTEM" 'DNS_SYSTEM'
 is_object_valid 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"
@@ -40,7 +40,7 @@ fi
 #----------------------------------------------------------#
 
 # Logging
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 # Define additional vars
 sub_domain=$(echo "$alias" |awk -F '.' '{print $1}')

+ 9 - 4
bin/v-add-dns-record

@@ -52,7 +52,7 @@ fi
 #----------------------------------------------------------#
 
 check_args '5' "$#" 'USER DOMAIN RECORD TYPE VALUE [PRIORITY] [ID] [RESTART]'
-validate_format 'user' 'domain' 'record' 'rtype' 'dvalue'
+is_format_valid 'user' 'domain' 'record' 'rtype' 'dvalue'
 is_system_enabled "$DNS_SYSTEM" 'DNS_SYSTEM'
 is_object_valid 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"
@@ -60,7 +60,7 @@ is_object_valid 'dns' 'DOMAIN' "$domain"
 is_object_unsuspended 'dns' 'DOMAIN' "$domain"
 is_package_full 'DNS_RECORDS'
 get_next_dnsrecord
-validate_format 'id'
+is_format_valid 'id'
 is_object_new "dns/$domain" 'ID' "$id"
 is_dns_fqnd "$rtype" "$dvalue"
 is_dns_nameserver_valid "$domain" "$rtype" "$dvalue"
@@ -70,10 +70,15 @@ is_dns_nameserver_valid "$domain" "$rtype" "$dvalue"
 #                       Action                             #
 #----------------------------------------------------------#
 
+# Generating timestamp
+time_n_date=$(date +'%T %F')
+time=$(echo "$time_n_date" |cut -f 1 -d \ )
+date=$(echo "$time_n_date" |cut -f 2 -d \ )
+
 # Adding record
 zone="$USER_DATA/dns/$domain.conf"
 dns_rec="ID='$id' RECORD='$record' TYPE='$rtype' PRIORITY='$priority'"
-dns_rec="$dns_rec VALUE='$dvalue' SUSPENDED='no' TIME='$TIME' DATE='$DATE'"
+dns_rec="$dns_rec VALUE='$dvalue' SUSPENDED='no' TIME='$time' DATE='$date'"
 echo "$dns_rec" >> $zone
 chmod 660 $zone
 
@@ -114,6 +119,6 @@ fi
 
 # Logging
 log_history "added $rtype dns record $record for $domain"
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 3 - 3
bin/v-add-domain

@@ -25,9 +25,9 @@ source $VESTA/conf/vesta.conf
 #                    Verifications                         #
 #----------------------------------------------------------#
 check_args '2' "$#" 'USER DOMAIN [IP] [RESTART]'
-validate_format 'user' 'domain'
+is_format_valid 'user' 'domain'
 if [ ! -z "$ip" ] ; then
-    validate_format 'ip'
+    is_format_valid 'ip'
 fi
 is_object_valid 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"
@@ -42,7 +42,7 @@ if [ -z "$ip" ]; then
     ip=$(get_user_ip $user)
     if [ -z "$ip" ]; then
         echo "Error: no avaiable IP address"
-        log_event "$E_NOTEXIST" "$EVENT"
+        log_event "$E_NOTEXIST" "$ARGUMENTS"
         exit $E_NOTEXIST
     fi
 fi

+ 8 - 3
bin/v-add-firewall-ban

@@ -29,7 +29,7 @@ source $VESTA/conf/vesta.conf
 #----------------------------------------------------------#
 
 check_args '2' "$#" 'IP CHAIN'
-validate_format 'ip' 'chain'
+is_format_valid 'ip' 'chain'
 is_system_enabled "$FIREWALL_SYSTEM" 'FIREWALL_SYSTEM'
 
 
@@ -59,8 +59,13 @@ fi
 # Adding chain
 $BIN/v-add-firewall-chain $chain
 
+# Generating timestamp
+time_n_date=$(date +'%T %F')
+time=$(echo "$time_n_date" |cut -f 1 -d \ )
+date=$(echo "$time_n_date" |cut -f 2 -d \ )
+
 # Adding ip to banlist
-echo "IP='$ip' CHAIN='$chain' TIME='$TIME' DATE='$DATE'" >> $conf
+echo "IP='$ip' CHAIN='$chain' TIME='$time' DATE='$date'" >> $conf
 $iptables -I fail2ban-$chain 1 -s $ip \
     -j REJECT --reject-with icmp-port-unreachable 2>/dev/null
 
@@ -73,6 +78,6 @@ chmod 660 $conf
 #----------------------------------------------------------#
 
 # Logging
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 2 - 2
bin/v-add-firewall-chain

@@ -31,7 +31,7 @@ source $VESTA/conf/vesta.conf
 #----------------------------------------------------------#
 
 check_args '1' "$#" 'CHAIN [PORT] [PROTOCOL]'
-validate_format 'chain'
+is_format_valid 'chain'
 is_system_enabled "$FIREWALL_SYSTEM" 'FIREWALL_SYSTEM'
 
 
@@ -81,6 +81,6 @@ chmod 660 $chains
 #----------------------------------------------------------#
 
 # Logging
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 10 - 5
bin/v-add-firewall-rule

@@ -47,13 +47,13 @@ sort_fw_rules() {
 #----------------------------------------------------------#
 
 check_args '3' "$#" 'ACTION IP PORT [PROTOCOL] [COMMENT] [RULE]'
-validate_format 'action' 'protocol' 'port_ext' 'ip'
+is_format_valid 'action' 'protocol' 'port_ext' 'ip'
 is_system_enabled "$FIREWALL_SYSTEM" 'FIREWALL_SYSTEM'
 get_next_fw_rule
-validate_format 'rule'
+is_format_valid 'rule'
 is_object_new '../../data/firewall/rules' 'RULE' "$rule"
 if [ ! -z "$comment" ]; then
-    validate_format 'comment'
+    is_format_valid 'comment'
 fi
 
 
@@ -61,10 +61,15 @@ fi
 #                       Action                             #
 #----------------------------------------------------------#
 
+# Generating timestamp
+time_n_date=$(date +'%T %F')
+time=$(echo "$time_n_date" |cut -f 1 -d \ )
+date=$(echo "$time_n_date" |cut -f 2 -d \ )
+
 # Concatenating rule
 str="RULE='$rule' ACTION='$action' PROTOCOL='$protocol' PORT='$port_ext'"
 str="$str IP='$ip' COMMENT='$comment' SUSPENDED='no'"
-str="$str TIME='$TIME' DATE='$DATE'"
+str="$str TIME='$time' DATE='$date'"
 
 # Adding to config
 echo "$str" >> $VESTA/data/firewall/rules.conf
@@ -84,6 +89,6 @@ $BIN/v-update-firewall
 #----------------------------------------------------------#
 
 # Logging
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 12 - 7
bin/v-add-mail-account

@@ -29,16 +29,16 @@ source $VESTA/conf/vesta.conf
 #----------------------------------------------------------#
 
 check_args '4' "$#" 'USER DOMAIN ACCOUNT PASSWORD [QUOTA]'
-validate_format 'user' 'domain' 'account'
+is_format_valid 'user' 'domain' 'account'
 if [ "$quota" != 'unlimited' ]; then
-    validate_format 'quota'
+    is_format_valid 'quota'
 fi
 is_system_enabled "$MAIL_SYSTEM" 'MAIL_SYSTEM'
 is_object_valid 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"
 is_object_valid 'mail' 'DOMAIN' "$domain"
 is_object_unsuspended 'mail' 'DOMAIN' "$domain"
-is_package_full 'MAIL_ACCOUNTS'
+is_package_full 'MAIL_USER'
 is_mail_new "$account"
 is_password_valid
 
@@ -65,13 +65,18 @@ fi
 #                       Vesta                              #
 #----------------------------------------------------------#
 
+# Generating timestamp
+time_n_date=$(date +'%T %F')
+time=$(echo "$time_n_date" |cut -f 1 -d \ )
+date=$(echo "$time_n_date" |cut -f 2 -d \ )
+
 if [[ "$quota" -eq '0' ]]; then
     quota='unlimited'
 fi
 
-str="ACCOUNT='$account' ALIAS='' QUOTA='$quota' AUTOREPLY='no' FWD=''"
-str="$str FWD_ONLY='' MD5='$md5' U_DISK='0' SUSPENDED='no' TIME='$TIME'"
-str="$str DATE='$DATE'"
+str="ACCOUNT='$account' ALIAS='' AUTOREPLY='no' FWD='' FWD_ONLY=''"
+str="$str MD5='$md5' QUOTA='$quota' U_DISK='0' SUSPENDED='no'"
+str="$str TIME='$time' DATE='$date'"
 echo "$str" >> $USER_DATA/mail/$domain.conf
 chmod 660 $USER_DATA/mail/$domain.conf
 
@@ -82,6 +87,6 @@ update_object_value 'mail' 'DOMAIN' "$domain" '$ACCOUNTS' "$accounts"
 
 # Logging
 log_history "added mail account $account@$domain"
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 2 - 2
bin/v-add-mail-account-alias

@@ -28,7 +28,7 @@ source $VESTA/conf/vesta.conf
 #----------------------------------------------------------#
 
 check_args '4' "$#" 'USER DOMAIN ACCOUNT ALIAS'
-validate_format 'user' 'domain' 'account' 'malias'
+is_format_valid 'user' 'domain' 'account' 'malias'
 is_system_enabled "$MAIL_SYSTEM" 'MAIL_SYSTEM'
 is_object_valid 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"
@@ -65,6 +65,6 @@ update_object_value "mail/$domain" 'ACCOUNT' "$account"  '$ALIAS' "$aliases"
 
 # Logging
 log_history "added alias $malias to $account@$domain "
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 2 - 2
bin/v-add-mail-account-autoreply

@@ -35,7 +35,7 @@ fi
 #----------------------------------------------------------#
 
 check_args '4' "$#" 'USER DOMAIN ACCOUNT MESSAGE'
-validate_format 'user' 'domain' 'account' 'autoreply'
+is_format_valid 'user' 'domain' 'account' 'autoreply'
 is_system_enabled "$MAIL_SYSTEM" 'MAIL_SYSTEM'
 is_object_valid 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"
@@ -70,6 +70,6 @@ update_object_value "mail/$domain" 'ACCOUNT' "$account" '$AUTOREPLY' 'yes'
 
 # Logging
 log_history "added autoreply message on $account@$domain"
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 3 - 3
bin/v-add-mail-account-forward

@@ -28,7 +28,7 @@ source $VESTA/conf/vesta.conf
 #----------------------------------------------------------#
 
 check_args '4' "$#" 'USER DOMAIN ACCOUNT FORWARD'
-validate_format 'user' 'domain' 'account' 'forward'
+is_format_valid 'user' 'domain' 'account' 'forward'
 is_system_enabled "$MAIL_SYSTEM" 'MAIL_SYSTEM'
 is_object_valid 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"
@@ -39,7 +39,7 @@ is_object_unsuspended "mail/$domain" 'ACCOUNT' "$account"
 fwd=$(get_object_value "mail/$domain" 'ACCOUNT' "$account" '$FWD')
 if [ ! -z "$(echo $fwd | grep -w $forward)" ]; then
     echo "Error: forward $forward exists"
-    log_event "$E_EXISTS $EVENT"
+    log_event "$E_EXISTS $ARGUMENTS"
     exit $E_EXISTS
 fi
 
@@ -71,6 +71,6 @@ update_object_value "mail/$domain" 'ACCOUNT' "$account"  '$FWD' "$fwd"
 
 # Logging
 log_history "added forwarding from $account@$domain to $forward"
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 3 - 3
bin/v-add-mail-account-fwd-only

@@ -34,7 +34,7 @@ fi
 #----------------------------------------------------------#
 
 check_args '3' "$#" 'USER DOMAIN ACCOUNT'
-validate_format 'user' 'domain' 'account'
+is_format_valid 'user' 'domain' 'account'
 is_system_enabled "$MAIL_SYSTEM" 'MAIL_SYSTEM'
 is_object_valid 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"
@@ -45,7 +45,7 @@ is_object_unsuspended "mail/$domain" 'ACCOUNT' "$account"
 fwd=$(get_object_value "mail/$domain" 'ACCOUNT' "$account" '$FWD')
 if [ -z "$fwd" ]; then
     echo "Error: forward doesn't exist"
-    log_event "$E_NOTEXIST $EVENT"
+    log_event "$E_NOTEXIST $ARGUMENTS"
     exit $E_NOTEXIST
 fi
 
@@ -71,6 +71,6 @@ update_object_value "mail/$domain" 'ACCOUNT' "$account"  '$FWD_ONLY' "yes"
 
 # Logging
 log_history "added fwd_only flag for $account@$domain"
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 9 - 4
bin/v-add-mail-domain

@@ -38,7 +38,7 @@ fi
 #----------------------------------------------------------#
 
 check_args '2' "$#" 'USER DOMAIN [ANTISPAM] [ANTIVIRUS] [DKIM] [DKIM_SIZE]'
-validate_format 'user' 'domain' 'antispam' 'antivirus' 'dkim' 'dkim_size'
+is_format_valid 'user' 'domain' 'antispam' 'antivirus' 'dkim' 'dkim_size'
 is_system_enabled "$MAIL_SYSTEM" 'MAIL_SYSTEM'
 is_object_valid 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"
@@ -50,10 +50,15 @@ is_package_full 'MAIL_DOMAINS'
 #                       Action                             #
 #----------------------------------------------------------#
 
+# Generating timestamp
+time_n_date=$(date +'%T %F')
+time=$(echo "$time_n_date" |cut -f 1 -d \ )
+date=$(echo "$time_n_date" |cut -f 2 -d \ )
+
 # Adding domain to mail.conf
 s="DOMAIN='$domain' ANTIVIRUS='$antivirus' ANTISPAM='$antispam' DKIM='$dkim'"
-s="$s ACCOUNTS='0' U_DISK='0' CATCHALL='' SUSPENDED='no' TIME='$TIME'"
-s="$s DATE='$DATE'"
+s="$s CATCHALL='' ACCOUNTS='0' U_DISK='0' SUSPENDED='no' TIME='$time'"
+s="$s DATE='$date'"
 echo $s >> $USER_DATA/mail.conf
 touch $USER_DATA/mail/$domain.conf
 
@@ -134,6 +139,6 @@ fi
 
 # Logging
 log_history "added mail domain $domain"
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 2 - 2
bin/v-add-mail-domain-antispam

@@ -26,7 +26,7 @@ source $VESTA/conf/vesta.conf
 #----------------------------------------------------------#
 
 check_args '2' "$#" 'USER DOMAIN'
-validate_format 'user' 'domain'
+is_format_valid 'user' 'domain'
 is_system_enabled "$MAIL_SYSTEM" 'MAIL_SYSTEM'
 is_object_valid 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"
@@ -54,6 +54,6 @@ update_object_value 'mail' 'DOMAIN' "$domain" '$ANTISPAM' 'yes'
 
 # Logging
 log_history "enabled antispam on $domain"
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 2 - 2
bin/v-add-mail-domain-antivirus

@@ -26,7 +26,7 @@ source $VESTA/conf/vesta.conf
 #----------------------------------------------------------#
 
 check_args '2' "$#" 'USER DOMAIN'
-validate_format 'user' 'domain'
+is_format_valid 'user' 'domain'
 is_system_enabled "$MAIL_SYSTEM" 'MAIL_SYSTEM'
 is_object_valid 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"
@@ -54,6 +54,6 @@ update_object_value 'mail' 'DOMAIN' "$domain" '$ANTIVIRUS' 'yes'
 
 # Logging
 log_history "enabled antivirus on $domain"
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 2 - 2
bin/v-add-mail-domain-catchall

@@ -27,7 +27,7 @@ source $VESTA/conf/vesta.conf
 #----------------------------------------------------------#
 
 check_args '3' "$#" 'USER DOMAIN EMAIL'
-validate_format 'user' 'domain' 'email'
+is_format_valid 'user' 'domain' 'email'
 is_system_enabled "$MAIL_SYSTEM" 'MAIL_SYSTEM'
 is_object_valid 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"
@@ -56,6 +56,6 @@ update_object_value 'mail' 'DOMAIN' "$domain" '$CATCHALL' "$email"
 
 # Logging
 log_history "added $email as catchall email for $domain"
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 2 - 2
bin/v-add-mail-domain-dkim

@@ -34,7 +34,7 @@ fi
 #----------------------------------------------------------#
 
 check_args '2' "$#" 'USER DOMAIN [DKIM_SIZE]'
-validate_format 'user' 'domain' 'dkim_size'
+is_format_valid 'user' 'domain' 'dkim_size'
 is_system_enabled "$MAIL_SYSTEM" 'MAIL_SYSTEM'
 is_object_valid 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"
@@ -83,6 +83,6 @@ increase_user_value "$user" '$U_MAIL_DKMI'
 
 # Logging
 log_history "enabled DKIM support for $domain"
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 1 - 1
bin/v-add-remote-dns-domain

@@ -25,7 +25,7 @@ source $VESTA/conf/vesta.conf
 #----------------------------------------------------------#
 
 check_args '2' "$#" 'USER DOMAIN [FLUSH]'
-validate_format 'user' 'domain'
+is_format_valid 'user' 'domain'
 is_system_enabled "$DNS_CLUSTER" 'DNS_CLUSTER'
 if [ ! -e "$VESTA/conf/dns-cluster.conf" ]; then
     check_result $E_NOTEXIST "dns-cluster.conf doesn't exist"

+ 8 - 3
bin/v-add-remote-dns-host

@@ -35,7 +35,7 @@ source $VESTA/conf/vesta.conf
 
 args_usage='HOST PORT USER PASSWORD [TYPE] [DNS_USER]'
 check_args '4' "$#" "$args_usage"
-validate_format 'host' 'port' 'user' 'type' 'dns_user'
+is_format_valid 'host' 'port' 'user' 'type' 'dns_user'
 is_system_enabled "$DNS_SYSTEM" 'DNS_SYSTEM'
 is_password_valid
 is_dnshost_new
@@ -46,10 +46,15 @@ is_dnshost_alive
 #                       Action                             #
 #----------------------------------------------------------#
 
+# Generating timestamp
+time_n_date=$(date +'%T %F')
+time=$(echo "$time_n_date" |cut -f 1 -d \ )
+date=$(echo "$time_n_date" |cut -f 2 -d \ )
+
 # Concatentating dns host string
 str="HOST='$host' PORT='$port' USER='$user' PASSWORD='$password'"
 str="$str DNS_USER='$dns_user' TYPE='$type' SUSPENDED='no'"
-str="$str TIME='$TIME' DATE='$DATE'"
+str="$str TIME='$time' DATE='$date'"
 
 # Adding host to dns-cluster.conf
 echo "$str" >> $VESTA/conf/dns-cluster.conf
@@ -83,6 +88,6 @@ if [ -z "$check_cron" ] && [ ! -z "$CRON_SYSTEM" ]; then
 fi
 
 # Logging
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 1 - 1
bin/v-add-remote-dns-record

@@ -25,7 +25,7 @@ source $VESTA/conf/vesta.conf
 #----------------------------------------------------------#
 
 check_args '3' "$#" 'USER DOMAIN ID'
-validate_format 'user' 'domain' 'id'
+is_format_valid 'user' 'domain' 'id'
 is_system_enabled "$DNS_CLUSTER" 'DNS_CLUSTER'
 is_object_valid 'user' 'USER' "$user"
 is_object_valid 'dns' 'DOMAIN' "$domain"

+ 1 - 1
bin/v-add-sys-firewall

@@ -52,6 +52,6 @@ $BIN/v-update-firewall
 #----------------------------------------------------------#
 
 # Logging
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 11 - 6
bin/v-add-sys-ip

@@ -35,15 +35,15 @@ source $VESTA/conf/vesta.conf
 #----------------------------------------------------------#
 
 check_args '2' "$#" 'IP NETMASK [INTERFACE] [USER] [STATUS] [NAME] [NATED_IP]'
-validate_format 'ip' 'netmask' 'interface' 'user' 'ip_status'
+is_format_valid 'ip' 'netmask' 'interface' 'user' 'ip_status'
 is_ip_free
 is_object_valid 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"
 if [ ! -z "$ip_name" ] ; then
-    validate_format 'ip_name'
+    is_format_valid 'ip_name'
 fi
 if [ ! -z "$nat_ip" ] ; then
-    validate_format 'nat_ip'
+    is_format_valid 'nat_ip'
 fi
 
 
@@ -82,6 +82,11 @@ if [ -z "$sys_ip_check" ]; then
     fi
 fi
 
+# Generating timestamp
+time_n_date=$(date +'%T %F')
+time=$(echo "$time_n_date" |cut -f 1 -d \ )
+date=$(echo "$time_n_date" |cut -f 2 -d \ )
+
 # Adding vesta ip
 echo "OWNER='$user'
 STATUS='$ip_status'
@@ -91,8 +96,8 @@ U_WEB_DOMAINS='0'
 INTERFACE='$interface'
 NETMASK='$netmask'
 NAT='$nat_ip'
-TIME='$TIME'
-DATE='$DATE'" > $VESTA/data/ips/$ip
+TIME='$time'
+DATE='$date'" > $VESTA/data/ips/$ip
 chmod 660 $VESTA/data/ips/$ip
 
 # WEB support
@@ -176,6 +181,6 @@ fi
 
 # Logging
 log_history "added system ip address $ip" '' 'admin'
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 1 - 1
bin/v-add-sys-quota

@@ -87,6 +87,6 @@ done
 #----------------------------------------------------------#
 
 # Logging
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 1 - 1
bin/v-add-sys-sftp-jail

@@ -101,6 +101,6 @@ fi
 #----------------------------------------------------------#
 
 # Logging
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 11 - 7
bin/v-add-user

@@ -25,7 +25,7 @@ is_user_free() {
     check_sysuser=$(cut -f 1 -d : /etc/passwd | grep -w "$user" )
     if [ ! -z "$check_sysuser" ] || [ -e "$USER_DATA" ]; then
         echo "Error: user $user exists"
-        log_event "$E_EXISTS" "$EVENT"
+        log_event "$E_EXISTS" "$ARGUMENTS"
         exit $E_EXISTS
     fi
 }
@@ -36,9 +36,9 @@ is_user_free() {
 #----------------------------------------------------------#
 
 check_args '3' "$#" 'USER PASSWORD EMAIL [PACKAGE] [FNAME] [LNAME]'
-validate_format 'user' 'email' 'package'
+is_format_valid 'user' 'email' 'package'
 if [ ! -z "$fname" ]; then
-    validate_format 'fname' 'lname'
+    is_format_valid 'fname' 'lname'
 fi
 is_user_free "$user"
 is_password_valid
@@ -50,7 +50,7 @@ is_package_valid
 #----------------------------------------------------------#
 
 # Parsing package data
-pkg_data=$(cat $VESTA/data/packages/$package.pkg |grep -v TIME |grep -v DATE)
+pkg_data=$(cat $VESTA/data/packages/$package.pkg |egrep -v "TIME|DATE")
 
 # Checking shell
 shell_conf=$(echo "$pkg_data" | grep 'SHELL' | cut -f 2 -d \')
@@ -134,6 +134,10 @@ if [ ! -z "$DB_SYSTEM" ]; then
     echo "$BIN/v-update-databases-disk $user" >> $VESTA/data/queue/disk.pipe
 fi
 
+# Generating timestamp
+time_n_date=$(date +'%T %F')
+time=$(echo "$time_n_date" |cut -f 1 -d \ )
+date=$(echo "$time_n_date" |cut -f 2 -d \ )
 
 # Filling user config
 if [ "$user" != 'admin' ]; then
@@ -181,8 +185,8 @@ U_CRON_JOBS='0'
 U_BACKUPS='0'
 LANGUAGE=''
 NOTIFICATIONS='no'
-TIME='$TIME'
-DATE='$DATE'" > $USER_DATA/user.conf
+TIME='$time'
+DATE='$date'" > $USER_DATA/user.conf
 chmod 660 $USER_DATA/user.conf
 
 # Updating quota
@@ -207,6 +211,6 @@ fi
 
 # Logging
 log_history "added system user $user" '' 'admin'
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 6 - 6
bin/v-add-user-favourites

@@ -26,12 +26,12 @@ source $VESTA/conf/vesta.conf
 #----------------------------------------------------------#
 
 check_args '3' "$#" 'USER SYSTEM OBJECT'
-validate_format 'user' 'system'
+is_format_valid 'user' 'system'
 case $system in 
-    MAIL_ACC)   validate_format 'email' ;;
-    CRON)       validate_format 'id' ;;
-    DNS_REC)    validate_format 'id' ;;
-    *)          validate_format 'object'
+    MAIL_ACC)   is_format_valid 'email' ;;
+    CRON)       is_format_valid 'id' ;;
+    DNS_REC)    is_format_valid 'id' ;;
+    *)          is_format_valid 'object'
 esac
 is_object_valid 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"
@@ -120,6 +120,6 @@ chmod 640 $USER_DATA/favourites.conf
 
 # Logging
 log_history "added starred $object in $system listing"
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 7 - 2
bin/v-add-user-notification

@@ -25,7 +25,7 @@ source $VESTA/conf/vesta.conf
 #----------------------------------------------------------#
 
 check_args '2' "$#" 'USER TOPIC NOTICE [TYPE]'
-validate_format 'user' 'topic' 'notice'
+is_format_valid 'user' 'topic' 'notice'
 is_object_valid 'user' 'USER' "$user"
 
 
@@ -46,9 +46,14 @@ else
     nid=1
 fi
 
+# Generating timestamp
+time_n_date=$(date +'%T %F')
+time=$(echo "$time_n_date" |cut -f 1 -d \ )
+date=$(echo "$time_n_date" |cut -f 2 -d \ )
+
 # Concatenating string
 str="NID='$nid' TOPIC='$topic' NOTICE='$notice' TYPE='$type'"
-str="$str ACK='no' TIME='$TIME' DATE='$DATE'"
+str="$str ACK='no' TIME='$time' DATE='$date'"
 
 # Adding to config
 echo "$str" >> $USER_DATA/notifications.conf

+ 15 - 15
bin/v-add-user-package

@@ -22,7 +22,7 @@ source $VESTA/conf/vesta.conf
 is_package_new() {
     if [ -e "$VESTA/data/packages/$package.pkg" ]; then
         echo "Error: package $package already exists."
-        log_event "$E_EXISTS" "$EVENT"
+        log_event "$E_EXISTS" "$ARGUMENTS"
         exit $E_EXISTS
     fi
 }
@@ -30,39 +30,39 @@ is_package_new() {
 is_package_consistent() {
     source $pkg_dir/$package.pkg
     if [ "$WEB_DOMAINS" != 'unlimited' ]; then
-        validate_format_int $WEB_DOMAINS 'WEB_DOMAINS'
+        is_format_valid_int $WEB_DOMAINS 'WEB_DOMAINS'
     fi
     if [ "$WEB_ALIASES" != 'unlimited' ]; then
-        validate_format_int $WEB_ALIASES 'WEB_ALIASES'
+        is_format_valid_int $WEB_ALIASES 'WEB_ALIASES'
     fi
     if [ "$DNS_DOMAINS" != 'unlimited' ]; then
-        validate_format_int $DNS_DOMAINS 'DNS_DOMAINS'
+        is_format_valid_int $DNS_DOMAINS 'DNS_DOMAINS'
     fi
     if [ "$DNS_RECORDS" != 'unlimited' ]; then
-        validate_format_int $DNS_RECORDS 'DNS_RECORDS'
+        is_format_valid_int $DNS_RECORDS 'DNS_RECORDS'
     fi
     if [ "$MAIL_DOMAINS" != 'unlimited' ]; then
-        validate_format_int $MAIL_DOMAINS 'MAIL_DOMAINS'
+        is_format_valid_int $MAIL_DOMAINS 'MAIL_DOMAINS'
     fi
     if [ "$MAIL_ACCOUNTS" != 'unlimited' ]; then
-        validate_format_int $MAIL_ACCOUNTS 'MAIL_ACCOUNTS'
+        is_format_valid_int $MAIL_ACCOUNTS 'MAIL_ACCOUNTS'
     fi
     if [ "$DATABASES" != 'unlimited' ]; then
-        validate_format_int $DATABASES 'DATABASES'
+        is_format_valid_int $DATABASES 'DATABASES'
     fi
     if [ "$CRON_JOBS" != 'unlimited' ]; then
-        validate_format_int $CRON_JOBS 'CRON_JOBS'
+        is_format_valid_int $CRON_JOBS 'CRON_JOBS'
     fi
     if [ "$DISK_QUOTA" != 'unlimited' ]; then
-        validate_format_int $DISK_QUOTA 'DISK_QUOTA'
+        is_format_valid_int $DISK_QUOTA 'DISK_QUOTA'
     fi
     if [ "$BANDWIDTH" != 'unlimited' ]; then
-        validate_format_int $BANDWIDTH 'BANDWIDTH'
+        is_format_valid_int $BANDWIDTH 'BANDWIDTH'
     fi
     if [ "$BACKUPS" != 'unlimited' ]; then
-        validate_format_int $BACKUPS 'BACKUPS'
+        is_format_valid_int $BACKUPS 'BACKUPS'
     fi
-    validate_format_shell $SHELL
+    is_format_valid_shell $SHELL
 }
 
 
@@ -71,7 +71,7 @@ is_package_consistent() {
 #----------------------------------------------------------#
 
 check_args '2' "$#" 'PKG_DIR PACKAGE' 'rewrite'
-validate_format 'pkg_dir' 'package'
+is_format_valid 'pkg_dir' 'package'
 if [ "$rewrite" != 'yes' ]; then
     is_package_new
 fi
@@ -97,6 +97,6 @@ if [ "$rewrite" != 'yes' ]; then
 else
     log_history "updated user package $package" '' 'admin'
 fi
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 4 - 4
bin/v-add-web-domain-ftp

@@ -28,7 +28,7 @@ source $VESTA/conf/vesta.conf
 #----------------------------------------------------------#
 
 check_args '4' "$#" 'USER DOMAIN FTP_USER FTP_PASSWORD [FTP_PATH]'
-validate_format 'user' 'domain' 'ftp_user'
+is_format_valid 'user' 'domain' 'ftp_user'
 is_system_enabled "$WEB_SYSTEM" 'WEB_SYSTEM'
 is_object_valid 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"
@@ -37,7 +37,7 @@ is_object_unsuspended 'web' 'DOMAIN' "$domain"
 check_ftp_user=$(grep "^$ftp_user:" /etc/passwd)
 if [ ! -z "$check_ftp_user" ] && [ "$FTP_USER" != "$ftp_user" ]; then
     echo "Error: ftp user $ftp_user already exists"
-    log_event "$E_EXISTS" "$EVENT"
+    log_event "$E_EXISTS" "$ARGUMENTS"
     exit $E_EXISTS
 fi
 is_password_valid
@@ -68,7 +68,7 @@ else
     ftp_path_a=$(readlink -f "$HOMEDIR/$user/web/$domain/$ftp_path")
     if [ -z "$(echo $ftp_path_a |grep $HOMEDIR/$user/web/$domain)" ]; then
         echo "Error: absolute path $ftp_path_a is invalid"
-        log_event "$E_INVALID" "$EVENT"
+        log_event "$E_INVALID" "$ARGUMENTS"
         exit $E_INVALID
     fi
     # Creating ftp user home directory
@@ -120,6 +120,6 @@ update_object_value 'web' 'DOMAIN' "$domain" '$FTP_PATH' "$ftp_path"
 
 # Logging
 log_history "added ftp account ${1}_${3}@$domain"
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 3 - 3
bin/v-add-web-domain-httpauth

@@ -32,7 +32,7 @@ docroot="$HOMEDIR/$user/web/$domain/public_html"
 #----------------------------------------------------------#
 
 check_args '4' "$#" 'USER DOMAIN AUTH_USER AUTH_PASSWORD [RESTART]'
-validate_format 'user' 'domain'
+is_format_valid 'user' 'domain'
 is_system_enabled "$WEB_SYSTEM" 'WEB_SYSTEM'
 is_object_valid 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"
@@ -42,7 +42,7 @@ is_password_valid
 get_domain_values 'web'
 if [ ! -z "$(echo "$AUTH_USER" |tr : '\n' |grep ^$auth_user$)" ]; then
     echo "Error: auth user $auth_user already exists"
-    log_event "$E_EXISTS" "$EVENT"
+    log_event "$E_EXISTS" "$ARGUMENTS"
     exit $E_EXISTS
 fi
 
@@ -100,6 +100,6 @@ update_object_value 'web' 'DOMAIN' "$domain" '$AUTH_HASH' "$auth_hash"
 
 # Logging
 log_history "added http auth user $httpauth_user on $domain"
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 2 - 2
bin/v-add-web-domain-stats-user

@@ -26,7 +26,7 @@ source $VESTA/conf/vesta.conf
 #----------------------------------------------------------#
 
 check_args '4' "$#" 'USER DOMAIN STATS_USER STATS_PASS'
-validate_format 'user' 'domain' 'stats_user'
+is_format_valid 'user' 'domain' 'stats_user'
 is_system_enabled "$WEB_SYSTEM" 'WEB_SYSTEM'
 is_object_valid 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"
@@ -63,6 +63,6 @@ update_object_value 'web' 'DOMAIN' "$domain" '$STATS_CRYPT' "$stats_crypt"
 
 # Logging
 log_history "added password protection for web stats on $domain"
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 1 - 1
bin/v-backup-users

@@ -44,6 +44,6 @@ done
 #----------------------------------------------------------#
 
 # No Logging
-#log_event "$OK" "$EVENT"
+#log_event "$OK" "$ARGUMENTS"
 
 exit

+ 8 - 3
bin/v-change-cron-job

@@ -30,7 +30,7 @@ source $VESTA/conf/vesta.conf
 #----------------------------------------------------------#
 
 check_args '7' "$#" 'USER JOB MIN HOUR DAY MONTH WDAY COMMAND'
-validate_format 'user' 'job' 'min' 'hour' 'day' 'month' 'wday' 'command' 
+is_format_valid 'user' 'job' 'min' 'hour' 'day' 'month' 'wday' 'command' 
 is_system_enabled "$CRON_SYSTEM" 'CRON_SYSTEM'
 is_object_valid 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"
@@ -42,10 +42,15 @@ is_object_unsuspended 'cron' 'JOB' "$job"
 #                       Action                             #
 #----------------------------------------------------------#
 
+# Generating timestamp
+time_n_date=$(date +'%T %F')
+time=$(echo "$time_n_date" |cut -f 1 -d \ )
+date=$(echo "$time_n_date" |cut -f 2 -d \ )
+
 # Concatenating cron string
 command=$(echo $command | sed -e "s/'/%quote%/g")
 str="JOB='$job' MIN='$min' HOUR='$hour' DAY='$day' MONTH='$month' WDAY='$wday'"
-str="$str CMD='$command' SUSPENDED='no' TIME='$TIME' DATE='$DATE'"
+str="$str CMD='$command' SUSPENDED='no' TIME='$time' DATE='$date'"
 
 # Deleting old job
 sed -i "/JOB='$job' /d" $USER_DATA/cron.conf
@@ -70,6 +75,6 @@ check_result $? "Cron restart failed" >/dev/null
 
 # Logging
 log_history "changed cron job $job"
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 2 - 2
bin/v-change-database-host-password

@@ -27,7 +27,7 @@ source $VESTA/conf/vesta.conf
 
 args_usage='TYPE HOST DBUSER DBPASS'
 check_args '4' "$#" "$args_usage"
-validate_format 'host' 'dbuser'
+is_format_valid 'host' 'dbuser'
 is_object_valid "../../conf/$type" 'HOST' "$host"
 dbpass="$password"
 
@@ -59,6 +59,6 @@ update_object_value "../../conf/$type" 'HOST' "$host" '$PASSWORD' "$dbpass"
 #----------------------------------------------------------#
 
 # Logging
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 6 - 6
bin/v-change-database-owner

@@ -25,7 +25,7 @@ source $VESTA/conf/vesta.conf
 #----------------------------------------------------------#
 
 check_args '2' "$#" 'DATABASE USER'
-validate_format 'database' 'user'
+is_format_valid 'database' 'user'
 is_system_enabled "$DB_SYSTEM" 'DB_SYSTEM'
 is_object_valid 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"
@@ -34,7 +34,7 @@ is_object_unsuspended 'user' 'USER' "$user"
 owner=$(echo $database | cut -f 1 -d '_')
 if [ ! -e "$VESTA/data/users/$owner" ]; then
     echo "Error: database owner doesn't exist"
-    log_event "$E_NOTEXIST" "$EVENT"
+    log_event "$E_NOTEXIST" "$ARGUMENTS"
     exit $E_NOTEXIST
 fi
 
@@ -47,7 +47,7 @@ fi
 db_data=$(grep "DB='$database'" $VESTA/data/users/$owner/db.conf)
 if [ -z "$db_data" ]; then
     echo "Error: database $database doesn't exist"
-    log_event "$E_NOTEXIST" "$EVENT"
+    log_event "$E_NOTEXIST" "$ARGUMENTS"
     exit $E_NOTEXIST
 fi
 
@@ -56,7 +56,7 @@ new_db=$(echo $database | sed "s/^${owner}_/${user}_/")
 check_db=$(grep "DB='$new_db'" $VESTA/data/users/$user/db.conf)
 if [ ! -z "$check_db" ]; then
     echo "Error: $new_db database exists"
-    log_event "$E_EXISTS" "$EVENT"
+    log_event "$E_EXISTS" "$ARGUMENTS"
     exit $E_EXISTS
 fi
 
@@ -69,7 +69,7 @@ fi
 tmpdir=$(mktemp -p $BACKUP -d)
 if [ "$?" -ne 0 ]; then
     echo "Error: can't create $tmpdir"
-    log_event "$E_NOTEXIST" "$EVENT"
+    log_event "$E_NOTEXIST" "$ARGUMENTS"
     exit $E_NOTEXIST
 fi
 
@@ -120,6 +120,6 @@ $BIN/v-update-user-counters $user
 #----------------------------------------------------------#
 
 # Logging
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 2 - 2
bin/v-change-database-password

@@ -26,7 +26,7 @@ source $VESTA/conf/vesta.conf
 #----------------------------------------------------------#
 
 check_args '3' "$#" 'USER DATABASE DBPASS'
-validate_format 'user' 'database'
+is_format_valid 'user' 'database'
 is_system_enabled "$DB_SYSTEM" 'DB_SYSTEM'
 is_object_valid 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"
@@ -56,6 +56,6 @@ update_object_value 'db' 'DB' "$database" '$MD5' "$md5"
 
 # Logging
 log_history "changed $database database password"
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 2 - 2
bin/v-change-database-user

@@ -27,7 +27,7 @@ source $VESTA/conf/vesta.conf
 #----------------------------------------------------------#
 
 check_args '3' "$#" 'USER DATABASE DBUSER [DBPASS]'
-validate_format 'user' 'database' 'dbuser'
+is_format_valid 'user' 'database' 'dbuser'
 is_system_enabled "$DB_SYSTEM" 'DB_SYSTEM'
 is_object_valid 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"
@@ -86,6 +86,6 @@ fi
 
 # Logging
 log_history "changed $database database user to $dbuser"
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 2 - 2
bin/v-change-dns-domain-exp

@@ -26,7 +26,7 @@ source $VESTA/conf/vesta.conf
 #----------------------------------------------------------#
 
 check_args '3' "$#" 'USER DOMAIN EXP'
-validate_format 'user' 'domain' 'exp'
+is_format_valid 'user' 'domain' 'exp'
 is_system_enabled "$DNS_SYSTEM" 'DNS_SYSTEM'
 is_object_valid 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"
@@ -58,6 +58,6 @@ fi
 
 # Logging
 log_history "changed whois expiration date for $domain"
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 2 - 2
bin/v-change-dns-domain-ip

@@ -27,7 +27,7 @@ source $VESTA/conf/vesta.conf
 #----------------------------------------------------------#
 
 check_args '3' "$#" 'USER DOMAIN IP'
-validate_format 'user' 'domain' 'ip'
+is_format_valid 'user' 'domain' 'ip'
 is_system_enabled "$DNS_SYSTEM" 'DNS_SYSTEM'
 is_object_valid 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"
@@ -78,6 +78,6 @@ fi
 
 # Logging
 log_history "changed dns ip for $domain to $ip"
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 2 - 2
bin/v-change-dns-domain-soa

@@ -28,7 +28,7 @@ source $VESTA/conf/vesta.conf
 #----------------------------------------------------------#
 
 check_args '3' "$#" 'USER DOMAIN SOA'
-validate_format 'user' 'domain' 'soa'
+is_format_valid 'user' 'domain' 'soa'
 is_system_enabled "$DNS_SYSTEM" 'DNS_SYSTEM'
 is_object_valid 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"
@@ -72,6 +72,6 @@ fi
 
 # Logging
 log_history "changed soa record for $domain to $soa"
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 2 - 2
bin/v-change-dns-domain-tpl

@@ -29,7 +29,7 @@ source $VESTA/conf/vesta.conf
 #----------------------------------------------------------#
 
 check_args '3' "$#" 'USER DOMAIN TEMPLATE [RESTART]'
-validate_format 'user' 'domain' 'template'
+is_format_valid 'user' 'domain' 'template'
 is_system_enabled "$DNS_SYSTEM" 'DNS_SYSTEM'
 is_object_valid 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"
@@ -98,6 +98,6 @@ fi
 
 # Logging
 log_history "changed dns template for $domain to $template" '' 'admin'
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 2 - 2
bin/v-change-dns-domain-ttl

@@ -27,7 +27,7 @@ source $VESTA/conf/vesta.conf
 #----------------------------------------------------------#
 
 check_args '3' "$#" 'USER DOMAIN TTL'
-validate_format 'user' 'domain' 'ttl'
+is_format_valid 'user' 'domain' 'ttl'
 is_system_enabled "$DNS_SYSTEM" 'DNS_SYSTEM'
 is_object_valid 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"
@@ -71,6 +71,6 @@ fi
 
 # Logging
 log_history "changed TTL for $domain to $ttl"
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 8 - 3
bin/v-change-dns-record

@@ -30,7 +30,7 @@ source $VESTA/conf/vesta.conf
 #----------------------------------------------------------#
 
 check_args '4' "$#" 'USER DOMAIN ID VALUE [PRIORITY] [RESTART]'
-validate_format 'user' 'domain' 'id' 'dvalue'
+is_format_valid 'user' 'domain' 'id' 'dvalue'
 is_system_enabled "$DNS_SYSTEM" 'DNS_SYSTEM'
 is_object_valid 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"
@@ -67,9 +67,14 @@ is_dns_nameserver_valid "$domain" "$TYPE" "$dvalue"
 # Deleting old record
 sed -i "/^ID='$id'/d" $USER_DATA/dns/$domain.conf
 
+# Generating timestamp
+time_n_date=$(date +'%T %F')
+time=$(echo "$time_n_date" |cut -f 1 -d \ )
+date=$(echo "$time_n_date" |cut -f 2 -d \ )
+
 # Adding record
 dns_rec="ID='$id' RECORD='$RECORD' TYPE='$TYPE' PRIORITY='$priority'"
-dns_rec="$dns_rec VALUE='$dvalue' SUSPENDED='no' TIME='$TIME' DATE='$DATE'"
+dns_rec="$dns_rec VALUE='$dvalue' SUSPENDED='no' TIME='$time' DATE='$date'"
 echo "$dns_rec" >> $USER_DATA/dns/$domain.conf
 
 # Sorting records
@@ -104,6 +109,6 @@ fi
 
 # Logging
 log_history "changed dns record on $domain to $dvalue"
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 2 - 2
bin/v-change-dns-record-id

@@ -29,7 +29,7 @@ source $VESTA/conf/vesta.conf
 #----------------------------------------------------------#
 
 check_args '4' "$#" 'USER DOMAIN ID NEWID [RESTART]'
-validate_format 'user' 'domain' 'id' 'newid'
+is_format_valid 'user' 'domain' 'id' 'newid'
 is_system_enabled "$DNS_SYSTEM" 'DNS_SYSTEM'
 is_object_valid 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"
@@ -78,6 +78,6 @@ fi
 
 # Logging
 log_history "changed dns record id on $domain"
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 3 - 3
bin/v-change-domain-owner

@@ -25,7 +25,7 @@ source $VESTA/conf/vesta.conf
 #----------------------------------------------------------#
 
 check_args '2' "$#" 'DOMAIN USER [IP]'
-validate_format 'domain' 'user'
+is_format_valid 'domain' 'user'
 is_object_valid 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"
 if [ ! -z "$ip" ]; then
@@ -36,7 +36,7 @@ fi
 owner=$(v-search-domain-owner $domain)
 if [ -z "$owner" ]; then
     echo "Error: domain $domain doesn't exist"
-    log_event "$E_NOTEXIST" "$EVENT"
+    log_event "$E_NOTEXIST" "$ARGUMENTS"
     exit $E_NOTEXIST
 fi
 if [ "$owner" = "$user" ]; then
@@ -168,6 +168,6 @@ $BIN/v-update-user-counters $user
 #----------------------------------------------------------#
 
 # Logging
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 9 - 4
bin/v-change-firewall-rule

@@ -40,9 +40,9 @@ sort_fw_rules() {
 #----------------------------------------------------------#
 
 check_args '5' "$#" 'RULE ACTION IP  PORT [PROTOCOL] [COMMENT]'
-validate_format 'rule' 'action' 'protocol' 'port_ext' 'ip'
+is_format_valid 'rule' 'action' 'protocol' 'port_ext' 'ip'
 if [ ! -z "$comment" ]; then
-    validate_format 'comment'
+    is_format_valid 'comment'
 fi
 is_system_enabled "$FIREWALL_SYSTEM" 'FIREWALL_SYSTEM'
 is_object_valid '../../data/firewall/rules' 'RULE' "$rule"
@@ -52,10 +52,15 @@ is_object_valid '../../data/firewall/rules' 'RULE' "$rule"
 #                       Action                             #
 #----------------------------------------------------------#
 
+# Generating timestamp
+time_n_date=$(date +'%T %F')
+time=$(echo "$time_n_date" |cut -f 1 -d \ )
+date=$(echo "$time_n_date" |cut -f 2 -d \ )
+
 # Concatenating firewall rule
 str="RULE='$rule' ACTION='$action' PROTOCOL='$protocol' PORT='$port_ext'"
 str="$str IP='$ip' COMMENT='$comment' SUSPENDED='no'"
-str="$str TIME='$TIME' DATE='$DATE'"
+str="$str TIME='$time' DATE='$date'"
 
 # Deleting old rule
 sed -i "/RULE='$rule' /d" $VESTA/data/firewall/rules.conf
@@ -75,6 +80,6 @@ $BIN/v-update-firewall
 #----------------------------------------------------------#
 
 # Logging
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 2 - 2
bin/v-change-mail-account-password

@@ -28,7 +28,7 @@ source $VESTA/conf/vesta.conf
 #----------------------------------------------------------#
 
 check_args '4' "$#" 'USER DOMAIN ACCOUNT PASSWORD'
-validate_format 'user' 'domain' 'account'
+is_format_valid 'user' 'domain' 'account'
 is_system_enabled "$MAIL_SYSTEM" 'MAIL_SYSTEM'
 is_object_valid 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"
@@ -63,6 +63,6 @@ update_object_value "mail/$domain" 'ACCOUNT' "$account" '$MD5' "$md5"
 
 # Logging
 log_history "changed password for $account@$domain"
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 3 - 3
bin/v-change-mail-account-quota

@@ -28,9 +28,9 @@ source $VESTA/conf/vesta.conf
 #----------------------------------------------------------#
 
 check_args '4' "$#" 'USER DOMAIN ACCOUNT QUOTA'
-validate_format 'user' 'domain' 'account'
+is_format_valid 'user' 'domain' 'account'
 if [ "$quota" != 'unlimited' ]; then
-    validate_format 'quota'
+    is_format_valid 'quota'
 fi
 is_system_enabled "$MAIL_SYSTEM" 'MAIL_SYSTEM'
 is_object_valid 'user' 'USER' "$user"
@@ -69,6 +69,6 @@ update_object_value "mail/$domain" 'ACCOUNT' "$account" '$QUOTA' "$quota"
 
 # Logging
 log_history "changed mail quota for $account@$domain to $quota"
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 2 - 2
bin/v-change-mail-domain-catchall

@@ -27,7 +27,7 @@ source $VESTA/conf/vesta.conf
 #----------------------------------------------------------#
 
 check_args '3' "$#" 'USER DOMAIN EMAIL'
-validate_format 'user' 'domain' 'email'
+is_format_valid 'user' 'domain' 'email'
 is_system_enabled "$MAIL_SYSTEM" 'MAIL_SYSTEM'
 is_object_valid 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"
@@ -56,6 +56,6 @@ update_object_value 'mail' 'DOMAIN' "$domain" '$CATCHALL' "$email"
 
 # Logging
 log_history "changed catchall email for $domain to $email"
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 1 - 1
bin/v-change-remote-dns-domain-exp

@@ -24,7 +24,7 @@ source $VESTA/conf/vesta.conf
 #----------------------------------------------------------#
 
 check_args '2' "$#" 'USER DOMAIN'
-validate_format 'user' 'domain'
+is_format_valid 'user' 'domain'
 is_system_enabled "$DNS_CLUSTER" 'DNS_CLUSTER'
 is_object_valid 'user' 'USER' "$user"
 is_object_valid 'dns' 'DOMAIN' "$domain"

+ 1 - 1
bin/v-change-remote-dns-domain-soa

@@ -24,7 +24,7 @@ source $VESTA/conf/vesta.conf
 #----------------------------------------------------------#
 
 check_args '2' "$#" 'USER DOMAIN'
-validate_format 'user' 'domain'
+is_format_valid 'user' 'domain'
 is_system_enabled "$DNS_CLUSTER" 'DNS_CLUSTER'
 is_object_valid 'user' 'USER' "$user"
 is_object_valid 'dns' 'DOMAIN' "$domain"

+ 1 - 1
bin/v-change-remote-dns-domain-ttl

@@ -24,7 +24,7 @@ source $VESTA/conf/vesta.conf
 #----------------------------------------------------------#
 
 check_args '2' "$#" 'USER DOMAIN'
-validate_format 'user' 'domain'
+is_format_valid 'user' 'domain'
 is_system_enabled "$DNS_CLUSTER" 'DNS_CLUSTER'
 is_object_valid 'user' 'USER' "$user"
 is_object_valid 'dns' 'DOMAIN' "$domain"

+ 2 - 2
bin/v-change-sys-config-value

@@ -24,7 +24,7 @@ source $VESTA/conf/vesta.conf
 #----------------------------------------------------------#
 
 check_args '2' "$#" 'KEY VALUE'
-validate_format 'key'
+is_format_valid 'key'
 
 
 #----------------------------------------------------------#
@@ -50,6 +50,6 @@ fi
 #----------------------------------------------------------#
 
 # Logging
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 2 - 2
bin/v-change-sys-hostname

@@ -22,7 +22,7 @@ source $VESTA/conf/vesta.conf
 #----------------------------------------------------------#
 
 check_args '1' "$#" 'HOSTNAME'
-validate_format 'domain'
+is_format_valid 'domain'
 
 
 #----------------------------------------------------------#
@@ -52,6 +52,6 @@ fi
 #----------------------------------------------------------#
 
 # Logging
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 3 - 3
bin/v-change-sys-ip-name

@@ -24,9 +24,9 @@ source $VESTA/conf/vesta.conf
 #----------------------------------------------------------#
 
 check_args '2' "$#" 'IP IP_NAME'
-validate_format 'ip'
+is_format_valid 'ip'
 if [ ! -z "$ip_name" ]; then
-    validate_format 'ip_name'
+    is_format_valid 'ip_name'
 fi
 is_ip_valid
 
@@ -45,6 +45,6 @@ update_ip_value '$NAME' "$ip_name"
 
 # Logging
 log_history "changed associated dns on $ip to $domain" '' 'admin'
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 3 - 3
bin/v-change-sys-ip-nat

@@ -25,9 +25,9 @@ source $VESTA/conf/vesta.conf
 #----------------------------------------------------------#
 
 check_args '2' "$#" 'IP NAT_IP [RESTART]'
-validate_format 'ip'
+is_format_valid 'ip'
 if [ ! -z "$nat_ip" ]; then
-    validate_format 'nat_ip'
+    is_format_valid 'nat_ip'
 fi
 is_ip_valid
 
@@ -82,6 +82,6 @@ fi
 
 # Logging
 log_history "changed associated nat address on $ip to $nat_ip" '' 'admin'
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 2 - 2
bin/v-change-sys-ip-owner

@@ -24,7 +24,7 @@ source $VESTA/conf/vesta.conf
 #----------------------------------------------------------#
 
 check_args '2' "$#" 'IP USER'
-validate_format 'ip' 'user'
+is_format_valid 'ip' 'user'
 is_object_valid 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"
 is_ip_valid
@@ -77,6 +77,6 @@ fi
 
 # Logging
 log_history "changed owner of $ip to $user" '' 'admin'
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 4 - 4
bin/v-change-sys-ip-status

@@ -24,11 +24,11 @@ source $VESTA/conf/vesta.conf
 #----------------------------------------------------------#
 
 check_args '2' "$#" 'IP IP_STATUS'
-validate_format 'ip' 'ip_status'
+is_format_valid 'ip' 'ip_status'
 is_ip_valid
 if [ "$ip_status" = "$(get_ip_value '$STATUS')" ]; then
     echo "Error: status $ip_status is already set"
-    log_event "$E_EXISTS" "$EVENT"
+    log_event "$E_EXISTS" "$ARGUMENTS"
     exit $E_EXISTS
 fi
 
@@ -37,7 +37,7 @@ sys_user=$(get_ip_value '$U_SYS_USERS')
 ip_owner=$(get_ip_value '$OWNER')
 if [ "$web_domains" -ne '0' ] && [ "$sys_user" != "$ip_owner" ]; then
     echo "Error: ip $ip is used"
-    log_event "$E_INUSE" "$EVENT"
+    log_event "$E_INUSE" "$ARGUMENTS"
     exit $E_INUSE
 fi
 
@@ -56,6 +56,6 @@ update_ip_value '$STATUS' "$ip_status"
 
 # Logging
 log_history "changed $ip status to $ip_status" '' 'admin'
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 3 - 3
bin/v-change-sys-language

@@ -20,7 +20,7 @@ source $VESTA/conf/vesta.conf
 is_language_valid() {
     if [ ! -e "$VESTA/web/inc/i18n/$language.php" ]; then
         echo "Error: language file $language doesn't exist"
-        log_event "$E_NOTEXIST $EVENT"
+        log_event "$E_NOTEXIST $ARGUMENTS"
         exit $E_NOTEXIST
     fi
 }
@@ -31,7 +31,7 @@ is_language_valid() {
 #----------------------------------------------------------#
 
 check_args '1' "$#" 'LANGUAGE'
-validate_format 'language'
+is_format_valid 'language'
 is_language_valid $language
 
 
@@ -52,6 +52,6 @@ fi
 #----------------------------------------------------------#
 
 # Logging
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 2 - 2
bin/v-change-sys-timezone

@@ -19,7 +19,7 @@ source $VESTA/conf/vesta.conf
 is_timezone_valid() {
     if [ ! -e "/usr/share/zoneinfo/$timezone" ]; then
         echo "Error: tz file $timezone doesn't exist"
-        log_event $E_NOTEXIST "$EVENT"
+        log_event $E_NOTEXIST "$ARGUMENTS"
         exit $E_NOTEXIST
     fi
 }
@@ -67,6 +67,6 @@ fi
 #----------------------------------------------------------#
 
 # Logging
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 2 - 2
bin/v-change-user-contact

@@ -23,7 +23,7 @@ source $VESTA/conf/vesta.conf
 #----------------------------------------------------------#
 
 check_args '2' "$#" 'USER EMAIL'
-validate_format 'user' 'email'
+is_format_valid 'user' 'email'
 is_object_valid 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"
 
@@ -49,6 +49,6 @@ $BIN/v-rebuild-cron-jobs $user > /dev/null 2>&1
 
 # Logging
 log_history "changed contact email to $email"
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 4 - 4
bin/v-change-user-language

@@ -21,12 +21,12 @@ source $VESTA/conf/vesta.conf
 is_language_valid() {
     if ! [[ "$1" =~ ^[[:alnum:]_-]+$ ]]; then
         echo "Error: language $1 is not valid"
-        log_event "$E_INVALID" "$EVENT"
+        log_event "$E_INVALID" "$ARGUMENTS"
         exit $E_INVALID
     fi
     if [ ! -e "$VESTA/web/inc/i18n/$1.php" ]; then
         echo "Error: language $1 doesn't exist"
-        log_event "$E_NOTEXIST" "$EVENT"
+        log_event "$E_NOTEXIST" "$ARGUMENTS"
         exit $E_NOTEXIST
     fi
 }
@@ -37,7 +37,7 @@ is_language_valid() {
 #----------------------------------------------------------#
 
 check_args '2' "$#" 'USER LANGUAGE'
-validate_format 'user' 'language'
+is_format_valid 'user' 'language'
 is_object_valid 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"
 is_language_valid $language
@@ -61,6 +61,6 @@ fi
 
 # Logging
 log_history "changed language to $language"
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 2 - 2
bin/v-change-user-name

@@ -24,7 +24,7 @@ source $VESTA/conf/vesta.conf
 #----------------------------------------------------------#
 
 check_args '3' "$#" 'USER FNAME LNAME'
-validate_format 'user' 'fname' 'lname'
+is_format_valid 'user' 'fname' 'lname'
 is_object_valid 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"
 
@@ -48,6 +48,6 @@ update_user_value "$user" '$LNAME' "$lname"
 
 # Logging
 log_history "changed user name to $fname $lname"
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 8 - 8
bin/v-change-user-ns

@@ -33,30 +33,30 @@ source $VESTA/conf/vesta.conf
 check_args '3' "$#" 'USER NS1 NS2 [NS3] [NS4] [NS5] [NS6] [NS7] [NS8]'
 
 # Checking argument format
-validate_format 'user' 'ns1' 'ns2'
+is_format_valid 'user' 'ns1' 'ns2'
 if [ ! -z "$ns3" ]; then
     ns3=$(echo $4 | sed -e 's/\.*$//g' -e 's/^\.*//g')
-    validate_format 'ns3'
+    is_format_valid 'ns3'
 fi
 if [ ! -z "$ns4" ]; then
     ns4=$(echo $5 | sed -e 's/\.*$//g' -e 's/^\.*//g')
-    validate_format 'ns4'
+    is_format_valid 'ns4'
 fi
 if [ ! -z "$ns5" ]; then
     ns5=$(echo $6 | sed -e 's/\.*$//g' -e 's/^\.*//g')
-    validate_format 'ns5'
+    is_format_valid 'ns5'
 fi
 if [ ! -z "$ns6" ]; then
     ns6=$(echo $7 | sed -e 's/\.*$//g' -e 's/^\.*//g')
-    validate_format 'ns6'
+    is_format_valid 'ns6'
 fi
 if [ ! -z "$ns7" ]; then
     ns7=$(echo $8 | sed -e 's/\.*$//g' -e 's/^\.*//g')
-    validate_format 'ns7'
+    is_format_valid 'ns7'
 fi
 if [ ! -z "$ns8" ]; then
     ns8=$(echo $9 | sed -e 's/\.*$//g' -e 's/^\.*//g')
-    validate_format 'ns8'
+    is_format_valid 'ns8'
 fi
 is_object_valid 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"
@@ -80,6 +80,6 @@ update_user_value "$user" '$NS' "$ns"
 
 # Logging
 log_history "updated nameservers $ns1 $ns2 $ns3 $ns4 $ns5 $ns6 $ns7 $ns8"
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 11 - 16
bin/v-change-user-package

@@ -41,62 +41,57 @@ is_package_avalable() {
     if [ "$WEB_DOMAINS" != 'unlimited' ]; then
         if [ "$WEB_DOMAINS" -lt "$U_WEB_DOMAINS" ]; then
             echo "Error: Package doesn't cover WEB_DOMAIN usage"
-            log_event "$E_LIMIT" "$EVENT"
+            log_event "$E_LIMIT" "$ARGUMENTS"
             exit $E_LIMIT
         fi
     fi
     if [ "$DNS_DOMAINS" ! = 'unlimited' ]; then
         if [ "$DNS_DOMAINS" -lt "$U_DNS_DOMAINS" ]; then
             echo "Error: Package doesn't cover DNS_DOMAIN usage"
-            log_event "$E_LIMIT" "$EVENT"
+            log_event "$E_LIMIT" "$ARGUMENTS"
             exit $E_LIMIT
         fi
     fi
     if [ "$MAIL_DOMAINS" != 'unlimited' ]; then
         if [ "$MAIL_DOMAINS" -lt "$U_MAIL_DOMAINS" ]; then
             echo "Error: Package doesn't cover MAIL_DOMAIN usage"
-            log_event "$E_LIMIT" "$EVENT"
+            log_event "$E_LIMIT" "$ARGUMENTS"
             exit $E_LIMIT
         fi
     fi
     if [ "$DATABASES" != 'unlimited' ]; then
         if [ "$DATABASES" -lt "$U_DATABASES" ]; then
             echo "Error: Package doesn't cover DATABASE usage"
-            log_event "$E_LIMIT" "$EVENT"
+            log_event "$E_LIMIT" "$ARGUMENTS"
             exit $E_LIMIT
         fi
     fi
     if [ "$CRON_JOBS" != 'unlimited' ]; then
         if [ "$CRON_JOBS" -lt "$U_CRON_JOBS" ]; then
             echo "Error: Package doesn't cover CRON usage"
-            log_event "$E_LIMIT" "$EVENT"
+            log_event "$E_LIMIT" "$ARGUMENTS"
             exit $E_LIMIT
         fi
     fi
     if [ "$DISK_QUOTA" != 'unlimited' ]; then
         if [ "$DISK_QUOTA" -lt "$U_DISK" ]; then
             echo "Error: Package doesn't cover DISK usage"
-            log_event "$E_LIMIT" "$EVENT"
+            log_event "$E_LIMIT" "$ARGUMENTS"
             exit $E_LIMIT
         fi
     fi
     if [ "$BANDWIDTH" != 'unlimited' ]; then
         if [ "$BANDWIDTH" -lt "$U_BANDWIDTH" ]; then
             echo "Error: Package doesn't cover BANDWIDTH usage"
-            log_event "$E_LIMIT" "$EVENT"
+            log_event "$E_LIMIT" "$ARGUMENTS"
             exit $E_LIMIT
         fi
     fi
 }
 
 change_user_package() {
-    usr_data=$(cat $USER_DATA/user.conf)
-    eval $usr_data
-
-    pkg_data=$(cat $VESTA/data/packages/$package.pkg |grep -v TIME |\
-        grep -v DATE)
-    eval $pkg_data
-
+    eval $(cat $USER_DATA/user.conf)
+    eval $(cat $VESTA/data/packages/$package.pkg |egrep -v "TIME|DATE")
     echo "FNAME='$FNAME'
 LNAME='$LNAME'
 PACKAGE='$package'
@@ -159,7 +154,7 @@ DATE='$DATE'" > $USER_DATA/user.conf
 #----------------------------------------------------------#
 
 check_args '2' "$#" 'USER PACKAGE [FORCE]'
-validate_format 'user' 'package'
+is_format_valid 'user' 'package'
 is_object_valid 'user' 'USER' "$user"
 is_package_valid
 if [ "$force" != 'yes' ];then
@@ -197,6 +192,6 @@ fi
 
 # Logging
 log_history "changed $user package to $package" '' 'admin'
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 2 - 2
bin/v-change-user-password

@@ -23,7 +23,7 @@ source $VESTA/conf/vesta.conf
 #----------------------------------------------------------#
 
 check_args '2' "$#" 'USER PASSWORD'
-validate_format 'user'
+is_format_valid 'user'
 is_object_valid 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"
 is_password_valid
@@ -48,6 +48,6 @@ update_user_value "$user" '$MD5' "$md5"
 
 # Logging
 log_history "changed password"
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 2 - 2
bin/v-change-user-shell

@@ -23,7 +23,7 @@ source $VESTA/conf/vesta.conf
 #----------------------------------------------------------#
 
 check_args '2' "$#" 'USER SHELL'
-validate_format 'user' 'shell'
+is_format_valid 'user' 'shell'
 is_object_valid 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"
 
@@ -58,6 +58,6 @@ update_user_value "$user" '$SHELL' "$shell"
 
 # Logging
 log_history "changed $user shell to $shell" '' 'admin'
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 2 - 2
bin/v-change-user-template

@@ -25,7 +25,7 @@ source $VESTA/conf/vesta.conf
 #----------------------------------------------------------#
 
 check_args '3' "$#" 'USER TYPE TEMPLATE'
-validate_format 'user' 'template'
+is_format_valid 'user' 'template'
 is_object_valid 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"
 
@@ -51,6 +51,6 @@ esac
 
 # Logging
 log_history "changed $type template to $template"
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 3 - 3
bin/v-change-web-domain-ftp-password

@@ -27,7 +27,7 @@ source $VESTA/conf/vesta.conf
 #----------------------------------------------------------#
 
 check_args '4' "$#" 'USER DOMAIN FTP_USER FTP_PASSWORD'
-validate_format 'user' 'domain' 'ftp_user'
+is_format_valid 'user' 'domain' 'ftp_user'
 is_system_enabled "$WEB_SYSTEM" 'WEB_SYSTEM'
 is_object_valid 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"
@@ -37,7 +37,7 @@ is_password_valid
 get_domain_values 'web'
 if [ -z "$(echo $FTP_USER | tr ':' '\n' | grep ^$ftp_user$)" ]; then
     echo "Error: account $ftp_user doesn't exist"
-    log_event "$E_NOTEXIST" "$EVENT"
+    log_event "$E_NOTEXIST" "$ARGUMENTS"
     exit $E_NOTEXIST
 fi
 
@@ -67,6 +67,6 @@ update_object_value 'web' 'DOMAIN' "$domain" '$FTP_MD5' "$ftp_md5"
 
 # Logging
 log_history "changed password for $ftp_user on $domain"
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 4 - 4
bin/v-change-web-domain-ftp-path

@@ -27,7 +27,7 @@ source $VESTA/conf/vesta.conf
 #----------------------------------------------------------#
 
 check_args '4' "$#" 'USER DOMAIN FTP_USER FTP_PATH'
-validate_format 'user' 'domain' 'ftp_user'
+is_format_valid 'user' 'domain' 'ftp_user'
 is_system_enabled "$WEB_SYSTEM" 'WEB_SYSTEM'
 is_object_valid 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"
@@ -36,13 +36,13 @@ is_object_unsuspended 'web' 'DOMAIN' "$domain"
 get_domain_values 'web'
 if [ -z "$(echo $FTP_USER | tr ':' '\n' | grep ^$ftp_user$)" ]; then
     echo "Error: account $ftp_user doesn't exist"
-    log_event "$E_NOTEXIST" "$EVENT"
+    log_event "$E_NOTEXIST" "$ARGUMENTS"
     exit $E_NOTEXIST
 fi
 ftp_path_a=$(readlink -f "$HOMEDIR/$user/web/$domain/$ftp_path")
 if [ -z "$(echo $ftp_path_a |grep $HOMEDIR/$user/web/$domain)" ]; then
     echo "Error: absolute path $ftp_path_a is invalid"
-    log_event "$E_INVALID" "$EVENT"
+    log_event "$E_INVALID" "$ARGUMENTS"
     exit $E_INVALID
 fi
 
@@ -84,6 +84,6 @@ update_object_value 'web' 'DOMAIN' "$domain" '$FTP_PATH' "$ftp_path"
 
 # Logging
 log_history "changed path to $ftp_path_a for $ftp_user@$domain"
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 3 - 3
bin/v-change-web-domain-httpauth

@@ -29,7 +29,7 @@ htpasswd="$HOMEDIR/$user/conf/web/$WEB_SYSTEM.$domain.htpasswd"
 #----------------------------------------------------------#
 
 check_args '4' "$#" 'USER DOMAIN AUTH_USER AUTH_PASSWORD [RESTART]'
-validate_format 'user' 'domain'
+is_format_valid 'user' 'domain'
 is_system_enabled "$WEB_SYSTEM" 'WEB_SYSTEM'
 is_object_valid 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"
@@ -39,7 +39,7 @@ is_password_valid
 get_domain_values 'web'
 if [ -z "$(echo "$AUTH_USER" |tr : '\n' |grep ^$auth_user$)" ]; then
     echo "Error: auth user $auth_user doesn't exist"
-    log_event "$E_NOTEXIST" "$EVENT"
+    log_event "$E_NOTEXIST" "$ARGUMENTS"
     exit $E_NOTEXIST
 fi
 
@@ -71,6 +71,6 @@ update_object_value 'web' 'DOMAIN' "$domain" '$AUTH_HASH' "$auth_hash"
 
 # Logging
 log_history "changed auth user $httpauth_user password on $domain"
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 1 - 1
bin/v-check-user-password

@@ -24,7 +24,7 @@ source $VESTA/conf/vesta.conf
 #----------------------------------------------------------#
 
 check_args '2' "$#" 'USER PASSWORD'
-validate_format 'user'
+is_format_valid 'user'
 
 # Checking user
 if [ ! -d "$VESTA/data/users/$user" ] && [ "$user" != 'root' ]; then

+ 1 - 1
bin/v-deactivate-vesta-license

@@ -60,6 +60,6 @@ if [ "$module" = 'SFTPJAIL' ]; then
 fi
 
 # Logging
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 2 - 2
bin/v-delete-backup-host

@@ -25,7 +25,7 @@ check_args '1' "$#" 'TYPE [HOST]'
 types=$(echo "$BACKUP_SYSTEM" |sed "s/,/\n/g" |grep "^$type$")
 if [ -z "$types" ]; then
     echo "Error: invalid backup type"
-    log_event "$E_INVALID" "$EVENT"
+    log_event "$E_INVALID" "$ARGUMENTS"
     exit $E_INVALID
 fi
 
@@ -51,6 +51,6 @@ bckp=$(echo "$BACKUP_SYSTEM" |\
 sed -i "s/BACKUP_SYSTEM=.*/BACKUP_SYSTEM='$bckp'/g" $VESTA/conf/vesta.conf
 
 # Logging
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 2 - 2
bin/v-delete-cron-job

@@ -23,7 +23,7 @@ source $VESTA/conf/vesta.conf
 #----------------------------------------------------------#
 
 check_args '2' "$#" 'USER JOB'
-validate_format 'user' 'job'
+is_format_valid 'user' 'job'
 is_system_enabled "$CRON_SYSTEM" 'CRON_SYSTEM'
 is_object_valid 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"
@@ -58,6 +58,6 @@ check_result $? "Restart restart failed" >/dev/null
 
 # Logging
 log_history "deleted cron job $job"
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 2 - 2
bin/v-delete-cron-reports

@@ -23,7 +23,7 @@ source $VESTA/conf/vesta.conf
 #----------------------------------------------------------#
 
 check_args '1' "$#" 'USER'
-validate_format 'user'
+is_format_valid 'user'
 is_system_enabled "$CRON_SYSTEM" 'CRON_SYSTEM'
 is_object_valid 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"
@@ -50,6 +50,6 @@ check_result $? "Cron restart failed" >/dev/null
 
 # Logging
 log_history "disabled cron reporting"
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 1 - 1
bin/v-delete-cron-restart-job

@@ -39,6 +39,6 @@ fi
 #----------------------------------------------------------#
 
 # Logging
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 1 - 1
bin/v-delete-cron-vesta-autoupdate

@@ -56,6 +56,6 @@ $BIN/v-restart-cron
 check_result $? "Cron restart failed" >/dev/null
 
 # Logging
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 2 - 2
bin/v-delete-database

@@ -25,7 +25,7 @@ source $VESTA/conf/vesta.conf
 #----------------------------------------------------------#
 
 check_args '2' "$#" 'USER DATABASE'
-validate_format 'user' 'database'
+is_format_valid 'user' 'database'
 is_system_enabled "$DB_SYSTEM" 'DB_SYSTEM'
 is_object_valid 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"
@@ -60,6 +60,6 @@ decrease_user_value "$user" '$U_DATABASES'
 
 # Logging
 log_history "deleted $database database"
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 2 - 2
bin/v-delete-database-host

@@ -25,7 +25,7 @@ source $VESTA/conf/vesta.conf
 #----------------------------------------------------------#
 
 check_args '2' "$#" 'TYPE HOST'
-validate_format 'type' 'host'
+is_format_valid 'type' 'host'
 is_system_enabled "$DB_SYSTEM" 'DB_SYSTEM'
 is_type_valid "$DB_SYSTEM" "$type"
 is_object_valid "../../conf/$type" 'HOST' "$host"
@@ -45,6 +45,6 @@ sed -i "/HOST='$host' /d" $VESTA/conf/$type.conf
 
 # Logging
 log_history "deleted $type database server $host" '' 'admin'
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 2 - 2
bin/v-delete-databases

@@ -22,7 +22,7 @@ source $VESTA/conf/vesta.conf
 #----------------------------------------------------------#
 
 check_args '1' "$#" 'USER'
-validate_format 'user'
+is_format_valid 'user'
 is_system_enabled "$DB_SYSTEM" 'DB_SYSTEM'
 is_object_valid 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"
@@ -43,6 +43,6 @@ done
 #----------------------------------------------------------#
 
 # Logging
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 2 - 2
bin/v-delete-dns-domain

@@ -26,7 +26,7 @@ source $VESTA/conf/vesta.conf
 #----------------------------------------------------------#
 
 check_args '2' "$#" 'USER DOMAIN'
-validate_format 'user' 'domain'
+is_format_valid 'user' 'domain'
 is_system_enabled "$DNS_SYSTEM" 'DNS_SYSTEM'
 is_object_valid 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"
@@ -79,6 +79,6 @@ fi
 
 # Logging
 log_history "deleted dns domain $domain"
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 2 - 2
bin/v-delete-dns-domains

@@ -23,7 +23,7 @@ source $VESTA/conf/vesta.conf
 #----------------------------------------------------------#
 
 check_args '1' "$#" 'USER'
-validate_format 'user'
+is_format_valid 'user'
 is_system_enabled "$DNS_SYSTEM" 'DNS_SYSTEM'
 is_object_valid 'user' 'USER' "$user"
 
@@ -49,6 +49,6 @@ if [ "$restart" != 'no' ]; then
 fi
 
 # Logging
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 2 - 2
bin/v-delete-dns-domains-src

@@ -24,7 +24,7 @@ source $VESTA/conf/vesta.conf
 #----------------------------------------------------------#
 
 check_args '2' "$#" 'USER SRC [RESTART]'
-validate_format 'user' 'src'
+is_format_valid 'user' 'src'
 is_system_enabled "$DNS_SYSTEM" 'DNS_SYSTEM'
 is_object_valid 'user' 'USER' "$user"
 
@@ -50,6 +50,6 @@ if [ "$restart" != 'no' ]; then
 fi
 
 # Logging
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 2 - 2
bin/v-delete-dns-on-web-alias

@@ -30,7 +30,7 @@ source $VESTA/conf/vesta.conf
 #----------------------------------------------------------#
 
 check_args '3' "$#" 'USER DOMAIN ALIAS'
-validate_format 'user' 'domain'
+is_format_valid 'user' 'domain'
 is_system_enabled "$WEB_SYSTEM" 'WEB_SYSTEM'
 is_system_enabled "$DNS_SYSTEM" 'DNS_SYSTEM'
 is_object_valid 'user' 'USER' "$user"
@@ -74,6 +74,6 @@ fi
 #----------------------------------------------------------#
 
 # Logging
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 2 - 2
bin/v-delete-dns-record

@@ -27,7 +27,7 @@ source $VESTA/conf/vesta.conf
 #----------------------------------------------------------#
 
 check_args '3' "$#" 'USER DOMAIN ID [RESTART]'
-validate_format 'user' 'domain' 'id'
+is_format_valid 'user' 'domain' 'id'
 is_object_valid 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"
 is_object_valid 'dns' 'DOMAIN' "$domain"
@@ -77,6 +77,6 @@ fi
 
 # Logging
 log_history "deleted dns record $id on $domain"
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 2 - 2
bin/v-delete-domain

@@ -24,7 +24,7 @@ source $VESTA/conf/vesta.conf
 #----------------------------------------------------------#
 
 check_args '2' "$#" 'USER DOMAIN'
-validate_format 'user' 'domain'
+is_format_valid 'user' 'domain'
 is_object_valid 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"
 
@@ -66,7 +66,7 @@ fi
 # Checking domain search result
 if [ -z "$domain_found" ]; then
     echo "Error: domain $domain doesn't exist"
-    log_event "$E_NOTEXIST" "$EVENT"
+    log_event "$E_NOTEXIST" "$ARGUMENTS"
     exit $E_NOTEXIST
 fi
 

+ 2 - 2
bin/v-delete-firewall-ban

@@ -29,7 +29,7 @@ source $VESTA/conf/vesta.conf
 #----------------------------------------------------------#
 
 check_args '2' "$#" 'IP CHAIN'
-validate_format 'ip' 'chain'
+is_format_valid 'ip' 'chain'
 is_system_enabled "$FIREWALL_SYSTEM" 'FIREWALL_SYSTEM'
 
 
@@ -59,6 +59,6 @@ chmod 660 $conf
 #----------------------------------------------------------#
 
 # Logging
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 2 - 2
bin/v-delete-firewall-chain

@@ -28,7 +28,7 @@ source $VESTA/conf/vesta.conf
 #----------------------------------------------------------#
 
 check_args '1' "$#" 'CHAIN'
-validate_format 'chain'
+is_format_valid 'chain'
 is_system_enabled "$FIREWALL_SYSTEM" 'FIREWALL_SYSTEM'
 
 
@@ -61,6 +61,6 @@ chmod 660 $chains
 #----------------------------------------------------------#
 
 # Logging
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 2 - 2
bin/v-delete-firewall-rule

@@ -25,7 +25,7 @@ source $VESTA/conf/vesta.conf
 #----------------------------------------------------------#
 
 check_args '1' "$#" 'RULE'
-validate_format 'rule'
+is_format_valid 'rule'
 is_system_enabled "$FIREWALL_SYSTEM" 'FIREWALL_SYSTEM'
 is_object_valid '../../data/firewall/rules' 'RULE' "$rule"
 
@@ -46,6 +46,6 @@ $BIN/v-update-firewall
 #----------------------------------------------------------#
 
 # Logging
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

+ 2 - 2
bin/v-delete-mail-account

@@ -27,7 +27,7 @@ source $VESTA/conf/vesta.conf
 #----------------------------------------------------------#
 
 check_args '3' "$#" 'USER DOMAIN ACCOUNT'
-validate_format 'user' 'domain' 'account'
+is_format_valid 'user' 'domain' 'account'
 is_system_enabled "$MAIL_SYSTEM" 'MAIL_SYSTEM'
 is_object_valid 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"
@@ -68,6 +68,6 @@ update_object_value 'mail' 'DOMAIN' "$domain" '$ACCOUNTS' "$accounts"
 
 # Logging
 log_history "deleted $account@$domain mail account"
-log_event "$OK" "$EVENT"
+log_event "$OK" "$ARGUMENTS"
 
 exit

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است