Add functionality to do the proximity searches for users as well. Almost all of the logic would be the same, the main issues are figuring out the UI (put it on the user search tab? Have a radio on search/location that allows to search for users, nodes or both?)

Comments

ankur’s picture

I'd like to figure out the issue at http://drupal.org/node/24947 first. Basically, the point made there is that since most of the logic would be the same, we should just store all locations (users and nodes) in one table instead of writing seperate code for the two. We'd have to be careful about privacy issues though. That is the other issue I want to figure out before we put in a patch: how should we handle who can and can't search for users. If searching for other users is opened up, how do we make it clear to site users that people will be able to search for them by zipcode (or other geographic criteria). What about giving the user privacy options (perhaps, on a per-field level)? Implementing those privacy options?

-Ankur

robertdouglass’s picture

That's correct. Jame's is right on the money with his suggestion.

jasonwhat’s picture

Has this issue moved forward at all? Another layer to throw on this is CivicCRM. For example, it would be nice to have the chance to email everybody in a specific proximity, and of course to view them on a map.

shark’s picture

re: privacy

When editing my account settings, in the location box, I'd like to see something like this:

Location---------
Enter as much of your address as you are comfortable with. Your address will only be viewable by those who have the appropriate permissions (set below). The site will be able to automatically link you to driving directions and other features if it already knows your address.

Street:
[ ]
Additional:
[ ]
City:
[ ]
State/Province:
[ ]
Postal Code:
[ ]
Country:
[ ]

Privacy Permissions:
Use these options to control which users are allowed to view your location information, and what exactly they are allowed to see. By default, no one (except the site administrator) is allowed to view your information.

Allow down-to [ ] by [ ] or Specific List ["Enter comma separated list of users in this text-field"]
[ Street ] [ Anonymous ]
[ Additional ] [ Authenticated Users ]
[ Zip ] [ Role X ]
[ City ] [ Role Y ]
[ State/Province ] [ Specific List... ]
[ Country ]
[ None ]

--------------------------------------- end location box

I think this would work fine for most people, because if you are going to allow others to see a more specific location detail you might as well let them see a less specific one since they can usually determine the less specific from the more specific. For example, if I give you my zip code, I am obviously OK with you learning my State as well. So the drop down menu has the fields organized by most to least specific here (and I suppose it would actually make more sense to have the least specific at the top but I don't want to re-draw that now).

The Specific List text field could be hidden until "Specific List..." is selected in the menu, with javascript perhaps.

As for how the database will handle this user defined access control, I think Ankur already knows how unknowledgeable I am with SQL. ;)

shark’s picture

Doh! I forgot about that whitespace tuncation thing... I'll try again that location box ascii drawing; looks best with fixed with font.

Location---------
Enter as much of your address as you are comfortable with. Your address will only be viewable by those who have the appropriate permissions (set below). The site will be able to automatically link you to driving directions and other features if it already knows your address.

Street:
[                              ]
Additional:
[                              ]
City:
[                              ]
State/Province:
[                              ]
Postal Code:
[                              ]
Country:
[                              ]

Privacy Permissions:
Use these options to control which users are allowed to view your location information, 
and what exactly they are allowed to see. 
By default, no one (except the site administrator) is allowed to view your information.

Allow down-to [   //drop menu  ] by [  //drop menu     ] or Specific List ["ex: user1,user2,role1 "]
              [ None           ]    [ Anonymous        ]
              [ Country        ]    [ Authenticated Users ]
              [ State/Province ]    [ Role X           ]
              [ City           ]    [ Role Y           ]
              [ Postal Code    ]    [ Specific List... ]
              [ Additional     ]
              [ Street Addr    ]

Allow ...

Allow ...

[ ] i need to specify more permissions ( generate more "Allow..."s )

--------------------------------------- end location box

i changed the drop down location menu too.

Enter comma separated list of users in this text-field

shark’s picture

Another option, in addition to specifing roles, and individual users who can access your location, would be to specify permissions for your given buddy list (if the buddylist module is enabled).

shark’s picture

I imagine using drupal for a couple types of sites, where users would mostly be OK with other users knowing their location (and contact info for that matter). The first site would be one for families, to help big extended families keep in contact. The other site would be for people in a school (like high school or college) to stay in contact or reconnect.

For the family site, I think what I have suggested would work fine; the admin would probably want to set the default permissions so authenticated users (which would be family members) could see each others location, and users could change it if there was a certain relative they didn't want to see their location.

For the school site, you might want let all the people you went to school with know your location, and that could ideally be done by saying "let all users see my location where they have an attribute called "graduation year" which is within my "graduation year" plus or minus three years.

I'm not sure if there is a way to do that though (the "graduation year" thing), because you would want only certain people (teachers/school secretary, etc) to have permission to set your graduation year. Perhaps profile.module could be changed so that when you add a new profile field, you specify that you'd like to control who can edit it with a check box, and selecting that makes the field show up in the admin/access list under "profile":

profile:                        Anonymous | Authenticated | Teachers 
  edit field "graduation year"  [ ]         [ ]             [x]

Someone let me know if my diagrams are unreadable. I am only looking at them in firefox on linux.

ankur’s picture

This was the scheme I was thinking of:

On the account settings page:

                                    Private
Street:        [textfield]        [checkbox]
Additional:  [textfield]        [checkbox]
City:           [textfield]        [checkbox]
Province:    [select]          [checkbox]
Postal:        [textfield]        [checkbox]


Note: 
 Submitted fields will be accessible by site administrators.
 Fields not marked private will be accessible only by members of the site.

I'd then want to add a permission like 'Access private address fields'.

Now the question of searching is a little bit more difficult. Do we turn up users on searches that have decided not to publicize the fields that help turn them in searches, where we simply suppress the display of private fields?. Or do we just disallow searching for them? Or should this be a question asked on a per user basis? My reason for not asking the question for each field on a role-by-role basis is that I want to keep the interface simple. I also want to give users what they're used to seeing on other sites.

shark’s picture

Ankur,

I think your suggested scheme sounds fine. It is much simpler than what I had suggested, but I agree that simplicity is good and that is what most other sites have.

As to your question re: searches, I think that a if a user wants, say, their City to be private, then people should not be able to find out that they live in London by searching for "London" and looking for the user's name.

bdragon’s picture

Status: Active » Closed (duplicate)

Marking as duplicate of #319278: [master][meta] Location_search rewrite. (MUAHAHAHAHA! I finally touched the oldest issue in the location queue!)