src/org/openbravo/erpCommon/security/Login.html
author RM packaging bot <staff.rm@openbravo.com>
Thu, 11 Aug 2016 05:53:51 +0000
changeset 30099 b90d4366a598
parent 30095 2292f81827e4
child 30100 541e897fe626
permissions -rw-r--r--
Merge temporary head for 3.0PR16Q3
asier@8910
     1
<!--
asier@8910
     2
 *************************************************************************
asier@8910
     3
 * The contents of this file are subject to the Openbravo  Public  License
priya@9072
     4
 * Version  1.1  (the  "License"),  being   the  Mozilla   Public  License
asier@8910
     5
 * Version 1.1  with a permitted attribution clause; you may not  use this
asier@8910
     6
 * file except in compliance with the License. You  may  obtain  a copy of
asier@8910
     7
 * the License at http://www.openbravo.com/legal/license.html 
asier@8910
     8
 * Software distributed under the License  is  distributed  on  an "AS IS"
asier@8910
     9
 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
asier@8910
    10
 * License for the specific  language  governing  rights  and  limitations
asier@8910
    11
 * under the License. 
asier@8910
    12
 * The Original Code is Openbravo ERP. 
asier@8910
    13
 * The Initial Developer of the Original Code is Openbravo SLU 
david@28975
    14
 * All portions are Copyright (C) 2010-2016 Openbravo SLU 
asier@8910
    15
 * All Rights Reserved. 
asier@8910
    16
 * Contributor(s):  ______________________________________.
asier@8910
    17
 ************************************************************************
asier@8910
    18
-->
asier@8910
    19
david@8918
    20
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
david@8918
    21
<head>
asier@8910
    22
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
asier@8910
    23
<title>Openbravo</title>
asier@8910
    24
<link rel="shortcut icon" href="../../../../../web/images/favicon.ico" type="image/x-icon" id="favicon" />
asier@8910
    25
<link rel="stylesheet" type="text/css" href="../../../../../web/skins/Default/Openbravo_ERP_250.css" id="paramCSS" />
david@8918
    26
<script language="JavaScript" src="../../../../../web/js/shortcuts.js" type="text/javascript"></script>
asier@8910
    27
<script language="JavaScript" src="../../../../../web/js/utils.js" type="text/javascript"></script>
david@8931
    28
<script language="JavaScript" src="../../../../../web/js/windowKeyboard.js" type="text/javascript"></script>
asier@8920
    29
<script language="JavaScript" src="../../../../../web/js/appStatus.js" type="text/javascript"></script>
asier@8920
    30
<script language="JavaScript" src="../../../../../web/js/ajax.js" type="text/javascript"></script>
asier@8923
    31
<script language="JavaScript" src="../utility/CheckCleanCache.js?cache=true" type="text/javascript"></script>
asier@8923
    32
<script language="JavaScript" src="../utility/CheckCleanCache.js?cache=false" type="text/javascript"></script>
david@8941
    33
<script language="JavaScript" type="text/javascript" id="visualPrefs">var showCompanyLogo = true, showSupportLogo = true, showForgeLogo = true, urlCompany = 'http://www.openbravo.com/', urlSupport = 'http://support.openbravo.com/';/* Parameters retreived from Login.java */</script>
david@8939
    34
<script language="JavaScript" type="text/javascript">var urlForge = 'http://forge.openbravo.com/';</script>
asier@14340
    35
<script language="JavaScript" type="text/javascript" id="expirationMessage"></script>
david@8931
    36
<script language="JavaScript" type="text/javascript" id="cacheMsg">var cacheMsg = 'xx';</script>
david@10246
    37
<script language="JavaScript" type="text/javascript" id="validBrowserMsg">var validBrowserMsg = 'xx';</script>
david@10269
    38
<script language="JavaScript" type="text/javascript" id="validBrowserMsgOrHigher">var validBrowserMsgOrHigher = 'xx';</script>
david@10246
    39
<script language="JavaScript" type="text/javascript" id="recBrowserMsgTitle">var recBrowserMsgTitle = 'xx';</script>
david@10246
    40
<script language="JavaScript" type="text/javascript" id="recBrowserMsgText">var recBrowserMsgText = 'xx';</script>
augusto@14219
    41
<script language="JavaScript" type="text/javascript" id="identificationFailureTitle">var identificationFailureTitle = 'xx';</script>
augusto@14219
    42
<script language="JavaScript" type="text/javascript" id="errorEmptyContent">var errorEmptyContent = 'xx';</script>
jonathan@28811
    43
<script language="JavaScript" type="text/javascript" id="errorSamePassword">var errorSamePassword = 'xx';</script>
jonathan@28811
    44
<script language="JavaScript" type="text/javascript" id="errorDifferentPasswordInFields">var errorDifferentPasswordInFields = 'xx';</script>
asier@8923
    45
david@10269
    46
<script language="JavaScript" type="text/javascript">
david@27856
    47
var validBrowserFirefox = '38.0.0.0';
staff@30099
    48
var validBrowserChrome = '48.0.0.0';
david@26264
    49
