mirror of
https://github.com/myvesta/vesta
synced 2025-08-20 21:34:12 -07:00
Added functions to check if a domain or user is unsuspended in main.sh
This commit is contained in:
parent
420a978572
commit
bf54a85a51
1 changed files with 23 additions and 0 deletions
23
func/main.sh
23
func/main.sh
|
@ -1236,3 +1236,26 @@ parse_object_kv_list_non_eval() {
|
|||
fi
|
||||
done
|
||||
}
|
||||
|
||||
# Return OK (0) if domain is unsupended
|
||||
# Parameters:
|
||||
# $1 - user
|
||||
# $2 - domain
|
||||
return_ok_if_domain_is_unsuspended() {
|
||||
spnd=$(grep "DOMAIN='$2'" /usr/local/vesta/data/users/$1/web.conf | grep "SUSPENDED='yes'")
|
||||
if [ ! -z "$spnd" ]; then
|
||||
return $E_SUSPENDED
|
||||
fi
|
||||
return $OK
|
||||
}
|
||||
|
||||
# Return OK (0) if user is unsupended
|
||||
# Parameters:
|
||||
# $1 - user
|
||||
return_ok_if_user_is_unsuspended() {
|
||||
spnd=$(cat /usr/local/vesta/data/users/$1/user.conf | grep "SUSPENDED='yes'")
|
||||
if [ ! -z "$spnd" ]; then
|
||||
return $E_SUSPENDED
|
||||
fi
|
||||
return $OK
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue