function update_user_password($uid, $old_password, $new_password) { try { $accountObj = new AccountAPI($this->apiKey, $this->apiSecret, array('output_format' => 'json')); return $accountObj->changeAccountPassword($uid, $old_password, $new_password); } catch (LoginRadiusException $e) { if (isset($e->getErrorResponse()->description) && $e->getErrorResponse()->description) { return $e->getErrorResponse()->description; } } }
/** * @param $post_value * Change user password */ public static function changePassword($post_value) { $data = $_SESSION['userprofile']; $userRegUser = new AccountAPI(LR_API_KEY, LR_API_SECRET, array('output_format' => 'json')); if (!empty($data->Uid)) { try { $result = $userRegUser->changeAccountPassword($data->Uid, $post_value['oldpassword'], $post_value['newpassword']); if (isset($result->isPosted) && $result->isPosted) { self::setMessage('Password changed successfully'); } } catch (LoginRadiusException $e) { self::setMessage($e->getErrorResponse()->description); } } }