Projekt

Obecné

Profil

Stáhnout (2.39 KB) Statistiky
| Větev: | Tag: | Revize:
1
<% if ( request.getSession().getAttribute("logged_user") == "1" ){ %>
2

    
3
	<div class="login_box">
4
		<%= request.getSession().getAttribute("logged_user_nick") %> <a href="log-out">Logout</a>
5
	</div>
6
				
7
<% } else { %>
8

    
9
	<% if ( request.getSession().getAttribute("logged_user_err") != null && request.getSession().getAttribute("logged_user_err").toString() == "1") { %>
10
		<script type="text/javascript">
11
			$(document).ready(function() {
12
				$('.login_popup .err_msg').html("Incorrect Login name or Password.");
13
				$('#login_name').val('<%= request.getSession().getAttribute("logged_user_err_name") %>');
14
		    	$('.login_popup').show();		    	
15
		    });
16
	     	
17
		</script>
18
	<% 
19
		request.getSession().setAttribute("logged_user_err", null);
20
		request.getSession().setAttribute("logged_user_err_name", null);
21
	} %>			
22
	<div class="login_box">
23
		<a href="#" onclick="$('.register_popup').hide(); $('.login_popup').toggle()">Login</a>
24
		<a href="#" onclick="$('.login_popup').hide(); $('.register_popup').toggle()">Register</a>
25
	</div>
26
	<div class="login_popup">
27
		<form action="log-in" method="post">
28
			<div class="err_msg"></div>
29
			<div class="not_msg"></div>
30
	  		<table>
31
	  			<tr>
32
					<td>Login name:</td>
33
					<td><input type="text" name="login_name" id="login_name"></td>
34
				</tr>
35
	  			<tr>
36
					<td>Password:</td>
37
					<td><input type="password" name="password"  id="login_password"></td>
38
				</tr>
39
	  			<tr>
40
					<td></td>
41
					<td><input type="submit" value="Login"></td>
42
				</tr>
43
	  		</table>
44
	  	</form>
45
	</div>
46
	<div class="register_popup">
47
		<form action="api/register" method="post">
48
			<div class="err_msg"></div>
49
			<div class="not_msg"></div>
50
	  		<table>	  		
51
	  			<tr>
52
					<td>Name:</td>
53
					<td><input type="text" name="user_name" id="user_name" ></td>
54
				</tr>
55
	  			<tr>
56
					<td>E-mail:</td>
57
					<td><input type="text" name="user_email" id="user_email"></td>
58
				</tr>
59
	  			<tr>
60
					<td>Login name:</td>
61
					<td><input type="text" name="user_nick" id="user_nick"></td>
62
				</tr>
63
	  			<tr>
64
					<td>Password:</td>
65
					<td><input type="password" name="user_password" id="user_password"></td>
66
				</tr>
67
	  			<tr>
68
					<td>Password again:</td>
69
					<td><input type="password" name="user_password_2" id="user_password_2"></td>
70
				</tr>
71
	  			<tr>
72
					<td></td>
73
					<td><input type="button" value="Register" onclick="send_register(); return false;"></td>
74
				</tr>
75
	  		</table>
76
	  	</form>
77
	</div>
78
	
79
<% } %>
(2-2/7)