Change Password in ExpressionEngine

Posted on February 1, 2014

ExpressionEngine having the core feature of reset password in which a system generated password is being emailed to member but there is no EE tags using which members could set a password of their own. There are a couple of third party add-on which provides Change Password tags.

Here is a simple method by using which Change Password can be implemented easily.

$this->EE = & get_instance();
$action_id = $this->EE->functions->fetch_action_id('Member', 'update_un_pw');
$site_id = $this->EE->config->item('site_id');

<form id="frm_change_password" method="post" action="{site_url}">
<input type="hidden" name="XID" value="{XID_HASH}" />
<input type="hidden" name="ACT" value="<?php echo $action_id; ?>" />
<input type="hidden" name="RET" value="template_group/template_name" />
<input type="hidden" name="site_id" value="<?php echo $site_id; ?>" />
<input type="hidden" name="username" value="{username}" />
<input type="hidden" name="screen_name" value="{screen_name}" />
<p>New Password:<input type="password" autocomplete="off" value="" name="new_password" required /></p>
<p>Confirm New Password:<input type="password" autocomplete="off" value="" name="new_password_confirm" required /></a>
<p>Your Current Password:<input type="password" autocomplete="off" value="" name="password" required /></p>
<p><input type="submit" value="Change Password" class="button" /></p>

As there is PHP code so you need to Allow PHP? for the template.