For Programmers: Free Programming Magazines  


Home > Archive > LDAP > August 2005 > Net::LDAP::Extension::SetPassword Documentation - gen_passwd()









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Net::LDAP::Extension::SetPassword Documentation - gen_passwd()
Gavin Henry

2005-08-24, 7:03 pm

Dear List,

At:

http://search.cpan.org/~gbarr/perl-.../SetPassword.pm

The example is:

---------------
use Net::LDAP;
use Net::LDAP::Extension::SetPassword;

$ldap = Net::LDAP->new( "ldap.mydomain.eg" );

$ldap->bind('cn=Joe User,cn=People,dc=mydomain,dc=eg",
password => 'oldPassword');

$mesg = $ldap->set_password( oldpasswd => 'oldPassword' );

die "error: ", $mesg->code(), ": ", $mesg->error() if ($mesg->code());

print "changed your password to", $mesg->gen_passwd() , "\n";
---------------

There's no such subroutine/function as gen_passwd() it's gen_password()

According to:

http://search.cpan.org/src/GBARR/pe.../SetPassword.pm

---------------
sub gen_password {
my $self = shift;

my $out = $passwdModRes->decode($self->response);

$out->{genPasswd};
}
----------------


On a side note, after sucessfully authenicating and changing a password,
gen_password() doesn't actually print anything???

Thanks.


--
Walking the road to enlightenment... I found a penguin and a camel on the
way..... Fancy a yourname@perl.me.uk? Just ask!!!
http://aberdeen.pm.org
Chris Ridd

2005-08-25, 8:02 am

On 24/8/05 3:42, Gavin Henry <ghenry@perl.me.uk> wrote:

> Dear List,
>
> At:
>
> http://search.cpan.org/~gbarr/perl-...sion/SetPasswor
> d.pm
>
> The example is:
>
> ---------------
> use Net::LDAP;
> use Net::LDAP::Extension::SetPassword;
>
> $ldap = Net::LDAP->new( "ldap.mydomain.eg" );
>
> $ldap->bind('cn=Joe User,cn=People,dc=mydomain,dc=eg",
> password => 'oldPassword');
>
> $mesg = $ldap->set_password( oldpasswd => 'oldPassword' );
>
> die "error: ", $mesg->code(), ": ", $mesg->error() if ($mesg->code());
>
> print "changed your password to", $mesg->gen_passwd() , "\n";
> ---------------
>
> There's no such subroutine/function as gen_passwd() it's gen_password()


Good catch. I'll commit a change to the docs shortly. (My svn logins are
failing ATM, hoping to catch Graham's eye..)

> On a side note, after sucessfully authenicating and changing a password,
> gen_password() doesn't actually print anything???


I'm not sure that it is guaranteed to return anything, unless you're using
the mode where the server generates a random password for you. This
behaviour might also depend on server/server configuration.

Cheers,

Chris


Gavin Henry

2005-08-25, 7:04 pm

>>
>
> Good catch. I'll commit a change to the docs shortly. (My svn logins are
> failing ATM, hoping to catch Graham's eye..)
>
>
> I'm not sure that it is guaranteed to return anything, unless you're using
> the mode where the server generates a random password for you. This
> behaviour might also depend on server/server configuration.


It's OpenLDAP on FC4.

Nah, I am just using a form. I'll addd some extras to it then.

Thanks.

--
Walking the road to enlightenment... I found a penguin and a camel on the
way..... Fancy a yourname@perl.me.uk? Just ask!!!
http://aberdeen.pm.org
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com