A question for the experienced on Sitelok


(Pedro Perdomo M.) #1

A question for the experienced on Sitelok:
Is it possible that for a given group each user can log in only once?

Thanks in advance


(Mark Harradine) #2

You could add a button to the page that, when clicked, removes them from that particular group. What is it that you want the user to do just once?


(Pedro Perdomo M.) #3

Thanks Mark for your kind response. What I am trying to do is a voting system that allows each registered member to vote only once.


(Mark Harradine) #4

That should be fairly easy to set up. Create a “NotVoted” group to contain those that have not yet voted, (you can automatically add new users to this group when they register). Make the voting page only accessible to the “NotVoted” group. Once they have voted, have a button that says something like “click to continue” and attach the code to that button for removing them from the “NotVoted” group.

<input type="hidden" name="modifygroup[]" value="<?php removegroupinput("NotVoted"); ?>">

In fact, you could also store their choice of vote in a Custom field, should you want to keep a running tally of the vote.


(Pedro Perdomo M.) #5

Thanks Mark!
I am planning the voting form in Formloom3. Do you think that when the user sends the form, it is automatically redirected to a page where the button that you suggest is? Could be a text like “click to finish the vote”?

Makes sense?

Best regards


(Mark Harradine) #6

Sounds like it should work. Perhaps a slicker method would to have the Sitelok php integrated into the Formloom “submit” button. Not sure if this is feasible or not, @vibralogix or the Formloom developer (Yabdab?) may be able to give some guidance.

I don’t use Formloom myself.


(Pedro Perdomo M.) #7

Yes Mark, I’ve been thinking about some kind of integration, but it’s beyond my skills. Your suggestions have been very useful. I will continue to explore and I would appreciate let me know if you have any additional ideas.

Best regards


(Mark Harradine) #8

Have you thought about integrating the vote into the registration form for Sitelok?

You could then omit the vote question from the update profile form.

It all depends on the structure of your Sitelok implementation. It is one of those questions that has many possible answers, but with a little planning, you should be able to make a robust and “scam proof” implementation. The beauty of Sitelok is that it is so flexible. Groups make this flexibility possible.

Good luck! Would be interested to hear what you decide.

Mark


(Adrian Jones) #9

As Mark said It could be that using a Sitelok form maybe the easiest way to have the user also added to the usergroup. It sounds like the users are already registered in Sitelok so an update profile form could be used to get the vote, store it in a custom field and remove the user to or from a usergroup if needed. You mentioned that you want the user to vote only once and there are a few ways to do that I think (for example using the Creditds Plugin). However in your case If the user is removed from a usergroup when they vote you can secure the form page using that same usergroup. Once they submit the form they get removed from the usergroup so can’t then access the form again. Would that work?

Thanks Mark for your ideas and replies.


(Pedro Perdomo M.) #10

Many thanks to Mark and Adrian for taking your time and providing ideas.
I will continue to try and will surely ask again. If any other member would like to give their opinion I will be very grateful.

Best