hello boys and girls hello all users of this list hello guru of php hello much many people
here is my previous discution
Hi there, You don't really need to write any line in C to change the password the PAM way:
http://svn.php.net/viewvc/pecl/pam/trunk/README?view=markup
This is a PECL module, so installation is easy: pecl install pam
See you!! emi
2010/4/20 fakessh fakessh@fakessh.eu:
On Tue, 20 Apr 2010 14:09:07 +0200, "A.L.E.C" <alec@alec.pl> wrote:
fakessh wrote:
I try to implement the change password plugin I just watched
http://trac.roundcube.net/browser/trunk/plugins/password it does not seem to have an option to change password when using
dovecot
I do not use sql or ldap. I use pam to store my password
through the authentication to postfix and dovecot: my passwords are login or plain text if so, can you enlighten me how to use the change password plugin
I don't know if there is a plugin or driver for PAM passwords
change. You need a command line tool for changing passwords e.g. chpasswd and use it in PHP. For example see 'sasl' driver from 'password' plugin. Programmers can take a look at http://www.unicom.com/sw/web-chpass. Also
virtualmin (which we support in virtualmin driver) probably is
working with PAM.
thank you A.L.E.C thanks you all users I just look at the code
http://trac.roundcube.net/browser/trunk/plugins/password/drivers/sasl.php to integrate easily into roundcube it is simply necessary to modify the code web-chpass and the executable c nipasswd then plugin with a part in c I'm afraid of writing this piece of c, I just perl the c is entirely taken from http://www.unicom.com/sw/web-chpass I am afraid to make mistakes in writing c them what someone feels able to write this plugin derives from nipasswd _______________________________________________ List info: http://lists.roundcube.net/dev/
i just perl and c I do not know php I want a little help to understand and run the documentation I correctly installed pecl install pam
I have the following API
1 API 2 3 bool pam_auth(string $username, string $password [, string &$error [ $checkacctmgmt = true ] ]) 4 bool pam_chpass(string $username, string $oldpassword, string $newpassword [, string &$error ]) 5 6 The parameters are 7 8 username - Username to check 9 password - User supplied password 10 error - Output parameter to put any error messages in 11 checkacctmgmt - Call pam_acct_mgmt() to check account expiration and access hours (requires root access!) 12 oldpassword - Current password on account 13 newpassword - Password to change to
can you give me a simple example using this API
bool pam_auth (string $username, string $password
[, string &$error [ $checkacctmgmt = true ] ])
^ ^ ^ ^
^ ^
what it 's what it 's what it 's what it 's
what it 's what it 's
bool pam_chpass (string $username, string
$oldpassword, string $newpassword [, string &$error ])
^ ^ ^ ^
^ ^
what it 's what it 's what it 's what it 's
what it 's what it 's
can you give me a simple example of how these functions A simple example would allow me to easily write the plugin for roundcubemail
thanks for your advice thanks for all return
aka /fakessh/
List info: http://lists.roundcube.net/users/
fakessh wrote:
can you give me a simple example using this API
something like that
function password_save($currpass, $newpass) { if (extension_loaded("pam")) { if (pam_chpass($_SESSION['username'], $currpass, $newpass)) { return PASSWORD_SUCCESS; } } return PASSWORD_ERROR; }
On Thu, 22 Apr 2010 08:16:10 +0200, "A.L.E.C" alec@alec.pl wrote:
fakessh wrote:
can you give me a simple example using this API
something like that
function password_save($currpass, $newpass) { if (extension_loaded("pam")) { if (pam_chpass($_SESSION['username'], $currpass, $newpass)) { return PASSWORD_SUCCESS; } } return PASSWORD_ERROR; }
I just finished the patch for pam I do not know if you want to quickly implement must make changes in files and installation documentation short, the patch is simple You may want to be more change in any case it is working perfectly on my 0.3.1 release
[root@r13151 ~]# diff --text -u /home/ftpchrootshell/fakessh/sasl.txt /home/roundcube/www/plugins/password/drivers/sasl.php --- /home/ftpchrootshell/fakessh/sasl.txt 2010-04-22 11:34:10.000000000 +0200 +++ /home/roundcube/www/plugins/password/drivers/sasl.php 2010-04-22 11:26:33.000000000 +0200 @@ -18,6 +18,16 @@
function password_save($currpass, $newpass) {
if ( !extension_loaded('pam') && !extension_loaded('pam_auth') )
if ( !dl('pam.so') && !dl('pam_auth.so') )
echo( "PHP PAM module cannot be loaded" );
if ( pam_auth ($_SESSION['username'],$currpass) )
return;
if (pam_chpass($_SESSION['username'], $currpass, $newpass))
return PASSWORD_SUCCESS;
rcmail::get_instance()->config->get('password_saslpasswd_args', ''); @@ -37,8 +47,5 @@ 'message' => "Password plugin: Unable to execute $curdir/chgsaslpasswd" ), true, false); }
}
?>
List info: http://lists.roundcube.net/users/