var validBrowserExplorer = '9.0.0.0';
david@28975
    50
var validBrowserEdge = '12.0.0.0'; // EdgeHTML version
david@28481
    51
var validBrowserSafari = '8.0.0.0';
david@10269
    52
david@28975
    53
var recBrowserFirefox = '45.0.0.0';
staff@30099
    54
var recBrowserChrome = '49.0.0.0';
david@25757
    55
var recBrowserExplorer = '11.0.0.0';
david@28975
    56
var recBrowserEdge = '13.0.0.0'; // EdgeHTML version
david@28481
    57
var recBrowserSafari = '9.0.0.0';
david@10269
    58
</script>
david@10269
    59
asier@8910
    60
<script type="text/javascript">
asier@8910
    61
  function redirectWhenPopup() {
asier@8910
    62
    var permission = false;
asier@8910
    63
    try {
asier@8910
    64
      if (top.opener.parent.frames['appFrame']) {
asier@8910
    65
        permission = true;
asier@8910
    66
      }
asier@8910
    67
    }
asier@8910
    68
    catch (e) {}
asier@8910
    69
    if (permission && top.opener) {
asier@8910
    70
      top.opener.parent.location.href = top.document.location.href;
asier@8910
    71
      top.window.close();
asier@8910
    72
    }
asier@8910
    73
  }
asier@8910
    74
asier@8910
    75
  function redirectWhenInsideMDI() {
asier@8910
    76
    if (typeof isWindowInMDIPage !== 'undefined' && isWindowInMDIPage) {
david@8918
    77
      var LayoutMDI = null;
david@8918
    78
      if (isWindowInMDIPopup && parent.opener) {
david@8918
    79
        LayoutMDI = parent.opener.getFrame('LayoutMDI'); // Since getFrame('LayoutMDI') function frameset checks equals the current opened Login_FS.html modal popup
david@8918
    80
      } else {
david@8918
    81
        LayoutMDI = getFrame('LayoutMDI');
david@8918
    82
      }
asier@8910
    83
      if (LayoutMDI && typeof parent.document.getElementById('framesetMenu') === 'object') {
asier@8910
    84
        LayoutMDI.location.href = parent.window.location.href;
asier@8910
    85
      }
asier@8910
    86
    }
asier@8910
    87
  }
asier@8910
    88
asier@8910
    89
  function hideMenuFrame() {
asier@8910
    90
    if (parent.document.getElementById('framesetMenu')) {
asier@8910
    91
      parent.document.getElementById('framesetMenu').cols = parent.document.getElementById('framesetMenu').cols.replace(parent.menuWidth, '0%');
david@20834
    92
      if (navigator.userAgent.indexOf('Trident/6.0') !== -1) {
david@20834
    93
        // There is an issue with IE10 while resizing frameset columns or rows:
david@20834
    94
        // https://connect.microsoft.com/IE/feedback/details/776054/cannot-resize-frameset-columns-or-rows-with-javascript
david@20834
    95
        // The solution is do a dummy style change to force window re-rendering
david@20834
    96
        parent.document.getElementById('framesetMenu').style.backgroundColor = 'white';
david@20834
    97
      }
asier@8910
    98
    }
asier@8910
    99
  }
david@8918
   100
</script>
david@8918
   101
<script type="text/javascript">
david@8958
   102
  function setLoginMessage(type, title, text) {
david@8931
   103
    if (type === 'Error') {
david@8918
   104
      var msgContainer = document.getElementById('errorMsg');
david@8958
   105
      var msgContainerTitle = document.getElementById('errorMsgTitle');
david@13393
   106
      var msgContainerTitleContainer = document.getElementById('errorMsgTitle_Container');
david@8958
   107
      var msgContainerContent = document.getElementById('errorMsgContent');
david@8958
   108
      if (typeof title !== 'undefined' && title !== '' && title !== null) {
david@8958
   109
        msgContainerTitle.innerHTML = title.replace(/\n/g, '<br>').replace(/\\n/g, '<br>');
david@13393
   110
        msgContainerTitleContainer.style.display = '';
david@8958
   111
      } else {
david@8958
   112
        msgContainerTitle.innerHTML = '';
david@13393
   113
        msgContainerTitleContainer.style.display = 'none';
david@8958
   114
      }
david@8958
   115
      if (typeof text !== 'undefined' && text !== '' && text !== null) {
david@8958
   116
        msgContainerContent.innerHTML = text.replace(/\n/g, '<br>').replace(/\\n/g, '<br>');
david@8958
   117
      } else {
david@8958
   118
        msgContainerContent.innerHTML = '';
david@8958
   119
      }
david@8931
   120
      msgContainer.style.display = '';
david@10269
   121
      isRecBrowserMsgShown = false;
asier@16643
   122
      return false;
asier@16643
   123
    } else if (type === 'Warning' || type === 'Confirmation') {
david@8958
   124
      var alertText = '';
david@8958
   125
      if (typeof title !== 'undefined' && title !== '' && title !== null) {
david@8958
   126
        alertText += title.replace(/<br>/g, '\n') + '\n';
david@8958
   127
      }
david@8958
   128
      if (typeof text !== 'undefined' && text !== '' && text !== null) {
david@8958
   129
        alertText += text.replace(/<br>/g, '\n')
david@8958
   130
      }
asier@16643
   131
      if (type === 'Warning') {
asier@16643
   132
        alert(alertText);
asier@16643
   133
        return true;
asier@16643
   134
      } else {
asier@16643
   135
        return confirm(alertText);
asier@16643
   136
      }
asier@8910
   137
    }
asier@8910
   138
  }
