Projet

Général

Profil

Télécharger (4,72 ko) Statistiques
| Branche: | Tag: | Révision:

univnautes / usr / local / www / pkg_mgr_settings.php @ 0fab7eb1

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) 2004-2010 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
ini_set('max_execution_time', '0');
43

    
44
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
$closehead = false;
62
$pgtitle = array(gettext("System"),gettext("Package Settings"));
63
include("head.inc");
64
?>
65
<script type="text/javascript">
66
//<![CDATA[
67

    
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
//]]>
77
</script>
78
</head>
79
<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
              <table width="100%" border="0" cellpadding="0" cellspacing="0" summary="package manager settings">
86
	<tr>
87
		<td>
88
<?php
89
	$version = file_get_contents("/etc/version");
90
	$tab_array = array();
91
	$tab_array[] = array(sprintf(gettext("%s packages"), $version), false, "pkg_mgr.php");
92
	$tab_array[] = array(gettext("Installed Packages"), false, "pkg_mgr_installed.php");
93
	$tab_array[] = array(gettext("Package Settings"), true, "pkg_mgr_settings.php");
94
	display_top_tabs($tab_array);
95
?>
96
		</td>
97
	</tr>
98
	<tr><td><div id="mainarea">
99
	      <table class="tabcont" width="100%" border="0" cellpadding="6" cellspacing="0" summary="main area">
100
	<tr>
101
		<td colspan="2" valign="top" class="listtopic"><?=gettext("Package Repository URL");?></td>
102
	</tr>
103
	<tr>
104
		<td valign="top" class="vncell"><?=gettext("Package Repository URL");?></td>
105
		<td class="vtable">
106
			<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 />
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
			</table>
110
			<span class="vexpl">
111
				<?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
				</span>
113
				</td>
114
	</tr>
115
	<script type="text/javascript">
116
	//<![CDATA[
117
	enable_altpkgrepourl();
118
	//]]>
119
	</script>
120
                <tr>
121
                  <td width="22%" valign="top">&nbsp;</td>
122
                  <td width="78%">
123
                    <input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" />
124
                  </td>
125
                </tr>
126
              </table></div></td></tr></table>
127
</form>
128
<?php include("fend.inc"); ?>
129
</body>
130
</html>
(133-133/254)