This commit is contained in:
hobbyquaker 2018-07-22 00:38:41 +02:00
parent 378f74170b
commit 861859c947
1 changed files with 5 additions and 29 deletions

View File

@ -1,36 +1,12 @@
#!/bin/tclsh
load tclrega.so
source /usr/local/addons/rmupdate/lib/querystring.tcl
source /usr/local/addons/rmupdate/lib/session.tcl
catch {
set input $env(QUERY_STRING)
set pairs [split $input &]
foreach pair $pairs {
if {0 != [regexp "^(\[^=]*)=(.*)$" $pair dummy varname val]} {
set $varname $val
}
}
}
if {[info exists sid] > 0} {
# Session prüfen
if {
([string index $sid 0] != "@")
|| ([string index $sid [expr [string length $sid] -1]] != "@")
|| ([string length $sid] != 12)} {
puts {error: session invalid}
} else {
regsub -all {@} $sid "" sid
set res [lindex [rega_script "Write(system.GetSessionVarStr('$sid'));"] 1]
if {$res != ""} {
# gültige Session
set fp [open "/usr/local/addons/rmupdate/www/rmupdate.html" r]
if {[info exists sid] && [check_session $sid]} {
set fp [open "/usr/local/addons/rmupdate/www/rmupdate.html" r]
puts -nonewline [read $fp]
close $fp
} else {
puts {error: session invalid}
}
}
} else {
puts {error: no session}
puts {error: invalid session}
}