mirror of
https://github.com/myvesta/vesta
synced 2025-08-14 02:28:05 -07:00
replaced underscore with dash in api syscalls
This commit is contained in:
parent
7ed705cee7
commit
b6b7eacadb
283 changed files with 438 additions and 412 deletions
53
bin/v-change-user-name
Executable file
53
bin/v-change-user-name
Executable file
|
@ -0,0 +1,53 @@
|
|||
#!/bin/bash
|
||||
# info: change user full name
|
||||
# options: user fname lname
|
||||
#
|
||||
# The function allow to change user's full name.
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Variable&Function #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Argument defenition
|
||||
user=$1
|
||||
fname=$2
|
||||
lname=$3
|
||||
|
||||
# Includes
|
||||
source $VESTA/conf/vesta.conf
|
||||
source $VESTA/func/main.sh
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Verifications #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
check_args '3' "$#" 'user fname lname'
|
||||
validate_format 'user' 'fname' 'lname'
|
||||
is_object_valid 'user' 'USER' "$user"
|
||||
is_object_unsuspended 'user' 'USER' "$user"
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Action #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Get old values
|
||||
old_fname=$(get_user_value '$FNAME')
|
||||
old_lname=$(get_user_value '$LNAME')
|
||||
|
||||
# Changing ns values
|
||||
update_user_value "$user" '$FNAME' "$fname"
|
||||
update_user_value "$user" '$LNAME' "$lname"
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Vesta #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Logging
|
||||
log_history "changed user name to $fname $lname"
|
||||
log_event "$OK" "$EVENT"
|
||||
|
||||
exit
|
Loading…
Add table
Add a link
Reference in a new issue