Skip to content
This repository has been archived by the owner on Jul 17, 2019. It is now read-only.

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
anders committed Oct 23, 2012
1 parent c80606b commit f606b47
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 22 deletions.
3 changes: 2 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,14 @@
<artifactId>derbyclient</artifactId>
<version>10.9.1.0</version>
</dependency>
<!--
<dependency>
<groupId>org.glassfish.extras</groupId>
<artifactId>glassfish-embedded-static-shell</artifactId>
<version>3.1.1</version>
<scope>system</scope>
<systemPath>${glassfish.embedded-static-shell.jar}</systemPath>
</dependency>
</dependency>-->
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-web-api</artifactId>
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/dat076/frukostklubben/bb/ChangeInfoBB.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import javax.faces.component.EditableValueHolder;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.validator.ValidatorException;
import javax.inject.Named;

/**
Expand Down Expand Up @@ -114,7 +113,7 @@ public Boolean getSelected() {
public void setSelected(Boolean selected) {
this.selected = selected;
}

//For authorizing changes
public String getCheckPasswd() {
return checkPasswd;
Expand Down
12 changes: 12 additions & 0 deletions src/main/java/dat076/frukostklubben/security/Subject.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,18 @@ public class Subject implements Serializable {
@CollectionTable(name = "SUBJECT_GROUP")
@Enumerated(EnumType.STRING)
private final List<SubjectGroup> groups = new ArrayList<>();

public String getIsAdmin(){
/*for (SubjectGroup group : groups)
{
if(group == SubjectGroup.ADMIN)
{
return true;
}
}
return false;*/
return "String";
}

public String getPasswd() {
return passwd;
Expand Down
5 changes: 5 additions & 0 deletions src/main/webapp/admins/add.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
<ui:composition template="/jsf/template/template.xhtml">

<ui:define name="content">
<h1>Add new flight</h1>
<p>
Since you are logged in as administrator it is now possible to add new flights. Please proceed.
</p>
<h:form id="addForm">
<h:panelGrid id="calendar">
<ace:dateTimeEntry id="cal"
Expand All @@ -32,6 +36,7 @@
</h:panelGrid>
</h:form>
</ui:define>

</ui:composition>

</h:body>
Expand Down
12 changes: 0 additions & 12 deletions src/main/webapp/admins/admins.xhtml

This file was deleted.

4 changes: 3 additions & 1 deletion src/main/webapp/jsf/template/sideboxBottom.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
<body>
<ui:composition>
<h:panelGroup rendered="#{empty request.remoteUser}">
<h1 class="titleRibbon"><strong class="titleContent">Popular</strong></h1>

<h1 class="titleRibbon"><strong class="titleContent">Are you admin?</strong></h1>
<p>If you are admin. You should log in <h:link outcome="/admins/add">here</h:link> instead.</p>
</h:panelGroup>

<h:panelGroup rendered="#{not empty request.remoteUser}">
Expand Down
18 changes: 12 additions & 6 deletions src/main/webapp/jsf/template/sideboxTop.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,21 @@
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core">
xmlns:f="http://java.sun.com/jsf/core"
xmlns:c="http://java.sun.com/jsp/jstl/core">
<body>
<ui:composition>

<h:form rendered="#{not empty request.remoteUser}">
<h1 class="titleRibbon"><strong class="titleContent">Välkommen</strong></h1>
<p>Logged in as: ${request.remoteUser}</p>
<h:commandButton action="#{changeInfo.fetchUser}" value="Ändra uppgifter" class="inputButton">
<f:setPropertyActionListener target="#{changeInfo.currentMail}" value="${request.remoteUser}"/>
<h1 class="titleRibbon"><strong class="titleContent">Welcome</strong></h1>



<h:commandButton action="#{changeInfo.fetchUser}" value="Change Details" class="inputButton">
<f:setPropertyActionListener target="#{changeInfo.currentMail}" value="${request.remoteUser}"/>
</h:commandButton>


<h:form>
<h:commandButton action="#{auth.logout}" class="inputButton" value="Logout"/>
</h:form>
Expand All @@ -23,7 +28,8 @@
<h:panelGroup rendered="#{empty request.remoteUser}">
<h1 class="titleRibbon"><strong class="titleContent">User Panel</strong></h1>
<p>It seems that you are not logged in. You can login
<h:link outcome="/users/users">here</h:link>. </p>
<h:link outcome="/users/users">here</h:link>.
</p>
<p>
It is also possible to register <h:link outcome="/signup">here</h:link>.
</p>
Expand Down
1 change: 1 addition & 0 deletions src/main/webapp/users/changeInfo.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
<li>Street Address: <h:outputText value="#{changeInfo.user.address.street}"/></li>
<li>Zip: <h:outputText value="#{changeInfo.user.address.zip}"/></li>
<li>City: <h:outputText value="#{changeInfo.user.address.city}"/></li>
<li>Groups: <h:outputText value="#{changeInfo.user.groups.get(0)}"/></li>
</ul>
</article>

Expand Down

0 comments on commit f606b47

Please sign in to comment.