s4

view s4.cgi @ 81:ddc8a4c0b8d9

All macro-expanding by m4 bypassed via syscmd or spaste
author HIROSE Yuuji <yuuji@gentei.org>
date Mon, 03 Aug 2015 09:34:43 +0900
parents 39e69daa2071
children 81d9b2476f07
line source
1 #!/bin/sh
2 # 愛
3 mydir=`dirname $0`
4 . $mydir/s4-funcs.sh
6 cgiinit
7 if [ -z "$guestonlymode" ]; then
8 if [ x"$1" = x"reg" ]; then
9 contenttype; echo
10 regist $2
11 putfooter
12 exit
13 fi
15 dologin
16 fi
18 case ${SERVER_SOFTWARE} in
19 bozohttp*) # Ugly workaround for bozohttpd, which can't send
20 # two or more arguments.
21 set -- `echo "$@"|(IFS=+ read a b c d e f g; echo $a $b $c $d $e $f $g)`
22 ;;
23 esac
25 # err 1=$1 2=$2 3=$3 4=$4
26 stage=`getpar stage`
27 stage=${stage:-$1}
28 case ${stage} in
29 home|"")
30 contenttype; echo
31 err HOME: just in rowid=`getpar rowid`
32 [ -n "`getpar rowid`" ] && par2table $formdir/user.def
33 showhome ${2:-$user}
34 ;;
35 login)
36 contenttype; echo
37 myargs=""
38 showlogin
39 ;;
40 # "edittable")
41 # contenttype; echo
42 # m4 -D_TITLE_="グループ編集/削除" $layout/html.m4.html
43 # edittable "$formdir/$2.def" "$2" "$3"
44 # ;;
45 "showattc")
46 shift
47 showattc "$@"
48 exit 0 # Do not output further chunks
49 ;;
50 invite|groupman|userconf|groupconf|mems|grps|grp|grpaction|commission|editheading|editart|showattc|send2mem)
51 contenttype; echo
52 [ -n "$1" ] && shift
53 $stage "$@"
54 ;;
55 "blog") # $2=grpID
56 contenttype; echo
57 . ./s4-blog.sh
58 blog_addentry $2
59 ;;
60 "replyblog")
61 contenttype; echo
62 rowid=${2%%[!A-Z0-9a-z_]*}
63 ## err ROWid=$rowid, '$2'=$2
64 . ./s4-blog.sh
65 err blog_reply $rowid
66 blog_reply $rowid
67 ;;
68 lshandout|gethandout)
69 contenttype; echo
70 rowid=${2%%[!A-Z0-9a-z_]*}
71 if [ -z "$rowid" ]; then
72 echo "話題番号が未指定です。" | html p
73 return
74 fi
75 . ./s4-blog.sh
76 $stage $rowid
77 ;;
78 lsmyfile)
79 contenttype; echo
80 . ./s4-blog.sh
81 shift
82 $stage "$@"
83 ;;
84 "searchart") # $2=blogowner
85 contenttype; echo
86 m4 -D_TITLE_="検索結果" $layout/html.m4.html
87 . ./s4-blog.sh
88 searchart $2
89 ;;
90 *)
91 exec $0 login
92 ;;
93 esac
95 putfooter