# HG changeset patch # User Christophe Lincoln # Date 1487553644 -3600 # Node ID 95673a3de4e4484e701f3d85606526113db9fe1b # Parent 538ed788329d21fe9f37e9dd4c8f54f6d4a64bc5 Add Facebook page to community plugins and improve TinyCM site(s) update diff -r 538ed788329d -r 95673a3de4e4 TODO --- a/TODO Sun Feb 19 23:58:18 2017 +0100 +++ b/TODO Mon Feb 20 02:20:44 2017 +0100 @@ -1,7 +1,7 @@ - * HTML5 Video player + * HTML5 Video player --> MediaBox * Mail integration in SHell or Python * PHP content viewer for hosting without CGI support - * Use tazu to manage users ? Use in option system users in /etc ? - + * Use tazu to manage users --> let users change passwd + * Better documentation on tinycm.slitaz.org (install, plugins) diff -r 538ed788329d -r 95673a3de4e4 config.cgi --- a/config.cgi Sun Feb 19 23:58:18 2017 +0100 +++ b/config.cgi Mon Feb 20 02:20:44 2017 +0100 @@ -1,4 +1,5 @@ -# CM configuration +# +# TinyCM configuration # # Administrator email. @@ -18,3 +19,17 @@ # Use Mercurial repo for content and configure user name HG="no" + +# +# Plugin configuration: community.cgi +# + +# Wall mode: public/private +WALL_MODE="public" + +# Max length for messages on the Wall +WALL_MESSAGES_LENGTH="240" + +# Twitter user name and/or Facebook page URL name +TWITTER_USER="slitaz" +FACEBOOK_PAGE="slitaz" diff -r 538ed788329d -r 95673a3de4e4 plugins/blog/blog.conf --- a/plugins/blog/blog.conf Sun Feb 19 23:58:18 2017 +0100 +++ b/plugins/blog/blog.conf Mon Feb 20 02:20:44 2017 +0100 @@ -3,5 +3,3 @@ PLUGIN="Blog Post" SHORT_DESC="A tiny Blog plugin for TinyCM" MAINTAINER="devel@slitaz.org" - -# Configurable variables used in plugin.cgi diff -r 538ed788329d -r 95673a3de4e4 plugins/cloud/cloud.conf --- a/plugins/cloud/cloud.conf Sun Feb 19 23:58:18 2017 +0100 +++ b/plugins/cloud/cloud.conf Mon Feb 20 02:20:44 2017 +0100 @@ -6,5 +6,3 @@ # This is a tool for auth users DASHBOARD_TOOLS="${DASHBOARD_TOOLS} Cloud" - -# Configurable variables used in plugin.cgi diff -r 538ed788329d -r 95673a3de4e4 plugins/community/community.cgi --- a/plugins/community/community.cgi Sun Feb 19 23:58:18 2017 +0100 +++ b/plugins/community/community.cgi Mon Feb 20 02:20:44 2017 +0100 @@ -99,6 +99,39 @@ EOT html_footer && exit 0 ;; + *\ facebook\ *) + d="Facebook @${FACEBOOK_PAGE}" + header + html_header + user_box + cat << EOT +
+ + +
+ +
+EOT + html_footer && exit 0 ;; + *\ community\ *) d="Community Tools" header @@ -111,6 +144,7 @@ cat << EOT Community Wall Twitter Timeline +Facebook Page

$d

$SHORT_DESC

