r7035 - in dumbhippo/trunk/server/src/com/dumbhippo: persistence server/impl web/servlets



Author: marinaz
Date: 2007-12-11 18:55:44 -0600 (Tue, 11 Dec 2007)
New Revision: 7035

Modified:
   dumbhippo/trunk/server/src/com/dumbhippo/persistence/Account.java
   dumbhippo/trunk/server/src/com/dumbhippo/server/impl/ExternalAccountSystemBean.java
   dumbhippo/trunk/server/src/com/dumbhippo/server/impl/FacebookTrackerBean.java
   dumbhippo/trunk/server/src/com/dumbhippo/web/servlets/FacebookServlet.java
Log:
Do em.flush() after removing AcccountClaim.

Check if the Facebook external account is loved and enabled before trying to get 
a profile link for it.

Don't check termsOfUserAccepted to determine if the account is active, since if 
we have some information for the account it means it came from Facebook and therefore
should be returned or used to make requests.

Adjust the application page form some more.

Modified: dumbhippo/trunk/server/src/com/dumbhippo/persistence/Account.java
===================================================================
--- dumbhippo/trunk/server/src/com/dumbhippo/persistence/Account.java	2007-12-12 00:51:15 UTC (rev 7034)
+++ dumbhippo/trunk/server/src/com/dumbhippo/persistence/Account.java	2007-12-12 00:55:44 UTC (rev 7035)
@@ -469,7 +469,14 @@
 	
 	@Transient
 	public boolean isActive() {
-		return !(isDisabled() || isAdminDisabled()) && hasAcceptedTerms;
+		// This used to also check hasAcceptedTerms, but since
+		// the only way we'd have any information for someone who
+		// did not accept terms is if they entered it on Facebook,
+		// we shouldn't check it here, but instead let this function 
+		// return True in that case.
+		// Alternatively, we can create a separate variable 
+		// isFacebookOnly.
+		return !(isDisabled() || isAdminDisabled());
 	}
 
 	@Column(nullable=true)

Modified: dumbhippo/trunk/server/src/com/dumbhippo/server/impl/ExternalAccountSystemBean.java
===================================================================
--- dumbhippo/trunk/server/src/com/dumbhippo/server/impl/ExternalAccountSystemBean.java	2007-12-12 00:51:15 UTC (rev 7034)
+++ dumbhippo/trunk/server/src/com/dumbhippo/server/impl/ExternalAccountSystemBean.java	2007-12-12 00:55:44 UTC (rev 7035)
@@ -133,7 +133,7 @@
 		
 		Set<ExternalAccountView> accountViews = new HashSet<ExternalAccountView>();
 		for (ExternalAccount account : accounts) {
-			if (account.getAccountType() == ExternalAccountType.FACEBOOK) {
+			if (account.getAccountType() == ExternalAccountType.FACEBOOK && account.isLovedAndEnabled()) {
 				accountViews.add(new ExternalAccountView(account, facebookSystem.getProfileLink(account)));
 			} else {
 				accountViews.add(new ExternalAccountView(account));

Modified: dumbhippo/trunk/server/src/com/dumbhippo/server/impl/FacebookTrackerBean.java
===================================================================
--- dumbhippo/trunk/server/src/com/dumbhippo/server/impl/FacebookTrackerBean.java	2007-12-12 00:51:15 UTC (rev 7034)
+++ dumbhippo/trunk/server/src/com/dumbhippo/server/impl/FacebookTrackerBean.java	2007-12-12 00:55:44 UTC (rev 7035)
@@ -154,6 +154,7 @@
 							    externalAccounts.setSentiment(ea, Sentiment.INDIFFERENT);
 							    ac.getOwner().getAccount().setDisabled(true);
 							    em.remove(ac);
+							    em.flush();
 							    identitySpider.addVerifiedOwnershipClaim(viewpoint.getViewer(), res);
 							    externalAccount.setExtra(Long.toString(facebookAccount.getId()));		
 							} catch (NotFoundException e) {

Modified: dumbhippo/trunk/server/src/com/dumbhippo/web/servlets/FacebookServlet.java
===================================================================
--- dumbhippo/trunk/server/src/com/dumbhippo/web/servlets/FacebookServlet.java	2007-12-12 00:51:15 UTC (rev 7034)
+++ dumbhippo/trunk/server/src/com/dumbhippo/web/servlets/FacebookServlet.java	2007-12-12 00:55:44 UTC (rev 7035)
@@ -307,7 +307,7 @@
 		    }
 		    ExternalAccountCategory currentCategory = null;
 		    xml.openElement("div", "style", "position:relative;width:400px;float:left;");
-		    xml.openElement("fb:editor", "action", "", "width", "400", "labelwidth", "120");
+		    xml.openElement("fb:editor", "action", "", "width", "280", "labelwidth", "120");
 		    for (ExternalAccountView externalAccount : getSupportedAccounts(user)) {
 		    	if (currentCategory == null || !currentCategory.equals(externalAccount.getExternalAccountType().getCategory())) {
 				    currentCategory = externalAccount.getExternalAccountType().getCategory();
@@ -362,15 +362,15 @@
 		    xml.closeElement(); // div with the form
 		    
 		    if (!user.getAccount().getHasAcceptedTerms()) {
-		    	xml.openElement("div", "style", "width:200px;float:left;color:#666666;font-weight:bold;margin-top:30px;");
+		    	xml.openElement("div", "style", "width:200px;float:left;color:#666666;font-weight:bold;margin-top:34px;margin-left:20px;");
 			    xml.append("Do you already have a Mugshot account? Don't fill in this stuff, just verify" +
 			    		   " your Mugshot account by following this link.");
 			    xml.openElement("form", "action", "http://dogfood.mugshot.org/facebook-add";, "target", "_blank", "method", "GET");
-			    xml.appendEmptyNode("input", "type", "submit", "value", "Verify My Mugshot Account", "style", "margin-bottom:30px;");
+			    xml.appendEmptyNode("input", "type", "submit", "value", "Verify My Mugshot Account", "style", "margin-top:20px;margin-bottom:40px;");
 			    xml.closeElement();		
 			    xml.append("Want to create a Mugshot account? It's free and easy and helps you see all your friends' activities in one place, share links, and read feeds in a social setting.");
 	            xml.openElement("form", "action", "http://dogfood.mugshot.org/facebook-signin";, "target", "_blank", "method", "GET");
-	            xml.appendEmptyNode("input", "type", "submit", "value", "Create My Mugshot Account", "style", "margin-bottom:30px;");
+	            xml.appendEmptyNode("input", "type", "submit", "value", "Create My Mugshot Account", "style", "margin-top:20px;margin-bottom:30px;");
 	            xml.closeElement();	
 		    	xml.closeElement();
 		    }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]