1
# See bottom of file for license and copyright information
3
package Foswiki::Configure::UIs::AUTH;
7
use Foswiki::Configure::UI;
9
use base 'Foswiki::Configure::UI';
18
my ( $this, $canChangePW, $actionMess ) = @_;
21
my @script = File::Spec->splitdir( $ENV{SCRIPT_NAME} );
22
my $scriptName = pop(@script);
23
$scriptName =~ s/.*[\/\\]//; # Fix for Item3511, on Win XP
25
$output .= CGI::start_form( { name => 'twiki_configure', action => $scriptName, method => 'post' } );
27
# Pass URL params through, except those below
28
foreach my $param ( $Foswiki::query->param ) {
29
next if ( $nonos{$param} );
30
$output .= $this->hidden( $param, $Foswiki::query->param($param) );
35
$output .= "<div id ='twikiPassword'><div class='foswikiFormSteps'>\n";
37
$output .= CGI::div( { class => 'foswikiFormStep' },
38
CGI::h3('Enter the configuration password') );
41
{ class => 'foswikiFormStep' },
42
CGI::h3( CGI::strong("Your Password:") )
44
CGI::password_field( -name=>'cfgAccess', -size =>20, -maxlength=>80, -class => 'foswikiInputField' )
47
-class => 'foswikiSubmit',
53
if ( $Foswiki::cfg{Password} ne '' ) {
55
{ class => 'foswikiFormStep' },
56
CGI::p( CGI::strong('Forgotten your password?') )
58
To reset the password, log in to the server and delete the
59
<code>$Foswiki::cfg{Password} = '...';</code> line from
60
<code>lib/LocalSite.cfg</code>
64
$output .= '</div><!--/foswikiFormSteps--></div><!--/twikiPassword-->';
68
"<div id='twikiPasswordChange'><div class='foswikiFormSteps'>\n";
69
$output .= '<div class="foswikiNotification" style="margin:1em;">';
75
. '?action=image;image=warning.gif;type=image/gif',
80
. CGI::span( { class => 'foswikiAlert' },
81
CGI::strong('Notes on Security') );
85
If you don't set a password, or the password is cracked, then
86
<code>configure</code> could be used to do <strong>very</strong> nasty
87
things to your server.
90
If you are running Foswiki on a public website, you are
91
<strong>strongly</strong> advised to totally disable saving from
92
<code>configure</code> by making <code>lib/LocalSite.cfg</code> readonly once
93
you are happy with your configuration.
96
</div><!--expanation-->
99
my $submitStr = $actionMess;
101
{ class => 'foswikiFormStep' },
103
{ class => 'foswikiFormStep' },
104
'You may set a new password here:'
108
{ class => 'foswikiFormStep' },
109
CGI::strong('New Password:')
110
. CGI::p( CGI::password_field( -name=>'newCfgP', -size=>20, -maxlength=>80, -class => 'foswikiInputField' ) )
113
{ class => 'foswikiFormStep' },
114
CGI::strong('Confirm Password:')
115
. CGI::p( CGI::password_field( -name=>'confCfgP', size=>20, -maxlength=>80, -class => 'foswikiInputField' ) )
117
$submitStr = 'Change Password and ' . $submitStr;
118
$output .= CGI::div( { class => 'foswikiFormStep foswikiLast' },
119
CGI::submit( -class => 'foswikiSubmit', -value => $submitStr ) );
121
"</div><!--/foswikiFormSteps--></div><!--/twikiPasswordChange-->";
124
return $output . CGI::end_form();
130
# Foswiki - The Free and Open Source Wiki, http://foswiki.org/
132
# Copyright (C) 2008 Foswiki Contributors. All Rights Reserved.
133
# Foswiki Contributors are listed in the AUTHORS file in the root
134
# of this distribution. NOTE: Please extend that file, not this notice.
136
# Additional copyrights apply to some or all of the code in this
139
# Copyright (C) 2000-2006 TWiki Contributors. All Rights Reserved.
140
# TWiki Contributors are listed in the AUTHORS file in the root
141
# of this distribution. NOTE: Please extend that file, not this notice.
143
# This program is free software; you can redistribute it and/or
144
# modify it under the terms of the GNU General Public License
145
# as published by the Free Software Foundation; either version 2
146
# of the License, or (at your option) any later version. For
147
# more details read LICENSE in the root of this distribution.
149
# This program is distributed in the hope that it will be useful,
150
# but WITHOUT ANY WARRANTY; without even the implied warranty of
151
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
153
# As per the GPL, removal of this notice is prohibited.