mirror of
https://github.com/serghey-rodin/vesta.git
synced 2025-08-21 13:54:26 -07:00
Merge changes from upstream
I'm a little angry
This commit is contained in:
parent
dcf849263d
commit
2b16d9bd83
254 changed files with 24485 additions and 24094 deletions
|
@ -1,51 +1,51 @@
|
|||
#!/bin/bash
|
||||
# info: change user contact email
|
||||
# options: user email
|
||||
#
|
||||
# The function for changing of e-mail associated with a certain user.
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Variable&Function #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Argument defenition
|
||||
user=$1
|
||||
email=$2
|
||||
|
||||
# Includes
|
||||
source $VESTA/conf/vesta.conf
|
||||
source $VESTA/func/main.sh
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Verifications #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
check_args '2' "$#" 'user email'
|
||||
validate_format 'user' 'email'
|
||||
is_object_valid 'user' 'USER' "$user"
|
||||
is_object_unsuspended 'user' 'USER' "$user"
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Action #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Changing user contact email
|
||||
old_email=$(get_user_value '$CONTACT')
|
||||
update_user_value "$user" '$CONTACT' "$email"
|
||||
pw_str=$(grep -n "^$user:" /etc/passwd)
|
||||
str=$(echo "$pw_str" | cut -f 1 -d :)
|
||||
sed -i "$str s/$old_email/$email/g" /etc/passwd
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Vesta #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Logging
|
||||
log_history "changed contact email to $email"
|
||||
log_event "$OK" "$EVENT"
|
||||
|
||||
exit
|
||||
#!/bin/bash
|
||||
# info: change user contact email
|
||||
# options: USER EMAIL
|
||||
#
|
||||
# The function for changing of e-mail associated with a certain user.
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Variable&Function #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Argument defenition
|
||||
user=$1
|
||||
email=$2
|
||||
|
||||
# Includes
|
||||
source $VESTA/conf/vesta.conf
|
||||
source $VESTA/func/main.sh
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Verifications #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
check_args '2' "$#" 'USER EMAIL'
|
||||
validate_format 'user' 'email'
|
||||
is_object_valid 'user' 'USER' "$user"
|
||||
is_object_unsuspended 'user' 'USER' "$user"
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Action #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Changing user contact email
|
||||
old_email=$(get_user_value '$CONTACT')
|
||||
update_user_value "$user" '$CONTACT' "$email"
|
||||
pw_str=$(grep -n "^$user:" /etc/passwd)
|
||||
str=$(echo "$pw_str" | cut -f 1 -d :)
|
||||
sed -i "$str s/$old_email/$email/g" /etc/passwd
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Vesta #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Logging
|
||||
log_history "changed contact email to $email"
|
||||
log_event "$OK" "$EVENT"
|
||||
|
||||
exit
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue