Example #1
0
    protected function renderControl($type = null, $confirmation = false)
    {
        if (!$type) {
            $type = $this->field->type;
        }
        ?>
        <input type="<?php 
        echo $type;
        ?>
" name="<?php 
        echo ($confirmation ? 'confirm_' : '') . $this->field->name;
        ?>
" class="field-control fld-<?php 
        echo $this->field->type;
        ?>
 <?php 
        echo $this->field->css_class;
        ?>
" <?php 
        $this->outputId($confirmation ? 'confirm_' : '');
        $this->outputAttributes($this->field->attributes);
        if ($this->field->getValue($confirmation) != null) {
            echo ' value="' . $this->field->getValue($confirmation) . '"';
        }
        if ($this->field->required) {
            echo ' required="required"';
        }
        ?>
 />
        <?php 
    }
Example #2
0
 public function validate(Request $request, &$message = null, $suppress_errors = false)
 {
     if (parent::validate($request, $message, $suppress_errors)) {
         if (strlen($this->value) >= 8) {
             if ($this->value == str_pad('', strlen($this->value), '*') || preg_match('/^(?=.*\\d)(?=.*[A-Za-z])[0-9A-Za-z!@#$%]{8,30}$/', $this->value)) {
                 return true;
             }
         }
         $this->error = $this->language->form['err_fld_password_strength'];
     }
     return false;
 }
Example #3
0
 public function validate(Request $request, &$message = null, $suppress_errors = false)
 {
     if (parent::validate($request, $message, $suppress_errors)) {
         $valid = true;
         if (strlen(@$_FILES[$this->name]['name']) > 0) {
             if (count($_FILES) > 0) {
                 $file_info = $_FILES[$this->name];
                 $valid = $this->checkFileSize($file_info);
                 $valid = $valid ? $this->checkFileType($file_info) : $valid;
                 $valid = $valid ? $this->checkPhpErrors($file_info) : $valid;
             }
         }
         return $valid;
     } else {
         return false;
     }
 }