# HG changeset patch # User Christophe Lincoln # Date 1486755154 -3600 # Node ID 33e6a5c881ec0cf3d113281d1a49c64cc43af88d # Parent 7b72f7f8da35de16c1e4aac349ac3aa955148d61 Small fix to cmdline tool and backport users plugins from tazbug diff -r 7b72f7f8da35 -r 33e6a5c881ec plugins/users/users.cgi --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/users/users.cgi Fri Feb 10 20:32:34 2017 +0100 @@ -0,0 +1,69 @@ +#!/bin/sh +# +# TinyCM/TazBug Plugin - Users profile and admin +# + +case " $(GET) " in + *\ users\ *) + d="Users" + header + html_header + user_box + if check_auth && ! admin_user; then + gettext "You must be admin to manage users" + exit 0 + fi + users=$(ls -1 $PEOPLE | wc -l) + cat << EOT +

Users: $users

+
+ Dashboard + Logged users +
+
+EOT
+		for u in $(ls $PEOPLE)
+		do
+			# Skip corrupted accounts
+			if ! [ -f "${PEOPLE}/${u}/account.conf" ]; then
+				echo "${u} : Missing account.conf"
+				continue
+			fi
+			. "${PEOPLE}/${u}/account.conf"
+			cat << EOT
+$(get_gravatar $MAIL 24) $USER | $NAME | $MAIL
+EOT
+# deluser link
+#: $(gettext "delete")
+			unset NAME USER 
+		done
+		echo "
" + html_footer && exit 0 ;; + + *\ logged\ *) + # Show online users based on sessions files. + d="Logged users" + header + html_header + user_box + if ! check_auth; then + gettext "You must be logged in to view online users" + exit 0 + fi + cat << EOT +

Logged users

+
+ Dashboard +
+
+EOT
+		for u in $(ls $sessions)
+		do
+			. "${PEOPLE}/${u}/account.conf"
+			cat << EOT
+$(get_gravatar $MAIL 24) $USER | $NAME
+EOT
+		done
+		echo "
" + html_footer && exit 0 ;; +esac diff -r 7b72f7f8da35 -r 33e6a5c881ec plugins/users/users.conf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/users/users.conf Fri Feb 10 20:32:34 2017 +0100 @@ -0,0 +1,14 @@ +# TinyCM/TazBug Plugin configuration + +PLUGIN="Users Admin" +SHORT_DESC="Handle TinyCM/TazBug users" +MAINTAINER="devel@slitaz.org" + +# Authenticated users +PLUGINS_TOOLS="${PLUGINS_TOOLS}" +DASHBOARD_TOOLS="${DASHBOARD_TOOLS} Logged users" + +# Admin only in Dashboard +ADMIN_TOOLS="${ADMIN_TOOLS} List users" + +# Configurable variables used in plugin.cgi diff -r 7b72f7f8da35 -r 33e6a5c881ec tinycm --- a/tinycm Thu Apr 21 10:13:55 2016 +0200 +++ b/tinycm Fri Feb 10 20:32:34 2017 +0100 @@ -86,11 +86,11 @@ echo "" boldify $(echo "Updating TinyCM installs...") - # Priority to cmdline path argument - if [ "$path" ]; then + # File liste of args + if [ -f "$path" ]; then + paths="$(cat ${list})" + else paths="$path" - else - paths="$(cat ${list})" fi for path in ${paths}