diff --git a/modules/user.module b/modules/user.module index 18ff15b822665dd9218fc5e224d64cfc920be4bf..2e7cefb4fa24fb3397f0855537db883dbb3eac01 100644 --- a/modules/user.module +++ b/modules/user.module @@ -362,7 +362,13 @@ function jabber_auth($username, $password, $server, $port = 5222) { return 0; } - jabber_send($session, "<iq type='set' id='". $jabber["jid"] ."'><query xmlns='jabber:iq:auth'><username>$username</username><password>$password</password><resource>drupal</resource></query></iq>"); + /* + ** Hash the password: + */ + + $digest = mhash(MHASH_SHA1, $password); + + jabber_send($session, "<iq type='set' id='". $jabber["jid"] ."'><query xmlns='jabber:iq:auth'><username>$username</username><digest>$digest</digest><resource>drupal</resource></query></iq>"); $data = jabber_recv($session); diff --git a/modules/user/user.module b/modules/user/user.module index 18ff15b822665dd9218fc5e224d64cfc920be4bf..2e7cefb4fa24fb3397f0855537db883dbb3eac01 100644 --- a/modules/user/user.module +++ b/modules/user/user.module @@ -362,7 +362,13 @@ function jabber_auth($username, $password, $server, $port = 5222) { return 0; } - jabber_send($session, "<iq type='set' id='". $jabber["jid"] ."'><query xmlns='jabber:iq:auth'><username>$username</username><password>$password</password><resource>drupal</resource></query></iq>"); + /* + ** Hash the password: + */ + + $digest = mhash(MHASH_SHA1, $password); + + jabber_send($session, "<iq type='set' id='". $jabber["jid"] ."'><query xmlns='jabber:iq:auth'><username>$username</username><digest>$digest</digest><resource>drupal</resource></query></iq>"); $data = jabber_recv($session);