OSDN Git Service

Initial commit
[ultramonkey-l7/l7gui.git] / src / WebContent / user_modify.jsp
1 <%@ page import="org.ultramonkey.l7.model.*, org.ultramonkey.l7.controller.*, org.ultramonkey.l7.view.*, java.util.*"
2         language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
3 <%
4
5         /*
6          * check session
7          */
8         if (session.isNew()) {
9         MessageView error = new MessageView(41427, LogCategorySet.GUI_USER_AUTHENTICATION,
10                         Message.INVALID_SESSSION);
11         session.setAttribute(SessionKeys.RESULT_MESSAGE, error);
12         response.sendRedirect(RedirectPages.LOGIN);
13         return;
14         }
15
16         
17         /*
18          * get result message
19          */
20         MessageView message = (MessageView) session.getAttribute(SessionKeys.RESULT_MESSAGE);
21         String errorMessage = null;
22         int errorNumber = 0;
23         String category = "";
24         if (message != null) {
25                 errorMessage = message.getMessage();
26                 errorNumber = message.getErrno();
27                 category = message.getCategory();
28                 session.setAttribute(SessionKeys.RESULT_MESSAGE, null);
29         }
30
31         /*
32          * get post user data
33          */
34         UserData user = (UserData)session.getAttribute(SessionKeys.INPUT_USERDATA);
35         if ( user != null ){
36                 session.setAttribute(SessionKeys.INPUT_USERDATA, null);
37         }
38         
39         if (user == null ){             
40                 user = (UserData)session.getAttribute(SessionKeys.LOGIN_SESSION);
41                 if (user == null){
42                         MessageView error = new MessageView(41428, LogCategorySet.GUI_USER_AUTHENTICATION,
43                                         Message.CLUSTER_DATA_ERROR);
44                         session.setAttribute(SessionKeys.RESULT_MESSAGE, error);
45                         response.sendRedirect(RedirectPages.LOGIN);
46                         return;
47                 }
48         }
49         
50         if (user.description == null){
51                 user.description = "";
52         }
53         
54         /*
55          * get cluster status
56          */
57         L7guiFramework framework = new L7guiFramework(); 
58         ClusterData cd = framework.getClusterData();
59         if (cd == null) {
60                 MessageView error = new MessageView(41429, LogCategorySet.GUI_IO_COMMAND,
61                                 Message.CLUSTER_DATA_ERROR);
62                 session.setAttribute(SessionKeys.RESULT_MESSAGE, error);
63                 response.sendRedirect(RedirectPages.LOGIN);
64                 return;
65         }
66
67         /*
68          * fix style seat
69          */
70         String cssSeat = "l7gui_single_style.css";
71         if ( cd.self_status == ClusterStatus.ACTIVE ){
72                 cssSeat = "l7gui_act_style.css";
73         }
74         else if ( cd.self_status == ClusterStatus.STANDBY ){
75                 cssSeat = "l7gui_sby_style.css";
76         }
77
78         
79 %>
80
81 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
82 <html>
83         <head>
84                 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
85                 <meta http-equiv="Pragma" content="no-cache">
86                 <meta http-equiv="Cache-Control" content="no-cache">
87                 <meta http-equiv="Expires" content="0"> 
88                 <meta http-equiv="Content-Script-Type" content="text/javascript" />
89                 <meta http-equiv="Content-Style-Type" content="text/css" />
90                 <script src="l7gui.js" type="text/javascript"></script>
91                 <noscript> 
92         <meta http-equiv="refresh" content="<%= RedirectPages.NOSCRIPT_TIME %>; url=<%= RedirectPages.LOGIN %>"/>
93                 </noscript> 
94                 <link rel="stylesheet" type="text/css" href="<%= cssSeat %>" />
95                 <link rel="shortcut icon" href="images/favicon.ico"/>
96
97                 <title>Modify User</title>
98
99
100         </head>
101
102
103         <body class="normal">
104         <jsp:include page="menu.jsp" flush="false"/>
105
106                 <div id="content">
107         
108                 <h1>Modify User</h1>
109         
110                 <%
111                         if ((message != null) || (errorMessage != null)){
112                 %>
113                         <p class="error">[ <%=category %> - <%=errorNumber %>]</p>
114                         <p class="error"><%= errorMessage %></p>        
115                 <%
116                         }
117                 %>
118                         
119                 <form method="post" action="UserModServlet">
120  
121                 <fieldset>
122                 <legend>Modify User Info</legend>       
123                 <table class="status">
124                 <tr>
125                         <th>
126                                 <label for="description">Description</label>
127                         </th>
128                         <td>
129                                 <input type="text" name="description" value="<%=user.description %>" size="32" maxlength="64">
130                         </td>
131                         <td>
132                                 <p class="required">Up to 64 one-byte characters in English</p>
133                         </td>
134                 </tr>
135                 <tr>
136                         <th>
137                                 <label for="current_password">Current Password</label>
138                         </th>
139                         <td>
140                                 <input type="password" name="password" size="18" maxlength="16">
141                         </td>
142                         <td>
143                                 <p class="item">Required Field</p>
144                         </td>           
145                 </tr>
146                 <tr>
147                         <th>
148                                 <label for="new_password">New Password</label>
149                         </th>
150                         <td>
151                                 <input type="password" name="new1_passwd" size="18" maxlength="16">
152                         </td>
153                         <td>
154                                 <p class="item">Required Field</p>
155                                 <p class="required">Up to 16 one-byte characters in English</p>
156                         </td>
157                 </tr>
158                 <tr>
159                         <th>
160                                 <label for="re-type_new_password">Re-type New Password</label>
161                         </th>
162                         <td>
163                                 <input type="password" name="new2_passwd" size="18" maxlength="16">
164                         </td>
165                         <td>
166                                 <p class="item">Required Field</p>
167                                 <p class="required">Up to 16 one-byte characters in English</p>
168                         </td>
169                 </tr>
170                 </table>
171                 </fieldset>
172                 
173         
174         <br />
175         
176         <input type="submit" name="button" value="<%= ButtonMode.CHANGE %>" onClick="return confirm(user_modify)" />
177         <input type="reset" value="Clear" />
178         </form>
179
180         </div>
181 </body>
182 </html>