diff s4-funcs.sh @ 80:39e69daa2071

New feature "lsmyfile" added
author HIROSE Yuuji <yuuji@gentei.org>
date Sun, 02 Aug 2015 17:05:08 +0900
parents f088d45dfdf2
children ddc8a4c0b8d9
line wrap: on
line diff
--- a/s4-funcs.sh	Sun Aug 02 10:58:58 2015 +0900
+++ b/s4-funcs.sh	Sun Aug 02 17:05:08 2015 +0900
@@ -1232,7 +1232,7 @@
   m4 -D_TITLE_="グループ一覧" -D_BODYCLASS_=listgroup $layout/html.m4.html
   kwd=`getpar kwd`
   listgroup $kwd \
-      | m4 -D_DUMPTABLE_="syscmd(\`cat')" \
+      | m4 -D_DUMPTABLE_="syscmd(cat)" \
 	   -D_TITLE_="グループ関連操作" \
 	   -D_FORM_="<a href=\"?groupman\">新規グループ作成</a>" \
 	   $layout/form+dump.m4.html
@@ -1267,6 +1267,17 @@
   if [ x"$user" = x"$uname" ]; then
     conflink="<a href=\"?userconf\">プロフィールの編集</a> /
 	<a href=\"?blog\">新規話題の作成</a>"
+    # Display folders
+    sql="select count(id) from article_m where id
+		 in (select id from article where author='$user')
+		and type like 'file:%';"
+    err nfile-sql=`echo "$sql"`
+    nfile=`query "$sql"`
+    err nfile=$nfile
+    if [ $nfile -gt 0 ]; then
+      conflink="$conflink /
+	<a href=\"?lsmyfile\">過去の提出ファイル</a>"
+    fi
   fi
   . ./s4-blog.sh
 
@@ -1277,6 +1288,7 @@
     $layout/html.m4.html $layout/home.m4.html
 
  if [ x"$user" = x"$uname" ]; then
+   # Display NEWS
    cond="where 新着 > 0 order by 新着 desc,ctime desc limit 10"
    new10=`DT_CHLD=article:blogid \
 	  DT_VIEW=replyblog dumptable html blog "ctime title gecos" "$cond"`
@@ -1470,7 +1482,7 @@
   if isgroup "$grp"; then
      showgroupsub $formdir/grp.def "$1" | \
 	 m4 -D_TITLE_="グループ $grp" \
-	    -D_FORM_="syscmd(\`cat')" \
+	    -D_FORM_="syscmd(cat)" \
 	    -D_DUMPTABLE_="" \
 	    $layout/form+dump.m4.html
   else				# if $grp is removed at par2table
@@ -1879,6 +1891,16 @@
   # copy current parameters of par into destination table
   # $1=definition-file
   # Using $user and $session
+  # Return value:
+  #	0: Stored successfully
+  #	1: Insufficient fillings
+  #	2: No permission to modify the record
+  #	3: Invalid rowid
+  #	4: SUCCESS to delete
+  #	5: Stop deletion for lack of confirm check
+  #	6: Password length too short
+  #	7: Password mismatch
+  #	8: Old password incorrect
   rowid=`getpar rowid`
 err ...........rowid=$rowid
   if [ ! -e $1 ]; then
@@ -1902,20 +1924,20 @@
     ### err rowowner=$rowowner
     if [ x"$user" != x"$rowowner" ]; then
       echo "他人のレコードはいじれないの" | html p
-      return
+      return 2
     elif [ -z "$rowowner" ]; then
       echo "指定したレコードはないみたい" | html p
-      return
+      return 3
     fi
     rm=`getpar rm` cfm=`getpar confirm`
     # Editing existent entry 
     if [ x"$rm" = x"yes" ]; then
       if [ x"$rm$cfm" = x"yesyes" ]; then
 	query "delete from $tbl where rowid=$rowid;"
-	return
+	return 4
       else
 	echo "消去確認のチェックがないので消さなかったの..." | html p
-	return
+	return 5
       fi
     fi
   fi
@@ -2055,16 +2077,16 @@
 		   case "$p1" in
 		     ??????????*) ;;
 		     *) echo "10字以上にしてください。" | html p
-			return ;;
+			return 6;;
 		   esac
 		   val="\"`echo $p1|mypwhash`\""
 		 else
 		   echo "2つの新パスワード不一致" | html p
-		   return
+		   return 7
 		 fi
 	       else
 		 echo "旧パスワード違います" | html p
-		 return
+		 return 8
 	       fi
 	     fi
 	     ;;

yatex.org