From 4462a0b5e605404553ee228b98361ff07d0f584e Mon Sep 17 00:00:00 2001 From: Dirk von Suchodoletz Date: Fri, 29 May 2009 17:33:02 +0000 Subject: Starting to enable the CGI script to write configurations ... git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@2908 95ad53e4-c205-0410-b2fa-d234c58c8868 --- boot-env/preboot/http-server/user_settings.pl | 44 +++++++++++++++++++++++---- 1 file changed, 38 insertions(+), 6 deletions(-) diff --git a/boot-env/preboot/http-server/user_settings.pl b/boot-env/preboot/http-server/user_settings.pl index a712d827..f824ff20 100755 --- a/boot-env/preboot/http-server/user_settings.pl +++ b/boot-env/preboot/http-server/user_settings.pl @@ -35,6 +35,8 @@ my $cgi = CGI->new; my $system = $cgi->param('system') || ''; my $client = $cgi->param('client') || ''; my $prebootID = $cgi->param('preboot_id') || ''; +my $type = $cgi->param('type') || 'directkiosk'; +my $errormsg = 'None'; die "must give 'system' ($system), 'client' ($client) and 'preboot_id' ($prebootID)!\n" unless $system && $client && $prebootID; @@ -42,17 +44,47 @@ die "must give 'system' ($system), 'client' ($client) and 'preboot_id' ($preboot my $webPath = "$openslxConfig{'public-path'}/preboot"; my $src = "$webPath/client-config/$system/$prebootID.tgz"; my $destPath = "$webPath/$prebootID/client-config/$system"; -mkpath($destPath."/".$client); -system(qq{tar -xz $src -C $destPath/$client/}); -# from here on the modifications of client configuration should take place -# within $destPath/$client directory +# if fastboot (default) is selected and a ConfTGZ exist just proceed ... +if ($type eq "fastboot" && !-e "$destPath/$client.tgz") { $type = "slxconfig"; } +# directkiosk/cfgkiosk/slxconfig +if ($type ne "fastboot") { + mkpath($destPath."/".$client); + system(qq{tar -xzf $src -C $destPath/$client/}); -system(qq{cd $destPath/$client; tar -czf $destPath/$client.tgz *}); -unlink("$destPath/$client"); + # from here on the modifications of client configuration should take place + # within $destPath/$client directory + if ($type eq "slxconfig") { + # configuration of a WAN boot SLX client + print STDERR "slxconfig sub"; + } + elsif ($type eq "cfgkiosk") { + # configuration of a WAN boot SLX kiosk + } + elsif (!$type || $type eq "directkiosk") { + # deactivate the desktop plugin for the kiosk mode + open (CFGFILE, ">$destPath/$client/initramfs/plugin-conf/desktop.conf"); + print CFGFILE 'desktop_active="0"'; + close (CFGFILE); + # activate the kiosk plugin + if (!-e "$destPath/$client/initramfs/plugin-conf/desktop.conf") { + $errormsg = "The kiosk plugin seems not to be installed"; + print STDERR $errormsg; + } + # open (CFGFILE, ">$destPath/$client/initramfs/plugin-conf/kiosk.conf"); + } + else { + # unknown type + $errormsg = "You have passed an unknown boot type $type"; + print STDERR $errormsg; + } + system(qq{cd $destPath/$client; tar -czf $destPath/$client.tgz *}); + rmtree($destPath."/".$client); +} print $cgi->header(-charset => 'iso8859-1'), $cgi->start_html('Hey there ...'), $cgi->h1('Yo!'), + $cgi->p("Error: $errormsg"), $cgi->end_html(); -- cgit v1.2.3-55-g7522