r7049 - in dumbhippo/trunk/server: src/com/dumbhippo/server/impl web/javascript/dh web/tags/3
- From: commits mugshot org
- To: online-desktop-list gnome org
- Subject: r7049 - in dumbhippo/trunk/server: src/com/dumbhippo/server/impl web/javascript/dh web/tags/3
- Date: Wed, 12 Dec 2007 19:40:13 -0600 (CST)
Author: marinaz
Date: 2007-12-12 19:40:12 -0600 (Wed, 12 Dec 2007)
New Revision: 7049
Modified:
dumbhippo/trunk/server/src/com/dumbhippo/server/impl/HttpMethodsBean.java
dumbhippo/trunk/server/web/javascript/dh/account.js
dumbhippo/trunk/server/web/tags/3/accountJavascriptSetup.tag
Log:
Get the name of the user through the PersonView when initializing the account page form.
Initialize everything on the account page form even if it is disabled.
Set the name for the user that we get from Facebook in the database once the user accepts
terms of use.
Modified: dumbhippo/trunk/server/src/com/dumbhippo/server/impl/HttpMethodsBean.java
===================================================================
--- dumbhippo/trunk/server/src/com/dumbhippo/server/impl/HttpMethodsBean.java 2007-12-13 01:02:36 UTC (rev 7048)
+++ dumbhippo/trunk/server/src/com/dumbhippo/server/impl/HttpMethodsBean.java 2007-12-13 01:40:12 UTC (rev 7049)
@@ -55,6 +55,7 @@
import com.dumbhippo.identity20.Guid.ParseException;
import com.dumbhippo.live.LiveGroup;
import com.dumbhippo.live.LiveState;
+import com.dumbhippo.persistence.AccountClaim;
import com.dumbhippo.persistence.AimResource;
import com.dumbhippo.persistence.Application;
import com.dumbhippo.persistence.ApplicationCategory;
@@ -63,6 +64,7 @@
import com.dumbhippo.persistence.ExternalAccount;
import com.dumbhippo.persistence.ExternalAccountType;
import com.dumbhippo.persistence.FacebookAccount;
+import com.dumbhippo.persistence.FacebookResource;
import com.dumbhippo.persistence.Feed;
import com.dumbhippo.persistence.FeedEntry;
import com.dumbhippo.persistence.Group;
@@ -136,6 +138,7 @@
import com.dumbhippo.server.views.UserViewpoint;
import com.dumbhippo.server.views.Viewpoint;
import com.dumbhippo.services.AmazonWebServices;
+import com.dumbhippo.services.FacebookWebServices;
import com.dumbhippo.services.FlickrUser;
import com.dumbhippo.services.FlickrWebServices;
import com.dumbhippo.services.LastFmWebServices;
@@ -1230,6 +1233,22 @@
public void doAcceptTerms(UserViewpoint viewpoint) {
viewpoint.getViewer().getAccount().setHasAcceptedTerms(true);
+ // set a better name for a Facebook user, since now the user can edit it, and
+ // we won't be needing to get it from Facebook again
+ if (viewpoint.getViewer().getNickname().contains("Facebook user")) {
+ for (AccountClaim ac : viewpoint.getViewer().getAccountClaims()) {
+ if (ac.getResource() instanceof FacebookResource) {
+ FacebookResource fr = (FacebookResource)ac.getResource();
+ FacebookWebServices ws = new FacebookWebServices(REQUEST_TIMEOUT, config);
+ FacebookAccount facebookAccount = facebookTracker.getFacebookAccount(fr.getFacebookUserId());
+ if (facebookAccount != null) {
+ String name = ws.getName(facebookAccount);
+ if (name.trim().length() > 0)
+ doRenamePerson(viewpoint, name);
+ }
+ }
+ }
+ }
}
public void doSetNeedsDownload(UserViewpoint viewpoint, boolean needsDownload) {
Modified: dumbhippo/trunk/server/web/javascript/dh/account.js
===================================================================
--- dumbhippo/trunk/server/web/javascript/dh/account.js 2007-12-13 01:02:36 UTC (rev 7048)
+++ dumbhippo/trunk/server/web/javascript/dh/account.js 2007-12-13 01:40:12 UTC (rev 7049)
@@ -823,8 +823,8 @@
}
if (!dh.account.active) {
+ // we want to disable editing, but still display all the data we have
dh.dom.disableChildren(document.getElementById("dhAccountContents"));
- return;
}
var usernameEntry = new dh.formtable.ExpandableTextInput('dhUsernameEntry', "J. Doe");
usernameEntry.setDescription("The name you appear to others as.");
Modified: dumbhippo/trunk/server/web/tags/3/accountJavascriptSetup.tag
===================================================================
--- dumbhippo/trunk/server/web/tags/3/accountJavascriptSetup.tag 2007-12-13 01:02:36 UTC (rev 7048)
+++ dumbhippo/trunk/server/web/tags/3/accountJavascriptSetup.tag 2007-12-13 01:40:12 UTC (rev 7049)
@@ -8,7 +8,7 @@
dh.account.active = ${signin.active};
dh.password.active = ${signin.active};
dh.formtable.currentValues = {
- 'dhUsernameEntry' : <dh:jsString value="${signin.user.nickname}"/>,
+ 'dhUsernameEntry' : <dh:jsString value="${signin.viewedUserFromSystem.name}"/>,
'dhBioEntry' : <dh:jsString value="${signin.user.account.bio}"/>,
'dhMusicBioEntry' : <dh:jsString value="${signin.user.account.musicBio}"/>,
'dhWebsiteEntry' : <dh:jsString value="${account.websiteUrl}"/>,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]