hbbs

bbs.hlirc.net
Log | Files | Refs | README | LICENSE

commit 67572429a73c7197180e47eb8d0f1c3a635ae566
parent b1e51b27cb486b0b74048325a107ba230973df7f
Author: hhvn <hayden@haydenvh.com>
Date:   Mon,  1 Feb 2021 14:37:51 +0000

bin/login.sh bin/interface.sh: add "realname" value

Diffstat:
Mbin/interface.sh | 16++++++++++------
Mbin/login.sh | 1+
2 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/bin/interface.sh b/bin/interface.sh @@ -248,9 +248,10 @@ menu_users(){ i) [ ! -f $datadir/users/${arg:-$user} ] && error "no such user" && break clear - echo "Created: $(userget "${arg:-$user}" creation)" - echo "Email: $(userget "${arg:-$user}" email)" - [ "$(userget "${arg:-$user}" nick)" != "" ] && echo "Nick: $(userget "${arg:-$user}" nick)" + echo "Created: $(userget "${arg:-$user}" creation)" + echo "Email: $(userget "${arg:-$user}" email)" + echo "Realname: $(userget "${arg:-$user}" realname)" + [ "$(userget "${arg:-$user}" nick)" != "" ] && echo "Nick: $(userget "${arg:-$user}" nick)" echo cat $datadir/profile/${arg:-$user} tput sgr0 @@ -258,9 +259,11 @@ menu_users(){ break ;; e) - prompt "email (empty to remain unchanged)" email - prompt "usual nick on irc (empty=unchanged)" nick - prompt "password (empty=unchanged)" passwd + info "leave prompts empty to let value remain unchanged" + prompt "email (currently: $(userget $user email))" email + prompt "usual nick on irc (currently: $(userget $user nick))" nick + prompt "\"realname\" (currently: $(userget $user realname))" realname + prompt "password" passwd [ "$password" != "" ] && { prompt "confirm password" passwd2 [ "$passwd" = "$passwd2" ] && { @@ -270,6 +273,7 @@ menu_users(){ } [ "$email" != "" ] && userset "$user" email "$email" [ "$nick" != "" ] && userset "$user" nick "$nick" + [ "$realname" != "" ] && userset "$user" realname "$realname" prompt "Edit bio (${k}y${s}es/${k}n${s}o/from ${k}u${s}ri)" edit [ "$edit" = "y" ] && { info "Type ctrl+d to finish the profile" diff --git a/bin/login.sh b/bin/login.sh @@ -53,6 +53,7 @@ login(){ userset "$user" "creation" "$(date +%Y-%m-%d)" userset "$user" "email" "$email" userset "$user" "passwd" "$(echo "$passwd" | sha512sum)" + userset "$user" "realname" "$user" touch $datadir/profile/$user ok "account \"$user\" created" [ "$verify_email" = "yes" ] && info "Your account expires in 2 days unless verified"