Reset the password encryption for the member to the config default.
Passwords from Foxy are encrypted so the encryption type is set to "none" when processing
the account from the data feed. Reseting is required for login to work on the website.
177757
private function resetPasswordEncryption()
    {
        $defaultEncryption = Security::config()->get('password_encryption_algorithm');
        if ($this->owner->PasswordEncryption != $defaultEncryption) {
            DB::prepared_query(
                'UPDATE "Member" SET "PasswordEncryption" = ? WHERE ID = ?',
                [$defaultEncryption, $this->owner->ID]
            );
        }
    }
723513
public boolean resetPassword(String password, String token) {
		UserRecoverRequest req = this.retrieveRecoverRequest(token);
		if (req == null)
			return false;
		User user = req.getUser();
		user.setPassword(CryptManager.passwordHash(password));
		this.dao.persist(user);
		req.setRecover(new Date());
		req.setRecoverIp(this.request.getRemoteAddr());
		req.setUsed(true);
		this.dao.persist(req);
		return true;
	}
143849
def _encrypt_password(self, password):
        
        if self.encryption_mode.lower() == 'crypt':
            return self._crypt_password(password)
        elif self.encryption_mode.lower() == 'md5':
            return self._md5_password(password)
        elif self.encryption_mode.lower() == 'md5-base':
            return self._md5_base_password(password)
        else:
            raise UnknownEncryptionMode(self.encryption_mode)
785245
def reset(ctx):
    

    controller = ctx.obj['controller']
    click.echo('Resetting OATH data...')
    old_id = controller.id
    controller.reset()

    settings = ctx.obj['settings']
    keys = settings.setdefault('keys', {})
    if old_id in keys:
        del keys[old_id]
        settings.write()

    click.echo(
        'Success! All OATH credentials have been cleared from your YubiKey.')
277855
private void doGetDefaultPassword() throws PageException {
	Password password = admin.getDefaultPassword();

	pageContext.setVariable(getString("admin", action, "returnVariable"), password == null ? "" : password.getPassword());
    }
1166677
async function askResetPassword(form) {
  await client.connect();

  try {
    await api.askResetPassword(
      {
        login: form.login.value
      },
      "user"
    );
    displayMessage(
      "Reset password",
      "A link was sent to reset your password",
      "is-success"
    );
    goTo("login");
  } catch (e) {
    displayMessage(
      "Reset password",
      `Failed to send the link to reset your password. Cause: ${e.message}`,
      "is-danger"
    );
  }
}
772842
def reset
      self.consumer_key       = DEFAULT_CONSUMER_KEY
      self.consumer_secret    = DEFAULT_CONSUMER_SECRET
      self.oauth_token        = DEFAULT_OAUTH_TOKEN
      self.oauth_token_secret = DEFAULT_OAUTH_TOKEN_SECRET
      self.endpoint           = DEFAULT_ENDPOINT
      self.user_agent         = DEFAULT_USER_AGENT
      self.timeout            = DEFAULT_TIMEOUT
      self
    end
570031
function encryptPassword(password, callback) {
        bcrypt.gen_salt(workFactor, function(err, salt) {
            if (err) callback(err);
            
            bcrypt.encrypt(password, salt, function(err, hashedPassword) {
                if (err) callback(err);
                
                callback(null, hashedPassword);
            });
        });
    }
192962
public function resetPassword()
    {
        $this->defaultData();
        $token = $this->getRequestParameter('token');

        $formContainer = new tao_actions_form_ResetUserPassword();
        $form = $formContainer->getForm();

        $form->setValues(array('token'=>$token));

        $user = $this->getPasswordRecovery()->getUser(PasswordRecoveryService::PROPERTY_PASSWORD_RECOVERY_TOKEN, $token);
        if ($user === null) {
            $this->logInfo("Password recovery token not found. Token value: {$token}");
            $this->setData('header', __('User not found'));
            $this->setData('error', __('This password reset link is no longer valid. It may have already been used. If you still wish to reset your password please request a new link'));
            $this->setData('content-template', array('passwordRecovery/password-recovery-info.tpl', 'tao'));
        } else {
            if ($form->isSubmited() && $form->isValid()) {
                $this->getPasswordRecovery()->setPassword($user, $form->getValue('newpassword'));
                $this->logInfo("User {$user->getUri()} has changed the password.");
                $this->setData('info', __("Password successfully changed"));
                $this->setData('content-template', array('passwordRecovery/password-recovery-info.tpl', 'tao'));
            } else {
                $this->setData('form', $form->render());
                $this->setData('content-template', array('passwordRecovery/password-reset.tpl', 'tao'));
            }
        }

        $this->setView('layout.tpl', 'tao');
    }
