password.php 796 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. /**
  3. * Elgg password input
  4. * Displays a password input field
  5. *
  6. * @package Elgg
  7. * @subpackage Core
  8. *
  9. * @uses $vars['value'] The current value, if any
  10. * @uses $vars['name'] The name of the input field
  11. * @uses $vars['class'] Additional CSS class
  12. */
  13. if (isset($vars['class'])) {
  14. $vars['class'] = "elgg-input-password {$vars['class']}";
  15. } else {
  16. $vars['class'] = "elgg-input-password";
  17. }
  18. $defaults = array(
  19. 'disabled' => false,
  20. 'value' => '',
  21. 'autocapitalize' => 'off',
  22. 'autocorrect' => 'off',
  23. );
  24. // added by the plugin
  25. if (elgg_get_plugin_setting('disable_autocomplete_on_password_fields', 'security_tools') == 'yes') {
  26. $defaults['autocomplete'] = 'off';
  27. }
  28. $attrs = array_merge($defaults, $vars);
  29. ?>
  30. <input type="password" <?php echo elgg_format_attributes($attrs); ?> />