Hi all.. I've found a little tool to be usefull in one of my sites. Let me explain.. Under certain situations, I should be sure the user completes a step of a form or a quiz, or just I do need the user to select one Item or accept the terms and conditions before letting him continue, but I have a lot of documentation in the site about how to help filling these forms, or just with enough knowledge to help the user to comply the requeriments.. Even if the user must complete the operation, it should be able to see other content in the site, but do nothing else..
An example, just in my case: the user should fill an account setup form, but should be able to go trough the faq/doc/forum, or just search the site. Any other request, like account editting, content posting or so should not be available, and gracefully redirect the user to the incomplete process of the account setup.
So the Idea is to 'jail' a user in the operation stage you want, but with enough room to find information or read something.. Once the operation is complete, you may free the user again.
These two apis will do the job:
jail_user_jail([url],[user id]) Jail a user in an url
- url (current url by default): url to jail the user
- uid (current user id by default: user to jail
jail_user_free([user id]) free the user
- uid (current user id by default): User id to free
The module provides the APIs and keeps track of jailed users. It also provides an interface to list jailed users and operations to free them.
Control about what the user can see while jailed is just an uri check against allowed paths. The "allowed" uris for a user are configured per site as a global 'free look' of the site even if the user is jailed. Most of the time this uris will be documentation trees or things like that.
Some usage examples could be:
- Jail the users to a poll, and free them when they submit their vote, or when the poll expires. This way uses have to cast a vote before they do any other thing.
- Punish a user to not be able to access any url having /add or /edit untill he writes a private message to an admin about his site 'suspictious' usage.
-
(In my case), when a user is attacked and his planet energy is too low, I should left the user 'blind', without access to any of his content (neither the private message system), but with free access to the documentation tree, to read the doc/forum/faq, untill the energy level is high enough to operate the "communication centre"..
I've done most of the code just because I need in one of my game sites, so I launch the request here just to see if someone else may consider this piece usefull enough, before creating a contrib module. Maybe some few feature requests will help to improve this kind of operations.
That's all.. thank you!
Comments
Perhaps combine jailing a
Perhaps combine jailing a user with a temporary assignment into a specific role?
And, possible integration with Actions module?
There is some useful functionality here -- I can see this being valuable.
Cheers,
Bill
FunnyMonkey
Tools for Teachers
FunnyMonkey
Exactly, we have done just
Exactly, we have done just that on a site recently. Basically we have set up quite a few user groups which - in other words - could be described as "levels". Using Workflow_ng Module we altered the user's group when he completed various things which gave access to new information on the site.
Follow me on Twitter @panatlantica
This is almost exactly what I am looking for
I'm new to drupal, but I'm encouraged you've built this. A "jail" concept is what I need to train my new members on various things. I don't want them to get lost in forum threads without getting certain core concepts. So if my system can track some things they have done, then I want them to be able to access other portions of the site. However, it is not about their participation in development. It is to reward them for participation and learning related to content.
There is also the issue of trust. While largely trust is a human decision I'd like to tie it in with ratings. If other members can rate their forum or group contributions to produce a total score, I'd like to use that in two ways.
The ad space takes two parts. (1) Banners for advertising whatever they want and (2) Our own affiliate program. So everyone who contributes to the site has the option to join the affiliate program. If they join it, and if no affiliate url (?affiliate=JoeSmith) exists from a referring site so that a default affiliate referrer is needed, then the affiliate rotator kicks in and assigns one of the members we have who has joined and gives them a financial reason to contribute great articles on our forums, since their portion of the rotation is based on their portion of the points earned by all participating members.
I'm sure this requires several modules combined. Also, my idea is still more complex. Some parts of the site require paid subscriptions. I want a free trial period with CRON stretching out the free trial when certain learning modules are completed and/or when certain forum points are earned.
Pretty much, I have a great idea, with many more details, as it involves a specific, very tremendous industry. And if you want to earn some huge money developing this, give me a call. I need a non-disclosure signed before we begin.
James Carvin
561-459-5690 (o)
561-310-7990 (m)
James Carvin
Thank you for your help!
interested
I can't follow in what ways it overlaps or is distinct from Drupal's access control system though.
benjamin, Agaric Design Collective
benjamin, agaric
just one use case example..
You let users edit nodes.. with enough granurality you can set an access control so an user can edit one node. This is access control system. Now.. set up this condition.. if the user starts to edit the node, don't let the user do any other thing untill he finished the edition, and force the user to edit that node everytime even if he wants to see other site area untill he submits the new content of the node.
is that clear enough?