src/org/openbravo/erpCommon/security/Login.html
author Asier Lostalé <asier.lostale@openbravo.com>
Mon, 15 Nov 2010 13:33:22 +0100
changeset 8923 a181b8f66476
parent 8921 facd5ef9ced0
child 8924 1c59291ba9fc
permissions -rw-r--r--
[login] Show cache and browser incompatibility messages
asier@8910
     1
<!--
asier@8910
     2
 *************************************************************************
asier@8910
     3
 * The contents of this file are subject to the Openbravo  Public  License
asier@8910
     4
 * Version  1.0  (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@8918
    14
 * All portions are Copyright (C) 2010 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>
asier@8920
    28
<script language="JavaScript" src="../../../../../web/js/appStatus.js" type="text/javascript"></script>
asier@8920
    29
<script language="JavaScript" src="../../../../../web/js/ajax.js" type="text/javascript"></script>
david@8918
    30
<script language="JavaScript" src="../../../../../web/js/windowKeyboard.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>
asier@8923
    33
<script language="JavaScript" type="text/javascript" id="cacheMsg">var cacheMsg = "xx";</script>
asier@8923
    34
<script language="JavaScript" type="text/javascript" id="browserMsg">var browserMsg = "xx";</script>
asier@8923
    35
asier@8910
    36
<script type="text/javascript">
asier@8910
    37
  function redirectWhenPopup() {
asier@8910
    38
    var permission = false;
asier@8910
    39
    try {
asier@8910
    40
      if (top.opener.parent.frames['appFrame']) {
asier@8910
    41
        permission = true;
asier@8910
    42
      }
asier@8910
    43
    }
asier@8910
    44
    catch (e) {}
asier@8910
    45
    if (permission && top.opener) {
asier@8910
    46
      top.opener.parent.location.href = top.document.location.href;
asier@8910
    47
      top.window.close();
asier@8910
    48
    }
asier@8910
    49
  }
asier@8910
    50
asier@8910
    51
  function redirectWhenInsideMDI() {
asier@8910
    52
    if (typeof isWindowInMDIPage !== 'undefined' && isWindowInMDIPage) {
david@8918
    53
      var LayoutMDI = null;
david@8918
    54
      if (isWindowInMDIPopup && parent.opener) {
david@8918
    55
        LayoutMDI = parent.opener.getFrame('LayoutMDI'); // Since getFrame('LayoutMDI') function frameset checks equals the current opened Login_FS.html modal popup
david@8918
    56
      } else {
david@8918
    57
        LayoutMDI = getFrame('LayoutMDI');
david@8918
    58
      }
asier@8910
    59
      if (LayoutMDI && typeof parent.document.getElementById('framesetMenu') === 'object') {
asier@8910
    60
        LayoutMDI.location.href = parent.window.location.href;
asier@8910
    61
      }
asier@8910
    62
    }
asier@8910
    63
  }
asier@8910
    64
asier@8910
    65
  function hideMenuFrame() {
asier@8910
    66
    if (parent.document.getElementById('framesetMenu')) {
asier@8910
    67
      parent.document.getElementById('framesetMenu').cols = parent.document.getElementById('framesetMenu').cols.replace(parent.menuWidth, '0%');
asier@8910
    68
    }
asier@8910
    69
  }
david@8918
    70
</script>
david@8918
    71
<script type="text/javascript">
david@8918
    72
  function setLoginMessage(type, text) {
asier@8919
    73
    if (type === "Error") {
david@8918
    74
      var msgContainer = document.getElementById('errorMsg');
david@8918
    75
      msgContainer.innerHTML = text;
david@8918
    76
      msgContainer.style.display = "";
asier@8919
    77
    } else if (type === "Warning") {
david@8918
    78
      alert(text);
asier@8910
    79
    }
asier@8910
    80
  }
asier@8921
    81
asier@8921
    82
  function resetMessage(){
asier@8921
    83
    var msgContainer = document.getElementById('errorMsg');
asier@8921
    84
    msgContainer.innerHTML = "";
asier@8921
    85
    msgContainer.style.display = "none";
asier@8921
    86
  }
david@8918
    87
</script>
david@8918
    88
<script type="text/javascript">
david@8918
    89
  function buttonOK_click() {
david@8918
    90
    var target;
david@8918
    91
    try {
david@8918
    92
      if (parent.frameMenu) {
david@8918
    93
        target = "_parent";
david@8918
    94
      } else {
david@8918
    95
        target = "_self";
david@8918
    96
      }
david@8918
    97
    } catch (e) {
david@8918
    98
      target = "_self";
david@8918
    99
    }
asier@8920
   100
    disableButton("buttonOK");
asier@8919
   101
    submitXmlHttpRequest(loginResult, document.frmIdentificacion, "DEFAULT", "../secureApp/LoginHandler.html", false, null, null);
david@8918
   102
    return false;
david@8918
   103
  }
asier@8919
   104
asier@8919
   105
  function loginResult(paramXMLParticular, XMLHttpRequestObj) {
asier@8919
   106
     var strText = "";
asier@8919
   107
     if (getReadyStateHandler(XMLHttpRequestObj,null,false)) {
asier@8919
   108
       if (XMLHttpRequestObj.responseText) {
asier@8919
   109
         strText = XMLHttpRequestObj.responseText;
asier@8919
   110
       }
asier@8919
   111
       strText = strText.toString();
asier@8919
   112
       var result = eval("("+strText+")");
asier@8919
   113
       processResult(result);
asier@8919
   114
     }
asier@8919
   115
  }
asier@8919
   116
asier@8919
   117
  function processResult(result){
asier@8919
   118
    if (result.showMessage) {
asier@8919
   119
      setLoginMessage(result.messageType, result.messageTitle + "\n" + result.messageText);
asier@8920
   120
      document.frmIdentificacion.password.value = "";
asier@8920
   121
      setFocus(document.frmIdentificacion.password);
asier@8919
   122
    }
asier@8919
   123
asier@8919
   124
    if (!result.showMessage || result.messageType === "Warning") {
asier@8919
   125
      window.location = result.target;
asier@8923
   126
    } else {
asier@8923
   127
      enableButton("buttonOK");
asier@8923
   128
    }
asier@8919
   129
  }
david@8918
   130
</script>
david@8918
   131
<script type="text/javascript">
asier@8910
   132
  function beforeLoadDo() {
asier@8910
   133
    redirectWhenPopup();
asier@8910
   134
    redirectWhenInsideMDI();
asier@8910
   135
    hideMenuFrame();
asier@8910
   136
  }
asier@8910
   137
asier@8910
   138
  function onLoadDo() {
david@8918
   139
    this.windowTables = new Array(
david@8918
   140
      new windowTableId('client', 'buttonOK')
david@8918
   141
    );
david@8918
   142
    setWindowTableParentElement();
david@8918
   143
    enableShortcuts('edition');
asier@8923
   144
asier@8923
   145
    
asier@8923
   146
    if ((!revisionControl('8847')) || (isOpsInstance() != isOpsInstanceCached())) {
asier@8923
   147
      alert(cacheMsg);
asier@8923
   148
    }
asier@8923
   149
asier@8923
   150
    if (!checkBrowserCompatibility()) {
asier@8923
   151
      alert(browserMsg);
asier@8923
   152
    }
asier@8910
   153
  }
asier@8910
   154
</script>
david@8918
   155
<script type="text/javascript">
david@8918
   156
  beforeLoadDo();
david@8918
   157
</script>
asier@8910
   158
</head>
david@8918
   159
<body onload="onLoadDo();">
asier@8910
   160
david@8918
   161
  <div class="Login_Main" id="client">
asier@8910
   162
david@8918
   163
    <div class="container">
asier@8910
   164
david@8918
   165
      <div class="logbox">
david@8918
   166
        <form method="post" action="../secureApp/LoginHandler.html" name="frmIdentificacion" id="frmFormulario" autocomplete="off">
david@8918
   167
david@8918
   168
            <div style="height: 115px; text-align: center;">
david@8918
   169
              <div style="padding-top: 25px;"><a href="#" class="Login_Img_Link"><img class="Login_Logo_Company" src="../../../../../web/images/blank.gif" /></a></div>
david@8918
   170
            </div>
david@8918
   171
            <div style="height: 162px !important;">
david@8918
   172
              <dl>
david@8918
   173
                <dt>
david@8918
   174
                  <label for="user" class="LabelText Login_LabelText">User name</label>
david@8918
   175
                </dt>
david@8918
   176
                <dd>
asier@8921
   177
                  <input class="dojoValidateValid Login_TextBox" type="text" maxlength="60" name="user" onKeyDown="resetMessage(); return true;" />
david@8918
   178
                </dd>
david@8918
   179
                <dt>
david@8918
   180
                  <label for="password" class="LabelText Login_LabelText">Password</label>
david@8918
   181
                </dt>
david@8918
   182
                <dd>
asier@8921
   183
                  <input class="dojoValidateValid Login_TextBox" type="password" maxlength="40" name="password" onKeyDown="resetMessage(); return true;" />
david@8918
   184
                </dd>
david@8918
   185
              </dl>
david@8918
   186
              <div id="errorMsg" class="LabelText Login_ErrorMsg_LabelText" style="display: none;">The username or password you entered is not correct.</div>
david@8918
   187
            </div>
david@8918
   188
            <div class="button">
david@8918
   189
              <div>
david@8918
   190
                <button type="button" 
david@8918
   191
                  id="buttonOK" 
david@8918
   192
                  class="ButtonLink" 
david@8918
   193
                  onclick="buttonOK_click();" 
david@8918
   194
                  onfocus="buttonEvent('onfocus', this); window.status='Login'; return true;" 
david@8918
   195
                  onblur="buttonEvent('onblur', this);" 
david@8918
   196
                  onkeyup="buttonEvent('onkeyup', this);" 
david@8918
   197
                  onkeydown="buttonEvent('onkeydown', this);" 
david@8918
   198
                  onkeypress="buttonEvent('onkeypress', this);" 
david@8918
   199
                  onmouseup="buttonEvent('onmouseup', this);" 
david@8918
   200
                  onmousedown="buttonEvent('onmousedown', this);" 
david@8918
   201
                  onmouseover="buttonEvent('onmouseover', this); window.status='Login'; return true;" 
david@8918
   202
                  onmouseout="buttonEvent('onmouseout', this);">
david@8918
   203
                  <table class="Button" id="fieldTable">
david@8918
   204
                    <tr>
david@8918
   205
                      <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@8918
   206
                      <td class="Button_text Button_width">Login</td>
david@8918
   207
                      <td class="Button_right"></td>
david@8918
   208
                    </tr>
david@8918
   209
                  </table>
david@8918
   210
                </button>
david@8918
   211
              </div>
david@8918
   212
            </div>
david@8918
   213
david@8918
   214
        </form>
david@8918
   215
      </div>
david@8918
   216
          
david@8918
   217
      <div class="login-top">
david@8918
   218
        <div>
david@8918
   219
          <img class="Main_NavBar_logo" src="../../../../../web/images/blank.gif" />
david@8918
   220
          <span style="margin-left: 520px; font-size: 70px; font-style: italic; font-weight: bold; color: #7F7F7F; font-family:'lucida sans',sans-serif;">3.0</span>
asier@8910
   221
        </div>
david@8918
   222
        <span style="display: block; margin-top: 215px; color: #afafaf; font-size: .9em;line-height: 0.9em; width: 14em; text-align: center; padding-bottom: 34px;">&copy; Copyright Openbravo <br />
david@8918
   223
        2001-2010</span>
david@8918
   224
      </div>
david@8918
   225
david@8918
   226
      <div style="position: relative; left: 110px; text-align: center; width: 100%;">
david@8918
   227
        <div style="width: 260px; position: relative; float: left;">
david@8918
   228
          <div style="text-align: center;" class="LabelText Login_LabelText">For support, contact:</div>
david@8918
   229
          <div style="text-align: center;"><a href="#" class="Login_Img_Link"><img class="Login_Logo_Support" src="../../../../../web/images/blank.gif" /></a></div>
asier@8910
   230
        </div>
david@8918
   231
        <div style="width: 350px; position: relative; float: left;">
david@8918
   232
          <div style="text-align: center;" class="LabelText Login_LabelText">Project hosted at:</div>
david@8918
   233
          <div style="text-align: center;"><a href="#" class="Login_Img_Link"><img class="Login_Logo_OBForge" src="../../../../../web/images/blank.gif" /></a></div>
david@8918
   234
        </div>
david@8918
   235
      </div>
asier@8910
   236
david@8918
   237
    </div>
asier@8910
   238
david@8918
   239
  </div>
asier@8910
   240
david@8918
   241
</body>
david@8918
   242
</html>