--- smeserver-openoffice-portable-2.3.1/root/sbin/e-smith/openoffice-delete-history.DeleteHistoryScript 2008-03-16 14:45:29.000000000 +0100 +++ smeserver-openoffice-portable-2.3.1/root/sbin/e-smith/openoffice-delete-history 2008-03-16 14:46:35.000000000 +0100 @@ -0,0 +1,23 @@ +#!/usr/bin/perl -w + +# Michael Weinberger, (C) 2008 + +use strict; +use XML::Twig; + +my $account=$ARGV[0]||''; +if( not $account ) + { + print "Usage: openoffice-delete-history ACCOUNT\n"; + exit -1; + } +my $Common_xcu="/home/e-smith/files/ooSettings/$account/user/registry/data/org/openoffice/Office/Common.xcu"; +return unless -f $Common_xcu; +my $twig= XML::Twig->new( PrettyPrint => "indented"); +$twig->parsefile($Common_xcu) or die "Parse error"; +my $root = $twig->root(); +for my $node ($root->children('node')) + { + $node->delete() if $node->att('oor:name') =~ /^(History|Cache|Help)$/; + } +$root->XML::Twig::print_to_file("$Common_xcu"); --- smeserver-openoffice-portable-2.3.1/root/etc/e-smith/events/actions/openoffice-usersettings.DeleteHistoryScript 2008-03-16 14:51:47.000000000 +0100 +++ smeserver-openoffice-portable-2.3.1/root/etc/e-smith/events/actions/openoffice-usersettings 2008-03-16 14:52:12.000000000 +0100 @@ -13,7 +13,6 @@ sub create_profiledir($); sub replace_value($$$$%); sub patch_xcu_file($$$%); -sub delete_history($); (my $self=$0)=~s/.*\///; my $event=$ARGV[0]||''; @@ -61,11 +60,6 @@ my $OOP_ini ="/opt/openoffice/OpenOfficePortable/OpenOfficePortable.ini"; system("/bin/cp -a $OOP_ini.contrib $OOP_ini") if not -f $OOP_ini; } -elsif( $self eq "openoffice-delete-history" ) - { - # delete History, like recent file list - delete_history($event); - } elsif( $self eq "openoffice-assoc-oo" ) { # Add file assocations for OO native files to netlogon.bat @@ -233,18 +227,3 @@ } return $root; } - -sub delete_history($) - { - my $username=shift; - my $Common_xcu="/home/e-smith/files/ooSettings/$username/user/registry/data/org/openoffice/Office/Common.xcu"; - return unless -f $Common_xcu; - my $twig= XML::Twig->new( PrettyPrint => "indented"); - $twig->parsefile($Common_xcu) or die "Parse error"; - my $root = $twig->root(); - for my $node ($root->children('node')) - { - $node->delete() if $node->att('oor:name') =~ /^(History|Cache|Help)$/; - } - $root->XML::Twig::print_to_file("$Common_xcu"); - }