asier@8921
   139
david@10269
   140
  var isRecBrowserMsgShown = false;
david@10246
   141
  function setRecommendedBrowserMessage(title, text) {
david@10246
   142
    var msgContainer = document.getElementById('errorMsg');
david@10246
   143
    var msgContainerTitle = document.getElementById('errorMsgTitle');
david@10246
   144
    var msgContainerContent = document.getElementById('errorMsgContent');
david@10246
   145
    msgContainerTitle.innerHTML = '';
david@10246
   146
    if (typeof title !== 'undefined' && title !== '' && title !== null) {
david@10246
   147
      msgContainerContent.innerHTML = '<span class="Login_RecBrowserMsg_Title">' + title.replace(/\n/g, '<br>').replace(/\\n/g, '<br>') + ': ' + '</span>';
david@10246
   148
    } else {
david@10246
   149
      msgContainerContent.innerHTML = '';
david@10246
   150
    }
david@10246
   151
    if (typeof text !== 'undefined' && text !== '' && text !== null) {
david@10246
   152
      msgContainerContent.innerHTML = msgContainerContent.innerHTML + '<span class="Login_RecBrowserMsg_Content">' + text.replace(/\n/g, '<br>').replace(/\\n/g, '<br>') + '</span>';
david@10246
   153
    }
david@10246
   154
    msgContainer.style.display = '';
david@10269
   155
    isRecBrowserMsgShown = true;
david@10246
   156
  }
david@10246
   157
david@8973
   158
  function resetLoginMessage() {
asier@8921
   159
    var msgContainer = document.getElementById('errorMsg');
david@8958
   160
    var msgContainerTitle = document.getElementById('errorMsgTitle');
david@13393
   161
    var msgContainerTitleContainer = document.getElementById('errorMsgTitle_Container');
david@8958
   162
    var msgContainerContent = document.getElementById('errorMsgContent');
david@8958
   163
    msgContainerTitle.innerHTML = '';
david@13393
   164
    msgContainerTitleContainer.style.display = '';
david@8958
   165
    msgContainerContent.innerHTML = '';
david@8931
   166
    msgContainer.style.display = 'none';
david@10269
   167
    isRecBrowserMsgShown = false;
asier@8921
   168
  }
david@8973
   169
david@8973
   170
  function addInputChangeCheck(input) {
david@8973
   171
    setObjAttribute(input, 'onkeypress', 'checkInputKeyDown(this); return true;');
david@8973
   172
    setObjAttribute(input, 'oncut', 'checkInputKeyDown(this); return true;');
david@8973
   173
    setObjAttribute(input, 'oncopy', 'checkInputKeyDown(this); return true;');
david@8973
   174
    setObjAttribute(input, 'onpaste', 'checkInputKeyDown(this); return true;');
david@8973
   175
  }
david@8973
   176
david@8973
   177
  function checkInputKeyDown(input, valueLength) {
david@8973
   178
    var msgContainer = document.getElementById('errorMsg');
david@10269
   179
    if (msgContainer.style.display !== 'none' && typeof input === 'object') {
david@10269
   180
      if (typeof valueLength === 'undefined' || valueLength === null) {
david@8973
   181
        valueLength = input.value.length;
david@8973
   182
        setTimeout(function() { checkInputKeyDown(input, valueLength); }, 100);
david@8973
   183
      } else {
david@10269
   184
        if (valueLength !== input.value.length && !isRecBrowserMsgShown) {
david@8973
   185
          resetLoginMessage();
david@8973
   186
        }
david@8973
   187
      }
david@8973
   188
    }
david@8973
   189
    return true;
david@8973
   190
  }
david@8918
   191
</script>
david@8918
   192
<script type="text/javascript">
augusto@14219
   193
function buttonOK_click() {
jonathan@28811
   194
    if (document.getElementById('resetPassword').value ==='true' && document.getElementById('user').value !== document.getElementById('password').value){
jonathan@28811
   195
        setLoginMessage('Error', errorSamePassword, errorDifferentPasswordInFields);
jonathan@28771
   196
        return true;
jonathan@28771
   197
    }
augusto@14219
   198
    if (focusedWindowElement.id === 'user' && document.getElementById('user').value !== '' && document.getElementById('password').value === '') {
david@8937
   199
      setTimeout(function() { // To manage browser autocomplete feature if it is active
david@8939
   200
       if (focusedWindowElement.id === 'user' && document.getElementById('password').value === '') {
david@8934
   201
         setWindowElementFocus(document.getElementById('password')) 
david@8934
   202
       } else {
david@8934
   203
         return true;
david@8934
   204
       }
david@8934
   205
      }, 10);
augusto@14219
   206
    } else if (focusedWindowElement.id === 'password' && document.getElementById('password').value !== '' && document.getElementById('user').value === '') {
david@8934
   207
      setWindowElementFocus(document.getElementById('user'))
david@8934
   208
    } else {
augusto@14219
   209
      if (document.getElementById('user').value === '' || document.getElementById('password').value === '') {
jonathan@28804
   210
        setLoginMessage('Error', identificationFailureTitle, errorEmptyContent);
augusto@14219
   211
        return true;
jonathan@28771
   212
      }   
david@8934
   213
      disableButton('buttonOK');
jonathan@28809
   214
      if (document.getElementById('resetPassword').value ==='true'){
jonathan@28804
   215
        submitXmlHttpRequest(loginResult, document.frmIdentificacion, 'FORCE_RESET_PASSWORD', '../secureApp/LoginHandler.html', false, null, null);
jonathan@28804
   216
      }else{
jonathan@28804
   217
        submitXmlHttpRequest(loginResult, document.frmIdentificacion, 'DEFAULT', '../secureApp/LoginHandler.html', false, null, null);
jonathan@28804
   218
      }
david@8934
   219
    }
jonathan@28771
   220
    
david@8918
   221
    return false;
david@8918
   222
  }
asier@8919
   223
asier@8919
   224
  function loginResult(paramXMLParticular, XMLHttpRequestObj) {
david@8931
   225
     var strText = '';
david@8931
   226
     if (getReadyStateHandler(XMLHttpRequestObj, null, false)) {
asier@8919
   227
       if (XMLHttpRequestObj.responseText) {
asier@8919
   228
         strText = XMLHttpRequestObj.responseText;
asier@8919
   229
       }
asier@8919
   230
       strText = strText.toString();
david@8931
   231
       var result = eval('('+strText+')');
asier@8919
   232
       processResult(result);
asier@8919
   233
     }
asier@8919
   234
  }
asier@8919
   235
asier@8919
   236
  function processResult(result){
asier@16643
   237
    var target, command, shouldContinue = true;
asier@8919
   238
    if (result.showMessage) {
asier@16643
   239
      shouldContinue = setLoginMessage(result.messageType, result.messageTitle, result.messageText);
asier@16653
   240
      if (!shouldContinue) {
asier@16653
   241
        document.getElementById('password').value = '';
asier@16653
   242
      }
asier@8919
   243
    }
jonathan@28807
   244
    if (result.resetPassword ){
jonathan@28781
   245
      document.getElementById('resetPassword').value=result.resetPassword;
jonathan@28781
   246
      document.getElementById('user').value = '';
jonathan@28781
   247
      document.getElementById('user').type = 'password';
jonathan@28802
   248
      document.getElementById('userlabel').style.display = 'none';
jonathan@28802
   249
      document.getElementById('passwordlabel').style.display = 'none';
jonathan@28802
   250
      document.getElementById('newpasswordlabel').style.display = '';
jonathan@28802
   251
      document.getElementById('confirmpasswordlabel').style.display = '';
jonathan@28771
   252
    }
asier@16643
   253
    if (shouldContinue) {
asier@8936
   254
      try {
asier@8936
   255
        if (parent.frameMenu) {
asier@8936
   256
          target = '_parent';
asier@8936
   257
        } else {
asier@8936
   258
          target = '_self';
asier@8936
   259
        }
asier@8936
   260
      } catch (e) {
asier@8936
   261
        target = '_self';
david@8931
   262
      }
asier@16643
   263
      command = result.command || 'DEFAULT';
asier@16643
   264
      submitCommandForm(command, false, null, result.target, target, true);
jonathan@28781
   265
    }else if (result.resetPassword){
jonathan@28781
   266
      enableButton('buttonOK');
jonathan@28797
   267
      document.getElementById('user').value = '';
jonathan@28781
   268
      setWindowElementFocus('user', 'id');
asier@8923
   269
    } else {
david@8931
   270
      enableButton('buttonOK');
david@8966
   271
      setWindowElementFocus('password', 'id');
asier@8923
   272
    }
asier@8919
   273
  }
david@8918
   274
</script>
david@8918
   275
