• Do not register here on develop.twiki.org, login with your twiki.org account.
• Use View topic Item7848 for generic doc work for TWiki-6.1.1. Use View topic Item7851 for doc work on extensions that are not part of a release. More... Close
• Anything you create or change in standard webs (Main, TWiki, Sandbox etc) will be automatically reverted on every SVN update.
Does this site look broken?. Use the LitterTray web for test cases.

Item5892: Registration with verification fails in 4.2.1

Item Form Data

AppliesTo: Component: Priority: CurrentState: WaitingFor: TargetRelease ReleasedIn
Engine   Urgent Closed   patch 4.2.2, 5.0.0

Edit Form Data

Summary:
Reported By:
Codebase:
Applies To:
Component:
Priority:
Current State:
Waiting For:
Target Release:
Released In:
 

Detail

Registration with verification fails in 4.2.1

In TWiki::UI::Register.pm, line 1195, it says:

throw Error::Simple("bad code") unless $code =~ /^(\w+)\.(\d+)$/;

but the verification code contains characters, so the (\d+) fails.

The reason is the password function that is used to generate random passwords used to return only numbers (why?) but now returns a wider range of printable characters, including dots. note that this can also result in an illegal filename for the verification code file.

The password function should never have been used for this application. The verification code should have been generated using a random number generator. The following patch cures the problem.

 Index: lib/TWiki/UI/Register.pm
===================================================================
--- lib/TWiki/UI/Register.pm    (revision 17344)
+++ lib/TWiki/UI/Register.pm    (working copy)
@@ -379,7 +379,7 @@
 
     require TWiki::Users;
     $data->{VerificationCode} =
-      $data->{WikiName}.'.'.TWiki::Users::randomPassword();
+      $data->{WikiName}.'.'.int(rand(99999999));
 
     require Data::Dumper;

-- TWiki:Main/CrawfordCurrie - 06 Aug 2008

unit tests need updating - doing now.

-- SvenDowideit - 09 Aug 2008

ItemTemplate
Summary Registration with verification fails in 4.2.1
ReportedBy TWiki:Main.CrawfordCurrie
Codebase 4.2.1
SVN Range TWiki-5.0.0, Sun, 03 Aug 2008, build 17280
AppliesTo Engine
Component

Priority Urgent
CurrentState Closed
WaitingFor

Checkins TWikirev:17354 TWikirev:17355 TWikirev:17356 TWikirev:17370 TWikirev:17371 TWikirev:17372 TWikirev:17373
TargetRelease patch
ReleasedIn 4.2.2, 5.0.0
Edit | Attach | Watch | Print version | History: r12 < r11 < r10 < r9 < r8 | Backlinks | Raw View |  Raw edit | More topic actions
Topic revision: r12 - 2008-08-11 - SvenDowideit
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback