From c5f64246f47b70585c8c599c7d20013d53cb25ec Mon Sep 17 00:00:00 2001 From: Brayan Pereyra Date: Tue, 7 Apr 2015 16:53:08 -0400 Subject: [PATCH] PM-2107 Deshabilitar el autocompletado del login --- gulliver/system/class.xmlform.php | 43 +++++++++++-------- .../engine/xmlform/login/forgotPassword.xml | 4 +- workflow/engine/xmlform/login/login.html | 13 +++--- workflow/engine/xmlform/login/login.xml | 22 +++++----- .../engine/xmlform/login/sysLoginNoWS.xml | 18 ++++++-- 5 files changed, 59 insertions(+), 41 deletions(-) diff --git a/gulliver/system/class.xmlform.php b/gulliver/system/class.xmlform.php index 73b519c94..5f2c36a66 100755 --- a/gulliver/system/class.xmlform.php +++ b/gulliver/system/class.xmlform.php @@ -1109,6 +1109,7 @@ class XmlForm_Field_Text extends XmlForm_Field_SimpleText public $replaceTags = 0; public $renderMode = ''; public $comma_separator = '.'; + public $autocomplete = "on"; /** * Function render @@ -1121,6 +1122,13 @@ class XmlForm_Field_Text extends XmlForm_Field_SimpleText */ public function render ($value = null, $owner = null) { + if ($this->autocomplete === '1') { + $this->autocomplete = "on"; + } else { + if ($this->autocomplete === '0') { + $this->autocomplete = "off"; + } + } if ($this->renderMode == '') { $this->renderMode = $this->mode; } @@ -1168,6 +1176,7 @@ class XmlForm_Field_Text extends XmlForm_Field_SimpleText $html .= 'id="form[' . $this->name . ']" '; $html .= 'name="form[' . $this->name . ']" '; $html .= 'type="text" size="' . $this->size . '" maxlength="' . $this->maxLength . '" '; + $html .= 'autocomplete="' . $this->autocomplete . '" '; $html .= 'value="' . $this->htmlentities( $value, ENT_QUOTES, 'utf-8' ) . '" '; $html .= 'style="' . $this->htmlentities( $this->style, ENT_COMPAT, 'utf-8' ) . '" '; $html .= 'onkeypress="' . $this->htmlentities( $onkeypress, ENT_COMPAT, 'utf-8' ) . '" '; @@ -4827,23 +4836,23 @@ class XmlForm_Field_Date extends XmlForm_Field_SimpleText /* //Year - %Y year with the century - %y year without the century (range 00 to 99) - //Month - %m month, range 01 to 12 - %B full month name - %b abbreviated month name - //Day - %d the day of the month (range 01 to 31) - %e the day of the month (range 1 to 31) - //Hour - %H hour, range 00 to 23 (24h format) - %I hour, range 01 to 12 (12h format) - %k hour, range 0 to 23 (24h format) - %l hour, range 1 to 12 (12h format) - //Min - %M minute, range 00 to 59 - //Sec + %Y year with the century + %y year without the century (range 00 to 99) + //Month + %m month, range 01 to 12 + %B full month name + %b abbreviated month name + //Day + %d the day of the month (range 01 to 31) + %e the day of the month (range 1 to 31) + //Hour + %H hour, range 00 to 23 (24h format) + %I hour, range 01 to 12 (12h format) + %k hour, range 0 to 23 (24h format) + %l hour, range 1 to 12 (12h format) + //Min + %M minute, range 00 to 59 + //Sec %S seconds, range 00 to 59 */ function date_create_from_format( $dformat, $dvalue, $withHours = false ) diff --git a/workflow/engine/xmlform/login/forgotPassword.xml b/workflow/engine/xmlform/login/forgotPassword.xml index f33c100fa..015f67cc1 100755 --- a/workflow/engine/xmlform/login/forgotPassword.xml +++ b/workflow/engine/xmlform/login/forgotPassword.xml @@ -3,10 +3,10 @@ <en><![CDATA[I forgot my password]]></en> - + - + diff --git a/workflow/engine/xmlform/login/login.html b/workflow/engine/xmlform/login/login.html index c0b57c92c..fe97cc24a 100755 --- a/workflow/engine/xmlform/login/login.html +++ b/workflow/engine/xmlform/login/login.html @@ -6,6 +6,7 @@ +
{$form.USR_PASSWORD}
@@ -15,8 +16,8 @@ - - + + @@ -37,12 +38,10 @@
{$form.TITLE}{$form.USR_USERNAME}
{$USR_PASSWORD}{$form.USR_PASSWORD}{$USR_PASSWORD_MASK}{$form.USR_PASSWORD_MASK}
{$USER_LANG}
- - - - + \ No newline at end of file diff --git a/workflow/engine/xmlform/login/login.xml b/workflow/engine/xmlform/login/login.xml index fe24f8e73..54fb684f2 100755 --- a/workflow/engine/xmlform/login/login.xml +++ b/workflow/engine/xmlform/login/login.xml @@ -3,19 +3,22 @@ <en><![CDATA[Login]]></en> - + - + + + + SELECT LANG_ID, LANG_NAME FROM langOptions - + @@ -84,14 +87,11 @@ var dynaformOnload = function() { }; leimnud.event.add(document.getElementById('form[BSUBMIT]'), 'click', function() { - setNestedProperty(this, Array('disabled'), 'true'); - setNestedProperty(this, Array('value'), @@LOGIN_VERIFY_MSG); - - var client = getBrowserClient(); - - if (client.browser != "firefox") { - document.login.submit(); - } + document.getElementById('form[USR_PASSWORD]').value = document.getElementById('form[USR_PASSWORD_MASK]').value; + document.getElementById('form[USR_PASSWORD_MASK]').value = ''; + document.getElementById('form[USR_PASSWORD_MASK]').setAttribute('type', 'text'); + document.login.submit(); + //return true; }.extend(document.getElementById('form[BSUBMIT]'))); ]]> diff --git a/workflow/engine/xmlform/login/sysLoginNoWS.xml b/workflow/engine/xmlform/login/sysLoginNoWS.xml index 7e24eebde..8e854da06 100755 --- a/workflow/engine/xmlform/login/sysLoginNoWS.xml +++ b/workflow/engine/xmlform/login/sysLoginNoWS.xml @@ -3,20 +3,23 @@ <en><![CDATA[Login]]></en> - + - + - + + + + SELECT LANG_ID, LANG_NAME FROM langOptions - +