1 |
diff -up smeserver-thinclient-2.1/root/etc/e-smith/web/functions/thinclient.archive smeserver-thinclient-2.1/root/etc/e-smith/web/functions/thinclient |
diff -up smeserver-thinclient-2.1/root/etc/e-smith/web/functions/thinclient.archive smeserver-thinclient-2.1/root/etc/e-smith/web/functions/thinclient |
2 |
--- smeserver-thinclient-2.1/root/etc/e-smith/web/functions/thinclient.archive 2016-04-03 21:25:05.000000000 +1000 |
--- smeserver-thinclient-2.1/root/etc/e-smith/web/functions/thinclient.archive 2016-04-03 21:25:05.000000000 +1000 |
3 |
+++ smeserver-thinclient-2.1/root/etc/e-smith/web/functions/thinclient 2016-04-25 12:45:56.818272258 +1000 |
+++ smeserver-thinclient-2.1/root/etc/e-smith/web/functions/thinclient 2016-04-25 20:18:35.000000000 +1000 |
4 |
@@ -27,6 +27,8 @@ use esmith::cgi; |
@@ -27,6 +27,8 @@ use esmith::cgi; |
5 |
use esmith::ConfigDB; |
use esmith::ConfigDB; |
6 |
use esmith::util; |
use esmith::util; |
239 |
+ { |
+ { |
240 |
+ print $q->p ("You can't delete the $tftproot$dir directory, so you'll have to manipulate the files yourself"); |
+ print $q->p ("You can't delete the $tftproot$dir directory, so you'll have to manipulate the files yourself"); |
241 |
+ } |
+ } |
242 |
} |
+ } |
243 |
+ else |
+ else |
244 |
+ { |
+ { |
245 |
+ print $q->p ('This Distribution was installed as an rpm, it will be removed via rpm -e!<BR>', |
+ print $q->p ('This Distribution was installed as an rpm, it will be removed via rpm -e!<BR>', |
246 |
+ 'Which will remove all associated files and database entries.', |
+ 'Which will remove all associated files and database entries.', |
247 |
+ ); |
+ ); |
248 |
+ } |
} |
249 |
+ print $q->p ; |
+ print $q->p ; |
250 |
+ print $q->start_table ({-class => "sme-noborders"}); |
+ print $q->start_table ({-class => "sme-noborders"}); |
251 |
print $q->Tr( |
print $q->Tr( |
366 |
} |
} |
367 |
} |
} |
368 |
|
|
369 |
@@ -1031,96 +1134,227 @@ sub saveClient ($) |
@@ -1031,96 +1134,242 @@ sub saveClient ($) |
370 |
sub saveDistribution ($) |
sub saveDistribution ($) |
371 |
{ |
{ |
372 |
my ($q) = @_; |
my ($q) = @_; |
602 |
{ |
{ |
603 |
- if ($install eq "Manual") |
- if ($install eq "Manual") |
604 |
- { |
- { |
605 |
my $distrecord = $pxeclients->get($dist); |
- my $distrecord = $pxeclients->get($dist); |
606 |
$distrecord->set_prop('dir' => $dir); |
- $distrecord->set_prop('dir' => $dir); |
607 |
$distrecord->set_prop('prog' => $prog); |
- $distrecord->set_prop('prog' => $prog); |
608 |
- } |
- } |
609 |
- else |
- else |
610 |
- { |
- { |
611 |
- showDistributionPanel ($q, "This Distribution was installed via rpm. You can\'t modify these settings.", ''); |
- showDistributionPanel ($q, "This Distribution was installed via rpm. You can\'t modify these settings.", ''); |
612 |
- return; |
- return; |
613 |
- } |
- } |
614 |
|
+ if ($dist eq $origdist) |
615 |
|
+ # If the Distribution name hasn't changed, just update the fields |
616 |
|
+ { |
617 |
|
+ my $distrecord = $pxeclients->get($origdist); |
618 |
|
+ $distrecord->set_prop('dir' => $dir); |
619 |
|
+ $distrecord->set_prop('prog' => $prog); |
620 |
|
+ } |
621 |
|
+ else |
622 |
|
+ # If the Distribution name has changed, create the new one and delete the old |
623 |
|
+ { |
624 |
|
+ my %newvalues = ('type' => 'dist', |
625 |
|
+ 'dir' => $dir, |
626 |
|
+ 'prog' => $prog, |
627 |
|
+ 'install' => 'Archive'); |
628 |
|
+ my $distrecord = $pxeclients->new_record($dist, \%newvalues); |
629 |
|
+ my $distrecord = $pxeclients->get($origdist); |
630 |
|
+ $distrecord->delete; |
631 |
|
+ } |
632 |
+ if ($dir ne $origdir && $movedir eq 'yes') |
+ if ($dir ne $origdir && $movedir eq 'yes') |
633 |
+ { |
+ { |
634 |
+ if ( $origdir =~ /^([$safe_filename_characters]+)$/ ) |
+ if ( $origdir =~ /^([$safe_filename_characters]+)$/ ) |
664 |
} |
} |
665 |
|
|
666 |
if (system ("/sbin/e-smith/signal-event thinclient-conf > /var/log/thinclient.log 2>&1")) |
if (system ("/sbin/e-smith/signal-event thinclient-conf > /var/log/thinclient.log 2>&1")) |
667 |
@@ -1129,9 +1363,9 @@ sub saveDistribution ($) |
@@ -1129,9 +1378,9 @@ sub saveDistribution ($) |
668 |
return; |
return; |
669 |
} |
} |
670 |
|
|
676 |
} |
} |
677 |
|
|
678 |
# ---------------------------------------------------------------------------- |
# ---------------------------------------------------------------------------- |
679 |
@@ -1197,3 +1431,64 @@ sub checkip($) |
@@ -1197,3 +1446,64 @@ sub checkip($) |
680 |
return 'OK'; |
return 'OK'; |
681 |
} |
} |
682 |
|
|