<!--
 -
 -  $Id$
 -
 -  This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
 -  project.
 -
 -  Copyright (C) 1998-2018 OpenLink Software
 -
 -  This project is free software; you can redistribute it and/or modify it
 -  under the terms of the GNU General Public License as published by the
 -  Free Software Foundation; only version 2 of the License, dated June 1991.
 -
 -  This program is distributed in the hope that it will be useful, but
 -  WITHOUT ANY WARRANTY; without even the implied warranty of
 -  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 -  General Public License for more details.
 -
 -  You should have received a copy of the GNU General Public License along
 -  with this program; if not, write to the Free Software Foundation, Inc.,
 -  51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
 -
-->
<v:page name="blog-home-page"
  xmlns:v="http://www.openlinksw.com/vspx/"
  doctype="-//W3C//DTD XHTML 1.0 Transitional//EN"
  doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <v:variable name="logout" type="varchar" default="null" param-name="logout" />
  <v:variable name="url" type="varchar" default="null" param-name="URL" />
  <v:variable name="login_attempts" type="integer" default="0" persist="0" />
  <v:on-init>
     if (self.logout is not null)
       delete from VSPX_SESSION where VS_SID = self.logout and VS_REALM = 'wa';
  </v:on-init>
  <html>
    <head>
      <title>Virtuoso Web Applications</title>
      <link rel="stylesheet" type="text/css" href="default.css" />
    </head>
    <body>
      <div id="MD">
	<div id="login_page">
	  <h1 class="page_title"><?vsp http(sys_stat ('st_host_name')); ?></h1>
	  <v:login name="login1" realm="wa" mode="url" user-password-check="OAUTH..web_user_password_check">
	    <div id="id_col">
	      <div id="site_id">
		<img class="id_logo" src="images/odslogo_200.png" alt="ods logo icon"/>
	      </div> <!-- site_id -->
	    </div> <!-- id_col -->
	    <div id="form_col">
	      <div id="login_form_ctr">
		<v:template type="if-no-login" name="login_if_no_login">
		  <div id="login_form">
		    <label for="login_frm_username">User ID</label>
		    <v:text xhtml_id="login_frm_username" name="username" value=""/><br/>
		    <label for="password">Password</label>
		    <v:text xhtml_id="login_frm_password" name="password" value="" type="password"/><br/>
		    <v:button action="simple" name="login" value="Login" xhtml_id="login_frm_b_login">
		      <v:on-post>
              self.login_attempts := coalesce(self.login_attempts, 0) + 1;
	    </v:on-post>
		    </v:button> <!-- login button -->
		  </div> <!-- login-form -->
		</v:template>
<?vsp
          if (self.login_attempts > 0)
            {
?>
        <div class="login_error_ctr">
          <p class="login_error">
            <img class="warn_img" src="images/warn_16.png"/>
            <span class="err_msg">Invalid member ID or password</span>
          </p>
        </div>
<?vsp
        }
?>
	      </div>
	    </div>
	    <v:template type="if-login" name="login_if_login">
	      <?vsp
	        if (self.url is not null)
		  self.vc_redirect (self.url);
	      ?>
	    </v:template>
	  </v:login>
	</div>
      </div>
      <div id="FT">
	<div id="FT_L">
	  <a href="http://www.openlinksw.com/virtuoso">
	    <img alt="Powered by OpenLink Virtuoso Universal Server"
	      src="images/virt_power_no_border.png"
	      border="0" />
	  </a>
	</div>
      </div>
    </body>
  </html>
</v:page>
