labs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simo...@apache.org
Subject svn commit: r795920 - in /labs/magma/trunk/fragment-user-web/src/main: java/org/apache/magma/web/user/UserWebHandler.java resources/org/apache/magma/web/user/noUserFound.vm
Date Mon, 20 Jul 2009 17:02:54 GMT
Author: simoneg
Date: Mon Jul 20 17:02:54 2009
New Revision: 795920

URL: http://svn.apache.org/viewvc?rev=795920&view=rev
Log:
LABS-391 : fixed case where user is null

Added:
    labs/magma/trunk/fragment-user-web/src/main/resources/org/apache/magma/web/user/noUserFound.vm
Modified:
    labs/magma/trunk/fragment-user-web/src/main/java/org/apache/magma/web/user/UserWebHandler.java

Modified: labs/magma/trunk/fragment-user-web/src/main/java/org/apache/magma/web/user/UserWebHandler.java
URL: http://svn.apache.org/viewvc/labs/magma/trunk/fragment-user-web/src/main/java/org/apache/magma/web/user/UserWebHandler.java?rev=795920&r1=795919&r2=795920&view=diff
==============================================================================
--- labs/magma/trunk/fragment-user-web/src/main/java/org/apache/magma/web/user/UserWebHandler.java
(original)
+++ labs/magma/trunk/fragment-user-web/src/main/java/org/apache/magma/web/user/UserWebHandler.java
Mon Jul 20 17:02:54 2009
@@ -63,10 +63,14 @@
 		return (HtmlProducer) doShow(user).compoundWith(new TemplatingProducer("registered").addParameter("user",
user), CompoundType.BEFORE);
 	}
 
-	public HtmlProducer doActivate(User user){
-		user.setActive(true);
-		new Database().save(user);
-		return new TemplatingProducer("activated").addParameter("user", user);
+	public HtmlProducer doActivate(User user) {
+		if (user != null) {
+			user.setActive(true);
+			new Database().save(user);
+			return new TemplatingProducer("activated").addParameter("user", user);
+		} else {
+			return new TemplatingProducer("noUserFound");
+		}
 	}
 	
 	

Added: labs/magma/trunk/fragment-user-web/src/main/resources/org/apache/magma/web/user/noUserFound.vm
URL: http://svn.apache.org/viewvc/labs/magma/trunk/fragment-user-web/src/main/resources/org/apache/magma/web/user/noUserFound.vm?rev=795920&view=auto
==============================================================================
--- labs/magma/trunk/fragment-user-web/src/main/resources/org/apache/magma/web/user/noUserFound.vm
(added)
+++ labs/magma/trunk/fragment-user-web/src/main/resources/org/apache/magma/web/user/noUserFound.vm
Mon Jul 20 17:02:54 2009
@@ -0,0 +1,6 @@
+<h1 >
+	$i18n.tr("No user found")
+</h1>
+	<p >
+		$i18n.tr("Hi "), $i18n.tr("your account seems to have been deleted or not available anymore.")
+	</p>



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@labs.apache.org
For additional commands, e-mail: commits-help@labs.apache.org


Mime
View raw message