Commit 4f336d35 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

when default map is not available for guest account there is no more stacktrace exception

parent aadf87c8
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
>
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
>
<h:head>
<title>#{mapMB.currentProject.name} - Authorization form</title>
<link rel="shortcut icon" href="./resources/images/favicon.png" type="image/png" />
<ui:include src="/WEB-INF/components/admin/statistics.xhtml" />
<script src="https://maps.google.com/maps/api/js?libraries=drawing&amp;v=3.26" type="text/javascript"/>
<script src="https://code.jquery.com/jquery-1.12.1.min.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script src="https://cdn.datatables.net/1.10.13/js/jquery.dataTables.min.js"></script>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.13/css/jquery.dataTables.min.css"/>
<link rel="stylesheet" type="text/css" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css"/>
<h:outputScript library="js" name="minerva.js" />
<h:outputStylesheet library="css" name="style.css"/>
<h:outputStylesheet library="css" name="minerva.css" />
<h:outputStylesheet library="css" name="admin.css"/>
<script type="text/javascript">
//<![CDATA[
var loggedIn = false;
minerva.GuiConnector.init();
minerva.ServerConnector.getSessionData(null);
minerva.ServerConnector.login().then(function(){
return minerva.ServerConnector.getProject()
});
function login(){
var loginString = document.getElementById('username').value;
var passwordString = document.getElementById('password').value;
minerva.GuiConnector.init();
minerva.ServerConnector.getSessionData(null);
return minerva.ServerConnector.login(loginString, passwordString);
}
function init() {
$('#login').click(function(e){
if (!loggedIn) {
e.preventDefault();
return login().then(function(){
loggedIn = true;
$('#login').click();
}, function(error){
if (error.constructor.name=== "InvalidCredentialsError" ) {
minerva.GuiConnector.alert("invalid credentials");
} else {
minerva.GuiConnector.alert(error);
}
});
}
});
}
//]]>
</script>
<title>minerva - Authorization form</title>
<link rel="shortcut icon" href="./resources/images/favicon.png" type="image/png"/>
<ui:include src="/WEB-INF/components/admin/statistics.xhtml"/>
<script src="https://maps.google.com/maps/api/js?libraries=drawing&amp;v=3.26" type="text/javascript"/>
<script src="https://code.jquery.com/jquery-1.12.1.min.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script src="https://cdn.datatables.net/1.10.13/js/jquery.dataTables.min.js"></script>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.13/css/jquery.dataTables.min.css"/>
<link rel="stylesheet" type="text/css" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css"/>
<h:outputScript library="js" name="minerva.js"/>
<h:outputStylesheet library="css" name="style.css"/>
<h:outputStylesheet library="css" name="minerva.css"/>
<h:outputStylesheet library="css" name="admin.css"/>
<script type="text/javascript">
//<![CDATA[
var loggedIn = false;
minerva.GuiConnector.init();
minerva.ServerConnector.getSessionData(null);
minerva.ServerConnector.login().then(function () {
return minerva.ServerConnector.getProject()
});
function login() {
var loginString = document.getElementById('username').value;
var passwordString = document.getElementById('password').value;
minerva.GuiConnector.init();
minerva.ServerConnector.getSessionData(null);
return minerva.ServerConnector.login(loginString, passwordString);
}
function init() {
$('#login').click(function (e) {
if (!loggedIn) {
e.preventDefault();
return login().then(function () {
loggedIn = true;
$('#login').click();
}, function (error) {
if (error.constructor.name === "InvalidCredentialsError") {
minerva.GuiConnector.alert("invalid credentials");
} else {
minerva.GuiConnector.alert(error);
}
});
}
});
}
//]]>
</script>
</h:head>
<h:body onload="init();">
<ui:include src="/WEB-INF/components/admin/header.xhtml" />
<center>
<h:form name="loginForm" prependId="false" class="loginPanel" style="text-align:left">
<div class="headerFormTitle">AUTHORIZATION FORM</div>
<h:panelGrid columns="2" styleClass="loginDataPanelGrid" >
<label for="username" class="labelText">LOGIN: </label>
<h:inputText id="username" name="username" value="#{userMB.login}" class="minerva-input-text"/>
<label for="password" class="labelText">PASSWORD: </label>
<h:inputSecret id="password" name="password" value="#{userMB.password}" type="password" class="minerva-input-password"/>
<label class="labelText"> </label>
<h:commandButton type="submit" id="login" action="#{userMB.doLogin}" ajax="false"
value="LOGIN" styleClass="labelText" update="loginMessages"/>
</h:panelGrid>
<br />
<br />
<a href="javascript:;" id="register_button" onClick="window.location.href='#{request.contextPath}/?id=#{mapMB.currentMapId}';" class="adminLink"><i class="fa fa-chevron-right"></i> BACK TO MAP</a>
<br />
<a href="javascript:;" id="register_button" onClick="window.location.href='mailto:#{userMB.requestAccountEmail}?subject=MINERVA account request'; return false;" class="adminLink"><i class="fa fa-chevron-right"></i> REQUEST AN ACCOUNT</a>
</h:form>
</center>
<ui:include src="/WEB-INF/components/admin/footer.xhtml" />
<center>
<h:form name="loginForm" prependId="false" class="loginPanel" style="text-align:left">
<div class="headerFormTitle">AUTHORIZATION FORM</div>
<h:panelGrid columns="2" styleClass="loginDataPanelGrid">
<label for="username" class="labelText">LOGIN: </label>
<h:inputText id="username" name="username" value="#{userMB.login}" class="minerva-input-text"/>
<label for="password" class="labelText">PASSWORD: </label>
<h:inputSecret id="password" name="password" value="#{userMB.password}" type="password"
class="minerva-input-password"/>
<label class="labelText"> </label>
<h:commandButton type="submit" id="login" action="#{userMB.doLogin}" ajax="false"
value="LOGIN" styleClass="labelText" update="loginMessages"/>
</h:panelGrid>
<br/>
<br/>
<a href="javascript:;" id="go_to_map_button"
onClick="window.location.href='#{request.contextPath}/?id=#{mapMB.currentMapId}';" class="adminLink"><i
class="fa fa-chevron-right"></i> BACK TO MAP</a>
<br/>
<a href="javascript:;" id="register_button"
onClick="window.location.href='mailto:#{userMB.requestAccountEmail}?subject=MINERVA account request'; return false;"
class="adminLink"><i class="fa fa-chevron-right"></i> REQUEST AN ACCOUNT</a>
</h:form>
</center>
<ui:include src="/WEB-INF/components/admin/footer.xhtml"/>
</h:body>
</html>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment