Skip to content

Commit 89fc4a5

Browse files
committed
fixed admin authentication provider
1 parent 2f9f29e commit 89fc4a5

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

logicaldoc-core/src/main/java/com/logicaldoc/core/security/spring/AdminAuthenticationProvider.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.logicaldoc.core.security.spring;
22

3+
import java.security.NoSuchAlgorithmException;
34
import java.util.ArrayList;
45
import java.util.Collection;
56

@@ -50,6 +51,11 @@ public Authentication authenticate(Authentication authentication) throws Authent
5051

5152
User user = new User();
5253
user.setUsername(ADMIN);
54+
try {
55+
user.setDecodedPassword(String.valueOf(auth.getCredentials()));
56+
} catch (NoSuchAlgorithmException e) {
57+
log.error(e.getMessage(), e);
58+
}
5359

5460
UserDAO uDao = Context.get(UserDAO.class);
5561

@@ -62,7 +68,7 @@ public Authentication authenticate(Authentication authentication) throws Authent
6268
long userId = uDao.queryForLong("select ld_id from ld_user where ld_username='admin' and ld_deleted=0");
6369
dbAvailable = userId == 1L;
6470
} catch (Exception t) {
65-
// Noting to do
71+
log.error(t.getMessage(), t);
6672
}
6773

6874
String adminPasswd = null;
@@ -73,7 +79,7 @@ public Authentication authenticate(Authentication authentication) throws Authent
7379
adminPasswd = uDao
7480
.queryForString("select ld_password from ld_user where ld_username='admin' and ld_deleted=0");
7581
} catch (Exception t) {
76-
// Noting to do
82+
log.error(t.getMessage(), t);
7783
}
7884
} else {
7985
// If the database is not available, get the password from the
@@ -82,7 +88,7 @@ public Authentication authenticate(Authentication authentication) throws Authent
8288
ContextProperties config = Context.get().getProperties();
8389
adminPasswd = config.getProperty("adminpasswd");
8490
} catch (Exception t) {
85-
// Noting to do
91+
log.error(t.getMessage(), t);
8692
}
8793
}
8894

logicaldoc-gui/war/login.jsp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
<%! static String LOGIN_PAGE="login.jsp"; %>
88
<%@ include file="header.jsp" %>
99
<%@ include file="detectmobile.jsp" %>
10-
<link REL="STYLESHEET" HREF="<%=MODULE%>/sc/skins/<%=SKIN%>/style-login.css" TYPE="text/css" />
1110

1211
<script type="text/javascript">
1312
var j_loginurl='${pageContext.request.contextPath}/<%=LOGIN_PAGE%>';
@@ -49,6 +48,6 @@
4948

5049
<%@ include file="body.jsp" %>
5150

52-
<link REL="STYLESHEET" HREF="<%=MODULE%>/sc/skins/<%=SKIN%>/style-login.css" TYPE="text/css" />
51+
<%@ include file="footer.jsp" %>
5352

54-
<%@ include file="footer.jsp" %>
53+
<link REL="STYLESHEET" HREF="<%=MODULE%>/sc/skins/<%=SKIN%>/style-login.css" TYPE="text/css" />

logicaldoc-gui/war/skin-Shiva/style.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@
159159
}
160160

161161
.warn {
162-
background-color: rgb(255, 255, 161);
162+
background-color: #FFFFA1;
163163
}
164164

165165
.diff {
@@ -483,6 +483,7 @@
483483
left:0;
484484
}
485485

486+
486487
/*
487488
* Shiva overrides
488489
*/

0 commit comments

Comments
 (0)