diff -r 538ed788329d -r 95673a3de4e4 plugins/community/community.conf --- a/plugins/community/community.conf Sun Feb 19 23:58:18 2017 +0100 +++ b/plugins/community/community.conf Mon Feb 20 02:20:44 2017 +0100 @@ -4,15 +4,5 @@ SHORT_DESC="Small social community functions and tools for TinyCM" MAINTAINER="pankso@slitaz.org" +# Authenticated users DASHBOARD_TOOLS="${DASHBOARD_TOOLS} Community" - -# Configurable variables used in community.cgi - -# Wall mode: public/private -WALL_MODE="public" - -# Max length for messages on the Wall -WALL_MESSAGES_LENGTH="240" - -# Twitter account user name -TWITTER_USER="slitaz" diff -r 538ed788329d -r 95673a3de4e4 plugins/dashboard/dashboard.conf --- a/plugins/dashboard/dashboard.conf Sun Feb 19 23:58:18 2017 +0100 +++ b/plugins/dashboard/dashboard.conf Mon Feb 20 02:20:44 2017 +0100 @@ -8,5 +8,3 @@ # Authenticated users PLUGINS_TOOLS="Dashboard ${PLUGINS_TOOLS}" - -# Configurable variables used in plugin.cgi diff -r 538ed788329d -r 95673a3de4e4 plugins/export/export.conf --- a/plugins/export/export.conf Sun Feb 19 23:58:18 2017 +0100 +++ b/plugins/export/export.conf Mon Feb 20 02:20:44 2017 +0100 @@ -3,5 +3,3 @@ PLUGIN="Export Content" SHORT_DESC="Export Wiki and other content to HTML" MAINTAINER="devel@slitaz.org" - -# Configurable variables used in plugin.cgi diff -r 538ed788329d -r 95673a3de4e4 plugins/forum/forum.conf --- a/plugins/forum/forum.conf Sun Feb 19 23:58:18 2017 +0100 +++ b/plugins/forum/forum.conf Mon Feb 20 02:20:44 2017 +0100 @@ -3,5 +3,3 @@ PLUGIN="Hashtags Forum" SHORT_DESC="Support/discussion forum using #hashtags" MAINTAINER="devel@slitaz.org" - -# Configurable variables used in plugin.cgi diff -r 538ed788329d -r 95673a3de4e4 plugins/keygen/keygen.conf --- a/plugins/keygen/keygen.conf Sun Feb 19 23:58:18 2017 +0100 +++ b/plugins/keygen/keygen.conf Mon Feb 20 02:20:44 2017 +0100 @@ -8,5 +8,3 @@ # Example url to add in a HTML template: http://site/index.cgi?keygen DASHBOARD_TOOLS="${DASHBOARD_TOOLS} Keygen" - -# Configurable variables used in plugin.cgi diff -r 538ed788329d -r 95673a3de4e4 plugins/skel/skel.conf --- a/plugins/skel/skel.conf Sun Feb 19 23:58:18 2017 +0100 +++ b/plugins/skel/skel.conf Mon Feb 20 02:20:44 2017 +0100 @@ -4,4 +4,9 @@ SHORT_DESC="An example plugin for TinyCM" MAINTAINER="devel@slitaz.org" -# Configurable variables used in plugin.cgi +# Authenticated users +PLUGINS_TOOLS="${PLUGINS_TOOLS}" +DASHBOARD_TOOLS="${DASHBOARD_TOOLS}" + +# Admin only in Dashboard +ADMIN_TOOLS="${ADMIN_TOOLS}" diff -r 538ed788329d -r 95673a3de4e4 plugins/users/users.cgi --- a/plugins/users/users.cgi Sun Feb 19 23:58:18 2017 +0100 +++ b/plugins/users/users.cgi Mon Feb 20 02:20:44 2017 +0100 @@ -15,7 +15,7 @@
- Dashboard + $PLUGINS_TOOLS $(gettext "Modify profile")
EOT @@ -136,6 +136,18 @@ . $PEOPLE/"$(GET user)"/account.conf public_people fi + + # Messages plugin integration + if [ -x "$plugins/messages/messages.cgi" ]; then + if check_auth && [ "$(GET user)" != "$user" ]; then + cat << EOT +
+$(gettext "Send message") +
+EOT + fi + fi + # Display personal user profile if [ -f "$PEOPLE/$USER/profile.txt" ]; then echo "

$(gettext "About me")

" diff -r 538ed788329d -r 95673a3de4e4 plugins/users/users.conf --- a/plugins/users/users.conf Sun Feb 19 23:58:18 2017 +0100 +++ b/plugins/users/users.conf Mon Feb 20 02:20:44 2017 +0100 @@ -10,5 +10,3 @@ # Admin only in Dashboard ADMIN_TOOLS="${ADMIN_TOOLS} Users" - -# Configurable variables used in plugin.cgi diff -r 538ed788329d -r 95673a3de4e4 tinycm --- a/tinycm Sun Feb 19 23:58:18 2017 +0100 +++ b/tinycm Mon Feb 20 02:20:44 2017 +0100 @@ -55,6 +55,52 @@ fi } +# Rebuilt an up-to-date config file, plugins may need new variables +update_config() { + echo "Updating config file: confi.cgi" + . ${path}/config.cgi + [ ! "$WALL_MODE" ] && WALL_MODE="public" + [ ! "$WALL_MESSAGES_LENGTH" ] && WALL_MESSAGES_LENGTH="240" + cat > ${path}/config.cgi << EOT +# +# TinyCM configuration +# + +# Administrator email. +ADMIN_MAIL="$ADMIN_MAIL" + +# Auth file for user +AUTH_FILE="$AUTH_FILE" + +# People config files +PEOPLE="$PEOPLE" + +# CM documents languages. +LANGUAGES="$LANGUAGES" + +# Online registration for user +ONLINE_SIGNUP="$ONLINE_SIGNUP" + +# Use Mercurial repo for content and configure user name +HG="$HG" + +# +# Plugin configuration: community.cgi +# + +# Wall mode: public/private +WALL_MODE="$WALL_MODE" + +# Max length for messages on the Wall +WALL_MESSAGES_LENGTH="$WALL_MESSAGES_LENGTH" + +# Twitter user name and/or Facebook page URL name +TWITTER_USER="$TWITTER_USER" +FACEBOOK_PAGE="$FACEBOOK_PAGE" +EOT + unset TWITTER_USER FACEBOOK_PAGE +} + # # Commands # @@ -85,7 +131,8 @@ exit 1 fi echo "" - boldify $(echo "Updating TinyCM installs...") + boldify "Updating TinyCM install(s)..." + echo "" # File liste of args if [ -f "$path" ]; then @@ -97,10 +144,11 @@ for path in ${paths} do check_tiny - echo "Updating: $path" + echo "Updating TinyCM: $path" cp -a index.cgi $path cp -a lib/functions.js $path/lib cp -a lib/jseditor.html $path/lib + echo "Updating plugins..." for plug in $(ls plugins) do if [ -d "$path/plugins/$plug" ]; then @@ -108,6 +156,7 @@ cp -a plugins/$plug $path/plugins fi done + update_config done && echo "" ;; *) usage ;;