tinycm rev 104

Some more fixes
author Christophe Lincoln <pankso@slitaz.org>
date Mon Feb 20 18:50:00 2017 +0100 (2017-02-20)
parents aebfa2a5c127
children ddf5125a4b03
files index.cgi plugins/users/users.cgi
line diff
     1.1 --- a/index.cgi	Mon Feb 20 18:29:02 2017 +0100
     1.2 +++ b/index.cgi	Mon Feb 20 18:50:00 2017 +0100
     1.3 @@ -250,18 +250,21 @@
     1.4  	echo "$user:$pass" >> $AUTH_FILE
     1.5  	mkdir -p $PEOPLE/$user/
     1.6  	cat > $PEOPLE/$user/account.conf << EOT
     1.7 -# SliTaz user configuration
     1.8 -#
     1.9 -
    1.10 +# User configuration
    1.11  NAME="$name"
    1.12  USER="$user"
    1.13  MAIL="$mail"
    1.14 -
    1.15  EOT
    1.16 -	chmod 0600 $PEOPLE/$user/account.conf
    1.17 +	cat > $PEOPLE/$user/profile.conf << EOT
    1.18 +# User profile
    1.19 +WEBSITE="$website"
    1.20 +FACEBOOK="$facebook"
    1.21 +TWITTER="$twitter"
    1.22 +EOT
    1.23 +	chmod 0600 $PEOPLE/$user/*.conf
    1.24  	# First created user is admin
    1.25  	if [ $(ls ${PEOPLE} | wc -l) == "1" ]; then
    1.26 -		echo 'ADMIN_USER="yes"' >> $PEOPLE/$user/account.conf
    1.27 +		echo "$user" > ${ADMIN_USERS}
    1.28  	fi
    1.29  }
    1.30  
     2.1 --- a/plugins/users/users.cgi	Mon Feb 20 18:29:02 2017 +0100
     2.2 +++ b/plugins/users/users.cgi	Mon Feb 20 18:50:00 2017 +0100
     2.3 @@ -174,7 +174,15 @@
     2.4  		header
     2.5  		html_header
     2.6  		user_box
     2.7 -		. $PEOPLE/"$(GET user)"/account.conf
     2.8 +		account_config="$PEOPLE/$(GET user)/account.conf"
     2.9 +		profile_config="$PEOPLE/$(GET user)/profile.conf"
    2.10 +		if [ ! -f "$account_config" ]; then
    2.11 +			echo "No user profile for: $(GET user)"
    2.12 +			html_footer && exit 0
    2.13 +		else
    2.14 +			. ${account_config}
    2.15 +		fi
    2.16 +		[ -f "$profile_config" ] && . ${profile_config}
    2.17  cat << EOT
    2.18  <h2>$(get_gravatar $MAIL) $NAME</h2>
    2.19