tinycm rev 107

users plugin: handle user.sh script to add content to a user profile
author Christophe Lincoln <pankso@slitaz.org>
date Wed Feb 22 19:27:51 2017 +0100 (2017-02-22)
parents 511841d477a3
children b5820178a40b
files plugins/users/users.cgi
line diff
     1.1 --- a/plugins/users/users.cgi	Wed Feb 22 12:22:11 2017 +0100
     1.2 +++ b/plugins/users/users.cgi	Wed Feb 22 19:27:51 2017 +0100
     1.3 @@ -176,7 +176,7 @@
     1.4  		user_box
     1.5  		account_config="$PEOPLE/$(GET user)/account.conf"
     1.6  		profile_config="$PEOPLE/$(GET user)/profile.conf"
     1.7 -		
     1.8 +		# account.conf
     1.9  		if [ ! -f "$account_config" ]; then
    1.10  			echo "No user profile for: $(GET user)"
    1.11  			html_footer && exit 0
    1.12 @@ -210,22 +210,17 @@
    1.13  			public_people
    1.14  		fi
    1.15  		
    1.16 -		# Messages plugin integration
    1.17 -		if [ -x "$plugins/messages/messages.cgi" ]; then
    1.18 -			if check_auth && [ "$(GET user)" != "$user" ]; then
    1.19 -				cat << EOT
    1.20 -<div id="tools">
    1.21 -<a href="$script?messages&amp;to=$(GET user)">$(gettext "Send message")</a>
    1.22 -</div>
    1.23 -EOT
    1.24 -			fi
    1.25 -		fi
    1.26 -		
    1.27  		# Display personal user profile
    1.28  		if [ -f "$PEOPLE/$USER/profile.txt" ]; then
    1.29  			echo "<h2>$(gettext "About me")</h2>"
    1.30  			cat $PEOPLE/$USER/profile.txt | wiki_parser
    1.31  		fi
    1.32 +		
    1.33 +		# Run user.sh that plugins can provide to add content to a profile
    1.34 +		for script in $(ls $plugins/*/user.sh); do
    1.35 +			. ${script}
    1.36 +		done
    1.37 +		
    1.38  		html_footer && exit 0 ;;
    1.39  		
    1.40  	*\ modprofile\ *)