# HG changeset patch # User Christophe Lincoln # Date 1487331845 -3600 # Node ID 7edde907440fdda98d9b13a1382a0829307e99fa # Parent 6a565d525bdae695a21f900b566dd012ebe46b6d Improve users and community plugin diff -r 6a565d525bda -r 7edde907440f plugins/community/community.cgi --- a/plugins/community/community.cgi Fri Feb 17 00:46:34 2017 +0100 +++ b/plugins/community/community.cgi Fri Feb 17 12:44:05 2017 +0100 @@ -13,8 +13,8 @@ user_box # Wall is only for logged users - if ! check_auth; then - gettext "You must be logged in to read the wall" + if [ "$WALL_MODE" == "private" ] && ! check_auth; then + gettext "Private Wall - You must be logged in to read the wall" html_footer && exit 0 fi @@ -39,15 +39,16 @@ fi # Message form - cat << EOT -

$d

+ echo "

$d

" + if check_auth; then + cat << EOT
- +
- $(eval_gettext "Date: $date - Max char:") ${MESSAGE_LENGTH} - + $(eval_gettext "Date: $date - Max char:") ${WALL_MESSAGES_LENGTH} - $(gettext "Wiki syntax is supported:") $(gettext "Help page")
@@ -55,6 +56,7 @@

$(gettext "Latest Messages")

EOT + fi # Display messages &nb=40 msg_nb=40 if [ "$(GET nb)" ]; then @@ -83,17 +85,38 @@ EOT html_footer && exit 0 ;; + *\ community-config\ *) + d="Community plugin config" + header + html_header + user_box + cat << EOT + + +

$d

+
+Wall mode        : $WALL_MODE
+Messages length  : $WALL_MESSAGES_LENGTH
+
+EOT + html_footer && exit 0 ;; + *\ community\ *) d="Community Tools" header html_header user_box cat << EOT +

$d

$SHORT_DESC

- EOT html_footer && exit 0 ;; diff -r 6a565d525bda -r 7edde907440f plugins/community/community.conf --- a/plugins/community/community.conf Fri Feb 17 00:46:34 2017 +0100 +++ b/plugins/community/community.conf Fri Feb 17 12:44:05 2017 +0100 @@ -6,7 +6,10 @@ DASHBOARD_TOOLS="${DASHBOARD_TOOLS} Community" -# Configurable variables used in plugin.cgi +# Configurable variables used in community.cgi + +# Wall mode: public/private +WALL_MODE="public" # Max length for messages on the Wall. -MESSAGE_LENGTH="240" +WALL_MESSAGES_LENGTH="240" diff -r 6a565d525bda -r 7edde907440f plugins/users/users.cgi --- a/plugins/users/users.cgi Fri Feb 17 00:46:34 2017 +0100 +++ b/plugins/users/users.cgi Fri Feb 17 12:44:05 2017 +0100 @@ -13,23 +13,12 @@ cat << EOT Email : $MAIL -EOT - # Each user can have personal profile page - if [ -f "$PEOPLE/$USER/profile.txt" ]; then - cat << EOT + EOT - else - cat << EOT - -EOT - fi } case " $(GET) " in