Item1805: Foswiki Validation Method 'none' doesn't work propperly
Priority: Urgent
Current State: Closed
Released In: 1.0.7
Target Release: patch
Applies To: Engine
Component:
Branches:
When saving a topic, Foswiki dies in an infinite rewrite loop requesting Confirmation, even thought we set Validation to 'none':
$Foswiki::cfg{Validation}{Method} = 'none';
We authenticate against Ldap using:
- LoginManager: LdapApacheLogin
- PasswordManager: LdapPasswdUser
- UserMappingManager: LdapUserMapping
Proposed patch from Babar:
diff --git a/core/lib/Foswiki/UI.pm b/core/lib/Foswiki/UI.pm
index 90ff428..751dc17 100644
--- a/core/lib/Foswiki/UI.pm
+++ b/core/lib/Foswiki/UI.pm
@@ -521,6 +521,9 @@ See Foswiki::Validation for more information.
sub checkValidationKey {
my ($session) = @_;
+ # If validation is disabled, do nothing
+ return if ( $Foswiki::cfg{Validation}{Method} eq 'none' );
+
# Check the nonce before we do anything else
my $nonce = $session->{request}->param('validation_key');
$session->{request}->delete('validation_key');
diff --git a/core/lib/Foswiki/Validation.pm b/core/lib/Foswiki/Validation.pm
index 239a2e6..e04b813 100644
--- a/core/lib/Foswiki/Validation.pm
+++ b/core/lib/Foswiki/Validation.pm
@@ -163,9 +163,9 @@ Return false if not.
sub isValidNonce {
my ( $cgis, $nonce ) = @_;
- print STDERR "V: CHECK: $nonce\n" if TRACE;
return 1 if ( $Foswiki::cfg{Validation}{Method} eq 'none' );
return 0 unless defined $nonce;
+ print STDERR "V: CHECK: $nonce\n" if TRACE;
my $actions = $cgis->param('VALID_ACTIONS');
return 0 unless ref($actions) eq 'HASH';
return $actions->{$nonce};
--
Babar
Looks reasonable.
--
CrawfordCurrie - 13 Jul 2009
Ok, so I've committed it.
--
Babar - 13 Jul 2009