diff --git a/addon/etc/rmupdate-addon.cfg b/addon/etc/rmupdate-addon.cfg index cde4aa0..f456c31 100644 --- a/addon/etc/rmupdate-addon.cfg +++ b/addon/etc/rmupdate-addon.cfg @@ -1,5 +1,5 @@ { - CONFIG_URL /addons/rmupdate + CONFIG_URL /addons/rmupdate/index.cgi CONFIG_DESCRIPTION { de {
  • System-Update
  • } en {
  • System-update
  • } diff --git a/addon/www/index.cgi b/addon/www/index.cgi new file mode 100644 index 0000000..46b5811 --- /dev/null +++ b/addon/www/index.cgi @@ -0,0 +1,36 @@ +#!/bin/tclsh + +load tclrega.so + +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] + puts -nonewline [read $fp] + close $fp + } else { + puts {error: session invalid} + } + } +} else { + puts {error: no session} +} diff --git a/addon/www/index.html b/addon/www/rmupdate.html similarity index 100% rename from addon/www/index.html rename to addon/www/rmupdate.html