diff --git a/addon/lib/querystring.tcl b/addon/lib/querystring.tcl new file mode 100644 index 0000000..bd1f01f --- /dev/null +++ b/addon/lib/querystring.tcl @@ -0,0 +1,9 @@ +catch { + set input $env(QUERY_STRING) + set pairs [split $input &] + foreach pair $pairs { + if {0 != [regexp "^(\[^=]*)=(.*)$" $pair dummy varname val]} { + set $varname $val + } + } +} diff --git a/addon/lib/session.tcl b/addon/lib/session.tcl new file mode 100644 index 0000000..eb183a6 --- /dev/null +++ b/addon/lib/session.tcl @@ -0,0 +1,13 @@ +#!/bin/tclsh + +load tclrega.so + +proc check_session sid { + if {[regexp {@([0-9a-zA-Z]{10})@} $sid all sidnr]} { + set res [lindex [rega_script "Write(system.GetSessionVarStr('$sidnr'));"] 1] + if {$res != ""} { + return 1 + } + } + return 0 +}