@@ -881,9 +881,6 @@ is_valid_extension() {
881881 test_domain=$( idn -t --quiet -u " $1 " )
882882 extension=$( /bin/echo " ${test_domain} " | /usr/bin/rev | /usr/bin/cut -d " ." --output-delimiter=" ." -f 1 | /usr/bin/rev ) ;
883883 exten=$( grep " ^$extension \$ " $HESTIA /data/extensions/public_suffix_list.dat) ;
884- if [ $? -ne 0 ]; then
885- check_result 2 " .$extension is not valid"
886- fi
887884}
888885
889886is_valid_2_part_extension () {
@@ -901,7 +898,7 @@ get_base_domain() {
901898 test_domain=$1
902899 is_valid_extension " $test_domain "
903900 if [ $? -ne 0 ]; then
904- basedomain=" "
901+ basedomain=$( /bin/echo " ${test_domain} " | /usr/bin/rev | /usr/bin/cut -d " . " --output-delimiter= " . " -f 1-2 | /usr/bin/rev ) ;
905902 else
906903 is_valid_2_part_extension " $test_domain "
907904 if [ $? -ne 0 ]; then
@@ -919,14 +916,16 @@ is_base_domain_owner(){
919916 if [ " $object " != " none" ]; then
920917 get_base_domain $object
921918 web=$( grep -F -H -h " DOMAIN='$basedomain '" $HESTIA /data/users/* /web.conf) ;
922- if [ ! -z " $web " ]; then
923- parse_object_kv_list " $web "
924- if [ -z " $ALLOW_USERS " ] || [ " $ALLOW_USERS " != " yes" ]; then
925- # Don't care if $basedomain all ready exists only if the owner is of the base domain is the current user
926- is_domain_new " " $basedomain
919+ if [ $ALLOW_USERS_SYSTEM = " no" ]; then
920+ if [ ! -z " $web " ]; then
921+ parse_object_kv_list " $web "
922+ if [ -z " $ALLOW_USERS " ] || [ " $ALLOW_USERS " != " yes" ]; then
923+ # Don't care if $basedomain all ready exists only if the owner is of the base domain is the current user
924+ is_domain_new " " $basedomain
925+ fi
926+ else
927+ is_domain_new " " $basedomain
927928 fi
928- else
929- is_domain_new " " $basedomain
930929 fi
931930 fi
932931 done
0 commit comments