Hi,
I am hoping someone can help me out here. I am looking at purchasing PM shortly, im just playing around with trial and the API too see that I can intergrate it with my site. Im not much of PHP'r but have done some scripting in the past, guess I just need a helping hand.
I am wondering how I can automate a login using AccountSessionKey. From what I gather you need to find your AccountSessionKey first then pass it in to the PM site. I am able to do this by executing the following 2 URL's
http://192.168.0.100:8087/api?command=a ... er=Player1
http://192.168.0.100:8087/?LoginName=Pl ... y=whatever above url returns
I have the API.php include script working correctly (as provided on this forum), I am able to use the "chip leaders" php with no issues.
So I guess my question is, what PHP code do I need to get the session key of the logged on user, then pass that to the 2nd url?
Thanks.
AccountSessionKey and Auto Logon
-
- Site Admin
- Posts: 5880
- Joined: Wed Mar 19, 2008 8:47 pm
Re: AccountSessionKey and Auto Logon
This link you did manually:pzero wrote: So I guess my question is, what PHP code do I need to get the session key of the logged on user, then pass that to the 2nd url?
http://192.168.0.100:8087/api?command=a ... er=Player1
Would look something like this via PHP (untested):
Code: Select all
include "API.php"; // API $url and $pw values set here
$player = "Player1";
$params = "Password=" . $pw . "&Command=AccountsSessionKey" . "&Player=" . $Player;
$api = Poker_API($url,$params,true);
$result = $api["Result"];
if ($result == "Error") die("Error: " . $api["Error"]);
$key = $api["SessionKey"];
// then build your login link:
echo "<a href='http://192.168.0.100:8087/?LoginName=" . $player . "SessionKey=" . $key . "'>Login Here</a>";
Re: AccountSessionKey and Auto Logon
Thanks Kent. Hoping to try this soon. Im having issues trying to get joomla to register a user and send the http post command to add that user to the poker mavs system at the same time.
Re: AccountSessionKey and Auto Logon
Got this working successfully on my site now. Getting it working with joomla was fun.......not. I had heaps of issues getting a site rego to sync up with poker mavens rego. then some more fun getting a session key out to pass back in. If anyone is using joomla and needs some help let me know. We can fudge ourway thru