/** * @inheritdoc */ public function init() { /** * @var Module $m */ $m = Yii::$app->getModule('user'); if (!$m->getRegistrationSetting('randomUsernames', $this->userType)) { $this->attributes['username'] = ['type' => Form::INPUT_TEXT, 'options' => ['autocomplete' => 'new-username']]; } if (!$m->getRegistrationSetting('randomPasswords', $this->userType)) { $password = ['type' => Form::INPUT_PASSWORD]; if (in_array(Module::SCN_REGISTER, $m->passwordSettings['strengthMeter'])) { $password = ['type' => Form::INPUT_WIDGET, 'widgetClass' => PasswordInput::classname(), 'options' => ['options' => ['placeholder' => Yii::t('user', 'Password'), 'autocomplete' => 'off']]]; } $this->attributes['password'] = $password; } $this->attributes['email'] = ['type' => Form::INPUT_TEXT]; $captcha = ArrayHelper::getValue($m->registrationSettings, 'captcha', false); if ($captcha !== false && is_array($captcha)) { $this->attributes['captcha'] = ['type' => Form::INPUT_WIDGET, 'widgetClass' => Captcha::classname(), 'options' => $captcha['widget']]; } parent::init(); unset($this->attributes['rememberMe']); $this->leftFooter = $m->button(Module::BTN_HOME) . $m->button(Module::BTN_ALREADY_REGISTERED); $this->rightFooter = $m->button(Module::BTN_RESET_FORM) . ' ' . $m->button(Module::BTN_REGISTER); }
/** * @inheritdoc */ public function init() { parent::init(); $m = $this->_module; if ($this->model->scenario !== Module::SCN_EXPIRY) { if ($this->model->scenario !== Module::SCN_REGISTER) { $this->mergeAttributes(['username' => ['type' => Form::INPUT_TEXT], 'password' => ['type' => Form::INPUT_PASSWORD], 'rememberMe' => ['type' => Form::INPUT_CHECKBOX]]); } $this->leftFooter = $m->button(Module::BTN_FORGOT_PASSWORD) . $m->button(Module::BTN_NEW_USER); $this->rightFooter = $m->button(Module::BTN_LOGIN); if ($this->hasSocialAuth && $m->socialSettings['widgetEnabled']) { $social = $m->getSocialWidget(); if (!isset($this->template)) { $this->template = <<<HTML <div class="row"> <div class="col-sm-8"> <legend>{$this->title}</legend> {fields} </div> <div class="col-sm-4"> <legend>{$this->authTitle}</legend> {$social} </div> </div> {footer} HTML; } else { $this->template = str_replace('{social}', $social, $this->template); } } } else { $password = ['type' => Form::INPUT_PASSWORD]; if (in_array(Module::SCN_EXPIRY, $m->passwordSettings['strengthMeter'])) { $password = ['type' => Form::INPUT_WIDGET, 'widgetClass' => PasswordInput::classname(), 'options' => ['options' => ['placeholder' => Yii::t('user', 'Password'), 'autocomplete' => 'new-password']]]; } $this->mergeAttributes(['username' => ['type' => Form::INPUT_HIDDEN], 'password' => ['type' => Form::INPUT_PASSWORD], 'password_new' => $password, 'password_confirm' => ['type' => Form::INPUT_PASSWORD]]); $this->leftFooter = Html::hiddenInput('unlock-account', '1', ['id' => 'unlock-account']); $this->rightFooter = $m->button(Module::BTN_SUBMIT_FORM); } }
</p> <?php $form = ActiveForm::begin(['id' => 'form-signup']); ?> <?php echo $form->field($model, 'username')->textInput(['placeholder' => Yii::t('app', 'Create your username'), 'autofocus' => true]); ?> <?php echo $form->field($model, 'email')->input('email', ['placeholder' => Yii::t('app', 'Enter your e-mail')]); ?> <?php echo $form->field($model, 'password')->widget(PasswordInput::classname(), ['options' => ['placeholder' => Yii::t('app', 'Create your password')]]); ?> <div class="form-group"> <?php echo Html::submitButton(Yii::t('app', 'Signup'), ['class' => 'btn btn-primary', 'name' => 'signup-button']); ?> </div> <?php ActiveForm::end(); ?> <?php if ($model->scenario === 'rna') { ?>
echo Html::encode($this->title) . " для " . $model->username; ?> </h1> <div class="links-form"> <?php $form = ActiveForm::begin(); ?> <?php echo $form->field($model, 'password')->widget(PasswordInput::classname()); ?> <?php echo $form->field($model, 'repeatPassword')->widget(PasswordInput::classname()); ?> <div class="form-group"> <?php echo Html::submitButton('Сохранить', ['class' => 'btn btn-success']); ?> </div> <?php ActiveForm::end(); ?> </div> </div>
?> </h1> </div> <?php $form = ActiveForm::begin(['type' => ActiveForm::TYPE_HORIZONTAL, 'formConfig' => ['labelSpan' => 4]]); echo $form->errorSummary($model); ?> <!-- dummy inputs to prevent auto fill --> <input type="text" name="prevent_autofill" id="prevent_autofill" value="" style="display:none;" /> <input type="password" name="password_fake" id="password_fake" value="" style="display:none;" /> <div class="row"> <div class="col-md-8"> <?php echo $form->field($model, 'username')->textInput(['maxlength' => 128, 'autocomplete' => 'new_username']); if (in_array(Module::SCN_ADMIN, $m->passwordSettings['strengthMeter'])) { echo $form->field($model, 'password')->widget(PasswordInput::classname(), []); } else { echo $form->field($model, 'password')->passwordInput(); } echo $form->field($model, 'email')->textInput(['maxlength' => 255]); echo $form->field($model, 'status')->widget(Select2::classname(), ['data' => $m->getEditStatuses(), 'options' => ['options' => $m->getDisabledStatuses()]]); ?> </div> </div> <hr> <div class="text-right"> <?php echo $m->button(Module::BTN_RESET_FORM); ?> <?php
?> </h1> <div class="col-md-5 well bs-component"> <p><?php echo Yii::t('app', 'Please choose your new password:'******'id' => 'reset-password-form']); ?> <?php echo $form->field($model, 'password')->widget(PasswordInput::classname(), ['options' => ['placeholder' => Yii::t('app', 'Enter new password'), 'autofocus' => true]]); ?> <div class="form-group"> <?php echo Html::submitButton(Yii::t('app', 'Save'), ['class' => 'btn btn-primary']); ?> </div> <?php ActiveForm::end(); ?> </div> </div>
?> <div class="mdlpermission-form"> <?php $form = ActiveForm::begin(['id' => $model->formName(), 'enableClientValidation' => true]); ?> <?php echo $form->field($model, 'username')->textInput(); ?> <!-- $form->field($model, 'password_hash')->passwordInput()?> --> <?php echo $form->field($model, 'password_hash')->widget(PasswordInput::classname()); ?> <?php echo $form->field($model, 'EMP_ID')->widget(Select2::classname(), ['data' => $data, 'language' => 'en', 'options' => ['placeholder' => 'Select...'], 'pluginOptions' => ['allowClear' => true]]); ?> <div class="form-group"> <?php echo Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']); ?> </div> <?php
<table class="form-table"> <!-- OLD PASSWORD --> <?php echo $form->field($model, 'password_old', ['options' => ['tag' => 'tr'], 'labelOptions' => ['class' => false, 'label' => '<strong>' . $model->getAttributeLabel('password_old') . '</strong>'], 'inputOptions' => ['class' => 'textfield'], 'errorOptions' => ['tag' => 'span', 'class' => 'error-text', 'for' => 'changepasword-password_old', 'style' => 'display: none;'], 'template' => "<td>{label}</td><td><div class='form-table-box'>{input}{error}</div></td>"])->passwordInput(); ?> <!-- NEW PASSWORD --> <?php $strength = Yii::t('profile', 'password_strength'); $tooShort = Yii::t('profile', 'password_too_short'); $veryWeak = Yii::t('profile', 'password_very_weak'); $weak = Yii::t('profile', 'password_weak'); $good = Yii::t('profile', 'password_good'); $strong = Yii::t('profile', 'password_strong'); $veryStrong = Yii::t('profile', 'password_very_strong'); $strengthTemplate = "<div class='password-strength'>\n <ul id='indicator'>\n <li></li>\n <li></li>\n <li></li>\n <li></li>\n <li></li>\n </ul>\n <ul style='display:none;' id='verdict'>\n <li id='tooShort'>{$tooShort}</li>\n <li id='veryWeak'>{$veryWeak}</li>\n <li id='weak'>{$weak}</li>\n <li id='good'>{$good}</li>\n <li id='strong'>{$strong}</li>\n <li id='veryStrong'>{$veryStrong}</li>\n </ul>\n <span>{$strength} — <span id='strengthVerdict'>{$tooShort}</span></span>\n </div>"; echo $form->field($model, 'password', ['options' => ['tag' => 'tr'], 'labelOptions' => ['class' => false, 'label' => '<strong>' . $model->getAttributeLabel('password') . '</strong>'], 'inputOptions' => ['class' => 'textfield'], 'errorOptions' => ['tag' => 'span', 'class' => 'error-text', 'for' => 'changepasword-password', 'style' => 'display: none;'], 'template' => "<td>{label}</td><td><div class='form-table-box pull-left'>{input}{error}</div>{$strengthTemplate}</td>"])->widget(PasswordInput::classname(), ['pluginOptions' => ['language' => 'ru', 'showMeter' => false, 'toggleMask' => false, 'showToggle' => false, 'rules' => ['midChar' => 2, 'consecAlphaUC' => 2, 'consecAlphaLC' => 2, 'consecNumber' => 2, 'seqAlpha' => 3, 'seqNumber' => 3, 'seqSymbol' => 3, 'length' => 4, 'number' => 4, 'symbol' => 6], 'inputClass' => 'textfield', 'mainTemplate' => '<table class="kv-strength-container"> <tr> <td>{input}</td> </tr> </table>']]); ?> <!-- REPEAT PASSWORD --> <?php echo $form->field($model, 'password_repeat', ['options' => ['tag' => 'tr'], 'labelOptions' => ['class' => false, 'label' => '<strong>' . $model->getAttributeLabel('password_repeat') . '</strong>'], 'inputOptions' => ['class' => 'textfield'], 'errorOptions' => ['tag' => 'span', 'class' => 'error-text', 'for' => 'changepasword-password_repeat', 'style' => 'display: none;'], 'template' => "<td>{label}</td><td><div class='form-table-box'>{input}{error}</div></td>"])->passwordInput(); ?> </table>
?> </h1> </div> <?php $form = ActiveForm::begin(['type' => ActiveForm::TYPE_HORIZONTAL, 'formConfig' => ['labelSpan' => 4]]); ?> <div class="row"> <div class="col-md-8"> <?php echo $form->field($model, 'password')->passwordInput(['placeholder' => Yii::t('user', 'Enter current password')]); ?> <?php if (in_array(Module::SCN_CHANGEPASS, $m->passwordSettings['strengthMeter'])) { ?> <?php echo $form->field($model, 'password_new')->widget(PasswordInput::classname(), ['options' => ['placeholder' => Yii::t('user', 'Enter new password')]]); ?> <?php } else { ?> <?php echo $form->field($model, 'password_new')->passwordInput(['placeholder' => Yii::t('user', 'Enter new password')]); ?> <?php } ?> <?php echo $form->field($model, 'password_confirm')->passwordInput(['placeholder' => Yii::t('user', 'Confirm new password')]); ?> </div> </div>
?> <?php if ($user->scenario === 'create') { ?> <?php echo $form->field($user, 'password')->widget(PasswordInput::classname(), ['options' => ['placeholder' => Yii::t('app', 'Create password')]]); ?> <?php } else { ?> <?php echo $form->field($user, 'password')->widget(PasswordInput::classname(), ['options' => ['placeholder' => Yii::t('app', 'Change password ( if you want )')]]); ?> <?php } ?> <div class="row"> <div class="col-md-6"> <?php echo $form->field($user, 'status')->dropDownList($user->statusList); ?> <?php
echo $form->field($model, 'email', ['addon' => Yii::$app->params['defaultAddons']['email']]); ?> </div> <div class="col-md-4"> <?php echo $form->field($model, 'group_id', ['template' => "{label}{input}{error}{hint}"])->dropDownList((new Group())->getDropdownOptions('name'), ['prompt' => '::' . Yii::t('user', 'Select a User Group') . '::']); ?> </div> </div> <div class="row"> <div class="col-md-4"> <?php echo $form->field($model, 'password')->passwordInput(['maxlength' => true])->hint($model->isNewRecord ? null : Yii::t('user', 'Password message'))->widget(PasswordInput::classname(), ['language' => 'pt-BR']); ?> </div> </div> <div class="row"> <div class="col-md-3"> <?php echo $form->field($model, 'repeatPassword')->passwordInput(['maxlength' => true]); ?> </div> </div> <?php echo $form->field($model, 'status')->checkbox(); ?>
<?php use yii\helpers\Html; use kartik\widgets\ActiveForm; use kartik\builder\Form; use kartik\password\PasswordInput; ?> <?php $form = ActiveForm::begin(['type' => ActiveForm::TYPE_VERTICAL, 'id' => 'password-utama-login', 'enableClientValidation' => true, 'enableAjaxValidation' => true, 'method' => 'post', 'action' => ['/sistem/crm-user-profile/password-utama-save']]); ?> <?php echo $form->field($validationFormLogin, 'oldpassword')->widget(PasswordInput::classname(), ['options' => []]); ?> <?php echo $form->field($validationFormLogin, 'password')->widget(PasswordInput::classname()); ?> <?php echo $form->field($validationFormLogin, 'repassword')->widget(PasswordInput::classname()); ?> <div style="text-align: right;"> <?php echo Html::submitButton('Saved', ['class' => 'btn btn-primary']); ?> </div> <?php ActiveForm::end();
<div class="panel panel-default"> <div class="panel-heading"> <div class="page-header" style="padding-left: 10px;"> <h1><?php echo Html::encode($this->title); ?> </h1> <small>Please feels free to update your password</small> </div> </div> <div class="panel-body"> <?php $form = ActiveForm::begin(['type' => ActiveForm::TYPE_VERTICAL, 'options' => ['enctype' => 'multipart/form-data']]); ?> <?php $form = ActiveForm::begin(['id' => 'login-form']); echo $form->field($model, 'password')->widget(PasswordInput::classname(), ['pluginOptions' => ['showMeter' => true, 'toggleMask' => false]]); ?> <hr/> <div class="form-group"> <div class="col-sm-offset-2 col-sm-9"> <?php echo Html::submitButton('Update', ['class' => 'btn btn-primary btn-block']); ActiveForm::end(); ?> </div> </div> </div> </div> </div>
<div class="mdlpermission-form"> <?php $form = ActiveForm::begin(['id' => $model->formName(), 'enableClientValidation' => true]); ?> <?php echo $form->field($model, 'username')->textInput(); ?> <!-- $form->field($model, 'old_pass')->textInput()?> --> <!-- $form->field($model, 'password_hash')->passwordInput()?> --> <?php echo $form->field($model, 'new_pass')->widget(PasswordInput::classname()); ?> <?php if (!$model->IsNewRecord) { echo $form->field($model, 'status')->dropDownList(['' => ' -- Silahkan Pilih --', '1' => 'Tidak Aktif', '10' => 'Aktif']); } ?> <div class="form-group"> <?php echo Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']); ?> </div> <?php