Functions from module passwd

passwd-lib.pl

Functions to support the change passwords module. Some example code :

 foreign_require('passwd', 'passwd-lib.pl');
 $user = passwd::find_user('joe');
 if ($user) {
   passwd::change_password($user, 'smeg', 0);
 }

can_edit_passwd(&user)

Returns 1 if the current Webmin user can change the password for the Unix user whose details are in the given hash ref, which is in the format returned by useradmin::list_users.

find_user(name)

Looks up the user structure for some name, in the useradmin, ldap-useradmin and nis modules, and returns it.

change_password(&user, pass, do-others)

Updates a user's password. The required parameters are :

  • user - A hash ref of user details, in the format supplied by find_user.
  • pass - The new password, in plain text.
  • do-others - If set to 1, the password is changed in other Webmin modules too.
Edit | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r1 | More topic actions
Topic revision: r1 - 28 Mar 2009 - 21:43:14 - TWikiGuest
 
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback