Commit 4736d54b authored by Bill Lynch's avatar Bill Lynch Committed by bill

Improved login screen


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@238 b35dd754-fafc-0310-a699-88a17e54d16e
parent c72d0271
<%@ taglib uri="core" prefix="c"%>
<%@ taglib uri="fmt" prefix="fmt" %>
<%--
- $RCSfile$
- $Revision$
......@@ -15,16 +12,20 @@
org.jivesoftware.messenger.container.Container,
org.jivesoftware.messenger.container.ServiceLookupFactory,
org.jivesoftware.messenger.container.ServiceLookup,
org.jivesoftware.messenger.JiveGlobals"
org.jivesoftware.messenger.JiveGlobals,
org.jivesoftware.util.Version,
org.jivesoftware.util.Log"
errorPage="error.jsp"
%>
<%@ taglib uri="core" prefix="c" %>
<%@ taglib uri="fmt" prefix="fmt" %>
<!-- Define Administration Bean -->
<jsp:useBean id="admin" class="org.jivesoftware.util.WebManager" />
<% admin.init(request, response, session, application, out ); %>
<c:set var="admin" value="${admin}" />
<%! // List of allowed usernames:
static Map allowedUsernames = null;
static String allowedUsernameProp = JiveGlobals.getProperty("admin.login.allowedUsernames");
......@@ -40,18 +41,25 @@
}
}
}
static final String go(String url) {
if (url == null) {
return "index.jsp";
}
else {
return url;
}
}
%>
<!-- Check if in setup mode -->
<c:if test="${admin.setupMode}">
<c:redirect url="setup-index.jsp" />
</c:if>
<% // get parameters
String username = ParamUtils.getParameter(request,"username");
String password = ParamUtils.getParameter(request,"password");
String password = ParamUtils.getParameter(request,"password");
String url = ParamUtils.getParameter(request,"url");
// The user auth token:
AuthToken authToken = null;
......@@ -74,7 +82,7 @@
}
authToken = AuthFactory.getAuthToken(username, password);
session.setAttribute("jive.admin.authToken", authToken);
response.sendRedirect("index.jsp");
response.sendRedirect(go(url));
return;
}
catch (UnauthorizedException ue) {
......@@ -84,25 +92,36 @@
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title><fmt:message key="title" /> Admin - Login</title>
<title>Jive Messenger Admin Console</title>
<script language="JavaScript" type="text/javascript">
<!--
// break out of frames
if (self.parent.frames.length != 0) {
self.parent.location=document.location;
}
function updateFields(el) {
if (el.checked) {
document.loginForm.username.disabled = true;
document.loginForm.password.disabled = true;
}
else {
document.loginForm.username.disabled = false;
document.loginForm.password.disabled = false;
document.loginForm.username.focus();
}
}
//-->
</script>
<link rel="stylesheet" href="style/global.css" type="text/css">
<style type="text/css">
.jive-login-form TH {
background-color : #eee;
text-align : left;
border-top : 1px #bbb solid;
border-bottom : 1px #bbb solid;
.jive-login-form {
position : relative;
top : 148px;
text-align : center;
width : 100%;
}
.jive-login-form .jive-login-label {
font-size : 0.8em;
......@@ -111,90 +130,142 @@
font-size : 0.8em;
font-weight : bold;
}
#jive-login-text-image {
padding : 0px;
margin : 0px;
padding-top : 18px;
padding-bottom : 10px;
}
#jive-logo-image {
padding : 0px;
margin : 0px;
padding-right : 10px;
}
BODY {
background-image : url(images/login-back.gif);
background-repeat : repeat-x;
background-color : #fff;
padding : 0px;
margin : 0px;
}
</style>
</head>
<body>
<form action="login.jsp" name="loginForm" method="post">
<% if (url != null) { try { %>
<input type="hidden" name="url" value="<%= url %>">
<% } catch (Exception e) { Log.error(e); } } %>
<input type="hidden" name="login" value="true">
<br><br><br><br>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="49%"><br></td>
<td width="2%">
<noscript>
<table border="0" cellspacing="0" cellpadding="0">
<td>
<span class="jive-error-text">
<b>Error:</b> You don't have JavaScript enabled. This tool uses JavaScript
and much of it will not work correctly without it enabled. Please turn
JavaScript back on and reload this page.
</span>
</td>
</table>
<br><br><br><br>
</noscript>
<% if (errors) { %>
<p class="jive-error-text">
Login failed: Make sure your username and password are correct.
</p>
<% } %>
<span class="jive-login-form">
<table cellpadding="6" cellspacing="0" border="0" style="border : 1px #bbb solid;">
<tr>
<th>
<fmt:message key="title" bundle="${lang}" /> Admin Login
</th>
</tr>
<tr>
<td>
<table cellpadding="3" cellspacing="0" border="0">
<div class="jive-login-form">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td width="48%">&nbsp;</td>
<td width="1%" nowrap>
<table cellpadding="3" cellspacing="0" border="0">
<tr valign="top">
<td rowspan="99"
><div id="jive-logo-image"
><img src="images/logo-messenger.gif" width="100" height="100" border="0" alt="Jive Messenger"
></div></td>
<td colspan="3"
><div id="jive-login-text-image"
><img src="images/login-text.gif" width="237" height="28" border="0" alt="Admin Console Login"
></div></td>
</tr>
<noscript>
<tr>
<td class="jive-login-label">
Username:
</td>
<td>
<input type="text" name="username" size="15" maxlength="50">
<td colspan="3">
<table cellpadding="0" cellspacing="0" border="0">
<tr valign="top">
<td><img src="images/error-16x16.gif" width="16" height="16" border="0" alt="" vspace="2"></td>
<td>
<div class="jive-error-text" style="padding-left:5px;">
Error: You don't have JavaScript enabled. This tool uses JavaScript
and much of it will not work correctly without it enabled. Please turn
JavaScript back on and reload this page.
</div>
</td>
</tr>
</table>
</td>
</tr>
</noscript>
<% if (errors) { %>
<tr>
<td class="jive-login-label">
Password:
</td>
<td>
<input type="password" name="password" size="15" maxlength="50">
</td>
<td>
<input type="submit" value=" Login ">
</td>
</tr>
<tr class="jive-login-label">
<td colspan="3"><img src="images/blank.gif" width="1" height="4" border="0"></td>
</tr>
<tr class="jive-footer">
<td colspan="3">
<fmt:message key="title" bundle="${lang}" /> Admin
<table cellpadding="0" cellspacing="0" border="0">
<tr valign="top">
<td><img src="images/error-16x16.gif" width="16" height="16" border="0" alt="" vspace="2"></td>
<td>
<div class="jive-error-text" style="padding-left:5px;">
Login failed: make sure your username and password are correct
and that you're an admin or moderator.
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<% } %>
</span>
<tr>
<td>
<input type="text" name="username" size="15" maxlength="50" id="u01">
</td>
<td>
<input type="password" name="password" size="15" maxlength="50" id="p01">
</td>
<td align="center">
<input type="submit" value="&nbsp; Login &nbsp;">
</td>
</tr>
<tr valign="top">
<td class="jive-login-label">
<label for="u01">
username
</label>
</td>
<td class="jive-login-label">
<label for="p01">
password
</label>
</td>
<td>
&nbsp;
</td>
</tr>
<tr class="jive-login-label">
<td colspan="3"><img src="images/blank.gif" width="1" height="4" border="0"></td>
</tr>
<tr class="jive-footer">
<td colspan="3" nowrap>
<span style="font-size:0.8em;">
Jive Messenger, Version:
<%= admin.getXMPPServer().getServerInfo().getVersion().getVersionString() %>
</span>
</td>
</tr>
</table>
</td>
<td width="48%">&nbsp;</td>
</tr>
</table>
</td>
<td width="49%"><br></td>
</tr>
</table>
</div>
</form>
......
......@@ -3,7 +3,6 @@ BODY {
}
BODY, TD, TH {
font-family : arial, helvetica, sans-serif;
font-size : 0.8em;
font-size : 10pt;
}
A {
......@@ -17,7 +16,6 @@ A:hover {
text-decoration : none;
}
PRE, TT {
font-size : 1.0em;
font-size : 10pt;
font-family : courier new, monospaced;
}
......@@ -56,7 +54,7 @@ PRE, TT {
.jive-tab, .jive-selected-tab {
padding : 4px 10px 4px 10px;
font-family : tahoma;
font-size : 0.7em;
font-size : 8pt;
}
.jive-selected-tab A {
color : #000 !important;
......@@ -88,7 +86,7 @@ PRE, TT {
.jive-tab-section TD {
font-weight : normal;
font-family : verdana;
font-size : 0.7em;
font-size : 8pt;
}
.jive-tab-section A {
color : #333 !important;
......@@ -96,10 +94,10 @@ PRE, TT {
font-weight : normal;
}
.jive-tab-spring {
font-size : 0.7em;
font-size : 8pt;
}
.jive-tab-logout {
font-size : 0.7em;
font-size : 8pt;
}
/* sidebar */
......@@ -166,7 +164,7 @@ PRE, TT {
.jive-description {
font-family : verdana;
font-size : 0.8em;
font-size : 8pt;
}
.jive-label {
......@@ -190,7 +188,7 @@ PRE, TT {
/* breadcrumbs */
.jive-breadcrumbs {
font-size : 0.7em;
font-size : 8pt;
font-weight : bold;
font-family : tahoma;
}
......@@ -361,126 +359,10 @@ TABLE.boxLayoutGrey {
margin-bottom:10px;
font-weight:bold;
}
.highlight {
color: #990000;
}
BODY {
font-size : 100%;
}
BODY, TD, TH {
font-family : tahoma, arial, helvetica, sans-serif;
font-size : 0.8em;
}
A {
color : #00f;
}
A:visited {
color : #00f;
}
A:hover {
color : #f00;
text-decoration : none;
}
PRE, TT {
font-size : 1.0em;
font-family : courier new, monospaced;
}
/* errors */
.jive-error-text {
color : #f00;
}
/* success */
.jive-success-text {
color : #090;
}
/* warning */
.jive-warning-text {
color : #f00;
}
/* tabs */
.jive-selected-tab {
border-width : 1px 1px 0px 1px;
background-color : #fff;
}
.jive-tab {
border-width : 1px 1px 1px 1px;
}
.jive-tab-spacer, .jive-tab-spring {
border-width : 0px 0px 1px 0px;
}
.jive-tab-bar {
background-color : #fff;
border-width : 0px 1px 1px 1px;
}
.jive-selected-tab, .jive-tab, .jive-tab-spacer, .jive-tab-spring, .jive-tab-bar
{
border-color : #bbb;
border-style : solid;
}
/* tab colors, spacings, fonts */
.jive-tab, .jive-selected-tab {
padding : 4px 10px 4px 10px;
font-family : tahoma;
font-size : 0.7em;
}
.jive-selected-tab A {
color : #000 !important;
text-decoration : none;
font-weight : bold;
}
.jive-tab A {
color : #333 !important;
text-decoration : none;
font-weight : bold;
}
.jive-tab A:hover, .jive-selected-tab A:hover {
text-decoration : underline;
}
.jive-tab {
background-color : #E8E8DE;
}
.jive-tab-bar TD {
font-family : tahoma;
font-weight : bold;
}
.jive-tab-bar A {
color : #000;
text-decoration : none;
}
.jive-tab-bar A:hover {
text-decoration : underline;
}
.jive-tab-section TD {
font-weight : normal;
font-family : verdana;
font-size : 0.7em;
}
.jive-tab-section A {
color : #333 !important;
padding-right : 6px;
font-weight : normal;
}
.jive-tab-spring {
font-size : 0.7em;
}
.jive-tab-logout {
font-size : 0.7em;
}
/* sidebar */
.jive-admin-sidebar-header {
font-weight : bold;
}
/* page titles */
.jive-admin-page-title TABLE {
margin-top : 5px;
......@@ -488,92 +370,7 @@ PRE, TT {
}
.jive-admin-page-title TD {
font-family : tahoma, arial, helvetica, sans-serif;
font-size : 0.9em;
font-weight : bold;
}
/* tables */
.jive-table TABLE {
border : 1px #ccc solid;
}
.jive-table TH {
background-color : #ddd;
color : #000;
font-size : 0.7em;
font-size : 9pt;
font-weight : bold;
border-bottom : 1px #bbb solid;
padding-left : 6px;
padding-right : 6px;
}
.jive-description {
font-family : verdana;
font-size : 0.8em;
}
.jive-table .jive-odd {
}
.jive-table .jive-even TD {
background-color : #f8f8f8;
width : 1%;
white-space : nowrap;
}
.jive-table .jive-current TD {
background-color : #ffc;
}
.jive-table .jive-label {
background-color : #f4f4f4;
padding-right : 3px;
border : 1px #ccc solid;
width : 1%;
white-space : nowrap;
}
/* breadcrumbs */
.jive-breadcrumbs {
font-size : 14px !important;
font-weight : plain !important;
font-family : tahoma !important;
}
.jive-breadcrumbs A {
color : #000 !important;
}
.jive-breadcrumbs A:hover {
text-decoration : underline !important;
}
/* sidebar */
.sidebar-group TH {
padding-left : 10px;
font-weight : bold;
text-align : left;
}
.sidebar-group .bullet {
padding-left : 10px;
text-align : right;
vertical-align : top;
width : 1%;
}
/* paginators */
.jive-current {
color : #000;
font-weight : bold;
background-color : #eee;
padding-left : 2px;
padding-right : 2px;
text-decoration : none;
border : 1px #ccc solid;
}
.jive-current:visited {
color : #000;
}
.jive-sm-button {
font-size : 11px;
font-family : tahoma;
}
#a:link {color: #000000; text-decoration: none; }
#a:active {color: #000000; text-decoration: none; }
#a:visited {color: #000000; text-decoration: none; }
#a:hover {color: red; text-decoration: underline; }
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