tinycm rev 82
Some small fixes and improvments
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Sat Feb 11 17:04:56 2017 +0100 (2017-02-11) |
parents | b07b36203b8d |
children | f587a0fa5435 |
files | plugins/cloud/cloud.cgi plugins/dashboard/dashboard.cgi plugins/users/users.cgi plugins/users/users.conf style.css |
line diff
1.1 --- a/plugins/cloud/cloud.cgi Sat Feb 11 14:33:17 2017 +0100 1.2 +++ b/plugins/cloud/cloud.cgi Sat Feb 11 17:04:56 2017 +0100 1.3 @@ -87,6 +87,7 @@ 1.4 gettext "You must be logged in to use the Cloud." 1.5 exit 1 1.6 fi 1.7 + [ -f "$cloudlog" ] || mkdir -p $(dirname $cloudlog) 1.8 cat << EOT 1.9 <div id="tools"> 1.10 <a href="$script?cloudlog">Cloud activity</a> 1.11 @@ -101,7 +102,7 @@ 1.12 or use them in your documents content. Tip: Drag and Drop files from your 1.13 desktop.") 1.14 </p> 1.15 -<div style="text-align: center;"> 1.16 +<div id="cloud-upload"> 1.17 <form method="post" action="plugins/cloud/cloud.cgi?upcloud&user=$user" 1.18 enctype="multipart/form-data"> 1.19 <input type="file" name="datafile" size="50" />
2.1 --- a/plugins/dashboard/dashboard.cgi Sat Feb 11 14:33:17 2017 +0100 2.2 +++ b/plugins/dashboard/dashboard.cgi Sat Feb 11 17:04:56 2017 +0100 2.3 @@ -8,7 +8,6 @@ 2.4 header 2.5 html_header 2.6 user_box 2.7 - users=$(ls -1 $PEOPLE | wc -l) 2.8 docs=$(find $wiki -type f | wc -l) 2.9 wikisize="$(du -sh $wiki | awk '{print $1}')" 2.10 cachesize="$(du -sh $cache | awk '{print $1}')" 2.11 @@ -39,7 +38,6 @@ 2.12 Wiki docs : $docs ($wikisize) 2.13 Cache size : $cachesize 2.14 Mercurial : $hg 2.15 -User accounts : $users 2.16 Server uptime : $(uptime | cut -d " " -f 4 | sed s"/:/h /" | sed s"/,/min/") 2.17 </pre> 2.18 2.19 @@ -72,14 +70,14 @@ 2.20 <tr> 2.21 <td><a href='?$p'>$PLUGIN</a></td> 2.22 <td>$SHORT_DESC</td> 2.23 - <td>remove</td> 2.24 + <td>TODO</td> 2.25 </tr> 2.26 EOT 2.27 done 2.28 echo "</table>" 2.29 fi 2.30 else 2.31 - gettext "You must be logged in to view the dashboard." 2.32 + gettext "You must be logged in to view the dashboard" 2.33 fi 2.34 html_footer && exit 0 2.35 fi
3.1 --- a/plugins/users/users.cgi Sat Feb 11 14:33:17 2017 +0100 3.2 +++ b/plugins/users/users.cgi Sat Feb 11 17:04:56 2017 +0100 3.3 @@ -39,6 +39,31 @@ 3.4 html_header 3.5 user_box 3.6 if check_auth && ! admin_user; then 3.7 + gettext "You must be admin to manage users" && exit 0 3.8 + fi 3.9 + cat << EOT 3.10 +<h2>Users admin</h2> 3.11 +<div id="tools"> 3.12 + <a href="$script?dashboard">Dashboard</a> 3.13 + <a href='$script?loggedusers'>Logged users</a> 3.14 + <a href='$script?userslist'>Users list</a> 3.15 +</div> 3.16 +<pre> 3.17 +User accounts : $(ls -1 $PEOPLE | wc -l) 3.18 +People DB : $PEOPLE 3.19 +Auth file : $AUTH_FILE 3.20 +EOT 3.21 + 3.22 + echo "</pre>" 3.23 + html_footer && exit 0 ;; 3.24 + 3.25 + *\ userslist\ *) 3.26 + # List all users (slow if a llots a of accounts) 3.27 + d="Users" 3.28 + header 3.29 + html_header 3.30 + user_box 3.31 + if check_auth && ! admin_user; then 3.32 gettext "You must be admin to manage users" 3.33 exit 0 3.34 fi 3.35 @@ -47,7 +72,8 @@ 3.36 <h2>Users: $users</h2> 3.37 <div id="tools"> 3.38 <a href="$script?dashboard">Dashboard</a> 3.39 - <a href='?logged'>Logged users</a> 3.40 + <a href="$script?users">Users admin</a> 3.41 + <a href='$script?loggedusers'>Logged users</a> 3.42 </div> 3.43 <pre> 3.44 EOT 3.45 @@ -62,14 +88,14 @@ 3.46 cat << EOT 3.47 $(get_gravatar $MAIL 24) <a href="?user=$USER">$USER</a> | $NAME | $MAIL 3.48 EOT 3.49 -# deluser link 3.50 +# deluser link --> use 'tazu' on SliTaz 3.51 #: <a href="?users&deluser=$USER">$(gettext "delete")</a> 3.52 unset NAME USER 3.53 done 3.54 echo "</pre>" 3.55 html_footer && exit 0 ;; 3.56 3.57 - *\ logged\ *) 3.58 + *\ loggedusers\ *) 3.59 # Show online users based on sessions files. 3.60 d="Logged users" 3.61 header 3.62 @@ -83,6 +109,7 @@ 3.63 <h2>Logged users</h2> 3.64 <div id="tools"> 3.65 <a href="$script?dashboard">Dashboard</a> 3.66 + <a href="$script?users">Users admin</a> 3.67 </div> 3.68 <pre> 3.69 EOT
4.1 --- a/plugins/users/users.conf Sat Feb 11 14:33:17 2017 +0100 4.2 +++ b/plugins/users/users.conf Sat Feb 11 17:04:56 2017 +0100 4.3 @@ -6,9 +6,9 @@ 4.4 4.5 # Authenticated users 4.6 PLUGINS_TOOLS="${PLUGINS_TOOLS}" 4.7 -DASHBOARD_TOOLS="${DASHBOARD_TOOLS} <a href='?logged'>Logged users</a>" 4.8 +DASHBOARD_TOOLS="${DASHBOARD_TOOLS}" 4.9 4.10 # Admin only in Dashboard 4.11 -ADMIN_TOOLS="${ADMIN_TOOLS} <a href='?users'>List users</a>" 4.12 +ADMIN_TOOLS="${ADMIN_TOOLS} <a href='?users'>Users</a>" 4.13 4.14 # Configurable variables used in plugin.cgi
5.1 --- a/style.css Sat Feb 11 14:33:17 2017 +0100 5.2 +++ b/style.css Sat Feb 11 17:04:56 2017 +0100 5.3 @@ -175,7 +175,7 @@ 5.4 textarea { border: 2px solid #ccc; padding: 4px; width: 100%; } 5.5 select { min-width: 180px; } 5.6 input[type="submit"], input[type="text"], input[type="password"], 5.7 -select, #tools a { 5.8 +input[type="file"], select, #tools a { 5.9 color: #444444; 5.10 border: 1px solid #cccccc; 5.11 padding: 4px; 5.12 @@ -225,7 +225,7 @@ 5.13 /* Round corner */ 5.14 5.15 pre, .button, .pctbar, .box, #login, #account-info, #user, img, 5.16 -input, textarea, select, #tools a { 5.17 +input, textarea, select, #tools a, #cloud-upload { 5.18 -moz-border-radius: 4px; 5.19 -webkit-border-radius: 4px; 5.20 border-radius: 4px; 5.21 @@ -302,3 +302,24 @@ 5.22 font-weight: bold; padding-left: 2px; } 5.23 .forum-msg { background-color: #eee; padding: 10px; 5.24 border: 2px solid #ddd; width: 98%;} 5.25 + 5.26 +/* Cloud */ 5.27 +#cloud-upload { 5.28 + text-align: center; 5.29 + color: #444444; 5.30 + border: 1px solid #cccccc; 5.31 + padding: 0px; 5.32 + margin: 4px 0px; 5.33 + background-image: -webkit-linear-gradient(#FAFAFA, #F4F4F4 40%, #E5E5E5); 5.34 + background-image: -moz-linear-gradient(#FAFAFA, #F4F4F4 40%, #E5E5E5); 5.35 +} 5.36 + 5.37 +#cloud-upload input[type="file"] { 5.38 + border: 0px solid #cccccc; 5.39 + width: 85%; 5.40 + -webkit-appearance: none; 5.41 + -webkit-padding-end: 0px; 5.42 + -webkit-padding-start: 0px; 5.43 +} 5.44 + 5.45 +