416213
def set_password(self, raw_password):
        
        if raw_password is None:
            self.set_unusable_password()
        else:
            xmpp_backend.set_password(self.node, self.domain, raw_password)
387754
def reset
      self.adapter            = DEFAULT_ADAPTER
      self.auth_method        = DEFAULT_AUTH_METHOD
      self.basic_auth_username= DEFAULT_BASIC_AUTH_USERNAME
      self.basic_auth_password= DEFAULT_BASIC_AUTH_PASSWORD
      self.consumer_key       = DEFAULT_CONSUMER_KEY
      self.consumer_secret    = DEFAULT_CONSUMER_SECRET
      self.domain             = DEFAULT_DOMAIN
      self.format             = DEFAULT_FORMAT
      self.logger             = DEFAULT_LOGGER
      self.max_requests       = DEFAULT_MAX_REQUESTS
      self.oauth_token        = DEFAULT_OAUTH_TOKEN
      self.oauth_token_secret = DEFAULT_OAUTH_TOKEN_SECRET
      self.proxy              = DEFAULT_PROXY
      self.subdomain          = DEFAULT_SUBDOMAIN
      self.support_email      = DEFAULT_SUPPORT_EMAIL
      self.use_max_requests   = DEFAULT_USE_MAX_REQUESTS
      self.user_agent         = DEFAULT_USER_AGENT
      self.version            = DEFAULT_VERSION
      self.timeout            = DEFAULT_TIMEOUT
      self
    end
1101052
public function resetpasswordAction()
    {
        $errors  = array();
        $form    = $this->createResetRequestForm();
        $request = $this->getRequest();

        if ($key = $this->_getParam('key')) {
            $user = $this->loader->getUserLoader()->getUserByResetKey($key);

            if ($user->hasValidResetKey()) {
                // Signal the reqset required so the maxage check is disabled while validating
                $user->setPasswordResetRequired(true);

                $form = $user->getChangePasswordForm(array('askOld' => false, 'askCheck' => true, 'labelWidthFactor' => $this->labelWidthFactor));

                $result = $user->authenticate(null, false);
                if (! $result->isValid()) {
                    $this->addMessage($result->getMessages());
                    $this->addMessage($this->_('For that reason you cannot reset your password.'));
                    return;
                }

                if (! $request->isPost()) {
                    $this->accesslog->logChange($request, sprintf("User %s opened valid reset link.", $user->getLoginName()));
                }
            } else {
                if (! $request->isPost()) {
                    if ($user->getLoginName()) {
                        $message = sprintf("User %s used old reset key.", $user->getLoginName());
                    } else {
                        $message = sprintf("Someone used a non existent reset key.", $user->getLoginName());
                    }
                    $this->accesslog->logChange($request, $message);

                    if ($user->hasPassword() || (! $user->isActive())) {
                        $errors[] = $this->_('Your password reset request is no longer valid, please request a new link.');
                    } else {
                        $errors[] = $this->_('Your password input request is no longer valid, please request a new link.');
                    }
                }

                if ($user->isActive()) {
                    $form->getUserNameElement()->setValue($user->getLoginName());
                    $form->getOrganizationElement()->setValue($user->getBaseOrganizationId());
                }
            }
        }

        if ($request->isPost() && $form->isValid($request->getPost())) {

            if ($form instanceof \Gems_User_Form_ResetRequestForm) {
                $user = $form->getUser();

                $result = $user->authenticate(null, false);
                if (! $result->isValid()) {
                    $this->addMessage($result->getMessages());
                    $this->addMessage($this->_('For that reason you cannot request a password reset.'));
                    return;
                }

                $errors = $this->sendUserResetEMail($user);
                if ($errors) {
                    $this->accesslog->logChange(
                            $request,
                            sprintf(
                                    "User %s requested reset password but got %d error(s). %s",
                                    $form->getUserNameElement()->getValue(),
                                    count($errors),
                                    implode(' ', $errors)
                                    )
                            );

                } else {
                    // Everything went OK!
                    $this->addMessage($this->_(
                            'We sent you an e-mail with a reset link. Click on the link in the e-mail.'
                            ));

                    $this->accesslog->logChange($request);

                    if ($this->returnToLoginAfterReset) {
                        $this->setCurrentOrganizationTo($user);
                        $this->currentUser->gotoStartPage($this->menu, $request);
                    }
                }

            } elseif ($form instanceof \Gems_User_Form_ChangePasswordForm) {
                $this->addMessage($this->_('New password is active.'));

                // User set before this form was initiated
                $user->setAsCurrentUser();

                /**
                 * Log the login
                 */
                $this->accesslog->logChange($request, $this->_("User logged in through reset password."));
        		$user->gotoStartPage($this->menu, $this->getRequest());
                return;
            }

        }
        $form->populate($request->getParams());

        $this->displayResetForm($form, $errors);
    }
