Commit a2335f6f authored by michael.simon's avatar michael.simon
Browse files

add page for viewing and deploying keys, no function yet.

parent 35daa9d1
* 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
* Contributors:
* Michael Simon - initial
package edu.kit.scc.webreg.bean;
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;
public class UserSshKeyManagementBean implements Serializable {
private static final long serialVersionUID = 1L;
private UserEntity user;
private UserService userService;
private SessionManager sessionManager;
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);
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;
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html xmlns=""
<f:event type="javax.faces.event.PreRenderViewEvent"
listener="#{userSshKeyManagementBean.preRenderView}" />
<ui:composition template="/template/default.xhtml">
<ui:param name="title" value="#{messages.title}"/>
<ui:define name="content">
<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="#{}" value="#{userPropertiesBean.user.surName}, #{userPropertiesBean.user.givenName}"/>
<bw:outputText label="#{messages.eppn}" value="#{userPropertiesBean.user.eppn}"/>
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