Project

General

Profile

Download (4.77 KB) Statistics
| Branch: | Tag: | Revision:
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 5259553e Colin Fleming
$closehead = false;
62 9a1e70df Carlos Eduardo Ramos
$pgtitle = array(gettext("System"),gettext("Package Settings"));
63 013a5d79 jim-p
include("head.inc");
64
?>
65 5259553e Colin Fleming
<script type="text/javascript">
66
//<![CDATA[
67 013a5d79 jim-p
68
function enable_altpkgrepourl(enable_over) {
69
	if (document.iform.alturlenable.checked || enable_over) {
70
		document.iform.pkgrepourl.disabled = 0;
71
	} else {
72
		document.iform.pkgrepourl.disabled = 1;
73
	}
74
}
75
76 5259553e Colin Fleming
//]]>
77 013a5d79 jim-p
</script>
78 5259553e Colin Fleming
</head>
79 013a5d79 jim-p
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
80
<?php include("fbegin.inc");?>
81
<?php if ($input_errors) print_input_errors($input_errors); ?>
82
83
<form action="pkg_mgr_settings.php" method="post" name="iform" id="iform">
84
            <?php if ($savemsg) print_info_box($savemsg); ?>
85 5259553e Colin Fleming
              <table width="100%" border="0" cellpadding="0" cellspacing="0" summary="package manager settings">
86 013a5d79 jim-p
	<tr>
87
		<td>
88
<?php
89
	$version = file_get_contents("/etc/version");
90
	$tab_array = array();
91 eb9116e9 Carlos Eduardo Ramos
	$tab_array[] = array(sprintf(gettext("%s packages"), $version), false, "pkg_mgr.php");
92 f65227b9 Vinicius Coque
	$tab_array[] = array(gettext("Installed Packages"), false, "pkg_mgr_installed.php");
93
	$tab_array[] = array(gettext("Package Settings"), true, "pkg_mgr_settings.php");
94 013a5d79 jim-p
	display_top_tabs($tab_array);
95
?>
96
		</td>
97
	</tr>
98 5259553e Colin Fleming
	<tr><td><div id="mainarea">
99
	      <table class="tabcont" width="100%" border="0" cellpadding="6" cellspacing="0" summary="main area">
100 013a5d79 jim-p
	<tr>
101 f65227b9 Vinicius Coque
		<td colspan="2" valign="top" class="listtopic"><?=gettext("Package Repository URL");?></td>
102 013a5d79 jim-p
	</tr>
103
	<tr>
104 f65227b9 Vinicius Coque
		<td valign="top" class="vncell"><?=gettext("Package Repository URL");?></td>
105 013a5d79 jim-p
		<td class="vtable">
106 5259553e Colin Fleming
			<input name="alturlenable" type="checkbox" id="alturlenable" value="yes" onclick="enable_altpkgrepourl()" <?php if(isset($curcfg['enable'])) echo "checked=\"checked\""; ?> /> <?=gettext("Use a different URL server for packages other than");?> <?php echo $g['product_website']; ?><br/>
107
			<table summary="alternative URL">
108
			<tr><td><?=gettext("Base URL:");?></td><td><input name="pkgrepourl" type="text" class="formfld url" id="pkgrepourl" size="64" value="<?php if($curcfg['xmlrpcbaseurl']) echo $curcfg['xmlrpcbaseurl']; else echo $g['']; ?>" /></td></tr>
109 013a5d79 jim-p
			</table>
110
			<span class="vexpl">
111 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.");?>
112 013a5d79 jim-p
				</span>
113
				</td>
114
	</tr>
115 5259553e Colin Fleming
	<script type="text/javascript">
116
	//<![CDATA[
117
	enable_altpkgrepourl();
118
	//]]>
119
	</script>
120 013a5d79 jim-p
                <tr>
121
                  <td width="22%" valign="top">&nbsp;</td>
122
                  <td width="78%">
123 5259553e Colin Fleming
                    <input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" />
124 013a5d79 jim-p
                  </td>
125
                </tr>
126
              </table></div></td></tr></table>
127
</form>
128
<?php include("fend.inc"); ?>
129
</body>
130
</html>