What's the best way to handle something like this... ?

Interzone - May 2, 2009 - 09:59

I'm interested in converting my social networking site to Drupal. I have a question about roles, user settings / permissions / status and the best way to handle a situation which is this:

1) Members of the site will have different statuses, such as "suspended" or "flagged" in addition to active, blocked, etc.. Where and how should these be added?

In addition, the user settings currently only have

1. Only site administrators can create new user accounts.
2. Visitors can create accounts and no administrator approval is required.
3. Visitors can create accounts but administrator approval is required.

The thing is under certain conditions we need approval and under others, we don't need it. What we need is a #4.

4. Visitors can create accounts and administrator approval is required only under certain conditions.

For example, we were able to determine that most spammers show IPs from a half a dozen countries, their IPs don't match the country they claim to be in, they register in English, and they claim to be female. So, if all of these conditions are met, we'd like to require approval. If they meet just the first two, we'd like to flag them for later review but allow them to register normally. What's the best way to handle that?

I've looked at ACL, Rules and Content Access modules but I'm not sure if these will do the trick. Any ideas?

Thanks,

J

Since you have a very

nevets - May 2, 2009 - 14:24

Since you have a very specific set of criteria for blocking you will need some custom code. To start you would use #2 above. You could do the rest with the rules module.

Add a new trigger rule for the event "User account has been created"

For condition use "Execute custom PHP code"

And and the actions "Block a user" and "Send a mail to an arbitrary mail address" (if you want to notify someone that the user was blocked).

You would implement your criteria in the PHP code returning TRUE if the user should be blocked. If the criteria is long and/or complex I would write a small module that as a new Rule condition and have it implement the criteria.

Thanks I appreciate that.

Interzone - May 2, 2009 - 17:46

Thanks I appreciate that advice. There are so many ways to approach these things that I'm always afraid to.. well, come up with a suboptimal (read: rather stupid) solution.

Do you think that things like Suspended and Flagged should be roles or statuses? I guess they could work as roles, but it seems at first glance it would be better to have them as statuses. Is there any module that can create extra statuses, how does one approach that?

Thanks again.

I think it depends on how you

nevets - May 2, 2009 - 21:33

I think it depends on how you use "Suspended" and "Flagged". If they change the users permissions they would need to be roles (This would imply a role other than authorized that most people have and has the larger set of permissions).

thanks again! On the

Interzone - May 3, 2009 - 17:30

thanks again!

On the permission front, I'm wondering if acl http://drupal.org/project/acl would be worth using. Has anyone used it with Drupal?

_

WorldFallz - May 3, 2009 - 00:25

You may also want to look at the http://drupal.org/project/flag module-- i believe you can do some cool things with rules and flags.

_
Don't be a Help Vampire - read and abide the forum guidelines.
If you find my assistance useful, please pay it forward to your fellow drupalers.

Thanks for the

Interzone - May 3, 2009 - 17:32

Thanks for the recommendation, looks interesting... and very useful. Very nice.

Another potholes in the road...

Interzone - May 3, 2009 - 17:54

On the site we need to establish location for members... for example, we have Country > State > City hierarchy within a "location" directory.

If you click location you go to a page with all the countries displayed with a separate link to go to all profiles for that country. If you click a country you go to a page with all the states displayed and a link so show all profiles for that state, etc...

The ideal way to do this would be with the taxonomy or something similar as tags have so many advantages.

The problem is that we already have over 100,000 users from every country in the world and tens of thousands of cities (on a non Drupal site I'm going to migrate to Acquia Drupal). That's a monstrous amount to dump into a single taxonomy vocabulary such as locations... or it seems that way.

The taxonomy structure, it appears, only allows one to establish hierarchies within a single vocabulary.

When a use registers I'd like to use a bit of Ajax so that they can chose the country then get the state for that country, after selecting a state, get the cities for that state. Right now the menu for the taxonomy (just with a handful of test data) is a gigantic mess.

Is there a graceful way to break this apart or a better way to do it while still taking advantage of tags and allowing for a smooth ajax registration using existing Drupal modules?

_

WorldFallz - May 3, 2009 - 18:29

It's still in development for d6, but checkout the http://drupal.org/project/hierarchical_select module-- especially the demo's on wim's site.

_
Don't be a Help Vampire - read and abide the forum guidelines.
If you find my assistance useful, please pay it forward to your fellow drupalers.

Thanks, I stumbled across

Interzone - May 3, 2009 - 20:09

Thanks, I stumbled across that one but wasn't sure how it worked, but it looks promising. I hope they have a release candidate soon for 6x so I can see if it fits the bill.

I was also looking at using these modules:

http://drupal.org/project/taxonomy_menu
http://drupal.org/project/taxonomy_csv
http://drupal.org/project/taxonomy_manager
http://drupal.org/project/content_taxonomy

Not sure if there is reduncancy with http://drupal.org/project/content_taxonomy vs http://drupal.org/project/hierarchical_select

But not quite sure how to pull it all together... that's a lot of modules.

Also using http://drupal.org/project/content_profile with profile.module to create profile.

_

WorldFallz - May 4, 2009 - 14:39

i'm not sure i understand why you would need all those modules. If you set up a single hierarchical vocabulary for the country/state/city info, you can use hierarchical_select directly with that vocabulary to setup a nice ajaxy dependent drop down (that also degrades gracefully if js is disabled). I'm using the d6 dev version of hs and its working very well so far. Might be worth a try.

_
Don't be a Help Vampire - read and abide the forum guidelines.
If you find my assistance useful, please pay it forward to your fellow drupalers.

Actually, the modules are for

Interzone - May 4, 2009 - 18:36

Actually, the modules are for other related issues, like data cleanup and management. If we let users submit their own city names, even with auto complete large amounts of junk input accumulates.

Anyway, I'll give it a try... if you've tested it and it's working, that's really encouraging news.

Thanks a bunch.

 
 

Drupal is a registered trademark of Dries Buytaert.