Freeside:1.9:Documentation:Developer/FS/SelfService/php/php examples
From Freeside
< Freeside:1.9:Documentation:Developer | FS | SelfService
Revision as of 18:29, 6 April 2010 by Huntsberg (talk | contribs) (Freeside:1.9:Documentation:Developer/FS/SelfService/php/freeside.login example.php moved to Freeside:1.9:Documentation:Developer/FS/SelfService/php/php examples)
<? require('freeside.class.php'); $freeside = new FreesideSelfService(); $domain = 'example.com'; $response = $freeside->login( array( 'username' => strtolower($_POST['username']), 'domain' => $domain, 'password' => strtolower($_POST['password']), ) ); error_log("[login] received response from freeside: $response"); $error = $response['error']; if ( ! $error ) { // sucessful login $session_id = $response['session_id']; error_log("[login] logged into freeside with session_id=$session_id"); // store session id in your session store, to be used for other calls } else { // unsucessful login error_log("[login] error logging into freeside: $error"); // display error message to user } ?>