diff -crB xmpp_user/xmpp_user.admin.inc xmpp_user_mod/xmpp_user.admin.inc
*** xmpp_user/xmpp_user.admin.inc	2009-10-01 20:36:01.000000000 -0400
--- xmpp_user_mod/xmpp_user.admin.inc	2009-10-01 20:34:28.000000000 -0400
***************
*** 32,37 ****
--- 32,43 ----
      '#default_value' => variable_get('xmpp_user_store_login_password', FALSE),
      '#description' => t('If checked the system will over write the xmpp password stored in the module with the password utilized on login, useful in ldap environment'),
    );
+   $form['xmpp_user_settings']['xmpp_user_web_authentication'] = array(
+ 	'#type' => 'checkbox',
+ 	'#title' => t('Authenticate User with WS Credentials'),
+ 	'#default_value' => variable_get('xmpp_user_web_authentication', FALSE),
+ 	'#description' => t('If checked the system will use the authentication credentials from the web server. Works well with webserver_auth module.'),
+   );
  
    $form['xmpp_user_provisioning'] = array('#type' => 'fieldset', '#title' => t('Provisioning Settings'), '#collapsible' => TRUE, '#collapsed' => FALSE);
    $form['xmpp_user_provisioning']['xmpp_user_provisioning_server'] = array(
diff -crB xmpp_user/xmpp_user.module xmpp_user_mod/xmpp_user.module
*** xmpp_user/xmpp_user.module	2009-10-01 20:35:53.000000000 -0400
--- xmpp_user_mod/xmpp_user.module	2009-10-01 20:34:20.000000000 -0400
***************
*** 1,5 ****
  <?php
! // $Id: xmpp_user.module,v 1.1.2.16 2009/09/25 20:51:05 darrenferguson Exp $
  
  /**
   * @file
--- 1,5 ----
  <?php
! // $Id: xmpp_user.module,v 1.1.2.15 2009/08/27 21:46:42 darrenferguson Exp $
  
  /**
   * @file
***************
*** 169,174 ****
--- 169,176 ----
   * Builds the form elements for use in the user administration screen
   */
  function xmpp_user_form($edit, $account, $category = NULL) {
+   //global $user;
+   //$account = $user;
    $form = array();
    if ($category == 'account') {
      $form['xmpp_user'] = array('#type' => 'fieldset', '#title' => t('XMPP User'), '#tree' => TRUE, '#weight' => 2);
***************
*** 176,181 ****
--- 178,184 ----
        '#type' => 'textfield',
        '#title' => t('JID'),
        '#default_value' => $account->xmpp_user['jid'],
+ //      '#default_value' => $account->name,
        '#description' => t('Enter your full JID (i.e. user@server.com) here'),
      );
      // Only display if the administrator is allowing the users to alter their password
***************
*** 316,322 ****
   */
  function xmpp_user_encrypt_password($password = NULL) {
    if (!is_null($password) && drupal_strlen($password)) {
!     return strtr($password, '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklm nopqrstuvwxyz', 'fo2gFeBMQ45Vl3sDp1HGTYbz7vWdikU86taqSPE0muZOj9cKr xRLnJXhwyCIAN');
    }
    return NULL;
  }
--- 319,326 ----
   */
  function xmpp_user_encrypt_password($password = NULL) {
    if (!is_null($password) && drupal_strlen($password)) {
!     //return strtr($password, '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklm nopqrstuvwxyz', 'fo2gFeBMQ45Vl3sDp1HGTYbz7vWdikU86taqSPE0muZOj9cKr xRLnJXhwyCIAN');
!     return $password; //BDIXON
    }
    return NULL;
  }
***************
*** 326,332 ****
   */
  function xmpp_user_decrypt_password($password = NULL) {
    if (!is_null($password) && drupal_strlen($password)) {
!     return strtr($password, 'fo2gFeBMQ45Vl3sDp1HGTYbz7vWdikU86taqSPE0muZOj9cKr xRLnJXhwyCIAN', '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklm nopqrstuvwxyz');
    }
    return NULL;
  }
--- 330,337 ----
   */
  function xmpp_user_decrypt_password($password = NULL) {
    if (!is_null($password) && drupal_strlen($password)) {
!     //return strtr($password, 'fo2gFeBMQ45Vl3sDp1HGTYbz7vWdikU86taqSPE0muZOj9cKr xRLnJXhwyCIAN', '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklm nopqrstuvwxyz');
!     return $password; //BDIXON
    }
    return NULL;
  }
***************
*** 341,347 ****
      global $user;
      $account = $user;
    }
!   // Verify that the user actually has a password associated with their account for xmpp
    if (isset($account->xmpp_user['password']) && !is_null($account->xmpp_user['password']) && drupal_strlen($account->xmpp_user['password'])) {
      $password = $account->xmpp_user['password'];
      if ($decrypt === TRUE) {
--- 346,352 ----
      global $user;
      $account = $user;
    }
!     // Verify that the user actually has a password associated with their account for xmpp
    if (isset($account->xmpp_user['password']) && !is_null($account->xmpp_user['password']) && drupal_strlen($account->xmpp_user['password'])) {
      $password = $account->xmpp_user['password'];
      if ($decrypt === TRUE) {
***************
*** 350,356 ****
    }
    else {
      // If nothing re-verify the database table just incase it was missing
!     $password = db_result(db_query("SELECT password FROM {xmpp_user} WHERE uid = %d", $account->uid));
      if (!is_null($password) && drupal_strlen($password)) {
        $password = xmpp_user_decrypt_password($password);
      }
--- 355,366 ----
    }
    else {
      // If nothing re-verify the database table just incase it was missing
!     if (variable_get('xmpp_user_web_authentication', FALSE)) {
! 	$password = $_SERVER['PHP_AUTH_PW'];    
!     }
!     else {    
! 	$password = db_result(db_query("SELECT password FROM {xmpp_user} WHERE uid = %d", $account->uid));
!     }
      if (!is_null($password) && drupal_strlen($password)) {
        $password = xmpp_user_decrypt_password($password);
      }
