1 |
mweinber |
1.1 |
--- smeserver-openoffice-portable-2.3.1/root/etc/e-smith/events/actions/openoffice-usersettings.DeleteHistory 2008-03-15 17:29:26.000000000 +0100 |
2 |
|
|
+++ smeserver-openoffice-portable-2.3.1/root/etc/e-smith/events/actions/openoffice-usersettings 2008-03-15 17:29:26.000000000 +0100 |
3 |
|
|
@@ -13,6 +13,7 @@ |
4 |
|
|
sub create_profiledir($); |
5 |
|
|
sub replace_value($$$$%); |
6 |
|
|
sub patch_xcu_file($$$%); |
7 |
|
|
+sub delete_history($); |
8 |
|
|
|
9 |
|
|
(my $self=$0)=~s/.*\///; |
10 |
|
|
my $event=$ARGV[0]||''; |
11 |
|
|
@@ -60,6 +61,11 @@ |
12 |
|
|
my $OOP_ini ="/opt/openoffice/OpenOfficePortable/OpenOfficePortable.ini"; |
13 |
|
|
system("/bin/cp -a $OOP_ini.contrib $OOP_ini") if not -f $OOP_ini; |
14 |
|
|
} |
15 |
|
|
+elsif( $self eq "openoffice-delete-history" ) |
16 |
|
|
+ { |
17 |
|
|
+ # delete History, like recent file list |
18 |
|
|
+ delete_history($event); |
19 |
|
|
+ } |
20 |
|
|
elsif( $self eq "openoffice-assoc-oo" ) |
21 |
|
|
{ |
22 |
|
|
# Add file assocations for OO native files to netlogon.bat |
23 |
|
|
@@ -176,15 +182,18 @@ |
24 |
|
|
} |
25 |
|
|
} |
26 |
|
|
# Pathes |
27 |
|
|
- my %OOPathes = |
28 |
|
|
- ( |
29 |
|
|
- 'Paths->Temp->WritePath'=>"", |
30 |
|
|
- 'Paths->Work->WritePath'=>"file://$ServerName/$username", |
31 |
|
|
- ); |
32 |
|
|
my $xcu_file = "/home/e-smith/files/ooSettings/$username/user/registry/data/org/openoffice/Office/Paths.xcu"; |
33 |
|
|
- my $r=patch_xcu_file($xcu_file, $username, $ServerName, %OOPathes); |
34 |
|
|
- $r->XML::Twig::print_to_file("$xcu_file"); |
35 |
|
|
- unlink "/home/e-smith/files/ooSettings/$username/user/registry/cache/org.openoffice.Office.Paths.dat"; |
36 |
|
|
+ if( -f $xcu_file ) |
37 |
|
|
+ { |
38 |
|
|
+ my %OOPathes = |
39 |
|
|
+ ( |
40 |
|
|
+ 'Paths->Temp->WritePath'=>"", |
41 |
|
|
+ 'Paths->Work->WritePath'=>"file://$ServerName/$username", |
42 |
|
|
+ ); |
43 |
|
|
+ my $r=patch_xcu_file($xcu_file, $username, $ServerName, %OOPathes); |
44 |
|
|
+ $r->XML::Twig::print_to_file("$xcu_file"); |
45 |
|
|
+ unlink "/home/e-smith/files/ooSettings/$username/user/registry/cache/org.openoffice.Office.Paths.dat"; |
46 |
|
|
+ } |
47 |
|
|
} |
48 |
|
|
|
49 |
|
|
|
50 |
|
|
@@ -224,3 +233,18 @@ |
51 |
|
|
} |
52 |
|
|
return $root; |
53 |
|
|
} |
54 |
|
|
+ |
55 |
|
|
+sub delete_history($) |
56 |
|
|
+ { |
57 |
|
|
+ my $username=shift; |
58 |
|
|
+ my $Common_xcu="/home/e-smith/files/ooSettings/$username/user/registry/data/org/openoffice/Office/Common.xcu"; |
59 |
|
|
+ return unless -f $Common_xcu; |
60 |
|
|
+ my $twig= XML::Twig->new( PrettyPrint => "indented"); |
61 |
|
|
+ $twig->parsefile($Common_xcu) or die "Parse error"; |
62 |
|
|
+ my $root = $twig->root(); |
63 |
|
|
+ for my $node ($root->children('node')) |
64 |
|
|
+ { |
65 |
|
|
+ $node->delete() if $node->att('oor:name') =~ /^(History|Cache|Help)$/; |
66 |
|
|
+ } |
67 |
|
|
+ $root->XML::Twig::print_to_file("$Common_xcu"); |
68 |
|
|
+ } |