<script type="text/javascript">
david@8937
   276
  function manageVisualPreferences() {
david@10723
   277
    var topLogos = document.getElementById('TopLogos_Container');
david@8937
   278
    var bottomLogos = document.getElementById('BottomLogos_Container');
david@8939
   279
    if (showSupportLogo && showForgeLogo) {
david@10723
   280
      topLogos.className = 'Login_TopLogos_Container_Support_Forge';
david@8937
   281
    } else if (showSupportLogo) {
david@10723
   282
      topLogos.className = 'Login_TopLogos_Container_Support';
david@8939
   283
    } else if (showForgeLogo) {
david@10723
   284
      topLogos.className = 'Login_TopLogos_Container_Forge';
david@8937
   285
    } else {
david@10723
   286
      topLogos.className = 'Login_TopLogos_Container_None';
david@8937
   287
    }
david@8937
   288
david@8939
   289
    if (showCompanyLogo && urlCompany !== '') {
david@8971
   290
      document.getElementById('CompanyLogo_Container').innerHTML = '<a href="' + urlCompany + '" target="_blank" class="Login_Img_Link">' + document.getElementById('CompanyLogo_Container').innerHTML + '</a>';
david@8937
   291
    }
david@8937
   292
david@8939
   293
    if (showSupportLogo && urlSupport !== '') {
david@8971
   294
      document.getElementById('SupportLogo_Container').innerHTML = '<a href="' + urlSupport + '" target="_blank" class="Login_Img_Link">' + document.getElementById('SupportLogo_Container').innerHTML + '</a>';
david@8937
   295
    }
david@8937
   296
david@8939
   297
    if (showForgeLogo && urlForge !== '') {
david@8971
   298
      document.getElementById('ForgeLogo_Container').innerHTML = '<a href="' + urlForge + '" target="_blank" class="Login_Img_Link">' + document.getElementById('ForgeLogo_Container').innerHTML + '</a>';
david@8937
   299
    }
david@8937
   300
david@8937
   301
    if (showCompanyLogo) {
david@8939
   302
      document.getElementById('CompanyLogo_Container').style.display = ''
david@8937
   303
    }
david@10723
   304
    topLogos.style.display = '';
david@8939
   305
    bottomLogos.style.display = '';
david@8937
   306
  }
david@9005
   307
david@9005
   308
  function maskLoginWindow(errorMsg) {
david@9005
   309
    var client = document.getElementById('client');
david@9005
   310
    var blocker = document.getElementById('blocker');
david@9005
   311
    blocker.innerHTML = '<div class="Login_Home_Logo_Icon" style="position: relative; padding: 50px 0px 0px 0px; margin: 0 auto;"></div><div class="LabelText" style="position: relative; text-align: center; color: red; font-size: 11pt; padding: 10px 0px 0px 0px; width: 608px; margin: 0 auto;">' + errorMsg + '</div>';
david@9005
   312
    blocker.style.display = '';
david@9005
   313
    client.style.display = 'none';
david@9005
   314
  }
david@8937
   315
</script>
david@8937
   316
<script type="text/javascript">
david@10269
   317
  function browserVersionToFloat(versionNum) {
david@10269
   318
    while (versionNum.indexOf('.') !== versionNum.lastIndexOf('.')) {
david@10269
   319
      versionNum = versionNum.substring(0, versionNum.lastIndexOf('.')) + versionNum.substring(versionNum.lastIndexOf('.')+1, versionNum.length);
david@10269
   320
    }
david@10269
   321
    versionNum = parseFloat(versionNum, 10);
david@10269
   322
    return versionNum;
david@10269
   323
  }
david@10269
   324
david@10269
   325
  function browserVersionTrim(versionNum) {
david@12919
   326
    while ((versionNum.substring(versionNum.length-1, versionNum.length) === '0' && versionNum.indexOf('.') !== -1) || versionNum.substring(versionNum.length-1, versionNum.length) === '.') {
david@12919
   327
      versionNum = versionNum.substring(0, versionNum.length-1);
david@10269
   328
    }
david@10269
   329
    return versionNum;
david@10269
   330
  }
david@10269
   331
david@10269
   332
  /**
david@10269
   333
  * Checks if the browser is a supported one. Just for 2.50
david@10269
   334
  */
david@10269
   335
  function checkBrowserCompatibility() {
david@10269
   336
    var browserName = getBrowserInfo('name');
david@10269
   337
    var browserVersion = getBrowserInfo('version');
david@10269
   338
    var browserMajorVersion = getBrowserInfo('majorVersion');
david@10269
   339
    var isValid = false;
david@10269
   340
    if (browserName.toUpperCase().indexOf('FIREFOX') != -1 || browserName.toUpperCase().indexOf('ICEWEASEL') != -1) {
david@10269
   341
      if (browserVersionToFloat(browserVersion) >= browserVersionToFloat(validBrowserFirefox)) {
david@10269
   342
        isValid = true;
david@10269
   343
      }
david@10269
   344
    } else if (browserName.toUpperCase().indexOf('INTERNET EXPLORER') != -1) {
david@10269
   345
      if (browserVersionToFloat(browserVersion) >= browserVersionToFloat(validBrowserExplorer)) {
david@10269
   346
        isValid = true;
david@10269
   347
      }
david@10269
   348
    } else if (browserName.toUpperCase().indexOf('GOOGLE CHROME') != -1) {
david@10269
   349
      if (browserVersionToFloat(browserVersion) >= browserVersionToFloat(validBrowserChrome)) {
david@10269
   350
        isValid = true;
david@10269
   351
      }
david@10269
   352
    } else if (browserName.toUpperCase().indexOf('APPLE SAFARI') != -1) {
david@10269
   353
      if (browserVersionToFloat(browserVersion) >= browserVersionToFloat(validBrowserSafari)) {
david@10269
   354
        isValid = true;
david@10269
   355
      }
carlos@28756
   356
    } else if (browserName.toUpperCase().indexOf('MICROSOFT EDGE') != -1) {
carlos@28756
   357
      if (browserVersionToFloat(browserVersion) >= browserVersionToFloat(validBrowserEdge)) {
carlos@28756
   358
        isValid = true;
carlos@28756
   359
      }
david@10269
   360
    }
david@10269
   361
    return isValid;
david@10269
   362
  }
