NOTE: If you are a developer, please use a private wiki based on foswiki/trunk on a daily base ...or use trunk.foswiki.org to view this page for some minimal testing.
Use Item11383 for general documentation changes for release 1.1.5. Use Item9693 for docu changes for release 2.0.

Item2120: Use of uninitialized value $loginName in hash element at /var/www/twiki/lib/Foswiki/Users/LdapUserMapping.pm line 160.

Priority: CurrentState: AppliesTo: Component: WaitingFor:
Normal No Action Required Extension LdapContrib  
Hi!

With this cronjob for notifications:

0   */2  * * * (cd /var/www/twiki/tools/;  perl -I bin ./mailnotify -q)

I recieve this email, each two hours:

subject   Cron <root@my_machine> (cd /var/www/twiki/tools/; perl -I bin ./mailnotify -q)

Use of uninitialized value $loginName in hash element at /var/www/twiki/lib/Foswiki/Users/LdapUserMapping.pm line 160.
Use of uninitialized value $wikiName in concatenation (.) or string at /var/www/twiki/lib/Foswiki/Users/LdapUserMapping.pm line 176.

I searched the value of $loginName, and it was AdminGroup.

Modifying /lib/Foswiki/Engine/CLI.pm this way solves the problem:

sub prepareHeaders {
    my ( $this, $req ) = @_;
    if ( defined $this->{user} ) {
        $req->remoteUser( $this->{user} );
        delete $this->{user};
    }
    else {
#        $req->remoteUser( $Foswiki::cfg{SuperAdminGroup} );
        $req->remoteUser( $Foswiki::cfg{AdminUserWikiName} );
    }
}

  • mypatch.diff: Replace $req->remoteUser( $Foswiki::cfg{SuperAdminGroup} ); with $req->remoteUser( $Foswiki::cfg{AdminUserWikiName} );

-- EduardoJ - 20 Sep 2009

i presume that Micha should see this to confirm that its gone?

-- SvenDowideit - 29 Jun 2010

According to Foswiki.spec

$Foswiki::cfg{AdminUserWikiName} = 'AdminUser';
$Foswiki::cfg{SuperAdminGroup} = 'AdminGroup';

Both settings should always be defined. Both settings should be okay, that is it is okay to use the AdminGroup as a user. AdminUser should always be member of the AdminGroup as defined in the BaseMapper.

The code lines mentioned above are rather unlikely to run into an undef, e.g. the wikiName defaults to the loginName if it is undefined. The coed never reaches wikiName if even loginName can't be derived from a cUID.

Eduardo, can yo please attach your version of LdapUserMapping.pm. In any case check for updates. Maybe you are using a rather old version of LdapContrib.

-- MichaelDaum - 30 Jun 2010

Closing this due to lack of feedback. Sorry.

-- MichaelDaum - 04 Nov 2010

ItemTemplate edit

Summary Use of uninitialized value $loginName in hash element at /var/www/twiki/lib/Foswiki/Users/LdapUserMapping.pm line 160.
ReportedBy EduardoJ
Codebase 1.0.5
SVN Range SVN 5053: Foswiki-1.1.0-dev, Thu, 03 Sep 2009, build 4764
AppliesTo Extension
Component LdapContrib
Priority Normal
CurrentState No Action Required
WaitingFor
Checkins 14
TargetRelease n/a
ReleasedIn n/a
Topic attachments
I Attachment Action Size Date Who Comment
mypatch.diffdiff mypatch.diff manage 0.4 K 20 Sep 2009 - 21:04 EduardoJ Replace $req->remoteUser( $Foswiki::cfg{SuperAdminGroup} ); with $req->remoteUser( $Foswiki::cfg{AdminUserWikiName} );
Topic revision: r4 - 04 Nov 2010 - 16:01:33 - MichaelDaum
 
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. see CopyrightStatement. Creative Commons LicenseGet Foswiki at sourceforge.net. Fast, secure and Free Open Source software downloads