Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
reg-app
Regapp
Commits
a2335f6f
Commit
a2335f6f
authored
Jan 15, 2019
by
michael.simon
Browse files
add page for viewing and deploying keys, no function yet.
parent
35daa9d1
Changes
2
Hide whitespace changes
Inline
Side-by-side
bwreg-webapp/src/main/java/edu/kit/scc/webreg/bean/UserSshKeyManagementBean.java
0 → 100644
View file @
a2335f6f
/*******************************************************************************
* Copyright (c) 2014 Michael Simon.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
*
* Contributors:
* Michael Simon - initial
******************************************************************************/
package
edu.kit.scc.webreg.bean
;
import
java.io.Serializable
;
import
java.util.ArrayList
;
import
java.util.List
;
import
javax.faces.bean.ManagedBean
;
import
javax.faces.bean.ViewScoped
;
import
javax.faces.event.ComponentSystemEvent
;
import
javax.inject.Inject
;
import
edu.kit.scc.webreg.entity.UserEntity
;
import
edu.kit.scc.webreg.service.UserService
;
import
edu.kit.scc.webreg.session.SessionManager
;
import
edu.kit.scc.webreg.ssh.OpenSshKeyDecoder
;
import
edu.kit.scc.webreg.ssh.OpenSshPublicKey
;
@ManagedBean
@ViewScoped
public
class
UserSshKeyManagementBean
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
private
UserEntity
user
;
@Inject
private
UserService
userService
;
@Inject
private
SessionManager
sessionManager
;
@Inject
private
OpenSshKeyDecoder
keyDecoder
;
private
List
<
OpenSshPublicKey
>
keyList
;
private
String
newKey
;
public
void
preRenderView
(
ComponentSystemEvent
ev
)
{
if
(
user
==
null
)
{
user
=
userService
.
findByIdWithStore
(
sessionManager
.
getUserId
());
keyList
=
new
ArrayList
<>();
}
}
public
void
deployKey
()
{
OpenSshPublicKey
key
=
keyDecoder
.
decode
(
newKey
);
keyList
.
add
(
key
);
}
public
UserEntity
getUser
()
{
return
user
;
}
public
String
getNewKey
()
{
return
newKey
;
}
public
void
setNewKey
(
String
newKey
)
{
this
.
newKey
=
newKey
;
}
public
List
<
OpenSshPublicKey
>
getKeyList
()
{
return
keyList
;
}
public
void
setKeyList
(
List
<
OpenSshPublicKey
>
keyList
)
{
this
.
keyList
=
keyList
;
}
}
bwreg-webapp/src/main/webapp/user/ssh-keys.xhtml
0 → 100644
View file @
a2335f6f
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html
xmlns=
"http://www.w3.org/1999/xhtml"
xmlns:f=
"http://java.sun.com/jsf/core"
xmlns:h=
"http://java.sun.com/jsf/html"
xmlns:ui=
"http://java.sun.com/jsf/facelets"
xmlns:bw=
"http://www.scc.kit.edu/bwfacelets"
xmlns:p=
"http://primefaces.org/ui"
xmlns:of=
"http://omnifaces.org/functions"
>
<head>
<title></title>
</head>
<body>
<f:view>
<f:metadata>
<f:event
type=
"javax.faces.event.PreRenderViewEvent"
listener=
"#{userSshKeyManagementBean.preRenderView}"
/>
</f:metadata>
<ui:composition
template=
"/template/default.xhtml"
>
<ui:param
name=
"title"
value=
"#{messages.title}"
/>
<ui:define
name=
"content"
>
<h:form>
<div
class=
"panel"
>
<div
class=
"panel"
>
#{messages.my_data_explanation}
</div>
<div
class=
"panel"
>
#{messages.data_from}:
<b>
#{userPropertiesBean.idpEntity.orgName}
</b></div>
<p:panelGrid
id=
"baseData"
columns=
"2"
>
<bw:outputText
label=
"#{messages.name}"
value=
"#{userPropertiesBean.user.surName}, #{userPropertiesBean.user.givenName}"
/>
<bw:outputText
label=
"#{messages.eppn}"
value=
"#{userPropertiesBean.user.eppn}"
/>
</p:panelGrid>
</div>
</h:form>
</ui:define>
</ui:composition>
</f:view>
</body>
</html>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment