Revision 013a5d79
Added by Jim Pingle almost 16 years ago
usr/local/www/pkg_mgr_settings.php | ||
---|---|---|
1 |
<?php |
|
2 |
/* $Id$ */ |
|
3 |
/* |
|
4 |
pkg_mgr_settings.php |
|
5 |
part of pfSense |
|
6 |
Copyright (C) 2009 Jim Pingle <jimp@pfsense.org> |
|
7 |
Copyright (C) 2008 Scott Ullrich <sullrich@gmail.com> |
|
8 |
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 |
require_once("globals.inc"); |
|
43 |
require_once("guiconfig.inc"); |
|
44 |
require_once("pkg-utils.inc"); |
|
45 |
|
|
46 |
if ($_POST) { |
|
47 |
if (!$input_errors) { |
|
48 |
if($_POST['alturlenable'] == "yes") { |
|
49 |
$config['system']['altpkgrepo']['enable'] = true; |
|
50 |
$config['system']['altpkgrepo']['xmlrpcbaseurl'] = $_POST['pkgrepourl']; |
|
51 |
} else { |
|
52 |
unset($config['system']['altpkgrepo']['enable']); |
|
53 |
} |
|
54 |
write_config(); |
|
55 |
} |
|
56 |
} |
|
57 |
|
|
58 |
$curcfg = $config['system']['altpkgrepo']; |
|
59 |
|
|
60 |
$pgtitle = array("System","Package Settings"); |
|
61 |
include("head.inc"); |
|
62 |
?> |
|
63 |
<script language="JavaScript"> |
|
64 |
<!-- |
|
65 |
|
|
66 |
|
|
67 |
function enable_altpkgrepourl(enable_over) { |
|
68 |
if (document.iform.alturlenable.checked || enable_over) { |
|
69 |
document.iform.pkgrepourl.disabled = 0; |
|
70 |
} else { |
|
71 |
document.iform.pkgrepourl.disabled = 1; |
|
72 |
} |
|
73 |
} |
|
74 |
|
|
75 |
// --> |
|
76 |
</script> |
|
77 |
|
|
78 |
<body link="#0000CC" vlink="#0000CC" alink="#0000CC"> |
|
79 |
<?php include("fbegin.inc");?> |
|
80 |
<?php if ($input_errors) print_input_errors($input_errors); ?> |
|
81 |
|
|
82 |
<form action="pkg_mgr_settings.php" method="post" name="iform" id="iform"> |
|
83 |
<?php if ($savemsg) print_info_box($savemsg); ?> |
|
84 |
<table width="100%" border="0" cellpadding="0" cellspacing="0"> |
|
85 |
<tr> |
|
86 |
<td> |
|
87 |
<?php |
|
88 |
$version = file_get_contents("/etc/version"); |
|
89 |
$tab_array = array(); |
|
90 |
$tab_array[] = array("{$version} packages", false, "pkg_mgr.php"); |
|
91 |
$tab_array[] = array("Installed Packages", false, "pkg_mgr_installed.php"); |
|
92 |
$tab_array[] = array("Package Settings", true, "pkg_mgr_settings.php"); |
|
93 |
display_top_tabs($tab_array); |
|
94 |
?> |
|
95 |
</td> |
|
96 |
</tr> |
|
97 |
<tr><td><div id=mainarea> |
|
98 |
<table class="tabcont" width="100%" border="0" cellpadding="6" cellspacing="0"> |
|
99 |
<tr> |
|
100 |
<td colspan="2" valign="top" class="listtopic">Package Repository URL</td> |
|
101 |
</tr> |
|
102 |
<tr> |
|
103 |
<td valign="top" class="vncell">Package Repository URL</td> |
|
104 |
<td class="vtable"> |
|
105 |
<input name="alturlenable" type="checkbox" id="alturlenable" value="yes" onClick="enable_altpkgrepourl()" <?php if(isset($curcfg['enable'])) echo "checked"; ?>> Use a different URL server for packages other than <?php echo $g['product_website']; ?><br> |
|
106 |
<table> |
|
107 |
<tr><td>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> |
|
108 |
</table> |
|
109 |
<span class="vexpl"> |
|
110 |
This is where <?php echo $g['product_name'] ?> will check for packages when the <a href="pkg_mgr.php">System: Packages</a> page is viewed. |
|
111 |
</span> |
|
112 |
</td> |
|
113 |
</tr> |
|
114 |
<script>enable_altpkgrepourl();</script> |
|
115 |
<tr> |
|
116 |
<td width="22%" valign="top"> </td> |
|
117 |
<td width="78%"> |
|
118 |
<input name="Submit" type="submit" class="formbtn" value="Save"> |
|
119 |
</td> |
|
120 |
</tr> |
|
121 |
</table></div></td></tr></table> |
|
122 |
</form> |
|
123 |
<?php include("fend.inc"); ?> |
|
124 |
</body> |
|
125 |
</html> |
Also available in: Unified diff
Add the actual settings page ref'd in the previous commit (pkg repo setting)