]>
git.ipfire.org Git - people/teissler/ipfire-2.x.git/blob - html/cgi-bin/pakfire.cgi
5 # This file is part of the IPFire Project
7 # This code is distributed under the terms of the GPL
13 # enable only the following on debugging purpose
15 use CGI
::Carp
'fatalsToBrowser';
17 require '/var/ipfire/general-functions.pl';
18 require "${General::swroot}/lang.pl";
19 require "${General::swroot}/header.pl";
20 require "/opt/pakfire/lib/functions.pl";
22 my %pakfiresettings=();
23 my $errormessage = '';
25 &Header
::showhttpheaders
();
27 $pakfiresettings{'ACTION'} = '';
28 $pakfiresettings{'VALID'} = '';
30 $pakfiresettings{'INSPAKS'} = '';
31 $pakfiresettings{'DELPAKS'} = '';
32 $pakfiresettings{'AUTOUPDATE'} = 'off';
33 $pakfiresettings{'UUID'} = 'on';
35 &Header
::getcgihash
(\
%pakfiresettings);
37 &Header
::openpage
($Lang::tr
{'pakfire configuration'}, 1);
38 &Header
::openbigbox
('100%', 'left', '', $errormessage);
40 if ($pakfiresettings{'ACTION'} eq 'install'){
41 $pakfiresettings{'INSPAKS'} =~ s/\|/\ /g;
42 if ("$pakfiresettings{'FORCE'}" eq "on") {
43 my $command = "/usr/local/bin/pakfire install --non-interactive --no-colors $pakfiresettings{'INSPAKS'} &>/dev/null &";
47 &Header
::openbox
("100%", "center", "Abfrage");
48 my @output = `/usr/local/bin/pakfire resolvedeps --no-colors $pakfiresettings{'INSPAKS'}`;
50 <table><tr><td colspan='2'>$Lang::tr{'pakfire install package'}.$pakfiresettings{'INSPAKS'}.$Lang::tr{'pakfire possible dependency'}
58 <tr><td colspan='2'>$Lang::tr{'pakfire accept all'}
59 <tr><td colspan='2'>
60 <tr><td align='right'><form method='post' action='$ENV{'SCRIPT_NAME'}'>
61 <input type='hidden' name='INSPAKS' value='$pakfiresettings{'INSPAKS'}' />
62 <input type='hidden' name='FORCE' value='on' />
63 <input type='hidden' name='ACTION' value='install' />
64 <input type='image' alt='$Lang::tr{'install'}' src='/images/go-next.png' />
67 <form method='post' action='$ENV{'SCRIPT_NAME'}'>
68 <input type='hidden' name='ACTION' value='' />
69 <input type='image' alt='$Lang::tr{'abort'}' src='/images/dialog-error.png' />
74 &Header
::closebigbox
();
78 } elsif ($pakfiresettings{'ACTION'} eq 'remove') {
80 $pakfiresettings{'DELPAKS'} =~ s/\|/\ /g;
81 if ("$pakfiresettings{'FORCE'}" eq "on") {
82 my $command = "/usr/local/bin/pakfire remove --non-interactive --no-colors $pakfiresettings{'DELPAKS'} &>/dev/null &";
86 &Header
::openbox
("100%", "center", "Abfrage");
87 my @output = `/usr/local/bin/pakfire resolvedeps --no-colors $pakfiresettings{'DELPAKS'}`;
89 <table><tr><td colspan='2'>$Lang::tr{'pakfire uninstall package'}.$pakfiresettings{'DELPAKS'}.$Lang::tr{'pakfire possible dependency'}
97 <tr><td colspan='2'>$Lang::tr{'pakfire accept all'}
98 <tr><td colspan='2'>
99 <tr><td align='right'><form method='post' action='$ENV{'SCRIPT_NAME'}'>
100 <input type='hidden' name='DELPAKS' value='$pakfiresettings{'DELPAKS'}' />
101 <input type='hidden' name='FORCE' value='on' />
102 <input type='hidden' name='ACTION' value='remove' />
103 <input type='image' alt='$Lang::tr{'uninstall'}' src='/images/go-next.png' />
106 <form method='post' action='$ENV{'SCRIPT_NAME'}'>
107 <input type='hidden' name='ACTION' value='' />
108 <input type='image' alt='$Lang::tr{'abort'}' src='/images/dialog-error.png' />
113 &Header
::closebigbox
();
114 &Header
::closepage
();
118 } elsif ($pakfiresettings{'ACTION'} eq 'update') {
120 system("/usr/local/bin/pakfire update --force --no-colors");
122 } elsif ($pakfiresettings{'ACTION'} eq 'upgrade') {
124 system("/usr/local/bin/pakfire upgrade -y --no-colors");
126 } elsif ($pakfiresettings{'ACTION'} eq "$Lang::tr{'save'}") {
128 &General
::writehash
("${General::swroot}/pakfire/settings", \
%pakfiresettings);
132 &General
::readhash
("${General::swroot}/pakfire/settings", \
%pakfiresettings);
137 $checked{'AUTOUPDATE'}{'off'} = '';
138 $checked{'AUTOUPDATE'}{'on'} = '';
139 $checked{'AUTOUPDATE'}{$pakfiresettings{'AUTOUPDATE'}} = "checked='checked'";
140 $checked{'UUID'}{'off'} = '';
141 $checked{'UUID'}{'on'} = '';
142 $checked{'UUID'}{$pakfiresettings{'UUID'}} = "checked='checked'";
144 # DPC move error message to top so it is seen!
146 &Header
::openbox
('100%', 'left', $Lang::tr
{'error messages'});
147 print "<font class='base'>$errormessage </font>\n";
151 my $return = `pidof pakfire`;
154 &Header
::openbox
( 'Waiting', 1, "<meta http-equiv='refresh' content='5;'>" );
158 <img src='/images/indicator.gif' alt='$Lang::tr{'aktiv'}' />
160 $Lang::tr{'pakfire working'}
161 <tr><td colspan='2' align='center'>
162 <form method='post' action='$ENV{'SCRIPT_NAME'}'>
163 <input type='image' alt='$Lang::tr{'reload'}' src='/images/view-refresh.png' />
165 <tr><td colspan='2' align='left'><pre>
167 my @output = `tail -20 /var/log/pakfire.log`;
176 &Header
::closebigbox
();
177 &Header
::closepage
();
181 &Header
::openbox
("100%", "center", "Pakfire");
183 system("pakfire update &>dev/null");
187 <tr><td width='40%' align="center">Verfuegbare Addons:<br />
188 <form method='post' action='$ENV{'SCRIPT_NAME'}'>
189 <select name="INSPAKS" size="10" multiple>
191 &Pakfire
::dblist
("notinstalled", "forweb");
196 <td width='20%' align="center">
197 <input type='hidden' name='ACTION' value='install' />
198 <input type='image' alt='$Lang::tr{'install'}' src='/images/list-add.png' />
201 <form method='post' action='$ENV{'SCRIPT_NAME'}'>
202 <input type='hidden' name='ACTION' value='update' />
203 <input type='submit' value='Liste aktualisieren' /><br />
206 <form method='post' action='$ENV{'SCRIPT_NAME'}'>
207 <input type='hidden' name='ACTION' value='remove' />
208 <input type='image' alt='$Lang::tr{'remove'}' src='/images/list-remove.png' />
210 <td width='40%' align="center">$Lang::tr{'pakfire installed addons'}<br />
211 <select name="DELPAKS" size="10" multiple>
214 &Pakfire
::dblist
("installed", "forweb");
220 <form method='post' action='$ENV{'SCRIPT_NAME'}'>
222 <tr><td colspan='2'>$Lang::tr{'pakfire updates'}
223 <tr><td width='20%'> <td width='60%' align='center'>
224 <select name="UPDPAKS" size="5" disabled>
227 &Pakfire
::dblist
("upgrade", "forweb");
231 <td width='20%' align='center' valign='middle'><input type='hidden' name='ACTION' value='upgrade' />
232 <input type='image' alt='$Lang::tr{'upgrade'}' src='/images/document-save.png' />
235 <form method='post' action='$ENV{'SCRIPT_NAME'}'>
237 <tr><td width='40%' align="right">$Lang::tr{'pakfire update daily'}
238 <td width='10%' align="left"><input type="checkbox" name="AUTOUPDATE" $checked{'AUTOUPDATE'}{'on'} />
239 <td width='40%' align="right">$Lang::tr{'pakfire register'}
240 <td width='10%' align="left"><input type="checkbox" name="UUID" $checked{'UUID'}{'on'} />
241 <tr><td width='100%' colspan="4" align="right"><input type="submit" name="ACTION" value="$Lang::tr{'save'}" />
247 &Header
::closebigbox
();
248 &Header
::closepage
();