From: chromatic <chr...@rm...> - 2001-11-19 17:33:23
|
On Monday 19 November 2001 10:18, Scott Johnson wrote: > When I look inside the code of the mySQL call, I see this on line 597 of > MySQL.pm: > > my($self, $user, $passwd, $kind) = @_; > > then this on line 601: > > return unless $user && $passwd; > So, it seems to me that when I only feed it two arguments, it will never > see $passwd (because the values I fed it got stored in $self and $user > instead) and therefore never authenticate. Is this correct? No. $slashdb->getUserAuthenticate( @args ) is a method call. $slashdb is automatically passed as the first argument. I could point you to the relevant source code in perl itself, but I don't want to scare you. :) $slashdb->getUserAuthenticate($ldapuname, $ldappassword) will populate $self, $user, and $passwd. Make sense? > $slashdb = getCurrentDB() *does* return something, but I don't know how > to tinker with it to see if it's providing me with the right something. > When evaluated as a scalar I get something like > Slash::DB=HASH(0x891327c). This is a functioning slash site, so it's > bound to be working somewhere. That's a stringified blessed reference. If you print ref($slashdb), you should just get 'Slash::DB'. All that mess means is that $slashdb is a hash reference that's been blessed into the Slash::DB class. It's an object. It's what you want. > Apologies for the newbie ramblings. This is very frustrating. Let me > know if there's anything else I can provide you. Money is good. > Thanks in advance for any help you can provide. The null string is not exactly the same as an undefined value. I'd do something like this: my $slashdb = getCurrentDB(); my $userstuff=$slashdb->getUserAuthenticate($ldapuname, $ldappassword); print "Sent ($ldapuname) and ($ldappassword)\n"; if (defined $userstuff) { print "Received ($userstuff)\n"; } else { print "Received undef from getUserAuthenticate.\n"; } That'll give you a better idea if it doesn't like $user and $passwd, or if it's just not finding anyone in the database. -- c |