[ Index ]

PHP Cross Reference of Quick Form DataBase

title

Body

[close]

/objects/ -> qfdbobj_password.php (source)

   1  <?php
   2  if (!defined('QFDB_SECURITY')) {
   3      die("You can't access this file directly...");
   4  }
   5  
   6  
   7  
   8  class qfdbobj_password {
   9      // 0.4
  10      static function obj_struct(&$qfdb)
  11      {
  12          $qfdb->m['object'] = 'password'; // string (fixed)
  13          $qfdb->m['status'] = '1234'; // string
  14          $qfdb->m['if'] = ''; // string
  15          $qfdb->m['alias'] = ''; // string
  16  
  17          $qfdb->m['db_field'] = ''; // string
  18          $qfdb->m['form_field'] = ''; // string
  19          $qfdb->m['verify'] = ''; // string
  20          $qfdb->m['verify_message'] = ''; // string
  21          $qfdb->m['crypt'] = ''; // string
  22          $qfdb->m['value'] = ''; // string
  23          $qfdb->m['minimum'] = 0; // string
  24          $qfdb->m['minimum_message'] = ''; // string
  25  
  26          $qfdb->m['title'] = ''; // string
  27  
  28          $qfdb->m['id'] = ''; // string
  29  
  30          $qfdb->m['disabled'] = 'false'; // bool
  31          $qfdb->m['required'] = 'false'; // bool
  32          $qfdb->m['size'] = 15; // int
  33          $qfdb->m['style'] = ''; // string
  34          $qfdb->m['class'] = $qfdb->get_css_value('qfdb_text'); // string
  35          $qfdb->m['help'] = ''; // string
  36          $qfdb->m['others'] = '';  // string
  37          $qfdb->m['ps_start'] = ''; // string
  38          $qfdb->m['ps_end'] = ''; // string
  39          $qfdb->m['verify_ps_start'] = ''; // string
  40          $qfdb->m['verify_ps_end'] = ''; // string
  41  
  42          $qfdb->m['label'] = ''; // string
  43          $qfdb->m['label_verify'] = ''; // string
  44          $qfdb->m['label_class'] = $qfdb->get_css_value('qfdb_tpl_label'); // string
  45          $qfdb->m['label_others'] = ''; // string
  46  
  47          $qfdb->m['display'] = 'two_cell'; //  string
  48  
  49          $qfdb->m['colspan_class'] = $qfdb->get_css_value('qfdb_tpl_colspan'); //  string
  50          $qfdb->m['colspan_others'] = ''; //  string
  51  
  52          $qfdb->m['left_class'] = $qfdb->get_css_value('qfdb_tpl_left'); // string
  53          $qfdb->m['left_others'] = ''; // string
  54          $qfdb->m['right_class'] = $qfdb->get_css_value('qfdb_tpl_right'); // string
  55          $qfdb->m['right_others'] = ''; // string
  56  
  57          $qfdb->m['validate'] = ''; // array
  58  
  59          $qfdb->m['object_properties'] = count($qfdb->m) +2; // int
  60      } // end func
  61  
  62      // 0.3
  63      static function obj_html(&$qfdb)
  64      {
  65          // inicia a construcao do objeto text
  66          $object = '<input type="password"';
  67          if ($qfdb->m['size']) {
  68              $object .= ' size="'.$qfdb->m['size'].'"';
  69          }
  70          if ($qfdb->m['style']) {
  71              $object .= ' style="'.$qfdb->m['style'].'"';
  72          }
  73          if ($qfdb->m['class']) {
  74              $object .= ' class="'.$qfdb->m['class'].'"';
  75          }
  76          if ($qfdb->m['title']) {
  77              $object .= ' title="'.$qfdb->m['title'].'"';
  78          }
  79          if ($qfdb->m['disabled']) {
  80              $object .= ' disabled="disabled"';
  81          }
  82          if ($qfdb->m['others']) {
  83              $object .= ' '.$qfdb->m['others'];
  84          }
  85  
  86          if ($qfdb->m['ps_start']) {
  87              $qfdb->m['ps_start'] = $qfdb->m['ps_start']. "\n    ";
  88          }
  89          if ($qfdb->m['ps_end']) {
  90              $qfdb->m['ps_end'] = "\n    ".$qfdb->m['ps_end'];
  91          }
  92  
  93          if ($qfdb->m['verify'] == 'true') {
  94              $object_verify = $object;
  95              $object = $qfdb->m['ps_start'].$object.' name="'.$qfdb->m['form_field'].'"  id="'.$qfdb->m['form_field'].'" />'.$qfdb->m['ps_end'];
  96              $object_verify = $qfdb->m['verify_ps_start'].$object_verify.' name="'.$qfdb->m['form_field'].'_qfdb_verify"  id="'.$qfdb->m['form_field'].'_qfdb_verify" />'.$qfdb->m['verify_ps_end'];
  97          } else {
  98              $object = $qfdb->m['ps_start'].$object.' name="'.$qfdb->m['form_field'].'"  id="'.$qfdb->m['form_field'].'" />'.$qfdb->m['ps_end'];
  99              $object_verify = false;
 100          }
 101  
 102          if ($qfdb->m['display'] == 'object_only') {
 103              $qfdb->add_output('html', $object."\n");
 104              if ($object_verify) {
 105                  $qfdb->add_output('html', $object_verify."\n");
 106              }
 107          } elseif ($qfdb->m['display'] == 'one_cell') {
 108              if ($qfdb->m['colspan_class']) {
 109                  $qfdb->m['colspan_others'] .= ' class="'.$qfdb->m['colspan_class'].'"';
 110              }
 111              $label = qfdb_themes::themes_label($qfdb->m);
 112              $qfdb->add_output('html', qfdb_themes::themes_container_one_cell( array('content'=>$object, 'others'=>$qfdb->m['colspan_others'], 'class'=>$qfdb->m['colspan_class'], 'label'=>$label) ));
 113  
 114              if ($object_verify) {
 115                  $qfdb->m['label'] = $qfdb->m['label_verify'];
 116                  $qfdb->m['id'] .= '_qfdb_verify';
 117                  $label = qfdb_themes::themes_label($qfdb->m);
 118                  $qfdb->add_output('html', qfdb_themes::themes_container_one_cell( array('content'=>$object_verify, 'others'=>$qfdb->m['colspan_others'], 'class'=>$qfdb->m['colspan_class'], 'label'=>$label)) );
 119              }
 120          } else { // $qfdb->m['display'] == 'two_cell'
 121              if ($qfdb->m['left_class']) {
 122                  $qfdb->m['left_others'] .= ' class="'.$qfdb->m['left_class'].'"';
 123              }
 124              if ($qfdb->m['right_class']) {
 125                  $qfdb->m['right_others'] .= ' class="'.$qfdb->m['right_class'].'"';
 126              }
 127              $label = qfdb_themes::themes_label($qfdb->m);
 128              $qfdb->add_output('html', qfdb_themes::themes_container_two_cells( array('label'=>$label, 'content'=>$object, 'label_others'=>$qfdb->m['left_others'], 'content_others'=>$qfdb->m['right_others'], 'label_class'=>$qfdb->m['left_class'], 'content_class'=>$qfdb->m['right_class']) ));
 129  
 130              if ($object_verify) {
 131                  $qfdb->m['label'] = $qfdb->m['label_verify'];
 132                  $qfdb->m['id'] .= '_qfdb_verify';
 133                  $label = qfdb_themes::themes_label($qfdb->m);
 134                  $qfdb->add_output('html', qfdb_themes::themes_container_two_cells( array('label'=>$label, 'content'=>$object_verify, 'label_others'=>$qfdb->m['left_others'], 'content_others'=>$qfdb->m['right_others'], 'label_class'=>$qfdb->m['left_class'], 'content_class'=>$qfdb->m['right_class']) ));
 135              }
 136          }
 137  
 138      } // end func
 139  
 140  
 141      // 0.3
 142      static function obj_db(&$qfdb)
 143      {
 144          if ($qfdb->m['crypt']) {
 145              if (function_exists($qfdb->m['crypt'])) {
 146                  $qfdb->m['value'] = $qfdb->m['crypt']($qfdb->m['value']);
 147              }
 148          }
 149      } // end func
 150  
 151  
 152      // 0.3
 153      static function obj_debug(&$qfdb)
 154      {
 155          // crypt
 156          if ($qfdb->m['crypt']) {
 157              if (!function_exists($qfdb->m['crypt'])) {
 158                  $this->set_critical_error( sprintf(QFDBOBJ_PASSWORD_NO_CRYPT_FUNCTION, $qfdb->m['crypt']) );
 159              }
 160          }
 161      } // end func
 162  
 163  
 164      // 0.4
 165      static function obj_fixed(&$qfdb)
 166      {
 167          $qfdb->fix_textpass_size();
 168          $qfdb->fix_others();
 169          $qfdb->fix_disabled();
 170          $qfdb->fix_required();
 171          $qfdb->fix_display_3();
 172  
 173          $qfdb->m['verify'] = ($qfdb->m['verify'] == 'true')  ? 'true' : 'false';
 174  
 175          // id
 176          $qfdb->m['id'] = $qfdb->m['form_field'];
 177  
 178  
 179          if ($qfdb->m['verify'] == 'true') {
 180              //if (isset($_POST[ $qfdb->m['form_field'] ]) && isset( $_POST[ $qfdb->m['form_field'].'_qfdb_verify' ])) {
 181                  if ($qfdb->m['validate']) {
 182                      $qfdb->m['validate'] .= ' &&& ';
 183                  }
 184                  $qfdb->m['validate'] .= 'verify:::'.$qfdb->m['verify_message'];
 185              //}
 186          }
 187  
 188          if (intval($qfdb->m['minimum']) > 0) {
 189              if ($qfdb->m['validate']) {
 190                  $qfdb->m['validate'] .= ' &&& ';
 191              }
 192              $qfdb->m['validate'] .= 'min:::'.$qfdb->m['minimum'].':::'.$qfdb->m['minimum_message'];
 193          }
 194      } // end func
 195  } // end class


Generated: Fri Nov 14 17:48:13 2008 Cross-referenced by PHPXref 0.7