autmated login

For discussion of the Poker Mavens server module and other administration topics
antmar904
Posts: 30
Joined: Sun Oct 07, 2012 7:24 pm

Re: autmated login

Post by antmar904 »

i also notice that in account property for the new user i don't see there validation code? its blank.

Image
Kent Briggs
Site Admin
Posts: 5878
Joined: Wed Mar 19, 2008 8:47 pm

Re: autmated login

Post by Kent Briggs »

antmar904 wrote:thank you, so i got it to the point that when the user fills out the register form it then creates the validation code and emails a 8 char code to them.
how would i then verify if that is the right verification code for that particular user also deny log in until there email has been validated?
If they login via the built-in interface, that will be handled automatically. If you're going to put a form on your web site that logs them in then fetch their name and call AccountsGet to fetch their ValCode:

Code: Select all

$params = "Password=$pw&Command=AccountsGet" . "&Player=" .   urlencode($Player);
$api = Poker_API($url,$params,true);
$ValCode = $api["ValCode"];
If $ValCode is blank then they've already been verified. Otherwise prompt them for it and compare it against the one you just retrieved.
Kent Briggs
Site Admin
Posts: 5878
Joined: Wed Mar 19, 2008 8:47 pm

Re: autmated login

Post by Kent Briggs »

antmar904 wrote:i also notice that in account property for the new user i don't see there validation code? its blank.
Then it didn't get set with your AccountsEdit call. Put an error check to see what it says. Something like this:

Code: Select all

$api = Poker_API($url,$params,true);
if ($api["Result"] == "Ok") echo "ValCode successfully saved for " . $Player;
else echo "Error saving ValCode: " . $api["Error"] ;
antmar904
Posts: 30
Joined: Sun Oct 07, 2012 7:24 pm

Re: autmated login

Post by antmar904 »

can you help me out with the accountsedit for valcode
Kent Briggs
Site Admin
Posts: 5878
Joined: Wed Mar 19, 2008 8:47 pm

Re: autmated login

Post by Kent Briggs »

antmar904 wrote:can you help me out with the accountsedit for valcode
I showed that a couple messages back in this thread.
antmar904
Posts: 30
Joined: Sun Oct 07, 2012 7:24 pm

Re: autmated login

Post by antmar904 »

Kent Briggs wrote:
antmar904 wrote:also is there a way to integrate the email validation into the create new account api?
Use the AccountsEdit API command to set a random ValCode for the player. Then use the mail() command in PHP to send that to them.
wouldn't i be using the AccountsAdd api if i am setting the valcode for the new user on the new account form?

i cant seem to get the val code set for the new user.
Kent Briggs
Site Admin
Posts: 5878
Joined: Wed Mar 19, 2008 8:47 pm

Re: autmated login

Post by Kent Briggs »

antmar904 wrote:wouldn't i be using the AccountsAdd api if i am setting the valcode for the new user on the new account form?
i cant seem to get the val code set for the new user.
The Add function doesn't look for a ValCode parameter since that's meant as an internal feature. I may add that in a future update but in the mean time you'll have to set it with AccountsEdit. Are you checking for an error when using AccountsEdit?

Actually you don't need to set it at all inside Poker Mavens if you are going to handle the verification from your own web site. Just create a local file or database and save it locally with the player's name. Then look it up from there when you attempt to log in.
Post Reply