david@10269
   363
david@10269
   364
  /**
david@10269
   365
  * Checks if the browser is a recommended one
david@10269
   366
  */
david@10269
   367
  function checkRecommendedBrowser() {
david@10269
   368
    var browserName = getBrowserInfo('name');
david@10269
   369
    var browserVersion = getBrowserInfo('version');
david@10269
   370
    var browserMajorVersion = getBrowserInfo('majorVersion');
david@10269
   371
    var isRecommended = false;
david@10269
   372
    if (browserName.toUpperCase().indexOf('FIREFOX') != -1 || browserName.toUpperCase().indexOf('ICEWEASEL') != -1) {
david@10269
   373
      if (browserVersionToFloat(browserVersion) >= browserVersionToFloat(recBrowserFirefox)) {
david@10269
   374
        isRecommended = true;
david@10269
   375
      }
david@10269
   376
    } else if (browserName.toUpperCase().indexOf('INTERNET EXPLORER') != -1) {
david@10269
   377
      if (browserVersionToFloat(browserVersion) >= browserVersionToFloat(recBrowserExplorer)) {
david@10269
   378
        isRecommended = true;
david@10269
   379
      }
david@10269
   380
    } else if (browserName.toUpperCase().indexOf('GOOGLE CHROME') != -1) {
david@10269
   381
      if (browserVersionToFloat(browserVersion) >= browserVersionToFloat(recBrowserChrome)) {
david@10269
   382
        isRecommended = true;
david@10269
   383
      }
david@12918
   384
    } else if (browserName.toUpperCase().indexOf('APPLE SAFARI') != -1) {
david@12918
   385
      if (browserVersionToFloat(browserVersion) >= browserVersionToFloat(recBrowserSafari)) {
david@12918
   386
        isRecommended = true;
david@12918
   387
      }
carlos@28756
   388
    } else if (browserName.toUpperCase().indexOf('MICROSOFT EDGE') != -1) {
carlos@28756
   389
      if (browserVersionToFloat(browserVersion) >= browserVersionToFloat(recBrowserEdge)) {
carlos@28756
   390
        isRecommended = true;
carlos@28756
   391
      }
david@10269
   392
    }
david@10269
   393
    return isRecommended;
david@10269
   394
  }
david@10269
   395
david@10269
   396
  function buildValidBrowserMsg() {
david@10269
   397
    var displayValidBrowserMsg = validBrowserMsg;
david@10269
   398
    displayValidBrowserMsg = displayValidBrowserMsg
david@10269
   399
      + '<br>' + ' * Mozilla Firefox ' + browserVersionTrim(validBrowserFirefox) + ' ' + validBrowserMsgOrHigher
david@10269
   400
      + '<br>' + ' * Google Chrome ' + browserVersionTrim(validBrowserChrome) + ' ' + validBrowserMsgOrHigher
david@10269
   401
      + '<br>' + ' * Microsoft Internet Explorer ' + browserVersionTrim(validBrowserExplorer) + ' ' + validBrowserMsgOrHigher
carlos@28756
   402
      + '<br>' + ' * Microsoft Edge ' + browserVersionTrim(validBrowserEdge) + ' ' + validBrowserMsgOrHigher
david@10269
   403
      + '<br>' + ' * Apple Safari ' + browserVersionTrim(validBrowserSafari) + ' ' + validBrowserMsgOrHigher;
david@10269
   404
    return displayValidBrowserMsg;
david@10269
   405
  }
david@10269
   406
david@10269
   407
  function buildRecBrowserMsgText() {
david@10269
   408
    var displayRecBrowserMsgText = recBrowserMsgText;
carlos@28756
   409
    displayRecBrowserMsgText = displayRecBrowserMsgText.replace('XX', 'Google Chrome ' + browserVersionTrim(recBrowserChrome) + ', Mozilla Firefox ' + browserVersionTrim(recBrowserFirefox) + ', Internet Explorer ' + browserVersionTrim(recBrowserExplorer) + ', Microsoft Edge ' + browserVersionTrim(recBrowserEdge));
david@12918
   410
    displayRecBrowserMsgText = displayRecBrowserMsgText.replace('YY', 'Apple Safari ' + browserVersionTrim(recBrowserSafari) + '');
david@10269
   411
    return displayRecBrowserMsgText;
david@10269
   412
  }
david@10269
   413
</script>
david@10269
   414
<script type="text/javascript">
asier@8910
   415
  function beforeLoadDo() {
asier@8910
   416
    redirectWhenPopup();
asier@8910
   417
    redirectWhenInsideMDI();
asier@8910
   418
    hideMenuFrame();
asier@8910
   419
  }
asier@8910
   420
asier@8910
   421
  function onLoadDo() {
david@13393
   422
    var msgContainer = document.getElementById('errorMsg');
david@13393
   423
    var msgContainerTitle = document.getElementById('errorMsgTitle');
david@13393
   424
    var msgContainerTitleContainer = document.getElementById('errorMsgTitle_Container');
david@13393
   425
    var msgContainerContent = document.getElementById('errorMsgContent');
david@13393
   426
david@13393
   427
    if (msgContainerTitle.innerHTML.length === 0) {
david@13393
   428
      msgContainerTitleContainer.style.display = 'none';
david@13393
   429
    }
david@9002
   430
    try { // To avoid in a release upgrade, that a change in code depending on these functions cause revisionControl message not being displayed
david@9002
   431
      manageVisualPreferences();
david@9002
   432
      addInputChangeCheck(document.getElementById('user'));
david@9002
   433
      addInputChangeCheck(document.getElementById('password'));
david@9002
   434
      this.windowTables = new Array(
david@9002
   435
        new windowTableId('client', 'buttonOK')
david@9002
   436
      );
david@9002
   437
      setWindowTableParentElement();
david@9002
   438
      enableShortcuts('edition');
david@9002
   439
      setWindowElementFocus('user', 'id');
david@9002
   440
    }
david@9002
   441
    catch (e) { }
asier@8923
   442
asier@29679
   443
    if ((!revisionControl('29468')) || (isOpsInstance() != isOpsInstanceCached())) {
david@9005
   444
      maskLoginWindow(cacheMsg);
david@8958
   445
      setLoginMessage('Warning', '', cacheMsg);
asier@8923
   446
    }
asier@8923
   447
asier@8923
   448
    if (!checkBrowserCompatibility()) {
david@10269
   449
      var displayValidBrowserMsg = buildValidBrowserMsg();
david@10269
   450
      setLoginMessage('Warning', '', displayValidBrowserMsg);
david@10246
   451
    }
david@13393
   452
    if (!checkRecommendedBrowser() && msgContainerTitle.innerHTML.length === 0 && msgContainerContent.innerHTML.length === 0) {
david@10269
   453
      var displayRecBrowserMsgText = buildRecBrowserMsgText();
david@10269
   454
      setRecommendedBrowserMessage(recBrowserMsgTitle, displayRecBrowserMsgText);
asier@8923
   455
    }
asier@14340
   456
    
asier@14340
   457
    if (expirationMessage){
asier@14340
   458
      setLoginMessage(expirationMessage.type, expirationMessage.title, expirationMessage.text);
asier@14340
   459
      if (expirationMessage.disableLogin) {
asier@14340
   460
          disableButton('buttonOK');
asier@14343
   461
          document.frmIdentificacion.user.disabled = true;
asier@14343
   462
          document.frmIdentificacion.password.disabled = true;
asier@14340
   463
      }
asier@14340
   464
    }
asier@8910
   465
  }
asier@8910
   466
</script>
david@8918
   467
<script type="text/javascript">
david@8918
   468
  beforeLoadDo();
david@8918
   469
</script>
asier@8910
   470
</head>
david@8918
   471
<body onload="onLoadDo();">
david@9005
   472
  <div style="display: none; width: 100%; height: 100%; position: absolute; vertical-align: middle; padding: 0px; text-align: center;" id="blocker"></div>
asier@8910
   473
david@8918
   474
  <div class="Login_Main" id="client">
asier@8910
   475
david@8937
   476
    <div class="Login_Container">
asier@8910
   477
david@8937
   478
      <div class="Login_LogForm">
david@8918
   479
        <form method="post" action="../secureApp/LoginHandler.html" name="frmIdentificacion" id="frmFormulario" autocomplete="off">
david@14041
   480
          <input type="hidden" name="Command" value="" />
jonathan@28771
   481
          <input type="hidden" name="resetPassword" id="resetPassword" value="" />
david@14041
   482
          <div class="Login_LogForm_CompanyLogo_Container">
david@14041
   483
            <div class="Login_LogForm_CompanyLogo" id="CompanyLogo_Container" style="display: none;"><img class="Login_Logo_Company" src="../../../../../web/images/blank.gif" /></div>
david@14041
   484
          </div>
david@14041
   485
          <div class="Login_LogForm_Input_Container">
david@14041
   486
            <dl>
david@14041
   487
              <dt>
jonathan@28771
   488
                <label for="user" class="LabelText Login_LabelText" id="userlabel" >User Name</label>
david@28481
   489
              </dt>
jonathan@28802
   490
              <dt>
jonathan@28802
   491
                <label for="user" class="LabelText Login_LabelText" id="newpasswordlabel" style="display:none;">New Password</label>
david@14041
   492
              </dt>
david@14041
   493
              <dd>
david@14041
   494
                <input class="dojoValidateValid Login_TextBox" type="text" maxlength="60" name="user" id="user" />
