Define the set password form.
192877
public function definition() {
        global $CFG;

        $mform = $this->_form;
        $mform->setDisableShortforms(true);
        $mform->addElement('header', 'setpassword', get_string('setpassword'), '');

        // Include the username in the form so browsers will recognise that a password is being set.
        $mform->addElement('text', 'username', '', 'style="display: none;"');
        $mform->setType('username', PARAM_RAW);
        // Token gives authority to change password.
        $mform->addElement('hidden', 'token', '');
        $mform->setType('token', PARAM_ALPHANUM);

        // Visible elements.
        $mform->addElement('static', 'username2', get_string('username'));

        $policies = array();
        if (!empty($CFG->passwordpolicy)) {
            $policies[] = print_password_policy();
        }
        if (!empty($CFG->passwordreuselimit) and $CFG->passwordreuselimit > 0) {
            $policies[] = get_string('informminpasswordreuselimit', 'auth', $CFG->passwordreuselimit);
        }
        if ($policies) {
            $mform->addElement('static', 'passwordpolicyinfo', '', implode('<br />', $policies));
        }
        $mform->addElement('password', 'password', get_string('newpassword'));
        $mform->addRule('password', get_string('required'), 'required', null, 'client');
        $mform->setType('password', PARAM_RAW);

        $strpasswordagain = get_string('newpassword') . ' (' . get_string('again') . ')';
        $mform->addElement('password', 'password2', $strpasswordagain);
        $mform->addRule('password2', get_string('required'), 'required', null, 'client');
        $mform->setType('password2', PARAM_RAW);

        $this->add_action_buttons(true);
    }
1253710
def set_password(url, ownerToken, password):
    '''
        
    '''
    
    service, fileId, key = sendclient.common.splitkeyurl(url)
    rawKey = sendclient.common.unpadded_urlsafe_b64decode(key)
    keys = sendclient.common.secretKeys(rawKey, password, url)
    
    return api_password(service, fileId, ownerToken, keys.newAuthKey)
252594
def check_or_set_password

    if self.password.blank?
      self.password =
        ::Milia::Password.generate(
          8, Password::ONE_DIGIT | Password::ONE_CASE
        )

        self.password_confirmation = self.password
    else
      # if a password is being supplied, then ok to skip
      # setting up a password upon confirm
      self.skip_confirm_change_password = true if ::Milia.use_invite_member
    end

  end
3214
public function initForm()
    {
        $this->form = tao_helpers_form_FormFactory::getForm('passwordRecoveryForm');

        $connectElt = tao_helpers_form_FormFactory::getElement('recovery', 'Submit');
        $connectElt->setValue(__('Email'));
        $connectElt->setAttribute('class', 'btn-success small');
        $this->form->setActions(array($connectElt), 'bottom');
    }
630260
def passwordbox(msg="Enter your password."
    , title=" "
    , default=""
    , image=None
    , root=None
    ):
    
    return __fillablebox(msg, title, default, mask="*",image=image,root=root)
98315
protected function settingForm()
    {
        return Administrator::form(function (Form $form) {
            $form->display('mobile', trans('merchant.mobile'))->rules('required');
            $form->email('email', trans('merchant.email'))->rules('required');
            $form->text('name', trans('merchant.name'))->rules('required');
            $form->image('avatar', trans('merchant.avatar'));
            $form->password('password', trans('merchant.password'))->rules('confirmed|required');
            $form->password('password_confirmation', trans('merchant.password_confirmation'))->rules('required')
                ->default(function ($form) {
                    return $form->model()->password;
                });

            $form->setAction(merchant_base_path('auth/setting'));
            $form->ignore(['password_confirmation']);

            $form->saving(function (Form $form) {
                if ($form->password && $form->model()->password != $form->password) {
                    $form->password = bcrypt($form->password);
                }
            });

            $form->saved(function () {
                merchant_toastr(trans('merchant.update_succeeded'));

                return redirect(merchant_base_path('auth/setting'));
            });
        });
    }
1343158
protected function createComponentRestorePasswordForm(): Form
	{
		$form = $this->formFactory->create();
		$form->addProtection();

		$form->addHidden('hash');

		$form->addPassword('password', 'cms.user.newPassword')
			->setRequired()
			->addRule(Form::MIN_LENGTH, null, $this->minPasswordLength);
		$form->addPassword('passwordVerify', 'cms.user.passwordVerify')
			->setRequired()
			->addRule(Form::EQUAL, null, $form['password']);

		$form->addSubmit('restore', 'form.save');

		$form->onSuccess[] = [$this, 'restorePasswordFormSucceeded'];

		return $form;
	}
249228
def ask_for_password(cls, ui, prompt='Provide your password:', **options):
        
        # optionally set title, that may be used by some helpers like zenity
        return cls.get_appropriate_helper(ui).ask_for_password(prompt,
                                                               title=options.get('title', prompt))
409556
public function setPassword($password = null)
    {
        if (empty($password)) {
            $password = $this->getEmptyPasswordSpecialty();
        }
        $phAttribute = $this->passwordHashAttribute;
        if (empty($phAttribute) || !is_string($phAttribute)) {
            return;
        }
        $this->$phAttribute = $this->generatePasswordHash($password);
        $this->_password = $password;
        $this->trigger(static::$eventAfterSetPassword);
    }
23907
def check_user_password(self, user, password=None, form=None):
        
        pwcol = self.options['password_column']
        if password is None:
            if not form and "form" in current_context.data and request.method == "POST":
                form = current_context.data.form
            if form:
                password = form[pwcol].data
            else:
                raise OptionMissingError("Missing 'password' option or a form")
        current_pwd = getattr(user, pwcol)
        if not current_pwd or not self.bcrypt.check_password_hash(current_pwd, password):
            current_context.exit(trigger_action_group="password_mismatch")
306269
def set_password(self, password):
        
        self.password = password
        self.changed_event.emit(self)
666426
def set_password(self, password):
        
        self.password = Security.hash(password)
        self.save()
369850
def password(name, options = {})
      field name, CharField.new(options.merge(widget: Widgets::PasswordInput.new))
    end
119558
static function laraform($name, $min = 6, $lower = true, $upper = true, $digits = true) {
        $el = new ElementPasswordTwbs($name);
        return $el->setAppend('<i class="fa fa-eye js-laraform-password pointer"></i>')
            ->setPrepend('<i class="fa fa-lock"></i>')
            ->addClass('form-control');
    }
645106
def setUserPasswdCredentials(self, username, password):
        """"""

        self.setCredentialValues(username=username, password=password)
1241865
def set_credentials(self, username, password):
        
        if username is not None:
            self._username = username

        if password is not None:
            self._password = password
54685
def set_password(self, service, username, password):
        
        segments = range(0, len(password), self._max_password_size)
        password_parts = [
            password[i:i + self._max_password_size] for i in segments]
        for i, password_part in enumerate(password_parts):
            curr_username = username
            if i > 0:
                curr_username += '{{part_%d}}' % i
            self._keyring.set_password(service, curr_username, password_part)