Index: work/feature_poll/pcb-rnd-poll.cgi =================================================================== --- work/feature_poll/pcb-rnd-poll.cgi (revision 1585) +++ work/feature_poll/pcb-rnd-poll.cgi (revision 1586) @@ -4,8 +4,17 @@ db=db sesdir=$db/session CGI="/cgi-bin/pcb-rnd-poll.cgi" -spiral=/home/igor2/C/c_exp/captcha/src/captcha/main +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 @@ -105,7 +114,7 @@ echo "" if test -f $name/icon.png then - echo "" + echo "" else echo " " fi @@ -251,7 +260,7 @@ ses_load() { local key val - export QS_SID=`echo $QS_SID | tr -d -c "[a-fA-F0-9]"` + export QS_SID=`echo $QS_SID | tr -d -c "a-fA-F0-9"` if test ! -f "$sesdir/$QS_SID" then echo "Error: invalid SID (session id)" @@ -276,6 +285,8 @@ cmd_try_enter() { + local cookie email cfn + export subs_current="entering..." if test "$QS_captcha" != "$SES_CAPTCHA" then @@ -282,6 +293,35 @@ echo "Error: you got the captcha wrong, please try again." exit fi + if test -z "$QS_email" + then + echo "Error: you need to provide an email address to vote, please try again." + exit + fi + + email=`echo $QS_email | tr -d -c "@a-fA-F0-9._-"` + if test "$email" != "$QS_email" + then + echo "Error: invalid character in email the email address." + exit + fi + + cfn=$db/cookies/$QS_email + cookie=`cat $cfn` + if test -z "$cookie" + then + if test ! -z "$QS_cookie" + then + echo "$QS_cookie" | md5sum > cfn + fi + else + if test "$QS_cookie" != "$cookie" + then + echo "Error: wrong cookie" + exit + fi + fi + cmd_list } Index: work/feature_poll/src/enter.html =================================================================== --- work/feature_poll/src/enter.html (revision 1585) +++ work/feature_poll/src/enter.html (revision 1586) @@ -2,7 +2,8 @@

Enter voting mode

-This site is registrationless. Each user needs to vote with his/her unique +This site doesn't require a full registration, even "password" (cookie) is +optional. Each user needs to vote with his/her unique email address (one address per user allowed). Privacy policy: I will use your email address only to: