#!/mod/bin/jimsh source /mod/var/mongoose/lib/settings.class package require cgi puts "Content-Type: text/html" puts "" cgi_input #cgi_dump set settings [settings new] set hostname [$settings hostname] set smtp_server [$settings smtp_server] set channel_group [$settings channel_group] # Handle updates #set _cgi(smtp_server) "fred.bob" #set env(REQUEST_URI) '' proc _handle_update {class var old text} { global _cgi global settings if {[dict exists $_cgi $var]} { set new [string trim [dict get $_cgi $var]] if {$new == $old} { puts "$text unchanged." } elseif [string is $class -strict $new] { $settings $var $new puts "$text updated." } else { puts "Invalid value for $var." } exit } } proc handle_int_update {var old {text "Value"}} { _handle_update digit $var $old $text } proc handle_str_update {var old {text "Value"}} { _handle_update alnum $var $old $text } handle_str_update hostname $hostname Hostname _handle_update ascii smtp_server $smtp_server "SMTP Server" handle_int_update channel_group $channel_group "Channel Group" source /mod/var/mongoose/html/lib/header.jim puts {} puts { } puts "
General Settings " puts " " puts " " puts "
Hostname
Channel Group for EPG


Email Settings " puts " " puts "
SMTP Server for outbound email
" source /mod/var/mongoose/html/lib/footer.jim