PM-2107 Deshabilitar el autocompletado del login

This commit is contained in:
Brayan Pereyra
2015-04-07 16:53:08 -04:00
parent 46ad717937
commit c5f64246f4
5 changed files with 59 additions and 41 deletions

View File

@@ -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 )

View File

@@ -3,10 +3,10 @@
<TITLE type="title">
<en><![CDATA[I forgot my password]]></en>
</TITLE>
<USR_USERNAME type="text" size="30" maxlength="50" required="true" validate="Any">
<USR_USERNAME type="text" size="30" maxlength="50" required="true" validate="Any" autocomplete="0">
<en><![CDATA[User]]></en>
</USR_USERNAME>
<USR_EMAIL type="text" size="30" required="true" maxlength="32">
<USR_EMAIL type="text" size="30" required="true" maxlength="32" autocomplete="0">
<en><![CDATA[Email]]></en>
</USR_EMAIL>
<URL type="hidden"/>

View File

@@ -6,6 +6,7 @@
<td valign='top'>
<input type="hidden" class="notValidateThisFields" name="__notValidateThisFields__" id="__notValidateThisFields__" value="{$form_objectRequiredFields}" />
<input type="hidden" name="DynaformRequiredFields" id="DynaformRequiredFields" value="{$form_objectRequiredFields}" />
<div style="display: none;"> {$form.USR_PASSWORD}</div>
<table cellspacing="0" cellpadding="0" border="0" width="100%">
<tr>
<td class='FormTitle' colspan="2" align="">{$form.TITLE}</td>
@@ -15,8 +16,8 @@
<td class='FormFieldContent' width='{$form_fieldContentWidth}' >{$form.USR_USERNAME}</td>
</tr>
<tr>
<td class='FormLabel' width="{$form_labelWidth}">{$USR_PASSWORD}</td>
<td class='FormFieldContent' width='{$form_fieldContentWidth}' >{$form.USR_PASSWORD}</td>
<td class='FormLabel' width="{$form_labelWidth}">{$USR_PASSWORD_MASK}</td>
<td class='FormFieldContent' width='{$form_fieldContentWidth}' >{$form.USR_PASSWORD_MASK}</td>
</tr>
<tr>
<td class='FormLabel' width="{$form_labelWidth}">{$USER_LANG}</td>
@@ -37,12 +38,10 @@
</table>
</div>
<div class="boxBottom"><div class="a"></div><div class="b"></div><div class="c"></div></div>
</div>
<script type="text/javascript">
</div></form>
<script type="text/javascript">
{$form.JS}
</script>
</form>
<script type="text/javascript">
try {literal}{{/literal} dynaformSetFocus();}catch(e){literal}{{/literal}}
</script>
</script>

View File

@@ -3,19 +3,22 @@
<TITLE type="title">
<en><![CDATA[Login]]></en>
</TITLE>
<USR_USERNAME type="text" size="30" maxlength="50" validate="Any">
<USR_USERNAME type="text" size="30" maxlength="50" validate="Any" autocomplete="0">
<en><![CDATA[User]]></en>
</USR_USERNAME>
<USR_PASSWORD type="password" size="30" maxlength="32" autocomplete="0">
<USR_PASSWORD type="text" size="30" maxlength="32" autocomplete="0">
<en><![CDATA[Password]]></en>
</USR_PASSWORD>
<USR_PASSWORD_MASK type="password" size="30" maxlength="32" autocomplete="0">
<en><![CDATA[Password]]></en>
</USR_PASSWORD_MASK>
<USER_LANG type="dropdown" sqlconnection="dbarray">
SELECT LANG_ID, LANG_NAME FROM langOptions
<en><![CDATA[Language]]></en>
</USER_LANG>
<URL type="hidden"/>
<LOGIN_VERIFY_MSG type="private" showInTable="0"/>
<BSUBMIT type="submit">
<BSUBMIT type="button">
<en><![CDATA[Login]]></en>
</BSUBMIT>
<FORGOT_PASWORD_LINK type="link" link="forgotPassword" onclick="" colAlign="right" colWidth="135" style="display:none;">
@@ -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]')));
]]></JS>

View File

@@ -3,20 +3,23 @@
<TITLE type="title">
<en><![CDATA[Login]]></en>
</TITLE>
<USR_USERNAME type="text" size="30" maxlength="50" validate="Any">
<USR_USERNAME type="text" size="30" maxlength="50" validate="Any" autocomplete="0">
<en><![CDATA[User]]></en>
</USR_USERNAME>
<USR_PASSWORD type="password" size="30" maxlength="32" autocomplete="0">
<USR_PASSWORD type="hidden" size="30" maxlength="32" autocomplete="0">
<en><![CDATA[Password]]></en>
</USR_PASSWORD>
<USER_ENV type="text" size="30" maxlength="50">
<USR_PASSWORD_MASK type="password" size="30" maxlength="32" autocomplete="0">
<en><![CDATA[Password]]></en>
</USR_PASSWORD_MASK>
<USER_ENV type="text" size="30" maxlength="50" autocomplete="0">
<en><![CDATA[Workspace]]></en>
</USER_ENV>
<USER_LANG type="dropdown" sqlconnection="dbarray">
SELECT LANG_ID, LANG_NAME FROM langOptions
<en><![CDATA[Language]]></en>
</USER_LANG>
<BSUBMIT type="submit">
<BSUBMIT type="button">
<en><![CDATA[Login]]></en>
</BSUBMIT>
<JS type="javascript"><![CDATA[
@@ -28,10 +31,17 @@ leimnud.event.add(document.getElementById('form[BSUBMIT]'), 'click', function()
ws = getField('USER_ENV').value;
createCookie('pmos_generik2', '{"ws":"'+ws+'"}', 365);
/*
var client = getBrowserClient();
if (client.browser == "msie" || client.browser == "safari"){
document.sysLogin.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.sysLogin.submit();
}.extend(document.getElementById('form[BSUBMIT]')));
try{