diff options
| author | Sebastian Schmelzer | 2010-09-02 17:50:49 +0200 |
|---|---|---|
| committer | Sebastian Schmelzer | 2010-09-02 17:50:49 +0200 |
| commit | 416ab8a37f1b07dc9f6c0fb3ff1a8ff2036510b5 (patch) | |
| tree | 4715f7d742fec50931017f38fe6ff0a89d4ceccc /boot-env/preboot/http-server | |
| parent | Fix for the problem reported on the list (sed filter forgotten for the (diff) | |
| download | core-416ab8a37f1b07dc9f6c0fb3ff1a8ff2036510b5.tar.gz core-416ab8a37f1b07dc9f6c0fb3ff1a8ff2036510b5.tar.xz core-416ab8a37f1b07dc9f6c0fb3ff1a8ff2036510b5.zip | |
change dir structure
Diffstat (limited to 'boot-env/preboot/http-server')
| -rwxr-xr-x | boot-env/preboot/http-server/user_settings.pl | 97 | ||||
| -rwxr-xr-x | boot-env/preboot/http-server/users.pl | 90 |
2 files changed, 0 insertions, 187 deletions
diff --git a/boot-env/preboot/http-server/user_settings.pl b/boot-env/preboot/http-server/user_settings.pl deleted file mode 100755 index 6c135267..00000000 --- a/boot-env/preboot/http-server/user_settings.pl +++ /dev/null @@ -1,97 +0,0 @@ -#!/usr/bin/perl -w -# Copyright (c) 2009 - OpenSLX GmbH -# -# This program is free software distributed under the GPL version 2. -# See http://openslx.org/COPYING -# -# If you have any feedback please consult http://openslx.org/feedback and -# send your feedback to feedback@openslx.org -# -# General information about OpenSLX can be found at http://openslx.org -# -# cgi-bin script that accepts user settings and stores them in a special -# folder on the openslx server - -use strict; -use warnings; - -use CGI; -use CGI::Carp qw(fatalsToBrowser); -use File::Path; - -# add openslx stuff to @INC -use FindBin; -use lib "$FindBin::RealBin/../../../../lib"; -use lib "$FindBin::RealBin"; - -# read default config -use OpenSLX::Basics; -openslxInit(); - -# die "*** Taint mode must be active! ***" unless ${^TAINT}; - -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; - -my $webPath = "$openslxConfig{'public-path'}/preboot"; -my $src = "$webPath/client-config/$system/$prebootID.tgz"; -my $destPath = "$webPath/$prebootID/client-config/$system"; - -# 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/}); - - - # 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/kiosk.conf") { - $errormsg = "The kiosk plugin seems not to be installed"; - print STDERR $errormsg; - } else { - open (CFGFILE, ">>$destPath/$client/initramfs/plugin-conf/kiosk.conf"); - print CFGFILE 'kiosk_active="1"'; - close (CFGFILE); - } - } - 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); -} - -# resulting page is not shown to the user (error reporting that way, or -# completely empty reply?) -print - $cgi->header(-charset => 'iso8859-1'), - $cgi->start_html('...'); -if ($errormsg) { print $cgi->p("Error: $errormsg"); } -print - $cgi->end_html(); - diff --git a/boot-env/preboot/http-server/users.pl b/boot-env/preboot/http-server/users.pl deleted file mode 100755 index cde3d227..00000000 --- a/boot-env/preboot/http-server/users.pl +++ /dev/null @@ -1,90 +0,0 @@ -#!/usr/bin/perl -w -# Copyright (c) 2009 - OpenSLX GmbH -# -# This program is free software distributed under the GPL version 2. -# See http://openslx.org/COPYING -# -# If you have any feedback please consult http://openslx.org/feedback and -# send your feedback to feedback@openslx.org -# -# General information about OpenSLX can be found at http://openslx.org -# -# cgi-bin script that accepts user settings and stores them in a special -# folder on the openslx server - -use strict; -use warnings; - -use CGI; -use CGI::Carp qw(fatalsToBrowser); -use File::Path; -use Switch; - -# add openslx stuff to @INC -use FindBin; -use lib "$FindBin::RealBin/../../../../lib"; -use lib "$FindBin::RealBin"; - -# read default config -use OpenSLX::Basics; -openslxInit(); - -my $cgi = CGI->new; -my $mac = $cgi->param('user') || ''; -my $action = $cgi->param('action'); -my $data = $cgi->param('data'); - -# global requirements -die "must give 'mac' ($mac)!\n" - unless $mac; - -my $webPath = "$openslxConfig{'public-path'}/preboot-users"; -my $userConfFile = "$webPath/$mac.conf"; - -# makes only sense if public path is writeable for www-data -# otherwise you have to create directory manualy -if ( ! -e $webPath ) { - mkpath ($webPath) or die _tr("Can't create user config directory (%s). Reason: %s", $webPath, @_); -} - -my $output = ""; -my $error; - -switch ($action) { - case 'set' { - if ($data) { - open (MYFILE, ">$userConfFile"); - print MYFILE $data; - close (MYFILE); - } else { - $error = "no data"; - } - } - case 'read' { - if ( -e $userConfFile ) { - open (MYFILE, $userConfFile); - while (<MYFILE>) { - chomp; - $output .= "$_\n"; - } - close (MYFILE); - } else { - $error = "foobar"; - } - - } - else { - #default case check if we have a user config - if ( -e $userConfFile ) { $output = "1"; } - else { $output = "0"; }; - } -} - -print $cgi->header('Content-type: text/plain'); -if ($error) { - print $error; -} else { - print $output; -} - -exit 0; |
