[sork] passwd module

Mike Cochrane mike@graftonhall.co.nz
Fri Oct 25 11:45:10 2002


Don't worry too much about the prefered entry. This is all handled by the main
Passwd code and the driver doesn't need to know.

And the smbpasswd driver is probably not a good one to choose as it hasn't been
updated for the new driver struture yet.

poppasswd, ldap and sql are all upto date. I haven't had time to do the others yet. 

Some important things:
The driver MUST check the current password is correct
The driver MUST NOT assume that it is changing the password of the currently
logged in user.

Is the process of changing a password you sometimes implicity check the current
password anyway, I think that will be the case with your driver.

Other than that here what you basically need:
a constructor and a function like this:
function change_password($username,  $oldpassword, $newpassword) 
{
// check current password is correct

// change new password

// return true if it works or a PEAR_Error if it didn't
}

- Mike :-)

> ----- Message from green@UMDNJ.EDU ---------
> 
> Quoting Tim Gorter <email@teletechnics.com>:
> 
> > Basically have a look at the files in the passwd/lib/Driver directory,
> > and see how those drivers there are made. You will need to place some
> > settings in the conf.php file (per se adjust the conf.xml) and that
> > more or less is it. That is if you do not need any changes in the UI
> > or similar.
> >
> > have fun,
> > tim.
> 
> Okay, I'll bite...  I'm currently trying to make an ssh driver;  I've started
> by
> using the smbpasswd driver as a model, but there's no matching entry in
> backends.php (cvs HEAD) to use as a model, and I'm just too lazy (!) right
> now
> to pass up the opportunity to ask some questions about this and ask for
> advice
> or opinions.  The following is what I'm starting with:
> 
> $backends['ssh'] = array(
>     'name' => 'SSH server',
>     'preferred' => '',
>     'password policy' => array(
>         'minLength' => 6,
>         'maxLength' => 8,
>         'minNumeric' => 1
>     ),
>     'driver' => 'ssh',
>     'params' => array(
>         'path' => '/usr/local/bin/ssh',
>         'command' => 'passwd'
>     )
> );
> 
> I'm still not sure if the 'preferred' notion has relevance here, and if so,
> how
> to set it up.  I'm also assuming that whatever server used for authenticating
> will be used for password change attempts - I think that should be valid, but
> I'm not sure if I need to do anything about it.
> 
> FWIW, we've successfully built a perl cgi and expect app to do this, but
> would
> prefer to have it as a horde module.
> 
> c
> --
> Cliff Green
> Academic Computing Services - UMDNJ
> Signature under NDA
> 
> --
> Sork mailing list
> Frequently Asked Questions: http://horde.org/faq/
> To unsubscribe, mail: sork-unsubscribe@lists.horde.org
> 
> 
> 
> ----- End message from green@UMDNJ.EDU -----