changeset 118:45d1b0f09e48

grpaction is limited to its member
author HIROSE Yuuji <yuuji@gentei.org>
date Tue, 04 Aug 2015 23:16:23 +0900
parents 82e215e75468
children 0d613e71c32b
files s4-funcs.sh
diffstat 1 files changed, 13 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/s4-funcs.sh	Tue Aug 04 22:54:33 2015 +0900
+++ b/s4-funcs.sh	Tue Aug 04 23:16:23 2015 +0900
@@ -290,6 +290,10 @@
   # ./args.rb -cmd ".timeout 3000" "$@"
   sqlite3 -cmd 'PRAGMA foreign_keys=ON' -cmd ".timeout 3000" "$@"
 }
+querycat() {
+  cat $sqo &
+  (echo .once $sqo; cat) > $sqi
+}
 query() {
   cat<<EOF > $sqi
 .once $sqo
@@ -1648,8 +1652,10 @@
   grid=${1:-`getpar grp`}
   grp=`getgroupbyid "$grid"`
   if [ -z "$grp" ]; then
-    echo "無効な指定です。" | html p
-    return
+    echo "無効な指定です。" | html p; return
+  fi
+  if ! ismember $user $grp; then
+    echo "加入者のみに許可された操作です。" | html p; return
   fi
   echo "グループ $grp 個別選択操作" \
       | m4 -D_TITLE_="syscmd(\`cat')" $layout/html.m4.html
@@ -2247,8 +2253,11 @@
 	     fi
 	     ;;
 	 esac
-## err p2t: "replace into $tb2 values($pval, \"$col\", $type, $val, $bin);"
-	 query "replace into $tb2 values($pval, \"$col\", $type, $val, $bin);"
+	 err p2t: "replace into $tb2 values($pval, \"$col\", $type, $val, bin...);"
+	 #query "replace into $tb2 values($pval, \"$col\", $type, $val, $bin);"
+	 echo "replace into $tb2 values($pval, \"$col\", $type, $val, $bin);" \
+	      | querycat
+	 err p2t done
        done
      done
    done

yatex.org