Project

General

Profile

Download (5.77 KB) Statistics
| Branch: | Tag: | Revision:
1 013a5d79 jim-p
<?php
2
/* $Id$ */
3
/*
4
	pkg_mgr_settings.php
5
	part of pfSense
6 ce77a9c4 Phil Davis
	Copyright (C) 2013-2015 Electric Sheep Fencing, LP
7 013a5d79 jim-p
	Copyright (C) 2009 Jim Pingle <jimp@pfsense.org>
8 ce77a9c4 Phil Davis
	Copyright (C) 2004-2010 Scott Ullrich <sullrich@gmail.com>
9
	Copyright (C) 2005 Colin Smith
10 013a5d79 jim-p
11
	Redistribution and use in source and binary forms, with or without
12
	modification, are permitted provided that the following conditions are met:
13
14
	1. Redistributions of source code must retain the above copyright notice,
15
	   this list of conditions and the following disclaimer.
16
17
	2. Redistributions in binary form must reproduce the above copyright
18
	   notice, this list of conditions and the following disclaimer in the
19
	   documentation and/or other materials provided with the distribution.
20
21
	THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
22
	INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
23
	AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
24
	AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
25
	OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26
	SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27
	INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28
	CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29
	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30
	POSSIBILITY OF SUCH DAMAGE.
31
*/
32
/*
33
	pfSense_MODULE:	pkgs
34
*/
35
36
##|+PRIV
37
##|*IDENT=page-pkg-mgr-settings
38
##|*NAME=Packages: Settings page
39
##|*DESCR=Allow access to the 'Packages: Settings' page.
40
##|*MATCH=pkg_mgr_settings.php*
41
##|-PRIV
42
43 0089af7c Scott Ullrich
ini_set('max_execution_time', '0');
44
45 013a5d79 jim-p
require_once("globals.inc");
46
require_once("guiconfig.inc");
47
require_once("pkg-utils.inc");
48
49
if ($_POST) {
50
	if (!$input_errors) {
51
		if($_POST['alturlenable'] == "yes") {
52
			$config['system']['altpkgrepo']['enable'] = true;
53
			$config['system']['altpkgrepo']['xmlrpcbaseurl'] = $_POST['pkgrepourl'];
54
		} else {
55
			unset($config['system']['altpkgrepo']['enable']);
56
		}
57
		write_config();
58
	}
59
}
60
61
$curcfg = $config['system']['altpkgrepo'];
62 5259553e Colin Fleming
$closehead = false;
63 9a1e70df Carlos Eduardo Ramos
$pgtitle = array(gettext("System"),gettext("Package Settings"));
64 013a5d79 jim-p
include("head.inc");
65
?>
66 5259553e Colin Fleming
<script type="text/javascript">
67
//<![CDATA[
68 013a5d79 jim-p
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 5259553e Colin Fleming
//]]>
78 013a5d79 jim-p
</script>
79 5259553e Colin Fleming
</head>
80 013a5d79 jim-p
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
81 7c8f3711 jim-p
<?php include("fbegin.inc");
82
83
	/* Print package server mismatch warning. See https://redmine.pfsense.org/issues/484 */
84
	if (!verify_all_package_servers())
85 e860ec1d jim-p
		print_info_box(package_server_mismatch_message()); 
86 7c8f3711 jim-p
87 6916360e jim-p
	/* Print package server SSL warning. See https://redmine.pfsense.org/issues/484 */
88
	if (check_package_server_ssl() === false)
89 e860ec1d jim-p
		print_info_box(package_server_ssl_failure_message()); ?>
90 6916360e jim-p
91 013a5d79 jim-p
<?php if ($input_errors) print_input_errors($input_errors); ?>
92
93
<form action="pkg_mgr_settings.php" method="post" name="iform" id="iform">
94
            <?php if ($savemsg) print_info_box($savemsg); ?>
95 5259553e Colin Fleming
              <table width="100%" border="0" cellpadding="0" cellspacing="0" summary="package manager settings">
96 013a5d79 jim-p
	<tr>
97
		<td>
98
<?php
99
	$version = file_get_contents("/etc/version");
100
	$tab_array = array();
101 eb9116e9 Carlos Eduardo Ramos
	$tab_array[] = array(sprintf(gettext("%s packages"), $version), false, "pkg_mgr.php");
102 f65227b9 Vinicius Coque
	$tab_array[] = array(gettext("Installed Packages"), false, "pkg_mgr_installed.php");
103
	$tab_array[] = array(gettext("Package Settings"), true, "pkg_mgr_settings.php");
104 013a5d79 jim-p
	display_top_tabs($tab_array);
105
?>
106
		</td>
107
	</tr>
108 5259553e Colin Fleming
	<tr><td><div id="mainarea">
109
	      <table class="tabcont" width="100%" border="0" cellpadding="6" cellspacing="0" summary="main area">
110 7c8f3711 jim-p
	<tr>
111
		<td colspan="2" valign="top" class="vncell">
112
			<?PHP echo gettext("This page allows an alternate package repository to be configured, primarily for temporary use as a testing mechanism."); ?>
113
			<?PHP echo gettext("The contents of unofficial packages servers cannot be verified and may contain malicious files."); ?>
114
			<?PHP echo gettext("The package server settings should remain at their default values to ensure that verifiable and trusted packages are recevied."); ?>
115
			<br/><br/>
116
			<?PHP echo gettext("A warning is printed on the Dashboard and in the package manager when an unofficial package server is in use."); ?>
117
			<br/><br/>
118
		</td>
119
	</tr>
120 013a5d79 jim-p
	<tr>
121 f65227b9 Vinicius Coque
		<td colspan="2" valign="top" class="listtopic"><?=gettext("Package Repository URL");?></td>
122 013a5d79 jim-p
	</tr>
123
	<tr>
124 f65227b9 Vinicius Coque
		<td valign="top" class="vncell"><?=gettext("Package Repository URL");?></td>
125 013a5d79 jim-p
		<td class="vtable">
126 8cd558b6 ayvis
			<input name="alturlenable" type="checkbox" id="alturlenable" value="yes" onclick="enable_altpkgrepourl()" <?php if(isset($curcfg['enable'])) echo "checked=\"checked\""; ?> /> <?=gettext("Use a non-official server for packages");?> <br />
127 5259553e Colin Fleming
			<table summary="alternative URL">
128
			<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>
129 013a5d79 jim-p
			</table>
130
			<span class="vexpl">
131 3b5b437b Chris Buechler
				<?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.");?>
132 013a5d79 jim-p
				</span>
133
				</td>
134
	</tr>
135 5259553e Colin Fleming
	<script type="text/javascript">
136
	//<![CDATA[
137
	enable_altpkgrepourl();
138
	//]]>
139
	</script>
140 013a5d79 jim-p
                <tr>
141
                  <td width="22%" valign="top">&nbsp;</td>
142
                  <td width="78%">
143 5259553e Colin Fleming
                    <input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" />
144 013a5d79 jim-p
                  </td>
145
                </tr>
146
              </table></div></td></tr></table>
147
</form>
148
<?php include("fend.inc"); ?>
149
</body>
150
</html>