s4

changeset 50:13f9b5e5df85

subshellize blog_notify_reply
author HIROSE Yuuji <yuuji@gentei.org>
date Wed, 22 Jul 2015 18:24:45 +0900
parents aa94b4c20944
children 0c26f4461d0b
files s4-blog.sh
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line diff
     1.1 --- a/s4-blog.sh	Wed Jul 22 18:22:39 2015 +0900
     1.2 +++ b/s4-blog.sh	Wed Jul 22 18:24:45 2015 +0900
     1.3 @@ -11,13 +11,14 @@
     1.4    blogowner=`getvalbyid blog owner "$1"`
     1.5    [ x"$blogowner" = x"$2" ] || isuser "$blogowner" || ismember "$2" "$blogowner"
     1.6  )
     1.7 -blog_notify_reply() {
     1.8 +blog_notify_reply() (
     1.9    # $1=articleid $2=ReplyingUser $3=WrittenText
    1.10    blogowner=`getvalbyid blog owner "$1"`
    1.11    [ x"$2" = x"$blogowner" ] && return # If author=blogowner, unnecessary
    1.12    blogtitle=`getvalbyid blog title "$1"`
    1.13    blogurl="$urlbase?replyblog+$1"
    1.14 -  case `getvalbyid blog notify "$1"` in
    1.15 +  mode=`getvalbyid blog notify "$1"`
    1.16 +  case $mode in
    1.17      admin)
    1.18        if isgroup "$owner"; then
    1.19  	qgrp=`sqlquote $owner`
    1.20 @@ -30,7 +31,7 @@
    1.21      no)		return ;;
    1.22      *)		emails=`collectemail $blogowner` ;;
    1.23    esac
    1.24 -err notify: emails="[$emails]"
    1.25 +  ## err notify: mode=$mode emails="[$emails]"
    1.26    smail "$emails" "書込通知 $urlbase"<<EOF
    1.27  [$blogtitle]板に書き込みがありました。
    1.28  場所: $blogurl
    1.29 @@ -39,7 +40,7 @@
    1.30  内容:
    1.31  `echo "$3"|sed 's/^/> /'`
    1.32  EOF
    1.33 -}
    1.34 +)
    1.35  blog_showentry() {
    1.36    # $1=table $2=rowid
    1.37    if [ -n "$2" ]; then