From 33811265e9f10f011f82944dd08978515c164b59 Mon Sep 17 00:00:00 2001 From: George Clark Date: Tue, 1 Mar 2016 19:23:20 -0500 Subject: [PATCH] Item13999: Remove the overwrite User Topic option It doesn't work, and there are multiple issues. Looking at the code, this appears to have been broken as far back as Foswiki 1.0.9 --- .../data/System/BulkRegistration.txt | 6 +----- .../data/System/BulkRegistrationInputViewTemplate.txt | 3 +-- core/lib/Foswiki/UI/Register.pm | 10 +--------- 3 files changed, 3 insertions(+), 16 deletions(-) diff --git a/TopicUserMappingContrib/data/System/BulkRegistration.txt b/TopicUserMappingContrib/data/System/BulkRegistration.txt index 4198272764..2cb31b54a1 100644 --- a/TopicUserMappingContrib/data/System/BulkRegistration.txt +++ b/TopicUserMappingContrib/data/System/BulkRegistration.txt @@ -1,4 +1,4 @@ -%META:TOPICINFO{author="ProjectContributor" comment="" date="1456768091" format="1.1" version="1"}% +%META:TOPICINFO{author="ProjectContributor" comment="" date="1456877772" format="1.1" version="1"}% %META:TOPICPARENT{name="AdminToolsCategory"}% ---+ Bulk Registration @@ -27,9 +27,6 @@ Below are the details. * Set REGISTERTOPIC = %USERSWEB%.UnprocessedRegistrations * Use this to define where to log the bulk registration process. It will be saved to the %USERSWEB% web. * Set LOGTOPIC = %REGISTERTOPIC%Log - * Set this to 1 to make the bulk registration overwrite any existing user - topics. By default, existing user topics are left alone. - * Set OVERWRITEHOMETOPICS = 0 ---++ The user table @@ -107,7 +104,6 @@ Make sure that the extra fields also appear on the %SYSTEMWEB%.UserForm.   - ---++ %REGISTERTOPIC% diff --git a/TopicUserMappingContrib/data/System/BulkRegistrationInputViewTemplate.txt b/TopicUserMappingContrib/data/System/BulkRegistrationInputViewTemplate.txt index ba86308ebb..c7e6bf188b 100644 --- a/TopicUserMappingContrib/data/System/BulkRegistrationInputViewTemplate.txt +++ b/TopicUserMappingContrib/data/System/BulkRegistrationInputViewTemplate.txt @@ -1,4 +1,4 @@ -%META:TOPICINFO{author="ProjectContributor" date="1456871285" format="1.1" version="1"}% +%META:TOPICINFO{author="ProjectContributor" date="1456877772" format="1.1" version="1"}% %META:TOPICPARENT{name="BulkRegister"}% %{ =================================================== @@ -24,7 +24,6 @@
-Overwrite home topics? " else="
*Bulk registration is restricted to Administrators.*
"}% diff --git a/core/lib/Foswiki/UI/Register.pm b/core/lib/Foswiki/UI/Register.pm index 298a3b64d6..20379078f5 100755 --- a/core/lib/Foswiki/UI/Register.pm +++ b/core/lib/Foswiki/UI/Register.pm @@ -361,9 +361,6 @@ sub bulkRegister { my $settings = {}; - # This gets set from the value in the BulkRegistrations topic - $settings->{doOverwriteTopics} = $query->param('OverwriteHomeTopics') || 0; - unless ( $session->{users}->isAdmin($user) ) { throw Foswiki::OopsException( 'accessdenied', @@ -473,9 +470,6 @@ sub _registerSingleBulkUser { my ( $session, $fieldNames, $row, $settings ) = @_; ASSERT($row) if DEBUG; - my $doOverwriteTopics = defined $settings->{doOverwriteTopics} - || throw Error::Simple('No doOverwriteTopics'); - my $log = "---++ Registering $row->{WikiName}\n"; #-- Ensure every required field exists @@ -530,9 +524,7 @@ sub _registerSingleBulkUser { $log .= "$b1 $row->{WikiName} has been added to the password and user mapping managers\n"; - if ( $settings->{doOverwriteTopics} - || !$session->topicExists( $row->{webName}, $row->{WikiName} ) ) - { + if ( !$session->topicExists( $row->{webName}, $row->{WikiName} ) ) { $log .= _createUserTopic( $session, $row ); } else {