1
# See bottom of file for license and copyright information
3
package Foswiki::Configure::UIs::UPDATE;
4
use base 'Foswiki::Configure::UI';
8
use Foswiki::Configure::UI;
9
use Foswiki::Configure::FoswikiCfg;
12
my ( $this, $root, $valuer, $updated ) = @_;
15
$this->{updated} = $updated;
17
$this->{output} = CGI::h2('Updating configuration');
22
if ( defined $Foswiki::query ) {
23
$this->{user} = $Foswiki::query->remote_user() || '';
26
Foswiki::Configure::FoswikiCfg::save( $root, $valuer, $this );
28
if ( $this->{log} && defined( $Foswiki::cfg{ConfigurationLogName} ) ) {
29
# configuration variable may be coming from POST, and might thus
30
# be tainted, we must be able to trust that the adminstrator has
31
# input a proper path and therefore untaint rigourously
32
# NOTE: this assumes configure is properly hardened through the web
33
# server as instructed in the fine manual!
34
$Foswiki::cfg{ConfigurationLogName} =~ /^(.*)$/;
35
$Foswiki::cfg{ConfigurationLogName} = $1;
36
if ( open( F, '>>', $Foswiki::cfg{ConfigurationLogName} ) ) {
42
# Put in a link to the front page of the Foswiki
44
"$Foswiki::cfg{DefaultUrlHost}$Foswiki::cfg{ScriptUrlPath}/view$Foswiki::cfg{ScriptSuffix}/";
48
. CGI::strong( 'Setting '
50
. ' configuration item'
51
. ( ( $this->{changed} == 1 ) ? '' : 's' )
54
. CGI::a( { href => $url }, "Go to the Foswiki front page" ) . " or ";
57
# Listener for when a saved configuration item is changed.
59
my ( $this, $keys, $value ) = @_;
61
if ( $this->{updated}->{$keys} ) {
62
$this->{output} .= CGI::h3($keys) . CGI::code($value);
66
. $this->{user} . ' | '
75
# Foswiki - The Free and Open Source Wiki, http://foswiki.org/
77
# Copyright (C) 2008 Foswiki Contributors. All Rights Reserved.
78
# Foswiki Contributors are listed in the AUTHORS file in the root
79
# of this distribution. NOTE: Please extend that file, not this notice.
81
# Additional copyrights apply to some or all of the code in this
84
# Copyright (C) 2000-2006 TWiki Contributors. All Rights Reserved.
85
# TWiki Contributors are listed in the AUTHORS file in the root
86
# of this distribution. NOTE: Please extend that file, not this notice.
88
# This program is free software; you can redistribute it and/or
89
# modify it under the terms of the GNU General Public License
90
# as published by the Free Software Foundation; either version 2
91
# of the License, or (at your option) any later version. For
92
# more details read LICENSE in the root of this distribution.
94
# This program is distributed in the hope that it will be useful,
95
# but WITHOUT ANY WARRANTY; without even the implied warranty of
96
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
98
# As per the GPL, removal of this notice is prohibited.