|
|
@@ -881,9 +881,6 @@ is_valid_extension() {
|
|
|
test_domain=$(idn -t --quiet -u "$1" )
|
|
|
extension=$( /bin/echo "${test_domain}" | /usr/bin/rev | /usr/bin/cut -d "." --output-delimiter="." -f 1 | /usr/bin/rev );
|
|
|
exten=$(grep "^$extension\$" $HESTIA/data/extensions/public_suffix_list.dat);
|
|
|
- if [ $? -ne 0 ]; then
|
|
|
- check_result 2 ".$extension is not valid"
|
|
|
- fi
|
|
|
}
|
|
|
|
|
|
is_valid_2_part_extension() {
|
|
|
@@ -901,7 +898,7 @@ get_base_domain() {
|
|
|
test_domain=$1
|
|
|
is_valid_extension "$test_domain"
|
|
|
if [ $? -ne 0 ]; then
|
|
|
- basedomain=""
|
|
|
+ basedomain=$( /bin/echo "${test_domain}" | /usr/bin/rev | /usr/bin/cut -d "." --output-delimiter="." -f 1-2 | /usr/bin/rev );
|
|
|
else
|
|
|
is_valid_2_part_extension "$test_domain"
|
|
|
if [ $? -ne 0 ]; then
|
|
|
@@ -919,14 +916,16 @@ is_base_domain_owner(){
|
|
|
if [ "$object" != "none" ]; then
|
|
|
get_base_domain $object
|
|
|
web=$(grep -F -H -h "DOMAIN='$basedomain'" $HESTIA/data/users/*/web.conf);
|
|
|
- if [ ! -z "$web" ]; then
|
|
|
- parse_object_kv_list "$web"
|
|
|
- if [ -z "$ALLOW_USERS" ] || [ "$ALLOW_USERS" != "yes" ]; then
|
|
|
- # Don't care if $basedomain all ready exists only if the owner is of the base domain is the current user
|
|
|
- is_domain_new "" $basedomain
|
|
|
+ if [ $ALLOW_USERS_SYSTEM = "no" ]; then
|
|
|
+ if [ ! -z "$web" ]; then
|
|
|
+ parse_object_kv_list "$web"
|
|
|
+ if [ -z "$ALLOW_USERS" ] || [ "$ALLOW_USERS" != "yes" ]; then
|
|
|
+ # Don't care if $basedomain all ready exists only if the owner is of the base domain is the current user
|
|
|
+ is_domain_new "" $basedomain
|
|
|
+ fi
|
|
|
+ else
|
|
|
+ is_domain_new "" $basedomain
|
|
|
fi
|
|
|
- else
|
|
|
- is_domain_new "" $basedomain
|
|
|
fi
|
|
|
fi
|
|
|
done
|