Exemple #1
0
        }
        if (result.crack_time >= great) {
            \$('#crack_time').removeClass('label-danger label-important label-warning label-info');
            \$('#crack_time').addClass('label-success');
            \$('#submit').removeAttr('disabled');
        }
    });
});
EOT;
$xoops->header('module:profile/profile_changepass.tpl');
if (!isset($_POST['submit'])) {
    $xoops->theme()->addScript(null, array('type' => 'application/x-javascript'), $zxcvbn);
    //show change password form
    $form = new Xoops\Form\ThemeForm(_PROFILE_MA_CHANGEPASSWORD, 'form', $_SERVER['REQUEST_URI'], 'post', true);
    $form->addElement(new Xoops\Form\Password(_PROFILE_MA_OLDPASSWORD, 'oldpass'), true);
    $password = new Xoops\Form\Password(_PROFILE_MA_NEWPASSWORD, 'newpass', null, null, '', 'off', 'New Password');
    $password->setPattern('^.{8,}$', 'You need at least 8 characters');
    $form->addElement($password, true);
    $form->addElement(new Xoops\Form\Label(XoopsLocale::PASSWORD_STRENGTH, '', 'crack_time'));
    $form->addElement(new Xoops\Form\Password(XoopsLocale::VERIFY_PASSWORD, 'vpass'), true);
    $form->addElement(new Xoops\Form\Button('', 'submit', XoopsLocale::A_SUBMIT, 'submit'));
    $form->assign($xoops->tpl());
    $xoops->appendConfig('profile_breadcrumbs', array('caption' => _PROFILE_MA_CHANGEPASSWORD));
} else {
    $xoops->getConfigs();
    $myts = \Xoops\Core\Text\Sanitizer::getInstance();
    $oldpass = trim($_POST['oldpass']);
    $password = trim($_POST['newpass']);
    $vpass = trim($_POST['vpass']);
    $errors = array();
    if (!password_verify($oldpass, $xoops->user->getVar('pass', 'n'))) {
Exemple #2
0
$tabtray = new Xoops\Form\TabTray('', 'uniqueid', $xoops->getModuleConfig('jquery_theme', 'system'));
//Now we create our tabs
//Tabs should also have unique ids
//First tab
$tab1 = new Xoops\Form\Tab('Caption-1', 'tabid-1');
//Second tab
$tab2 = new Xoops\Form\Tab('Caption-2', 'tabid-2');
//Third tab
$tab3 = new Xoops\Form\Tab('Caption-3', 'tabid-3');
// Create the elements and assign them to the corresponding tabs
$code = new Xoops\Form\Text('Code', 'code', 2, 25, '', 'Code...');
$code->setDescription('Description code');
$code->setPattern('^.{3,}$', 'You need at least 3 characters');
$code->setDatalist(array('list 1', 'list 2', 'list 3'));
$tab1->addElement($code, true);
$password = new Xoops\Form\Password('Password', 'password', 3, 25, '', false, 'Your Password');
$password->setDescription('Description password');
$password->setPattern('^.{8,}$', 'You need at least 8 characters');
$tab1->addElement($password, true);
$description = new Xoops\Form\TextArea('Description', 'description', '', 5, 6, 'Your description');
$description->setDescription('Put the description');
$tab1->addElement($description, true);
$description_2 = new Xoops\Form\DhtmlTextArea('Description_2', 'description_2', '', 6, 7);
$description_2->setDescription('Put the description_2');
$tab1->addElement($description_2, true);
$tab2->addElement(new Xoops\Form\RadioYesNo('Yes or No', 'yesorno', 0), false);
$radio_inline = new Xoops\Form\Radio('Radio Inline', 'radio_inline', 1, true);
$radio_inline->addOption(1, 'Radio Inline 1');
$radio_inline->addOption(2, 'Radio Inline 2');
$radio_inline->addOption(3, 'Radio Inline 3');
$radio_inline->setDescription('Description Radio Inline');