Item2120: Use of uninitialized value $loginName in hash element at /var/www/twiki/lib/Foswiki/Users/LdapUserMapping.pm line 160.
Priority: Normal
Current State: No Action Required
Released In: n/a
Target Release: n/a
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