java/nekurak.net-web/web/WEB-INF/casti/registrovatUzivatele.jsp
author František Kučera <franta-hg@frantovo.cz>
Tue Mar 23 01:12:16 2010 +0100 (2010-03-23)
changeset 77 5378f8dc8fa9
parent 55 079a3221355d
child 82 df86ad0c0e55
permissions -rw-r--r--
ClanekREST.java
franta-hg@51
     1
<?xml version="1.0" encoding="UTF-8"?>
franta-hg@51
     2
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
franta-hg@51
     3
	  xmlns:c="http://java.sun.com/jsp/jstl/core"
franta-hg@51
     4
	  xmlns:fmt="http://java.sun.com/jsp/jstl/fmt"
franta-hg@51
     5
	  xmlns:fn="http://java.sun.com/jsp/jstl/functions"
franta-hg@73
     6
	  xmlns:nk="urn:jsptagdir:/WEB-INF/tags/nekurak"
franta-hg@51
     7
	  version="2.0">
franta-hg@51
     8
franta-hg@55
     9
    <jsp:useBean id="uzivatel" class="cz.frantovo.nekurak.dto.PozadavekNaRegistraciUzivatele" scope="request"/>
franta-hg@51
    10
    <jsp:useBean id="uzivatelPredRegistraci" class="cz.frantovo.nekurak.web.UzivatelPredRegistraci" scope="request"/>
franta-hg@51
    11
    <jsp:useBean id="registraceUzivatele" class="cz.frantovo.nekurak.web.RegistraceUzivatele" scope="session"/>
franta-hg@51
    12
franta-hg@73
    13
    <fmt:message key="registrace.nadpis" var="titulekStranky"/>
franta-hg@73
    14
    <nk:stranka titulek="${titulekStranky}">
franta-hg@51
    15
franta-hg@73
    16
	<h1><c:out value="${titulekStranky}"/></h1>
franta-hg@73
    17
franta-hg@73
    18
	<!--
franta-hg@73
    19
	Registrace probíhá ve třech krocích:
franta-hg@52
    20
	1) uživatel vyplňí formulář
franta-hg@52
    21
	2) zobrazíme mu vyplněné údaje a on si je zkontroluje
franta-hg@73
    22
	3) potvrdí registraci
franta-hg@73
    23
	-->
franta-hg@52
    24
franta-hg@73
    25
	<c:choose>
franta-hg@73
    26
	    <c:when test="${param.akceRegistrace == 'kontrola'}">
franta-hg@73
    27
		<!-- Vypíšeme uživateli údaje, které zadal do formuláře, aby si je mohl zkontrolovat. -->
franta-hg@73
    28
		<c:choose>
franta-hg@73
    29
		    <c:when test="${param.heslo == param.heslo_kontrola}">
franta-hg@73
    30
			<jsp:setProperty name="uzivatel" property="*"/>
franta-hg@73
    31
			<jsp:setProperty name="uzivatelPredRegistraci" property="uzivatel" value="${uzivatel}"/>
franta-hg@73
    32
			<jsp:setProperty name="registraceUzivatele" property="uzivatel" value="${uzivatelPredRegistraci}"/>
franta-hg@51
    33
franta-hg@73
    34
			<p><fmt:message key="registrace.kontrola"/></p>
franta-hg@51
    35
franta-hg@73
    36
			<p class="registraceKontrolaUdaju">
franta-hg@73
    37
			    <fmt:message key="dto.uzivatel.prezdivka"/>: <c:out value="${uzivatel.prezdivka}"/><br/>
franta-hg@73
    38
			    <fmt:message key="dto.uzivatel.jmeno"/>: <c:out value="${uzivatel.jmeno}"/><br/>
franta-hg@73
    39
			    <fmt:message key="dto.uzivatel.prijmeni"/>: <c:out value="${uzivatel.prijmeni}"/><br/>
franta-hg@73
    40
			    <fmt:message key="dto.uzivatel.email"/>: <c:out value="${uzivatel.email}"/><br/>
franta-hg@73
    41
			</p>
franta-hg@51
    42
franta-hg@73
    43
			<p>
franta-hg@73
    44
			    <a href="?akce=registrovatUzivatele&amp;amp;akceRegistrace=dokonceni&amp;amp;token=${fn:escapeXml(uzivatelPredRegistraci.token)}">
