You are here: Foswiki>Tasks Web>Item14098 (18 Feb 2017, GeorgeClark)Edit Attach

Item14098: Approve User Registration should not require Verify User Registration.

pencil
Priority: Normal
Current State: Closed
Released In: 2.1.3
Target Release: patch
Applies To: Engine
Component: FoswikiUIRegister
Branches: Release02x01 master Item13897
Reported By: DavidRimmer
Waiting For:
Last Change By: GeorgeClark
With Approve User Registration set but not Verify User Registration, the new user is approved immediately.

Thinking about it, it makes sense to have the new user verify their email address before requesting approval. Therefore I've set verify on to fix the issue for me.

Perhaps setting approval on should force verify on?

"This site is running Foswiki version v2.1.2, Release Foswiki-2.1.2, Plugin API version 2.4"

-- DavidRimmer - 15 Jun 2016

The following patch appears to resolve the issue. It needs more testing, but worked for me.
diff --git a/core/lib/Foswiki/UI/Register.pm b/core/lib/Foswiki/UI/Register.pm
index 03d71b1..41f6074 100755
--- a/core/lib/Foswiki/UI/Register.pm
+++ b/core/lib/Foswiki/UI/Register.pm
@@ -134,6 +134,15 @@ sub _action_register {
         _requireConfirmation( $session, $data, 'Verification', 'confirm',
             $data->{Email} );
     }
+   elsif ( $Foswiki::cfg{Register}{NeedApproval} ) {
+        my $query = $session->{request};
+        my $data = _getDataFromQuery( $session->{users}, $query );
+        $data->{FirstLastName} = $data->{Name};
+        my $approvers = $Foswiki::cfg{Register}{Approvers}
+          || $Foswiki::cfg{AdminUserWikiName};
+        _requireConfirmation( $session, $data, 'Approval', 'approve',
+            $approvers );
+    }
     else {
 
         # No need for confirmation

-- GeorgeClark - 17 Jun 2016

That's exactly what I would have done.

-- CrawfordCurrie - 17 Jun 2016

Needs some unit tests. I've had trouble coming up with one. Manual testing shows it works fine.

-- Main.GeorgeClark - 27 Jun 2016 - 01:59
 

ItemTemplate edit

Summary Approve User Registration should not require Verify User Registration.
ReportedBy DavidRimmer
Codebase 2.1.2, 2.1.1, 2.1.0, 2.1.0 beta1, 2.0.3, 2.0.2, 2.0.1, 2.0.0
SVN Range
AppliesTo Engine
Component FoswikiUIRegister
Priority Normal
CurrentState Closed
WaitingFor
Checkins distro:a2440648bb7d
TargetRelease patch
ReleasedIn 2.1.3
CheckinsOnBranches Release02x01 master Item13897
trunkCheckins
masterCheckins distro:a2440648bb7d
ItemBranchCheckins distro:a2440648bb7d
Release02x01Checkins distro:a2440648bb7d
Release02x00Checkins
Release01x01Checkins
Topic revision: r7 - 18 Feb 2017, GeorgeClark - This page was cached on 24 Sep 2017 - 07:33.

The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License