conflict between drupal standard password field and xmpp paswword
muldos - June 11, 2009 - 10:56
| Project: | XMPP Framework |
| Version: | 6.x-2.x-dev |
| Component: | XMPP-User |
| Category: | bug report |
| Priority: | critical |
| Assigned: | darren.ferguson |
| Status: | active |
Jump to:
Description
Hi, I think I've seen a bug on the xmpp_user module for the 2.x version :
When we allow users to modify their xmpp settings and also allow them to modify their standard drupal password, the following code is used in the xmpp_user_update function :
<?php
// If user updates their password from the user edit form we should update the xmpp one
if (isset($edit['pass']) && !is_null($edit['pass']) && drupal_strlen($edit['pass'])) {
$password = xmpp_user_encrypt_password($edit['pass']);
db_query("UPDATE {xmpp_user} SET jid = '%s', resource = '%s', password = '%s' WHERE uid = %d", $edit['xmpp_user']['jid'], $resource, $password, $account->uid);
}
elseif (isset($edit['xmpp_user']['password']) && !is_null($edit['xmpp_user']['password']) && drupal_strlen($edit['xmpp_user']['password'])) {
$password = xmpp_user_encrypt_password($edit['xmpp_user']['password']);
db_query("UPDATE {xmpp_user} SET jid = '%s', resource = '%s', password = '%s' WHERE uid = %d", $edit['xmpp_user']['jid'], $resource, $password, $account->uid);
}
?>drupal force user to have the standard password field and the repeat password field to be set in order to process the form, so the result of this code is that the xmpp password is always set to the standard default password value.
I think that this should not be an "elseif" but just an "if".
Or maybe I have missed a wanted behaviour
David

#1
I think i need to re-work this one, it is the way it currently is for ldap portion but if people aint running ldap then it needs to be checking both.
Will re-check