Hello,
Does anyone know how to add an update username and password form to a page within the site theme? I’ve incorporated a registration form in successfully as detailed in this page: http://expressionengine.com/wiki/EE2_Standalone_Registration_Form
I’ve tried using the following code based on the registration form wiki:
<?php
$this->EE =& get_instance();
$action_id = $this->EE->functions->fetch_action_id('Member', 'update_un_pw');
print $action_id;
?>
<form id="register_member_form" method="post" action="index.php">
<input type="hidden" name="XID" value={XID_HASH} />
<input type="hidden" name="ACT" value="<?php echo $action_id; ?>" />
<input type="hidden" name="RET" value="user/update-username-password-success" />
<input type="hidden" name="site_id" value="1" />
<div class="form-item form-item-textfield form-item-required">
<label for="username">Username</label>{required}<input type="text" name="username" value="{username}" id="username" />
</div>
<div class="form-item form-item-textfield form-item-required">
<label for="screen_name">Screen Name</label>{required}<input type="text" name="screen_name" value="{screen_name}" id="screen_name" />
</div>
<div class="form-item form-item-textfield form-item-required">
<label for="password">New Password</label>{required}<input type="password" name="password" value="" id="password" />
</div>
<div class="form-item form-item-textfield form-item-required">
<label for="password_confirm">...and again</label>{required}<input type="password" name="password_confirm" value="" id="password_confirm" />
</div>
<div class="form-item form-item-textfield form-item-required">
<label for="current_password">Existing Password</label>{required}<input type="password" name="current_password" value="" id="current_password" />
</div>
<div class="form-item form-item-submit">
<button type="submit" name="submit" value="Send" id="submit" class="ir">Submit</button>
</div>
</form>On submission, it throws an error - You must submit all fields
I’ve tried this with just providing Username, Screen Name & Current Password, as well as Username, Screen Name, New Password, New Password Confirm & Current Passwor.
Thanks in advance
Dave
Moved to Development and Programming by Moderator
Hi Greg,
Thanks for the reply - that makes sense. We actually went an purchased Solspace’s User module which did the trick. I’ll have another go when I get some time on a clean install.
Dave
My 2 cents:
I had to comment out this piece of code to get only one or the other (username or pwd changed)
file:mod.member_settings.php
I do not encourage to modify the source code as any further EE upgrade down the road will become complicated to maintain.
Comment out the following lines as they force the users to change their Username and PWD (not one OR the other) (line: 2140)
/*
if ( ! isset($_POST['new_username']) AND ! isset($_POST['new_password']))
{
$missing = TRUE;
}
if ((isset($_POST['new_username']) AND $_POST['new_username'] == '') OR (isset($_POST['new_password']) AND $_POST['new_password'] == ''))
{
$missing = TRUE;
}
*/And correct this piece of Code (line: 2167)
// return $this->EE->output->show_user_error('submission', implode(', ', $this->auth->errors));
return $this->EE->output->show_user_error('submission', implode(', ', $this-[b]>EE[/b]->auth->errors));Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.