Skip to content

Commit

Permalink
Item14548: fix parsing and formating registration times
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDaum committed Nov 9, 2020
1 parent 9b42ccd commit 68c2ebc
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions TopicUserMappingContrib/lib/Foswiki/Users/TopicUserMapping.pm
Original file line number Diff line number Diff line change
Expand Up @@ -376,8 +376,7 @@ sub _maintainUsersTopic {
$entry .= $login . " - " if $login;

my $today =
Foswiki::Time::formatTime( time(), $Foswiki::cfg{DefaultDateFormat},
'gmtime' );
Foswiki::Time::formatTime( time(), '$day $mon $year', 'gmtime' );

my $user;

Expand Down Expand Up @@ -1347,7 +1346,7 @@ sub getEmails {

=begin TML
---++ ObjectMethod getRegistrationDate($name) -> @emailAddress
---++ ObjectMethod getRegistrationDate($name) -> $epoch
returns the date this user has registered.
Expand Down Expand Up @@ -1636,6 +1635,7 @@ sub _cacheUser {
ASSERT($wikiname) if DEBUG;

$login ||= $wikiname;
$date ||= time;

#discard users that are the BaseUserMapper's responsibility
return
Expand All @@ -1646,6 +1646,8 @@ sub _cacheUser {
return unless ($cUID);
ASSERT($cUID) if DEBUG;

$date = Foswiki::Time::parseTime($date) unless $date =~ /^\d+$/;

#$this->{U2L}->{$cUID} = $login;
$this->{U2W}->{$cUID} = $wikiname;
$this->{L2U}->{$login} = $cUID;
Expand Down Expand Up @@ -1675,9 +1677,6 @@ sub _getListOfGroups {
my $users = $this->{session}->{users};
$this->{groupsList} = [];

#create a MetaCache _before_ we do silly things with the session's users
$this->{session}->search->metacache();

# Temporarily set the user to admin, otherwise it cannot see groups
# where %USERSWEB% is protected from view
local $this->{session}->{user} = $Foswiki::cfg{SuperAdminGroup};
Expand Down

0 comments on commit 68c2ebc

Please sign in to comment.