/[smecontribs]/rpms/smeserver-openoffice-portable/contribs7/smeserver-openoffice-portable-2.3.1-pathesfix.patch
ViewVC logotype

Contents of /rpms/smeserver-openoffice-portable/contribs7/smeserver-openoffice-portable-2.3.1-pathesfix.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download)
Fri Mar 14 13:42:41 2008 UTC (16 years, 7 months ago) by mweinber
Branch: MAIN
CVS Tags: smeserver-openoffice-portable-2_3_1-8_el4_sme
pathesfix

1 --- /dev/null 2008-03-12 17:01:43.367208064 +0100
2 +++ smeserver-openoffice-portable-2.3.1/root/opt/openoffice/OpenOfficePortable/OpenOfficePortable.ini 2008-03-14 14:14:07.000000000 +0100
3 @@ -0,0 +1,8 @@
4 +[OpenOfficePortable]
5 +OpenOfficeDirectory=App\openoffice
6 +SettingsDirectory=Data\settings
7 +OpenOfficeExecutable=soffice.exe
8 +WaitForOpenOffice=false
9 +RunDataLocally=true
10 +DisableSplashScreen=true
11 +
12 --- smeserver-openoffice-portable-2.3.1/root/etc/e-smith/events/actions/openoffice-usersettings.pathesfix 2008-02-22 18:47:55.000000000 +0100
13 +++ smeserver-openoffice-portable-2.3.1/root/etc/e-smith/events/actions/openoffice-usersettings 2008-03-14 14:34:17.000000000 +0100
14 @@ -1,13 +1,18 @@
15 #!/usr/bin/perl -w
16 -# Michael Weinberger, Feb 2008
17 +
18 +# Michael Weinberger, (C) 2008
19
20 use strict;
21 use esmith::AccountsDB;
22 use esmith::ConfigDB;
23 use File::Path;
24 +use XML::Twig;
25 +
26 sub file_assoc($$);
27 sub patch_netlogon($);
28 sub create_profiledir($);
29 +sub replace_value($$$$%);
30 +sub patch_xcu_file($$$%);
31
32 (my $self=$0)=~s/.*\///;
33 my $event=$ARGV[0]||'';
34 @@ -146,9 +151,73 @@
35 chmod 0700, "$settings/$username";
36 if( not -d "$settings/$username/user" && -d "/opt/openoffice/OpenOfficePortable/Data/settings/user" )
37 {
38 + system( "/bin/rm -f /opt/openoffice/OpenOfficePortable/Data/settings/user/registry/cache/*" );
39 system( "/bin/cp -fR /opt/openoffice/OpenOfficePortable/Data/settings/user $settings/$username" );
40 system( "/bin/chown -R $username.$username $settings/$username/user" );
41 +
42 +
43 + # Firstname, Lastname, Initials
44 + my $xcu_file = "/home/e-smith/files/ooSettings/$username/user/registry/data/org/openoffice/UserProfile.xcu";
45 + if( -f $xcu_file )
46 + {
47 + my $givenname=$accountdb->get_prop( $username, 'FirstName')||'';
48 + my $sn=$accountdb->get_prop( $username, 'LastName')||'';
49 + my %UserProfile =
50 + (
51 + 'Data->givenname'=>$givenname,
52 + 'Data->sn'=>$sn,
53 + 'Data->initials'=>substr($givenname,0,1).substr($sn,0,1)
54 + );
55 + my $r=patch_xcu_file($xcu_file, $username, $ServerName, %UserProfile);
56 + $r->XML::Twig::print_to_file("$xcu_file");
57 + }
58 }
59 + # Pathes
60 + my %OOPathes =
61 + (
62 + 'Paths->Temp->WritePath'=>"",
63 + 'Paths->Work->WritePath'=>"file://$ServerName/$username",
64 + );
65 + my $xcu_file = "/home/e-smith/files/ooSettings/$username/user/registry/data/org/openoffice/Office/Paths.xcu";
66 + my $r=patch_xcu_file($xcu_file, $username, $ServerName, %OOPathes);
67 + $r->XML::Twig::print_to_file("$xcu_file");
68 + unlink "/home/e-smith/files/ooSettings/$username/user/registry/cache/org.openoffice.Office.Paths.dat";
69 }
70
71
72 +sub replace_value($$$$%)
73 +{
74 + my ($sn, $name, $account, $ServerName, %vals) = @_;
75 + for my $node ($sn)
76 + {
77 + foreach my $child ($node->children())
78 + {
79 + if( defined $vals{$name} )
80 + {
81 + $child->set_atts('xsi:nil'=>'false') if( $child->att('xsi:nil'));
82 + $child->set_atts('xsi:nil'=>'true') if( not $vals{$name} );
83 + $child->set_text($vals{$name});
84 + }
85 + replace_value(
86 + $child,
87 + $name . ($child->att('oor:name') ? "->".$child->att('oor:name') : ''),
88 + $account,
89 + $ServerName,
90 + %vals
91 + ) if $child->has_children() && $child->name() ne 'value';
92 + }
93 + }
94 +}
95 +
96 +sub patch_xcu_file($$$%)
97 + {
98 + my ($xmlfile, $account, $ServerName, %vals)=@_;
99 + my $twig= XML::Twig->new( PrettyPrint => "indented");
100 + $twig->parsefile($xmlfile) or die "Parse error";
101 + my $root = $twig->root();
102 + for my $node ($root->children('node'))
103 + {
104 + replace_value($node, $node->att('oor:name'), $account, $ServerName, %vals);
105 + }
106 + return $root;
107 + }
108 --- smeserver-openoffice-portable-2.3.1/root/etc/e-smith/templates/etc/smb.conf/50openoffice-portable.pathesfix 2008-02-14 14:56:52.000000000 +0100
109 +++ smeserver-openoffice-portable-2.3.1/root/etc/e-smith/templates/etc/smb.conf/50openoffice-portable 2008-03-14 14:14:07.000000000 +0100
110 @@ -1,3 +1,7 @@
111 +{
112 + return "" unless (($openoffice{status}||'enabled') eq "enabled");
113 +
114 + $OUT .= <<HERE;
115 [openoffice]
116 comment = Open Office Portable
117 browseable = yes
118 @@ -11,3 +15,5 @@
119 force directory mode = 0755
120 path = /opt/openoffice
121
122 +HERE
123 +}

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed