src/org/openbravo/erpCommon/security/Login.html
author Asier Lostalé <asier.lostale@openbravo.com>
Mon, 15 Nov 2010 12:50:59 +0100
changeset 8919 c1958f882b50
parent 8918 f397e268ff90
child 8920 8ca215b18239
permissions -rw-r--r--
[login] Implemented login button
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@8919
    28
  <script language="JavaScript" src="../../../../../web/js/ajax.js" type="text/javascript"></script>
david@8918
    29
<script language="JavaScript" src="../../../../../web/js/windowKeyboard.js" type="text/javascript"></script>
asier@8910
    30
<script type="text/javascript">
asier@8910
    31
  function redirectWhenPopup() {
asier@8910
    32
    var permission = false;
asier@8910
    33
    try {
asier@8910
    34
      if (top.opener.parent.frames['appFrame']) {
asier@8910
    35
        permission = true;
asier@8910
    36
      }
asier@8910
    37
    }
asier@8910
    38
    catch (e) {}
asier@8910
    39
    if (permission && top.opener) {
asier@8910
    40
      top.opener.parent.location.href = top.document.location.href;
asier@8910
    41
      top.window.close();
asier@8910
    42
    }
asier@8910
    43
  }
asier@8910
    44
asier@8910
    45
  function redirectWhenInsideMDI() {
asier@8910
    46
    if (typeof isWindowInMDIPage !== 'undefined' && isWindowInMDIPage) {
david@8918
    47
      var LayoutMDI = null;
david@8918
    48
      if (isWindowInMDIPopup && parent.opener) {
david@8918
    49
        LayoutMDI = parent.opener.getFrame('LayoutMDI'); // Since getFrame('LayoutMDI') function frameset checks equals the current opened Login_FS.html modal popup
david@8918
    50
      } else {
david@8918
    51
        LayoutMDI = getFrame('LayoutMDI');
david@8918
    52
      }
asier@8910
    53
      if (LayoutMDI && typeof parent.document.getElementById('framesetMenu') === 'object') {
asier@8910
    54
        LayoutMDI.location.href = parent.window.location.href;
asier@8910
    55
      }
asier@8910
    56
    }
asier@8910
    57
  }
asier@8910
    58
asier@8910
    59
  function hideMenuFrame() {
asier@8910
    60
    if (parent.document.getElementById('framesetMenu')) {
asier@8910
    61
      parent.document.getElementById('framesetMenu').cols = parent.document.getElementById('framesetMenu').cols.replace(parent.menuWidth, '0%');
asier@8910
    62
    }
asier@8910
    63
  }
david@8918
    64
</script>
david@8918
    65
<script type="text/javascript">
david@8918
    66
  function setLoginMessage(type, text) {
asier@8919
    67
    if (type === "Error") {
david@8918
    68
      var msgContainer = document.getElementById('errorMsg');
david@8918
    69
      msgContainer.innerHTML = text;
david@8918
    70
      msgContainer.style.display = "";
asier@8919
    71
    } else if (type === "Warning") {
david@8918
    72
      alert(text);
asier@8910
    73
    }
asier@8910
    74
  }
david@8918
    75
</script>
david@8918
    76
<script type="text/javascript">
david@8918
    77
  function buttonOK_click() {
david@8918
    78
    var target;
david@8918
    79
    try {
david@8918
    80
      if (parent.frameMenu) {
david@8918
    81
        target = "_parent";
david@8918
    82
      } else {
david@8918
    83
        target = "_self";
david@8918
    84
      }
david@8918
    85
    } catch (e) {
david@8918
    86
      target = "_self";
david@8918
    87
    }
asier@8919
    88
    submitXmlHttpRequest(loginResult, document.frmIdentificacion, "DEFAULT", "../secureApp/LoginHandler.html", false, null, null);
asier@8919
    89
    //submitCommandForm('DEFAULT', false, null, '../secureApp/LoginHandler.html', target, true);
david@8918
    90
    return false;
david@8918
    91
  }
asier@8919
    92
asier@8919
    93
  function loginResult(paramXMLParticular, XMLHttpRequestObj) {
asier@8919
    94
     var strText = "";
asier@8919
    95
     if (getReadyStateHandler(XMLHttpRequestObj,null,false)) {
asier@8919
    96
       if (XMLHttpRequestObj.responseText) {
asier@8919
    97
         strText = XMLHttpRequestObj.responseText;
asier@8919
    98
       }
asier@8919
    99
       strText = strText.toString();
asier@8919
   100
       var result = eval("("+strText+")");
asier@8919
   101
       processResult(result);
asier@8919
   102
     }
asier@8919
   103
  }
asier@8919
   104
asier@8919
   105
  function processResult(result){
asier@8919
   106
    if (result.showMessage) {
asier@8919
   107
      setLoginMessage(result.messageType, result.messageTitle + "\n" + result.messageText);
asier@8919
   108
    }
asier@8919
   109
asier@8919
   110
    if (!result.showMessage || result.messageType === "Warning") {
asier@8919
   111
      window.location = result.target;
asier@8919
   112
    }    
asier@8919
   113
  }
david@8918
   114
</script>
david@8918
   115
