passwordField.php 642 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. namespace MGModule\DNSManager2\mgLibs\forms;
  3. use MGModule\DNSManager2 as main;
  4. /**
  5. * Password Form Field
  6. *
  7. * @author Michal Czech <michael@modulesgarden.com>
  8. */
  9. class passwordField extends abstractField{
  10. public $showPassword = false;
  11. public $type = 'password';
  12. static function asteriskVar($input){
  13. $num = strlen($input);
  14. $input = '';
  15. for($i=0;$i<$num;$i++)
  16. {
  17. $input .= '*';
  18. }
  19. return $input;
  20. }
  21. function prepare() {
  22. if(!$this->showPassword)
  23. {
  24. self::asteriskVar($this->value);
  25. }
  26. }
  27. }