david@14041
   495
              </dd>
david@14041
   496
              <dt>
jonathan@28771
   497
                <label for="password" class="LabelText Login_LabelText" id="passwordlabel" >Password</label>
david@28481
   498
              </dt>
jonathan@28802
   499
              <dt>
jonathan@28802
   500
                <label for="password" class="LabelText Login_LabelText" id="confirmpasswordlabel" style="display:none;">Confirm Password</label>
david@14041
   501
              </dt>
david@14041
   502
              <dd>
david@14041
   503
                <input class="dojoValidateValid Login_TextBox" type="password" maxlength="40" name="password" id="password" />
david@14041
   504
              </dd>
david@14041
   505
            </dl>
david@14041
   506
            <div id="errorMsg" class="LabelText Login_ErrorMsg_Container" style="display:none;">
david@14041
   507
              <span id="errorMsgTitle_Container"><span id="errorMsgTitle" class="Login_ErrorMsg_Title">xx</span><br></span><span id="errorMsgContent" class="Login_ErrorMsg_Content">xx</span>
david@8918
   508
            </div>
david@14041
   509
          </div>
david@14041
   510
        </form>
david@14041
   511
        <div class="Login_LogForm_Button_Container">
david@14041
   512
          <div class="Login_LogForm_Button">
david@14041
   513
            <button type="button" 
david@14041
   514
              id="buttonOK" 
david@14041
   515
              class="ButtonLink" 
david@14041
   516
              onclick="buttonOK_click();" 
david@14041
   517
              onfocus="buttonEvent('onfocus', this); window.status='Login'; return true;" 
david@14041
   518
              onblur="buttonEvent('onblur', this);" 
david@14041
   519
              onkeyup="buttonEvent('onkeyup', this);" 
david@14041
   520
              onkeydown="buttonEvent('onkeydown', this);" 
david@14041
   521
              onkeypress="buttonEvent('onkeypress', this);" 
david@14041
   522
              onmouseup="buttonEvent('onmouseup', this);" 
david@14041
   523
              onmousedown="buttonEvent('onmousedown', this);" 
david@14041
   524
              onmouseover="buttonEvent('onmouseover', this); window.status='Login'; return true;" 
david@14041
   525
              onmouseout="buttonEvent('onmouseout', this);">
david@14041
   526
              <table class="Button" id="fieldTable">
david@14041
   527
                <tr>
david@14041
   528
                  <td class="Button_left"><img class="Button_Icon Button_Icon_ok" alt="Login" title="Login" src="../../../../../web/images/blank.gif" border="0" id="fieldButton" /></td>
david@14041
   529
                  <td class="Button_text Button_width">Log in</td>
david@14041
   530
                  <td class="Button_right"></td>
david@14041
   531
                </tr>
david@14041
   532
              </table>
david@14041
   533
            </button>
david@14041
   534
          </div>
david@14041
   535
          <div id="sign-in" style="margin-top:12px;">xxxSignIn</div>
david@14041
   536
        </div>
david@8918
   537
david@8918
   538
      </div>
david@10723
   539
david@10723
   540
      <div class="Login_TopLogos_Container_Support_Forge" id="TopLogos_Container" style="display: none;">
david@10723
   541
        <div style="height: 1px; width: 1px; font-size: 1"></div>
david@10723
   542
        <div class="Login_TopLogos_ForgeLogo_Container">
david@10723
   543
          <div class="LabelText Login_LabelText Login_TopLogos_ForgeLogo_Text">Project hosted at:</div>
david@10723
   544
          <div class="Login_TopLogos_ForgeLogo_Logo_Container" id="ForgeLogo_Container"><img class="Login_Logo_Forge" src="../../../../../web/images/blank.gif" /></div>
asier@8910
   545
        </div>
david@10723
   546
        <div class="Login_TopLogos_SupportLogo_Container">
david@10723
   547
          <div class="LabelText Login_LabelText Login_TopLogos_SupportLogo_Text">For support, contact:</div>
david@10723
   548
          <div class="Login_TopLogos_SupportLogo_Logo_Container" id="SupportLogo_Container"><img class="Login_Logo_Support" src="../../../../../web/images/blank.gif" /></div>
david@10723
   549
        </div>
david@8918
   550
      </div>
david@8918
   551
david@10723
   552
      <div class="Login_BottomLogos_Container" id="BottomLogos_Container" style="display: none;">
david@10723
   553
        <div class="Login_BottomLogos_Openbravo_Logo_Container" id="OpenbravoLogo_Container"><img class="Login_Logo_Openbravo" src="../../../../../web/images/blank.gif" /></div>
david@10723
   554
        <div class="Login_BottomLogos_CopyrightText_Container"><span class="Login_BottomLogos_CopyrightText">&copy; Copyright Openbravo <br />
naroa@28137
   555
        2001-2016</span></div>
david@8918
   556
      </div>
david@8918
   557
    </div>
asier@8910
   558
david@8918
   559
  </div>
asier@8910
   560
david@8918
   561
</body>
david@8918
   562
</html>