s4

view s4.cgi @ 448:9724472a3cd2

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