changeset 402:58c291b6a81f

Allow lshandoutall and gethandout on frozen board
author HIROSE Yuuji <yuuji@gentei.org>
date Mon, 30 Jan 2017 19:59:32 +0900
parents 6dc23f0b7279
children 3ea86fe63490
files s4-blog.sh
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/s4-blog.sh	Mon Jan 30 19:57:35 2017 +0900
+++ b/s4-blog.sh	Mon Jan 30 19:59:32 2017 +0900
@@ -395,7 +395,9 @@
 }
 lshandoutall() {
   # $1=rowid of blog
-  if ! blog_writable $1 $user; then
+  blog_writable $1 $user
+  r=$?		# =0: writable, $BLOG_NOTMEM bit set => not member
+  if [ $((rc & $BLOG_NOTMEM)) -gt 0 ] ; then
     echo "メンバー以外は利用できません。" | html p; return
   fi
   rowid=$(($1 + 0))
@@ -501,7 +503,9 @@
 }
 gethandout() {
   # $1=rowid of blog
-  if ! blog_writable $1 $user; then
+  blog_writable $1 $user
+  r=$?		# =0: writable, $BLOG_NOTMEM bit set => not member
+  if [ $((rc & $BLOG_NOTMEM)) -gt 0 ] ; then
     echo "メンバー以外は利用できません。" | html p; return
   fi
   i=0

yatex.org