franta-hg@73
    45
				<fmt:message key="registrace.potvrdit"/>
franta-hg@73
    46
			    </a>
franta-hg@73
    47
			</p>
franta-hg@73
    48
		    </c:when>
franta-hg@73
    49
		    <c:otherwise>
franta-hg@73
    50
			<p class="chybovaHlaska"><fmt:message key="registrace.vyjimka.heslaSeNeshoduji"/></p>
franta-hg@73
    51
		    </c:otherwise>
franta-hg@73
    52
		</c:choose>
franta-hg@73
    53
	    </c:when>
franta-hg@73
    54
	    <c:when test="${param.akceRegistrace == 'dokonceni'}">
franta-hg@73
    55
		<!-- Uživatel si zkontroloval údaje a chce dokončit svoji registraci. -->
franta-hg@73
    56
		<jsp:setProperty name="registraceUzivatele" property="token" value="${param.token}"/>
franta-hg@51
    57
franta-hg@73
    58
		<c:set var="chybaRegistrace" value="${registraceUzivatele.dokonciRegistraci}"/>
franta-hg@52
    59
franta-hg@73
    60
		<c:choose>
franta-hg@73
    61
		    <c:when test="${chybaRegistrace == null}">
franta-hg@73
    62
			<!-- Registrace proběhla úspěšně. -->
franta-hg@73
    63
			<p>
franta-hg@73
    64
			    <fmt:message key="registrace.hotovo"/>&amp;#160;
franta-hg@73
    65
			    <a href="?akce=prihlaseni">
franta-hg@73
    66
				<fmt:message key="registrace.hotovo.prihlasit"/>
franta-hg@73
    67
			    </a>.
franta-hg@73
    68
			</p>
franta-hg@73
    69
		    </c:when>
franta-hg@73
    70
		    <c:otherwise>
franta-hg@73
    71
			<!-- Během pokusu o registraci uživatele došlo k chybě. -->
franta-hg@73
    72
			<p class="chybovaHlaska"><fmt:message key="${chybaRegistrace}"/></p>
franta-hg@73
    73
		    </c:otherwise>
franta-hg@73
    74
		</c:choose>
franta-hg@73
    75
	    </c:when>
franta-hg@73
    76
	    <c:otherwise>
franta-hg@73
    77
		<!-- Zobrazíme uživateli registrační formulář. -->
franta-hg@73
    78
		<form method="post" action="?akce=registrovatUzivatele&amp;amp;akceRegistrace=kontrola">
franta-hg@73
    79
		    <fieldset>
franta-hg@73
    80
			<fmt:message key="dto.uzivatel.prezdivka.tip" var="prezdivkaTip"/>
franta-hg@73
    81
			<label title="${prezdivkaTip}"><fmt:message key="dto.uzivatel.prezdivka"/>: <input type="text" name="prezdivka" maxlength="255"/></label><br/>
franta-hg@73
    82
			<label><fmt:message key="dto.uzivatel.heslo"/>: <input type="password" name="heslo" maxlength="255"/></label><br/>
franta-hg@73
    83
			<label><fmt:message key="dto.uzivatel.heslo.kontrola"/>: <input type="password" name="heslo_kontrola" maxlength="255"/></label><br/>
franta-hg@73
    84
			<br/>
franta-hg@73
    85
			<label><fmt:message key="dto.uzivatel.jmeno"/>: <input type="text" name="jmeno" maxlength="255"/></label><br/>
franta-hg@73
    86
			<label><fmt:message key="dto.uzivatel.prijmeni"/>: <input type="text" name="prijmeni" maxlength="255"/></label><br/>
franta-hg@73
    87
			<label><fmt:message key="dto.uzivatel.email"/>: <input type="text" name="email" maxlength="255"/></label><br/>
franta-hg@73
    88
			<button value="submit"><fmt:message key="registrace.tlacitko"/></button>
franta-hg@73
    89
		    </fieldset>
franta-hg@73
    90
		</form>
franta-hg@73
    91
	    </c:otherwise>
franta-hg@73
    92
	</c:choose>
franta-hg@73
    93
franta-hg@73
    94
    </nk:stranka>
franta-hg@51
    95
franta-hg@51
    96
</jsp:root>