2009-01-08 19:08:02 -07:00
|
|
|
fn bridge_init {
|
2009-01-10 20:03:46 -07:00
|
|
|
if(! ~ $#allowComments 0) {
|
|
|
|
ll_add handlers_body_foot bridge_body_foot
|
|
|
|
if(get_post_args comment_text) {
|
|
|
|
dprint POST COMMNET $"comment_text
|
|
|
|
d=`{date -n} # FIXME Obvious race
|
|
|
|
d=$local_path^'_werc/comments/'^$d/
|
2009-01-08 19:08:02 -07:00
|
|
|
|
2009-01-10 20:03:46 -07:00
|
|
|
u=$logged_user
|
|
|
|
if(~ $#logged_user 0) {
|
|
|
|
get_post_args comment_user_name comment_user_password
|
|
|
|
# XXX Should do this too if user not in required group
|
|
|
|
if(! login_user $comment_user_name $comment_user_password) {
|
|
|
|
u=$comment_user_name ':' $comment_user_password
|
|
|
|
d=$d^'_pending'
|
|
|
|
}
|
|
|
|
if not
|
|
|
|
u = $logged_user
|
2009-01-08 19:08:02 -07:00
|
|
|
}
|
|
|
|
|
2009-01-10 20:03:46 -07:00
|
|
|
umask 002
|
|
|
|
mkdir -m 775 -p $d
|
|
|
|
echo $u > $d/user
|
|
|
|
echo $comment_text > $d/body
|
|
|
|
}
|
|
|
|
if not
|
|
|
|
dprint SSS $status
|
2009-01-08 19:08:02 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2009-01-10 20:03:46 -07:00
|
|
|
|
|
|
|
fn bridge_body_foot {
|
|
|
|
template apps/bridge/foot.tpl
|
|
|
|
}
|
|
|
|
|