98102
def set_password(cls, instance, raw_password):
        
        # support API for both passlib 1.x and 2.x
        hash_callable = getattr(
            instance.passwordmanager, "hash", instance.passwordmanager.encrypt
        )
        password = hash_callable(raw_password)
        if six.PY2:
            instance.user_password = password.decode("utf8")
        else:
            instance.user_password = password
        cls.regenerate_security_code(instance)
134996
public function resetPassword()
    {
        $data = $this->getData();

        if (!isset($data['token']) === 0) {
            throw new Exceptions\BadRequestException("you must provide a 'token'.");
        }
        if (!isset($data['password']) || strlen($data['password']) === 0) {
            throw new Exceptions\BadRequestException("you must provide a valid 'password'.");
        }

        // Set trusted context to update auths row
        Context::setTrusted(true);

        $auth = Auth::where(Auth::FORGOT_PASSWORD_FIELD, $data['token'])->first();
        if ($auth && $auth->resetPassword($data['password'])) {
            return array('success' => true);
        } else {
            throw new Exceptions\UnauthorizedException("invalid_token");
        }
    }
597780
def change_password():
    
    basic_auth = '%s:%s' % (DEFAULT_USERNAME, DEFAULT_PASSWORD)
    try:  # Python 2
        auth = base64.encodestring(basic_auth)
    except TypeError:  # Python 3
        auth = base64.encodestring(bytes(basic_auth, 'utf-8')).decode()

    headers = {
        "Content-Type": "application/json",
        "Accept": "application/json",
        "Authorization": "Basic %s" % auth.strip()
    }
    
    response = None
    retry = 0
    while not response:  # Retry if the server is not ready yet
        sleep(1)
        con = http.HTTPConnection('localhost:7474', timeout=10)
        try:
            con.request('GET', 'http://localhost:7474/user/neo4j', headers=headers)
            response = json.loads(con.getresponse().read().decode('utf-8'))
        except ValueError:
            con.close()
        retry += 1
        if retry > 10:
            print("Could not change password for user neo4j")
            break
    if response and response.get('password_change_required', None):
        payload = json.dumps({'password': 'testing'})
        con.request('POST', 'http://localhost:7474/user/neo4j/password', payload, headers)
        print("Password changed for user neo4j")
    con.close()
1232326
def reset
      self.app_key = DEFAULT_APP_KEY
      self.master_secret = DEFAULT_MASTER_SECRET
      self.endpoint = DEFAULT_ENDPOINT
      self.http_adapter = DEFAULT_HTTP_ADAPTER
      self.proxy = DEFAULT_PROXY
      self.user_agent = DEFAULT_USER_AGENT
    end
1150538
def reset_password(self, token=None, login_user=None):
        
        pwcol = self.options['password_column']
        if not token:
            if "token" in request.view_args:
                token = request.view_args["token"]
            elif "token" in request.values:
                token = request.values["token"]
            else:
                raise OptionMissingError(("Missing 'token' option or 'token' view arg "
                                          "or 'token' GET paramater in 'reset_password' action"))

        user = self.find_by_token(token, salt="password-reset", max_age=self.options["reset_password_ttl"])
        if user is None:
            if self.options["reset_password_error_message"]:
                flash(self.options["reset_password_error_message"], "error")
            current_context.exit(trigger_action_group="reset_password_failed")

        self.update_password_from_form(user)
        self.reset_password_signal.send(self, user=user)
        if (login_user is None and self.options["login_user_on_reset_password"]) or login_user:
            flask_login.login_user(user)
        return user