Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

- UserEmailProvider -> UserLdapNameProvider

- Email -> RZ-Login
  • Loading branch information...
commit b1d876d914935808c3c1ab57cebe089d4d1c51fd 1 parent 8fadda9
@alexbiehl alexbiehl authored
View
8 src/main/java/org/fhw/asta/kasse/client/components/SessionManagerComponent.java
@@ -5,20 +5,22 @@
public class SessionManagerComponent {
+ private static final String COOKIE_NAME = "ldap_name";
+
public boolean isLoggedIn() {
- return !Strings.isNullOrEmpty(Cookies.getCookie("email"));
+ return !Strings.isNullOrEmpty(Cookies.getCookie(COOKIE_NAME));
}
public String getUserEmail() {
if (!isLoggedIn()) {
- return Cookies.getCookie("email");
+ return Cookies.getCookie(COOKIE_NAME);
} else {
throw new RuntimeException("Junge check VORHER das der Nutzer eingeloggt ist!!");
}
}
public void setLoggedIn(String email) {
- Cookies.setCookie("email", email);
+ Cookies.setCookie(COOKIE_NAME, email);
}
}
View
2  src/main/java/org/fhw/asta/kasse/client/widget/basket/BasketWidgetImpl.ui.xml
@@ -15,7 +15,7 @@
<td><g:Label ui:field="sum" text="€0.00"/></td>
</tr>
<tr>
- <td><strong>MatrNr: </strong></td>
+ <td><strong>RZ-Login: </strong></td>
<td><g:TextBox ui:field="matrNr" text="0000"/></td>
</tr>
<tr>
View
2  src/main/java/org/fhw/asta/kasse/client/widget/login/LoginWidgetImpl.ui.xml
@@ -15,7 +15,7 @@
<legend>Login</legend>
<div class="control-group">
- <label class="control-label" for="inputEmail">Email</label>
+ <label class="control-label" for="inputEmail">RZ-Login</label>
<div class="controls">
<g:TextBox ui:field="emailTextBox" styleName="" focus="true"/>
</div>
View
9 src/main/java/org/fhw/asta/kasse/client/widget/main/MainWidgetImpl.java
@@ -22,6 +22,9 @@ public MainWidgetImpl() {
}
@UiField
+ HTMLPanel sidebarPanel;
+
+ @UiField
SimplePanel mainContainer;
@UiField
@@ -45,7 +48,10 @@ public void setSidebarWidget(IsWidget widget) {
sidebarContainer.clear();
if (widget != null) {
+ sidebarPanel.setVisible(true);
sidebarContainer.add(widget);
+ } else {
+ sidebarPanel.setVisible(false);
}
}
@@ -55,7 +61,10 @@ public void setBasketWidget(IsWidget widget) {
basketContainer.clear();
if (widget != null) {
+ basketContainer.setVisible(true);
basketContainer.add(widget);
+ } else {
+ basketContainer.setVisible(false);
}
}
View
13 src/main/java/org/fhw/asta/kasse/client/widget/main/MainWidgetImpl.ui.xml
@@ -11,12 +11,11 @@
<div class="container-fluid">
<div class="row-fluid">
<div class="span2">
- <div class="well sidebar-nav">
+ <g:HTMLPanel ui:field="sidebarPanel" styleName="well sidebar-nav">
<ul class="nav nav-list">
<g:HTMLPanel ui:field="sidebarContainer" />
</ul>
-
- </div>
+ </g:HTMLPanel>
</div>
<div class="span7">
<div class="">
@@ -25,13 +24,7 @@
</div>
<div class="span3">
- <div class="well sidebar-nav">
- <g:HTMLPanel ui:field="basketContainer" />
- </div>
-
- <div class="well sidebar-nav">
- bla
- </div>
+ <g:HTMLPanel styleName="well sidebar-nav" ui:field="basketContainer" />
</div>
</div>
View
6 ...w/asta/kasse/server/common/UserEmailProvider.java → ...sta/kasse/server/common/UserLdapNameProvider.java
@@ -19,13 +19,13 @@
* @author alexbiehl
*
*/
-public class UserEmailProvider implements Supplier<Optional<String>> {
+public class UserLdapNameProvider implements Supplier<Optional<String>> {
- private static final String EMAIL_COOKIE = "email";
+ private static final String EMAIL_COOKIE = "ldap_name";
private final HttpServletRequest req;
- public UserEmailProvider(HttpServletRequest req) {
+ public UserLdapNameProvider(HttpServletRequest req) {
this.req = req;
}
View
4 src/main/java/org/fhw/asta/kasse/server/service/CheckoutServiceEndpoint.java
@@ -3,7 +3,7 @@
import java.util.List;
import org.apache.log4j.Logger;
-import org.fhw.asta.kasse.server.common.UserEmailProvider;
+import org.fhw.asta.kasse.server.common.UserLdapNameProvider;
import org.fhw.asta.kasse.shared.basket.BasketItem;
import org.fhw.asta.kasse.shared.exception.CheckoutException;
import org.fhw.asta.kasse.shared.service.checkout.CheckoutService;
@@ -24,7 +24,7 @@
public Integer doCheckout(List<BasketItem> items, int discount,
String matrNr) throws CheckoutException {
- final Optional<String> email = new UserEmailProvider(
+ final Optional<String> email = new UserLdapNameProvider(
this.getThreadLocalRequest()).get();
if (email.isPresent()) {
Please sign in to comment.
Something went wrong with that request. Please try again.