#!/bin/bash root=src db=db sesdir=$db/session CGI="/cgi-bin/pcb-rnd-poll.cgi" if test -z "$srcdir" then srcdir="src" fi if test -z "$spiral" then spiral=/home/igor2/C/c_exp/captcha/src/captcha/main fi session_fields="SES_EMAIL SES_CAPTCHA" # how much each choice is worth when calculating scores choice2score=' BEGIN { SCORE[0] = 15 SCORE[1] = 10 SCORE[2] = 6 SCORE[3] = 3 SCORE[4] = 1 SCORE[5] = 0 } ' # ordered list of choices from 0 choices='I would use pcb-rnd in production for this feature and hereby sign up for testing the feature I hereby sign up for testing this feature in pcb-rnd I would definitely download and try pcb-rnd if it already had this feature I would maybe try pcb-rnd if it had this feature This feature is interesting, I would maybe use it in mainline, but it is not important enough for me to try pcb-rnd I do not need this feature at all ' # the same table with shorter tests choices_short='production-user tester user lurker mainliner no-need ' # someone is a tester if choice is < $tester_thrs tester_thrs=2 url_decode() { awk ' function cd(n) { chr=sprintf("%c", n); if (chr == "&") chr = "\\&" code="%" sprintf("%02x", n); CODE[tolower(code)] = chr; CODE[toupper(code)] = chr; } BEGIN { for(n = 1; n < 256; n++) cd(n); } { tmp = $0; gsub("[+]", " ", tmp); for(c in CODE) { gsub(c, CODE[c], tmp) } print tmp } ' } fix_ltgt() { sed "s/\</g;s/>/\>/g" } back_link() { echo "back to the main page" } error() { echo "Content-type: text/html" echo "" echo "
" if test -z "$QS_SID" then echo " start voting " else render_vote_section $bn fi done } find_all() { find "$root" -maxdepth 1 -type d -print | grep -v ".svn\|^$root\$" } find_text() { for n in `find_all` do found=`grep -- "$@" $n/short $n/long` if test ! -z "$found" then echo $n fi done } render_captcha() { if test -z "$SES_CAPTCHA" then error "INTERNAL ERROR generating the captcha" fi echo "
" $spiral -n 35 -aalib "$SES_CAPTCHA" | fix_ltgt | sed "s/ *$//" | grep -v "^$" echo "" echo "