<script type="text/javascript">
asier@8910
   116
  function beforeLoadDo() {
asier@8910
   117
    redirectWhenPopup();
asier@8910
   118
    redirectWhenInsideMDI();
asier@8910
   119
    hideMenuFrame();
asier@8910
   120
  }
asier@8910
   121
asier@8910
   122
  function onLoadDo() {
david@8918
   123
    this.windowTables = new Array(
david@8918
   124
      new windowTableId('client', 'buttonOK')
david@8918
   125
    );
david@8918
   126
    setWindowTableParentElement();
david@8918
   127
    enableShortcuts('edition');
asier@8910
   128
  }
asier@8910
   129
</script>
david@8918
   130
<script type="text/javascript">
david@8918
   131
  beforeLoadDo();
david@8918
   132
</script>
asier@8910
   133
</head>
david@8918
   134
<body onload="onLoadDo();">
asier@8910
   135
david@8918
   136
  <div class="Login_Main" id="client">
asier@8910
   137
david@8918
   138
    <div class="container">
asier@8910
   139
david@8918
   140
      <div class="logbox">
david@8918
   141
        <form method="post" action="../secureApp/LoginHandler.html" name="frmIdentificacion" id="frmFormulario" autocomplete="off">
david@8918
   142
david@8918
   143
            <div style="height: 115px; text-align: center;">
david@8918
   144
              <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
   145
            </div>
david@8918
   146
            <div style="height: 162px !important;">
david@8918
   147
              <dl>
david@8918
   148
                <dt>
david@8918
   149
                  <label for="user" class="LabelText Login_LabelText">User name</label>
david@8918
   150
                </dt>
david@8918
   151
                <dd>
david@8918
   152
                  <input class="dojoValidateValid Login_TextBox" type="text" maxlength="60" name="user" />
david@8918
   153
                </dd>
david@8918
   154
                <dt>
david@8918
   155
                  <label for="password" class="LabelText Login_LabelText">Password</label>
david@8918
   156
                </dt>
david@8918
   157
                <dd>
david@8918
   158
                  <input class="dojoValidateValid Login_TextBox" type="password" maxlength="40" name="password" />
david@8918
   159
                </dd>
david@8918
   160
              </dl>
david@8918
   161
              <div id="errorMsg" class="LabelText Login_ErrorMsg_LabelText" style="display: none;">The username or password you entered is not correct.</div>
david@8918
   162
            </div>
david@8918
   163
            <div class="button">
david@8918
   164
              <div>
david@8918
   165
                <button type="button" 
david@8918
   166
                  id="buttonOK" 
david@8918
   167
                  class="ButtonLink" 
david@8918
   168
                  onclick="buttonOK_click();" 
david@8918
   169
                  onfocus="buttonEvent('onfocus', this); window.status='Login'; return true;" 
david@8918
   170
                  onblur="buttonEvent('onblur', this);" 
david@8918
   171
                  onkeyup="buttonEvent('onkeyup', this);" 
david@8918
   172
                  onkeydown="buttonEvent('onkeydown', this);" 
david@8918
   173
                  onkeypress="buttonEvent('onkeypress', this);" 
david@8918
   174
                  onmouseup="buttonEvent('onmouseup', this);" 
david@8918
   175
                  onmousedown="buttonEvent('onmousedown', this);" 
david@8918
   176
                  onmouseover="buttonEvent('onmouseover', this); window.status='Login'; return true;" 
david@8918
   177
                  onmouseout="buttonEvent('onmouseout', this);">
david@8918
   178
                  <table class="Button" id="fieldTable">
david@8918
   179
                    <tr>
david@8918
   180
                      <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
   181
                      <td class="Button_text Button_width">Login</td>
david@8918
   182
                      <td class="Button_right"></td>
david@8918
   183
                    </tr>
david@8918
   184
                  </table>
david@8918
   185
                </button>
david@8918
   186
              </div>
david@8918
   187
            </div>
david@8918
   188
david@8918
   189
        </form>
david@8918
   190
      </div>
david@8918
   191
          
david@8918
   192
      <div class="login-top">
david@8918
   193
        <div>
david@8918
   194
          <img class="Main_NavBar_logo" src="../../../../../web/images/blank.gif" />
david@8918
   195
          <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
   196
        </div>
david@8918
   197
        <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
   198
        2001-2010</span>
david@8918
   199
      </div>
david@8918
   200
david@8918
   201
      <div style="position: relative; left: 110px; text-align: center; width: 100%;">
david@8918
   202
        <div style="width: 260px; position: relative; float: left;">
david@8918
   203
          <div style="text-align: center;" class="LabelText Login_LabelText">For support, contact:</div>
david@8918
   204
          <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
   205
        </div>
david@8918
   206
        <div style="width: 350px; position: relative; float: left;">
david@8918
   207
          <div style="text-align: center;" class="LabelText Login_LabelText">Project hosted at:</div>
david@8918
   208
          <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
   209
        </div>
david@8918
   210
      </div>
asier@8910
   211
david@8918
   212
    </div>
asier@8910
   213
david@8918
   214
  </div>
asier@8910
   215
david@8918
   216
</body>
david@8918
   217
</html>