diff se-funcs.sh @ 2:7aa52f9874ae

.hgignore added
author HIROSE Yuuji <yuuji@gentei.org>
date Sat, 18 Jul 2015 09:54:00 +0900
parents 5bafa0d981e0
children 95cebd686c97
line wrap: on
line diff
--- a/se-funcs.sh	Thu Jul 16 23:03:51 2015 +0900
+++ b/se-funcs.sh	Sat Jul 18 09:54:00 2015 +0900
@@ -7,8 +7,9 @@
 bindir=`(cd $mydir/bin; pwd)`
 PATH=/usr/local/sqlite3/bin:$PATH:$bindir
 tmpdir=${TMPDIR:-tmp}
+dbdir=${DBDIR:-db}
 tmpfiles=""
-db=${DB:-$tmpdir/cgi.sq3}
+db=${DB:-$dbdir/cgi.sq3}
 admin=wwwadmin@gentei.org
 layout=templ/default
 formdir=templ/form
@@ -36,10 +37,12 @@
 グループへの一斉送信機能は付いたが表に出てない(7/6)
 ひとつのarticleをheadingにして新規ツリーを作成、あるといいかも。
 
-7/17	個人blogに「レポート提出用」がついたとき
+7/18	○書込著者からホームへのリンク
+	締切設定
 	一斉送信
-	添付ファイル回収
-	imgcacheは別ディレクトリにしないと + .htaccess
+7/17	○個人blogに「レポート提出用」がついたときの挙動
+	○添付ファイル回収
+	○imgcacheは別ディレクトリにしないと + .htaccess
 7/15	○レポート提出モードの表示を付ける
 	管理者権限での削除? → まだいいか
 
@@ -372,8 +375,14 @@
 }
 gecos() (
   u=${1:-$user}
-  gecos=`query "select val from user_s where name='$u' and key='gecos';"`
-  echo "${gecos:-$u}"
+  #gecos=`query "select val from user_s where name='$u' and key='gecos';"`
+  sql="select case when (select name from user where name='$u') is not null
+		then (select val from user_s where name='$u' and key='gecos')
+		when (select gname from grp where gname='$u') is not null
+		then (select val from grp_s where gname='$u' and key='gecos')
+		else '$u'
+		end;"
+  query "$sql"
 )
 getpar() {
 err getpar: "select val from par where var='$1' and sessid='$session' $2;"
@@ -545,7 +554,7 @@
 			 query "select quote(bin) from $cond and val=\"$fn\";" \
 			     | xxd -r -p > $file
 			 echo ${type#file:} > $file.content-type
-err TTTTTTTTTTTTTTTT: $type
+# err TTTTTTTTTTTTTTTT: $type
 			 case $type in
 			   *:[Ii]mage*) mogrify -geometry $thumbxy $file ;;
 			   *:[Aa]pplication*)
@@ -932,7 +941,7 @@
 	    type='file'; k=${k%:filename}
 	    case `file --mime-type $tmpdir/$v|cut -d' ' -f2` in
 	      [Ii]mage/*)
-		mogrify -resize $maximagexy $tmpdir/$v
+		mogrify -resize $maximagexy'>' $tmpdir/$v
 		;;
 	    esac
 	    ;;
@@ -1391,7 +1400,7 @@
   fi
   tbl=${1%.def}
   tbl=${tbl##*/}
-  if [ -n "$rowid" ]; then
+  if [ -n "$rowid" ]; then	# Modify existing entry
     if [ x"$tbl" = x"user" ]; then
       rowowner=`query "select name from $tbl where rowid=$rowid;"`
     elif [ x"$tbl" = x"grp" ]; then

yatex.org