Explorar o código

improved domain validation

Serghey Rodin %!s(int64=8) %!d(string=hai) anos
pai
achega
b1449299bc
Modificáronse 4 ficheiros con 6 adicións e 8 borrados
  1. 0 1
      bin/v-add-dns-domain
  2. 0 1
      bin/v-add-mail-domain
  3. 5 3
      func/main.sh
  4. 1 3
      upd/add_notifications.sh

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

@@ -16,7 +16,6 @@
 # Argument definition
 user=$1
 domain=$2
-domain_idn=$2
 ip=$3
 ns1=$4
 ns2=$5

+ 0 - 1
bin/v-add-mail-domain

@@ -12,7 +12,6 @@
 # Argument definition
 user=$1
 domain=$2
-domain_idn=$2
 antispam=${3-yes}
 antivirus=${4-yes}
 dkim=${5-yes}

+ 5 - 3
func/main.sh

@@ -875,12 +875,11 @@ format_domain() {
         domain=$(echo "$domain" |sed -e "s/^www.//")
     fi
     if [[ "$domain" =~ .*\.$ ]]; then
-        domain=$(echo "$domain" |sed -e "s/\.$//")
+        domain=$(echo "$domain" |sed -e "s/[.]*$//g")
     fi
     if [[ "$domain" =~ ^\. ]]; then
-        domain=$(echo "$domain" |sed -e "s/^\.//")
+        domain=$(echo "$domain" |sed -e "s/^[.]*//")
     fi
-
 }
 
 format_domain_idn() {
@@ -896,6 +895,9 @@ format_aliases() {
     if [ ! -z "$aliases" ] && [ "$aliases" != 'none' ]; then
         aliases=$(echo $aliases |tr '[:upper:]' '[:lower:]' |tr ',' '\n')
         aliases=$(echo "$aliases" |sed -e "s/\.$//" |sort -u)
+        aliases=$(echo "$aliases" |tr -s '.')
+        aliases=$(echo "$aliases" |sed -e "s/[.]*$//g")
+        aliases=$(echo "$aliases" |sed -e "s/^[.]*//")
         aliases=$(echo "$aliases" |grep -v www.$domain |sed -e "/^$/d")
         aliases=$(echo "$aliases" |tr '\n' ',' |sed -e "s/,$//")
     fi

+ 1 - 3
upd/add_notifications.sh

@@ -4,6 +4,4 @@
 rm -f /usr/local/vesta/data/users/admin/notifications.conf
 /usr/local/vesta/bin/v-add-user-notification admin "File Manager" "Browse, copy, edit, view, and retrieve all your web domain files using a fully featured <a href='http://vestacp.com/features/#filemanager'>File Manager</a>. Plugin is available for <a href='/edit/server/?lead=filemanager#module-filemanager'>purchase</a>." 'filemanager'
 /usr/local/vesta/bin/v-add-user-notification admin "Chroot SFTP" "If you want to have SFTP accounts that will be used only to transfer files (and not to SSH), you can  <a href='/edit/server/?lead=sftp#module-sftp'>purchase</a> and enable <a href='http://vestacp.com/features/#sftpchroot'>SFTP Chroot</a>"
-/usr/local/vesta/bin/v-add-user-notification admin "Free SSL Certificates" "Lets Encrypt is a free and automated Certificate Authority. You can find out more information at <a href='https://letsencrypt.org/'>letsencrypt.org</a>"
-/usr/local/vesta/bin/v-add-user-notification admin "Keyboard Control" "You can use your keyboard to perform many of the actions you perform with your mouse, such as navigating to or selecting menus and items"
-/usr/local/vesta/bin/v-add-user-notification admin "Release 0.9.8-17" "Notable in this release is the improved server tab. You can now edit service configs, php.ini and so on. We have added nice mail helpers and fixed a dozen bugs. For more information please read the <a href='http://vestacp.com/roadmap/#0.9.8-17'>release notes</a>"
+/usr/local/vesta/bin/v-add-user-notification admin "Release 0.9.8-18" "Biggest the <a href='http://vestacp.com/roadmap/#0.9.8-18'>release notes</a>"