Answers.Body: <p>As of Craft 2.3, the rules for changing an existing password are:</p>
  
  <p>If you're editing your existing account OR you're an administrator OR you have the 'changeUserEmails' permission set on your user account, then you need to supply <em>your</em> existing user account's password as a hidden input (not the current password for the account you're trying to change).</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;input type="text" id="currentPassword" name="password" /&gt;
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-01-27T16:16:18.470Z
Answers.Text: Thanks, Brad. I've tried doing this via a hidden field, but it still will not work. Is this the wrong approach?
  `<input type="hidden" id="currentPassword" name="password" value="{{ currentUser.password }}">`
Answers.UserDisplayName: Herb Himes
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-01-27T17:22:49.273Z
Answers.Text: Sorry... forgot the logic around this changed for the 2.3 release.  Just updated my answer.
Answers.UserDisplayName: Brad Bell
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-01-27T17:52:52.000Z
Answers.Text: @BradBell So there's no option to bypass that requirement?
Answers.UserDisplayName: Mike Pierce
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-01-27T17:54:26.333Z
Answers.Text: @HerbHimes That won't work Herb, the password is stored in the DB hashed for security reasons, so when you submit it as a hidden field, it is passing along the hashed version and not your actual password.
Answers.UserDisplayName: Mike Pierce
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-01-27T20:11:40.533Z
Answers.Text: @MikePierce correct
Answers.UserDisplayName: Brad Bell
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-01-27T03:24:32.370Z
Answers.LastActivityDate: 2017-12-04T18:38:22.973Z
Answers.LastEditDate: 2017-12-04T18:38:22.973Z
Answers.UserDisplayName: Brad Bell
Body: <p>I figure I must need to pass the current user's password along with the updated email address upon form submit. However, I cannot get the email address change to take. Any help is greatly appreciated. Here's my code snippet:</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;form action="" method="post" accept-charset="UTF-8" enctype="multipart/form-data" class="account-edit"&gt;
  
      {{ getCsrfInput() }}
  
      &lt;input type="hidden" name="action" value="users/saveUser"&gt;
      &lt;input type="hidden" name="password" value="{{ currentUser.password }}"&gt;
      &lt;input type="hidden" name="redirect" value="account"&gt;
      &lt;input type="hidden" name="userId" value="{{ currentUser.id }}"&gt;
      &lt;input type="hidden" name="deleteUserPhoto" id="deleteUserPhotoInput" value=""&gt;
  
      {% if currentUser.firstName %}
          &lt;div class="form-group"&gt;
              &lt;label for="firstName"&gt;First Name&lt;/label&gt;&lt;br&gt;
              &lt;input name="firstName" value="{{ currentUser.firstName }}" class="form-control"&gt;
          &lt;/div&gt;
      {% endif %}
  
      {% if currentUser.lastName %}
          &lt;div class="form-group"&gt;
              &lt;label for="lastName"&gt;Last Name&lt;/label&gt;&lt;br&gt;
              &lt;input name="lastName" value="{{ currentUser.lastName }}" class="form-control"&gt;
          &lt;/div&gt;
      {% endif %}
  
      {% if currentUser.email %}
          &lt;div class="form-group"&gt;
              &lt;label for="email"&gt;Email&lt;/label&gt;&lt;br&gt;
              &lt;input name="email" value="{{ currentUser.email }}" class="form-control"&gt;
          &lt;/div&gt;
      {% endif %}
  
      {# Check to see if the user has a photo  #}
      {% if currentUser.photoUrl %}
          &lt;label for="userPhoto"&gt;Edit Photo&lt;/label&gt;&lt;br&gt;
          &lt;div class="form-group"&gt;
              &lt;figure&gt;
                  &lt;div class="cover"&gt;&lt;/div&gt;
                  &lt;img src="{{ currentUser.photoUrl (100) }}" /&gt;
                  &lt;a href="#" id="deleteUserPhotoAction" class=""&gt;Delete&lt;/a&gt;
              &lt;/figure&gt;
              {# If a photo exists, give the option to change the user photo #}          
              &lt;input type="file" name="userPhoto" value="Change Photo"&gt;
  
          &lt;/div&gt;
      {% else %}
  
      {# If no photo exists, give the option to upload a new one #}
          &lt;label for="userPhoto"&gt;Upload Photo&lt;/label&gt;&lt;br&gt;
          &lt;div class="form-group"&gt;
          &lt;figure&gt;&lt;img src="/assets/img/user.gif" /&gt;&lt;/figure&gt;
              &lt;input type="file" name="userPhoto" value="Upload"&gt;
          &lt;/div&gt;
      {% endif %}
  
  
      &lt;input type="submit" value="Update Account" class="btn profile-save"&gt;
  &lt;/form&gt;
  </code></pre>
  
Tags: <frontend><usermodel>
Title: I cannot get the email address to properly update from my user account management form
ThreadText: # I cannot get the email address to properly update from my user account management form
  
  (Asked by: username_0 on 2015-01-27)
  
  I figure I must need to pass the current user's password along with the updated email address upon form submit. However, I cannot get the email address change to take. Any help is greatly appreciated. Here's my code snippet:
  
  ```html
  <form action="" method="post" accept-charset="UTF-8" enctype="multipart/form-data" class="account-edit">
  
      {{ getCsrfInput() }}
  
      <input type="hidden" name="action" value="users/saveUser">
      <input type="hidden" name="password" value="{{ currentUser.password }}">
      <input type="hidden" name="redirect" value="account">
      <input type="hidden" name="userId" value="{{ currentUser.id }}">
      <input type="hidden" name="deleteUserPhoto" id="deleteUserPhotoInput" value="">
  
      {% if currentUser.firstName %}
          <div class="form-group">
              <label for="firstName">First Name</label><br>
              <input name="firstName" value="{{ currentUser.firstName }}" class="form-control">
          </div>
      {% endif %}
  
      {% if currentUser.lastName %}
          <div class="form-group">
              <label for="lastName">Last Name</label><br>
              <input name="lastName" value="{{ currentUser.lastName }}" class="form-control">
          </div>
      {% endif %}
  
      {% if currentUser.email %}
          <div class="form-group">
              <label for="email">Email</label><br>
              <input name="email" value="{{ currentUser.email }}" class="form-control">
          </div>
      {% endif %}
  
      {# Check to see if the user has a photo  #}
      {% if currentUser.photoUrl %}
          <label for="userPhoto">Edit Photo</label><br>
          <div class="form-group">
              <figure>
                  <div class="cover"></div>
                  <img src="{{ currentUser.photoUrl (100) }}" />
                  <a href="#" id="deleteUserPhotoAction" class="">Delete</a>
              </figure>
              {# If a photo exists, give the option to change the user photo #}          
              <input type="file" name="userPhoto" value="Change Photo">
  
          </div>
      {% else %}
  
      {# If no photo exists, give the option to upload a new one #}
          <label for="userPhoto">Upload Photo</label><br>
          <div class="form-group">
          <figure><img src="/assets/img/user.gif" /></figure>
              <input type="file" name="userPhoto" value="Upload">
          </div>
      {% endif %}
  
      <input type="submit" value="Update Account" class="btn profile-save">
  </form>
  
  ```
  
  **Tags:** frontend, usermodel
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2015-01-27. Score: 3
  
  As of Craft 2.3, the rules for changing an existing password are:
  
  If you're editing your existing account OR you're an administrator OR you have the 'changeUserEmails' permission set on your user account, then you need to supply *your* existing user account's password as a hidden input (not the current password for the account you're trying to change).
  
  ```html
  <input type="text" id="currentPassword" name="password" />
  
  ```
  
  > **Comments:**
  > **username_0**: Thanks, username_1. I've tried doing this via a hidden field, but it still will not work. Is this the wrong approach? `<input type="hidden" id="currentPassword" name="password" value="{{ currentUser.password }}">`  
  > **username_1**: Sorry... forgot the logic around this changed for the 2.3 release.  Just updated my answer.  
  > **username_2**: @username_1 So there's no option to bypass that requirement?  
  > **username_2**: @username_0 That won't work username_0, the password is stored in the DB hashed for security reasons, so when you submit it as a hidden field, it is passing along the hashed version and not your actual password.  
  > **username_1**: @username_2 correct  
  
  ---
  
  