本文整理匯總了PHP中IPSMember::updatePassword方法的典型用法代碼示例。如果您正苦於以下問題:PHP IPSMember::updatePassword方法的具體用法?PHP IPSMember::updatePassword怎麽用?PHP IPSMember::updatePassword使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類IPSMember
的用法示例。
在下文中一共展示了IPSMember::updatePassword方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: onPasswordChange
/**
* Converge_Server::onPasswordChange()
*
* handles new password change
*
* This will return a param "response" with either
* - FAILED (Unknown failure)
* - SUCCESS (Added OK)
*
* @access public
* @param int $product_id Product ID
* @param string $auth_key Authentication Key
* @param string $email_address Email address
* @param string $md5_once_password Plain text password hashed by MD5
* @return mixed xml / boolean
*/
public function onPasswordChange($auth_key, $product_id, $email_address, $md5_once_password)
{
//-----------------------------------------
// INIT
//-----------------------------------------
$auth_key = IPSText::md5Clean($auth_key);
$product_id = intval($product_id);
$email_address = IPSText::parseCleanValue($email_address);
$md5_once_password = IPSText::md5Clean($md5_once_password);
$return = 'FAILED';
//-----------------------------------------
// Authenticate
//-----------------------------------------
if ($this->__authenticate($auth_key, $product_id) !== FALSE) {
IPSMember::updatePassword($email_address, $md5_once_password);
$return = 'SUCCESS';
$this->classApiServer->apiSendReply(array('complete' => 1, 'response' => $return));
exit;
}
}
示例2: cleanConvertData
/**
* Clean up the converted data
*
* @access public
* @param string new password
* @return @e void
*/
public function cleanConvertData($new_pass)
{
IPSMember::save($this->_memberData['email'], array('core' => array('misc' => '', $this->password_field => '')), 'email');
IPSMember::updatePassword($this->_memberData['email'], $new_pass);
}
示例3: changePW
public function changePW($newPass, $member, $currentPass = false)
{
//-----------------------------------------
// INIT
//-----------------------------------------
$save_array = array();
//-----------------------------------------
// Generate a new random password
//-----------------------------------------
$new_pass = IPSText::parseCleanValue(urldecode($newPass));
//-----------------------------------------
// Generate a new salt
//-----------------------------------------
$salt = IPSMember::generatePasswordSalt(5);
$salt = str_replace('\\', "\\\\", $salt);
//-----------------------------------------
// New log in key
//-----------------------------------------
$key = IPSMember::generateAutoLoginKey();
//-----------------------------------------
// Update...
//-----------------------------------------
$save_array['members_pass_salt'] = $salt;
$save_array['members_pass_hash'] = md5(md5($salt) . md5($new_pass));
$save_array['member_login_key'] = $key;
$save_array['member_login_key_expire'] = $this->settings['login_key_expire'] * 60 * 60 * 24;
$save_array['failed_logins'] = null;
$save_array['failed_login_count'] = 0;
//-----------------------------------------
// Load handler...
//-----------------------------------------
$classToLoad = IPSLib::loadLibrary(IPS_ROOT_PATH . 'sources/handlers/han_login.php', 'han_login');
$this->han_login = new $classToLoad($this->registry);
$this->han_login->init();
$this->han_login->changePass($member['email'], md5($new_pass), $new_pass, $member);
IPSMember::save($member['member_id'], array('members' => $save_array));
IPSMember::updatePassword($member['member_id'], md5($new_pass));
IPSLib::runMemberSync('onPassChange', $member['member_id'], $new_pass);
}
示例4: change
/**
* Change account data
*
* @param int ID number
* @param string md5( IPS Connect Key (see login method) . ID number )
* @param string New username (blank means do not change)
* @param string New displayname (blank means do not change)
* @param string New email address (blank means do not change)
* @param string New password, md5 encoded (blank means do not change)
* @param string Redirect URL, Base64 encoded
* @param string md5( IPS Connect Key . $redirect )
* @return mixed If the redirect URL is provided, this function should redirect the user to that URL with a single paramater - 'status'
* If blank, will output to screen a JSON object with the same parameter
* Values:
* BAD_KEY Invalid Key
* NO_USER ID number not match any member account
* SUCCESS Information changed successfully
* USERNAME_IN_USE The chosen username was in use and as a result NO information was changed
* DISPLAYNAME_IN_USE The chosen username was in use and as a result NO information was changed
* EMAIL_IN_USE The chosen username was in use and as a result NO information was changed
* MISSING_DATA No details to be changed were provided
*/
public function change($id, $key, $username, $displayname, $email, $md5Password, $redirect, $redirectHash)
{
if ($key != md5($this->masterKey . $id)) {
$this->_return(base64_encode($this->settings['board_url']), array('status' => 'BAD_KEY'));
}
$member = IPSMember::load(intval($id), 'none', 'id');
if (!$member['member_id']) {
$this->_return($redirect, array('status' => 'NO_USER'));
}
$update = array();
if ($username) {
if (IPSMember::getFunction()->checkNameExists($username, $member, 'name', TRUE)) {
$this->_return($redirect, array('status' => 'USERNAME_IN_USE'));
}
$update['name'] = $username;
}
if ($displayname) {
if (IPSMember::getFunction()->checkNameExists($displayname, $member, 'members_display_name', TRUE)) {
$this->_return($redirect, array('status' => 'DISPLAYNAME_IN_USE'));
}
$update['members_display_name'] = $displayname;
}
if ($email) {
if (IPSMember::checkByEmail($email)) {
$this->_return($redirect, array('status' => 'EMAIL_IN_USE'));
}
$update['email'] = $email;
}
if (empty($update)) {
if (!$md5Password) {
$this->_return($redirect, array('status' => 'MISSING_DATA'));
}
} else {
IPSMember::save($member['member_id'], array('members' => $update));
}
if ($md5Password) {
IPSMember::updatePassword($member['member_id'], $md5Password);
}
if ($redirect) {
$redirect = $redirectHash == md5($this->masterKey . $redirect) ? $redirect : base64_encode($this->settings['board_url']);
}
$this->_return($redirect, array('status' => 'SUCCESS'));
}
示例5: saveFormEmailPassword
/**
* UserCP Save Form: Email Address
*
* @return mixed Array of errors / boolean true
*/
public function saveFormEmailPassword()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$_emailOne = strtolower(trim($this->request['in_email_1']));
$_emailTwo = strtolower(trim($this->request['in_email_2']));
$cur_pass = trim($this->request['current_pass']);
$new_pass = trim($this->request['new_pass_1']);
$chk_pass = trim($this->request['new_pass_2']);
$isRemote = (!$this->memberData['bw_local_password_set'] and $this->memberData['members_created_remote']) ? true : false;
if ($cur_pass or $new_pass) {
if ($this->memberData['g_access_cp']) {
return array(0 => $this->lang->words['admin_emailpassword']);
}
if ($isRemote === false and (!$_POST['current_pass'] or empty($new_pass) or empty($chk_pass))) {
return array(0 => $this->lang->words['complete_entire_form']);
}
//-----------------------------------------
// Do the passwords actually match?
//-----------------------------------------
if ($new_pass != $chk_pass) {
return array(0 => $this->lang->words['passwords_not_matchy']);
}
//-----------------------------------------
// Check password...
//-----------------------------------------
if ($isRemote === false) {
if ($this->_checkPassword($cur_pass) !== TRUE) {
return array(0 => $this->lang->words['current_pw_bad']);
}
} else {
/* This is INIT in _checkPassword */
$classToLoad = IPSLib::loadLibrary(IPS_ROOT_PATH . 'sources/handlers/han_login.php', 'han_login');
$this->han_login = new $classToLoad($this->registry);
$this->han_login->init();
}
//-----------------------------------------
// Create new password...
//-----------------------------------------
$md5_pass = md5($new_pass);
//-----------------------------------------
// han_login was loaded during check_password
//-----------------------------------------
$this->han_login->changePass($this->memberData['email'], $md5_pass, $new_pass, $this->memberData);
if ($this->han_login->return_code and $this->han_login->return_code != 'METHOD_NOT_DEFINED' and $this->han_login->return_code != 'SUCCESS') {
return array(0 => $this->lang->words['hanlogin_pw_failed']);
}
//-----------------------------------------
// Update the DB
//-----------------------------------------
IPSMember::updatePassword($this->memberData['email'], $md5_pass);
IPSLib::runMemberSync('onPassChange', $this->memberData['member_id'], $new_pass);
//-----------------------------------------
// Update members log in key...
//-----------------------------------------
$key = IPSMember::generateAutoLoginKey();
IPSMember::save($this->memberData['member_id'], array('core' => array('member_login_key' => $key, 'bw_local_password_set' => 1)));
$this->ok_message = $this->lang->words['pw_change_successful'];
}
if ($_emailOne or $_emailTwo) {
//-----------------------------------------
// Do not allow validating members to change
// email when admin validation is on
// @see http://community.invisionpower.com/tracker/issue-19964-loophole-in-registration-procedure/
//-----------------------------------------
if ($this->memberData['member_group_id'] == $this->settings['auth_group'] and in_array($this->settings['reg_auth_type'], array('admin', 'admin_user'))) {
$this->registry->output->showError($this->lang->words['admin_val_no_email_chg'], 10190);
}
//-----------------------------------------
// Check input
//-----------------------------------------
if ($this->memberData['g_access_cp']) {
return array(0 => $this->lang->words['admin_emailpassword']);
}
if (!$_POST['in_email_1'] or !$_POST['in_email_2']) {
return array(0 => $this->lang->words['complete_entire_form']);
}
//-----------------------------------------
// Check password...
//-----------------------------------------
if (!$this->_isFBUser) {
if ($this->_checkPassword($this->request['password']) === FALSE) {
return array(0 => $this->lang->words['current_pw_bad']);
}
}
//-----------------------------------------
// Test email addresses
//-----------------------------------------
if ($_emailOne != $_emailTwo) {
return array(0 => $this->lang->words['emails_no_matchy']);
}
if (IPSText::checkEmailAddress($_emailOne) !== TRUE) {
return array(0 => $this->lang->words['email_not_valid']);
}
//.........這裏部分代碼省略.........
示例6: save_password
/**
* Change a member's password
*
* @return @e void [Outputs to screen]
*/
protected function save_password()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$member_id = intval($this->request['member_id']);
$password = IPSText::parseCleanValue($_POST['password']);
$password2 = IPSText::parseCleanValue($_POST['password2']);
$new_key = intval($this->request['new_key']);
$new_salt = intval($this->request['new_salt']);
$salt = str_replace('\\', "\\\\", IPSMember::generatePasswordSalt(5));
$key = IPSMember::generateAutoLoginKey();
$md5_once = md5(trim($password));
//-----------------------------------------
// AJAX debug
//-----------------------------------------
IPSDebug::fireBug('info', array('Password: ' . $password));
//-----------------------------------------
// Check
//-----------------------------------------
if (!$password or !$password2) {
$this->registry->output->showError($this->lang->words['password_nogood']);
}
if ($password != $password2) {
$this->registry->output->showError($this->lang->words['m_passmatch']);
}
//-----------------------------------------
// Get member
//-----------------------------------------
$member = IPSMember::load($member_id);
//-----------------------------------------
// Allowed to edit administrators?
//-----------------------------------------
if ($member['g_access_cp'] and !$this->registry->getClass('class_permissions')->checkPermission('member_edit_admin', 'members', 'members')) {
$this->registry->output->showError($this->lang->words['m_editadmin']);
}
//-----------------------------------------
// Check Converge: Password
//-----------------------------------------
$classToLoad = IPSLib::loadLibrary(IPS_ROOT_PATH . 'sources/handlers/han_login.php', 'han_login');
$han_login = new $classToLoad($this->registry);
$han_login->init();
$han_login->changePass($member['email'], $md5_once, $password, $member);
/*if ( $han_login->return_code != 'METHOD_NOT_DEFINED' AND $han_login->return_code != 'SUCCESS' )
{
$this->returnJsonError( $this->lang->words['m_passchange']);
exit();
}*/
//-----------------------------------------
// Local DB
//-----------------------------------------
$update = array();
if ($new_salt) {
$update['members_pass_salt'] = $salt;
}
if ($new_key) {
$update['member_login_key'] = $key;
}
if (count($update)) {
IPSMember::save($member_id, array('core' => $update));
}
IPSMember::updatePassword($member_id, $md5_once);
IPSLib::runMemberSync('onPassChange', $member_id, $password);
ipsRegistry::getClass('adminFunctions')->saveAdminLog(sprintf($this->lang->words['m_passlog'], $member_id));
$this->registry->output->global_message = $this->lang->words['pw_updated_success'];
$this->registry->output->silentRedirectWithMessage($this->settings['base_url'] . 'module=members&do=viewmember&member_id=' . $member_id);
}
示例7: _saveForm
/**
* Save new email and/or pass
*
* @return @e void
*/
protected function _saveForm()
{
if (!$this->request['email'] and !$this->request['password']) {
$this->registry->output->global_error = $this->lang->words['change_nothing_update'];
$this->_showForm();
return;
}
if ($this->request['email']) {
if (!$this->request['email_confirm']) {
$this->registry->output->global_error = $this->lang->words['change_both_fields'];
$this->_showForm();
return;
} else {
if ($this->request['email'] != $this->request['email_confirm']) {
$this->registry->output->global_error = $this->lang->words['change_not_match'];
$this->_showForm();
return;
}
}
$email = trim($this->request['email']);
if (!IPSText::checkEmailAddress($email)) {
$this->registry->output->global_error = $this->lang->words['bad_email_supplied'];
$this->_showForm();
return;
}
$email_check = IPSMember::load(strtolower($email));
if ($email_check['member_id']) {
if ($email_check['member_id'] == $this->memberData['member_id']) {
$this->registry->output->global_error = $this->lang->words['already_using_email'];
} else {
$this->registry->output->global_error = $this->lang->words['change_email_already_used'];
}
$this->_showForm();
return;
}
//-----------------------------------------
// Load handler...
//-----------------------------------------
$classToLoad = IPSLib::loadLibrary(IPS_ROOT_PATH . 'sources/handlers/han_login.php', 'han_login');
$han_login = new $classToLoad($this->registry);
$han_login->init();
$han_login->changeEmail(trim(strtolower($this->memberData['email'])), trim(strtolower($email)), $this->memberData);
IPSLib::runMemberSync('onEmailChange', $this->memberData['member_id'], strtolower($email), $this->memberData['email']);
IPSMember::save($this->memberData['member_id'], array('core' => array('email' => strtolower($email))));
ipsRegistry::getClass('adminFunctions')->saveAdminLog(sprintf($this->lang->words['changed_email'], $email));
}
if ($this->request['password']) {
if (!$this->request['password_confirm']) {
$this->registry->output->global_error = $this->lang->words['change_both_fields'];
$this->_showForm();
return;
} else {
if ($this->request['password'] != $this->request['password_confirm']) {
$this->registry->output->global_error = $this->lang->words['change_not_match_pw'];
$this->_showForm();
return;
}
}
$password = $this->request['password'];
$salt = str_replace('\\', "\\\\", IPSMember::generatePasswordSalt(5));
$key = IPSMember::generateAutoLoginKey();
$md5_once = md5(trim($password));
$classToLoad = IPSLib::loadLibrary(IPS_ROOT_PATH . 'sources/handlers/han_login.php', 'han_login');
$han_login = new $classToLoad($this->registry);
$han_login->init();
$han_login->changePass($this->memberData['email'], $md5_once, $password, $this->memberData);
IPSMember::save($this->memberData['member_id'], array('core' => array('members_pass_salt' => $salt, 'member_login_key' => $key)));
IPSMember::updatePassword($this->memberData['member_id'], $md5_once);
IPSLib::runMemberSync('onPassChange', $this->memberData['member_id'], $password);
ipsRegistry::getClass('adminFunctions')->saveAdminLog($this->lang->words['changed_password']);
}
$this->registry->output->global_message = $this->lang->words['details_updated'];
$this->registry->output->silentRedirectWithMessage($this->settings['base_url']);
}
示例8: authenticate
/**
* Authenticate the request
*
* @access public
* @param string Username
* @param string Email Address
* @param string Password
* @return boolean Authentication successful
*/
public function authenticate($username, $email_address, $password)
{
//-----------------------------------------
// Set basic data
//-----------------------------------------
$send = array('act' => 'login', 'key' => $this->connectConfig['master_key'], 'password' => md5($password));
//-----------------------------------------
// Load to check if we have master ID already
//-----------------------------------------
if ($username) {
$_member = IPSMember::load($username, 'all', 'username');
} else {
$_member = IPSMember::load($email_address, 'all', 'email');
}
if ($_member['ipsconnect_id']) {
$send['idType'] = 'id';
$send['id'] = $_member['ipsconnect_id'];
} else {
if ($username) {
$send['idType'] = 'username';
$send['id'] = $username;
} else {
$send['idType'] = 'email';
$send['id'] = $email_address;
}
}
//-----------------------------------------
// Send API Call
//-----------------------------------------
$send['key'] = md5($send['key'] . $send['id']);
$url = $this->connectConfig['master_url'] . '?' . http_build_query($send);
$return = $this->cfm->getFileContents($url);
$data = @json_decode($return, TRUE);
if (!isset($data['connect_status']) or !$data['connect_status']) {
$this->return_code = 'WRONG_AUTH';
return false;
}
//-----------------------------------------
// If unsuccessful, return
//-----------------------------------------
if ($data['connect_status'] != 'SUCCESS') {
$this->return_code = $data['connect_status'];
if ($this->return_code == 'ACCOUNT_LOCKED') {
$this->account_unlock = $data['connect_unlock'];
/* @link http://community.invisionpower.com/resources/bugs.html/_/ip-board/ipsconnect-account-unlock-time-r40812 */
if ($data['connect_unlock_period']) {
$this->settings['ipb_bruteforce_period'] = $data['connect_unlock_period'];
}
}
if ($this->return_code == 'VALIDATING') {
$this->revalidate_url = $data['connect_revalidate_url'];
}
return false;
}
//-----------------------------------------
// Create or update member accordingly
//-----------------------------------------
$update = array();
$this->member_data = IPSMember::load($data['connect_id'], 'all', 'ipsconnect');
if (!isset($this->member_data['member_id']) and isset($_member['member_id'])) {
$this->member_data = $_member;
$update['ipsconnect_id'] = $data['connect_id'];
}
if (!isset($this->member_data['member_id'])) {
if (IPSText::mbstrlen($data['connect_username']) > ipsRegistry::$settings['max_user_name_length']) {
$data['connect_username'] = IPSText::mbsubstr($data['connect_username'], 0, ipsRegistry::$settings['max_user_name_length']);
}
$this->member_data = $this->createLocalMember(array('members' => array('name' => $data['connect_username'], 'members_display_name' => $data['connect_displayname'], 'email' => $email_address, 'password' => $password, 'ipsconnect_id' => $data['connect_id'])));
} else {
if ($this->member_data['name'] != $data['connect_username'] and !defined('CONNECT_NOSYNC_NAMES')) {
$update['name'] = $data['connect_username'];
}
if ($this->member_data['members_display_name'] != $data['connect_displayname'] and !defined('CONNECT_NOSYNC_NAMES')) {
$update['members_display_name'] = $data['connect_displayname'];
}
if ($this->member_data['email'] != $data['connect_email']) {
$update['email'] = $data['connect_email'];
}
IPSMember::updatePassword($this->member_data['member_id'], md5($password));
}
//-----------------------------------------
// Privacy
//-----------------------------------------
$privacy = $this->member_data['g_hide_online_list'] || empty($this->settings['disable_anonymous']) && !empty($this->request['anonymous']) ? 1 : 0;
$update['login_anonymous'] = intval($privacy) . '&1';
//-----------------------------------------
// Update
//-----------------------------------------
if (!empty($update)) {
IPSMember::save($this->member_data['member_id'], array('members' => $update));
}
//.........這裏部分代碼省略.........
示例9: updateUser
public function updateUser($api_key, $api_module, $username, $email, $md5_passwordHash)
{
//-----------------------------------------
// INIT
//-----------------------------------------
$api_key = IPSText::md5Clean($api_key);
$api_module = IPSText::parseCleanValue($api_module);
//-----------------------------------------
// Authenticate
//-----------------------------------------
if ($this->__authenticate($api_key, $api_module, 'updateUser') !== FALSE) {
//-----------------------------------------
// Add log
//-----------------------------------------
$this->addLogging($api_key);
//-----------------------------------------
// Load our user
//-----------------------------------------
$member = IPSMember::load($username, 'all', 'username');
if ($member != null) {
$email_result = IPSMember::save(array('core' => array('field' => 'member_id', 'value' => $member['member_id'])), array('core' => array('email' => $email)));
$password_result = $password_result = IPSMember::updatePassword($member['member_id'], $md5_passwordHash);
if ($email_result && $password_result) {
$this->classApiServer->apiSendReply(array('result' => 'success'));
} else {
$this->classApiServer->apiSendReply(array('result' => 'failure'));
}
}
$this->classApiServer->apiSendReply(array('result' => 'failure'));
exit;
}
}
示例10: save_password
/**
* Change a member's password
*
* @access protected
* @return void [Outputs to screen]
*/
protected function save_password()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$member_id = intval($this->request['member_id']);
$password = $this->request['password'];
$password2 = $this->request['password2'];
$new_key = intval($this->request['new_key']);
$new_salt = intval($this->request['new_salt']);
$salt = str_replace('\\', "\\\\", IPSMember::generatePasswordSalt(5));
$key = IPSMember::generateAutoLoginKey();
$md5_once = md5(trim($password));
//-----------------------------------------
// Check
//-----------------------------------------
if (!$password or !$password2) {
$this->returnJsonError($this->lang->words['password_nogood']);
exit;
}
if ($password != $password2) {
$this->returnJsonError($this->lang->words['m_passmatch']);
exit;
}
//-----------------------------------------
// Get member
//-----------------------------------------
$member = IPSMember::load($member_id);
//-----------------------------------------
// Allowed to edit administrators?
//-----------------------------------------
if ($member['g_access_cp'] and !$this->registry->getClass('class_permissions')->checkPermission('member_edit_admin', 'members', 'members')) {
$this->returnJsonError($this->lang->words['m_editadmin']);
exit;
}
//-----------------------------------------
// Check Converge: Password
//-----------------------------------------
require_once IPS_ROOT_PATH . 'sources/handlers/han_login.php';
$han_login = new han_login($this->registry);
$han_login->init();
$han_login->changePass($member['email'], $md5_once);
/*if ( $han_login->return_code != 'METHOD_NOT_DEFINED' AND $han_login->return_code != 'SUCCESS' )
{
$this->returnJsonError( $this->lang->words['m_passchange']);
exit();
}*/
//-----------------------------------------
// Local DB
//-----------------------------------------
$update = array();
if ($new_salt) {
$update['members_pass_salt'] = $salt;
}
if ($new_key) {
$update['member_login_key'] = $key;
}
if (count($update)) {
IPSMember::save($member_id, array('core' => $update));
}
IPSMember::updatePassword($member_id, $md5_once);
IPSLib::runMemberSync('onPassChange', $member_id, $password);
ipsRegistry::getClass('adminFunctions')->saveAdminLog(sprintf($this->lang->words['m_passlog'], $member_id));
$_string = <<<EOF
\t\t{
\t\t\t'success' : true,
\t\t\t'password' : "*************"
\t\t}
\t\t
EOF;
$this->returnString($_string);
}
示例11: saveFormPassword
/**
* UserCP Save Form: Password
*
* @access public
* @param array Array of member / core_sys_login information (if we're editing)
* @return mixed Array of errors / boolean true
*/
public function saveFormPassword($member = array())
{
//-----------------------------------------
// INIT
//-----------------------------------------
$cur_pass = trim($this->request['current_pass']);
$new_pass = trim($this->request['new_pass_1']);
$chk_pass = trim($this->request['new_pass_2']);
//-----------------------------------------
// Checks...
//-----------------------------------------
if ($this->memberData['g_access_cp']) {
return array(0 => $this->lang->words['admin_emailpassword']);
}
if (!$_POST['current_pass'] or empty($new_pass) or empty($chk_pass)) {
return array(0 => $this->lang->words['complete_entire_form']);
}
//-----------------------------------------
// Do the passwords actually match?
//-----------------------------------------
if ($new_pass != $chk_pass) {
return array(0 => $this->lang->words['passwords_not_matchy']);
}
//-----------------------------------------
// Check password...
//-----------------------------------------
if ($this->_checkPassword($cur_pass) !== TRUE) {
return array(0 => $this->lang->words['current_pw_bad']);
}
/*if ( IPSText::mbstrlen( $new_pass ) > 32)
{
return array( 0 => $this->lang->words['new_pw_too_long'] );
}*/
//-----------------------------------------
// Create new password...
//-----------------------------------------
$md5_pass = md5($new_pass);
//-----------------------------------------
// han_login was loaded during check_password
//-----------------------------------------
$this->han_login->changePass($this->memberData['email'], $md5_pass);
if ($this->han_login->return_code and $this->han_login->return_code != 'METHOD_NOT_DEFINED' and $this->han_login->return_code != 'SUCCESS') {
return array(0 => $this->lang->words['hanlogin_pw_failed']);
}
//-----------------------------------------
// Update the DB
//-----------------------------------------
IPSMember::updatePassword($this->memberData['email'], $md5_pass);
IPSLib::runMemberSync('onPassChange', $this->memberData['member_id'], $new_pass);
//-----------------------------------------
// Update members log in key...
//-----------------------------------------
$key = IPSMember::generateAutoLoginKey();
IPSMember::save($this->memberData['member_id'], array('core' => array('member_login_key' => $key)));
$this->ok_message = $this->lang->words['pw_change_successful'];
return TRUE;
}