1 |
013a5d79
|
jim-p
|
<?php
|
2 |
|
|
/* $Id$ */
|
3 |
|
|
/*
|
4 |
|
|
pkg_mgr_settings.php
|
5 |
|
|
part of pfSense
|
6 |
|
|
Copyright (C) 2009 Jim Pingle <jimp@pfsense.org>
|
7 |
4f6a5e6a
|
Scott Ullrich
|
Copyright (C) 2004-2010 Scott Ullrich <sullrich@gmail.com>
|
8 |
013a5d79
|
jim-p
|
Copyright (C) 2005 Colin Smith
|
9 |
|
|
|
10 |
|
|
Redistribution and use in source and binary forms, with or without
|
11 |
|
|
modification, are permitted provided that the following conditions are met:
|
12 |
|
|
|
13 |
|
|
1. Redistributions of source code must retain the above copyright notice,
|
14 |
|
|
this list of conditions and the following disclaimer.
|
15 |
|
|
|
16 |
|
|
2. Redistributions in binary form must reproduce the above copyright
|
17 |
|
|
notice, this list of conditions and the following disclaimer in the
|
18 |
|
|
documentation and/or other materials provided with the distribution.
|
19 |
|
|
|
20 |
|
|
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
21 |
|
|
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
22 |
|
|
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
23 |
|
|
AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
|
24 |
|
|
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
25 |
|
|
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
26 |
|
|
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
27 |
|
|
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
28 |
|
|
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
29 |
|
|
POSSIBILITY OF SUCH DAMAGE.
|
30 |
|
|
*/
|
31 |
|
|
/*
|
32 |
|
|
pfSense_MODULE: pkgs
|
33 |
|
|
*/
|
34 |
|
|
|
35 |
|
|
##|+PRIV
|
36 |
|
|
##|*IDENT=page-pkg-mgr-settings
|
37 |
|
|
##|*NAME=Packages: Settings page
|
38 |
|
|
##|*DESCR=Allow access to the 'Packages: Settings' page.
|
39 |
|
|
##|*MATCH=pkg_mgr_settings.php*
|
40 |
|
|
##|-PRIV
|
41 |
|
|
|
42 |
0089af7c
|
Scott Ullrich
|
ini_set('max_execution_time', '0');
|
43 |
|
|
|
44 |
013a5d79
|
jim-p
|
require_once("globals.inc");
|
45 |
|
|
require_once("guiconfig.inc");
|
46 |
|
|
require_once("pkg-utils.inc");
|
47 |
|
|
|
48 |
|
|
if ($_POST) {
|
49 |
|
|
if (!$input_errors) {
|
50 |
|
|
if($_POST['alturlenable'] == "yes") {
|
51 |
|
|
$config['system']['altpkgrepo']['enable'] = true;
|
52 |
|
|
$config['system']['altpkgrepo']['xmlrpcbaseurl'] = $_POST['pkgrepourl'];
|
53 |
|
|
} else {
|
54 |
|
|
unset($config['system']['altpkgrepo']['enable']);
|
55 |
|
|
}
|
56 |
|
|
write_config();
|
57 |
|
|
}
|
58 |
|
|
}
|
59 |
|
|
|
60 |
|
|
$curcfg = $config['system']['altpkgrepo'];
|
61 |
|
|
|
62 |
9a1e70df
|
Carlos Eduardo Ramos
|
$pgtitle = array(gettext("System"),gettext("Package Settings"));
|
63 |
013a5d79
|
jim-p
|
include("head.inc");
|
64 |
|
|
?>
|
65 |
|
|
<script language="JavaScript">
|
66 |
|
|
<!--
|
67 |
|
|
|
68 |
|
|
|
69 |
|
|
function enable_altpkgrepourl(enable_over) {
|
70 |
|
|
if (document.iform.alturlenable.checked || enable_over) {
|
71 |
|
|
document.iform.pkgrepourl.disabled = 0;
|
72 |
|
|
} else {
|
73 |
|
|
document.iform.pkgrepourl.disabled = 1;
|
74 |
|
|
}
|
75 |
|
|
}
|
76 |
|
|
|
77 |
|
|
// -->
|
78 |
|
|
</script>
|
79 |
|
|
|
80 |
|
|
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
|
81 |
|
|
<?php include("fbegin.inc");?>
|
82 |
|
|
<?php if ($input_errors) print_input_errors($input_errors); ?>
|
83 |
|
|
|
84 |
|
|
<form action="pkg_mgr_settings.php" method="post" name="iform" id="iform">
|
85 |
|
|
<?php if ($savemsg) print_info_box($savemsg); ?>
|
86 |
|
|
<table width="100%" border="0" cellpadding="0" cellspacing="0">
|
87 |
|
|
<tr>
|
88 |
|
|
<td>
|
89 |
|
|
<?php
|
90 |
|
|
$version = file_get_contents("/etc/version");
|
91 |
|
|
$tab_array = array();
|
92 |
eb9116e9
|
Carlos Eduardo Ramos
|
$tab_array[] = array(sprintf(gettext("%s packages"), $version), false, "pkg_mgr.php");
|
93 |
f65227b9
|
Vinicius Coque
|
$tab_array[] = array(gettext("Installed Packages"), false, "pkg_mgr_installed.php");
|
94 |
|
|
$tab_array[] = array(gettext("Package Settings"), true, "pkg_mgr_settings.php");
|
95 |
013a5d79
|
jim-p
|
display_top_tabs($tab_array);
|
96 |
|
|
?>
|
97 |
|
|
</td>
|
98 |
|
|
</tr>
|
99 |
|
|
<tr><td><div id=mainarea>
|
100 |
|
|
<table class="tabcont" width="100%" border="0" cellpadding="6" cellspacing="0">
|
101 |
|
|
<tr>
|
102 |
f65227b9
|
Vinicius Coque
|
<td colspan="2" valign="top" class="listtopic"><?=gettext("Package Repository URL");?></td>
|
103 |
013a5d79
|
jim-p
|
</tr>
|
104 |
|
|
<tr>
|
105 |
f65227b9
|
Vinicius Coque
|
<td valign="top" class="vncell"><?=gettext("Package Repository URL");?></td>
|
106 |
013a5d79
|
jim-p
|
<td class="vtable">
|
107 |
f65227b9
|
Vinicius Coque
|
<input name="alturlenable" type="checkbox" id="alturlenable" value="yes" onClick="enable_altpkgrepourl()" <?php if(isset($curcfg['enable'])) echo "checked"; ?>> <?=gettext("Use a different URL server for packages other than");?> <?php echo $g['product_website']; ?><br>
|
108 |
013a5d79
|
jim-p
|
<table>
|
109 |
eb9116e9
|
Carlos Eduardo Ramos
|
<tr><td><?=gettext("Base URL:");?></td><td><input name="pkgrepourl" type="input" class="formfld url" id="pkgrepourl" size="64" value="<?php if($curcfg['xmlrpcbaseurl']) echo $curcfg['xmlrpcbaseurl']; else echo $g['']; ?>"></td></tr>
|
110 |
013a5d79
|
jim-p
|
</table>
|
111 |
|
|
<span class="vexpl">
|
112 |
a62ad193
|
Erik Fonnesbeck
|
<?php printf(gettext("This is where %s will check for packages when the"),$g['product_name']);?>, <a href="pkg_mgr.php"><?=gettext("System: Packages");?></a> <?=gettext("page is viewed.");?>
|
113 |
013a5d79
|
jim-p
|
</span>
|
114 |
|
|
</td>
|
115 |
|
|
</tr>
|
116 |
|
|
<script>enable_altpkgrepourl();</script>
|
117 |
|
|
<tr>
|
118 |
|
|
<td width="22%" valign="top"> </td>
|
119 |
|
|
<td width="78%">
|
120 |
f65227b9
|
Vinicius Coque
|
<input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>">
|
121 |
013a5d79
|
jim-p
|
</td>
|
122 |
|
|
</tr>
|
123 |
|
|
</table></div></td></tr></table>
|
124 |
|
|
</form>
|
125 |
|
|
<?php include("fend.inc"); ?>
|
126 |
|
|
</body>
|
127 |
|
|
</html>
|