3 require('freeside.class.php');
4 $freeside = new FreesideSelfService();
6 $response = $freeside->login( array(
7 'email' => strtolower($_POST['email']),
8 'username' => strtolower($_POST['username']),
9 'domain' => strtolower($_POST['domain']),
10 'password' => $_POST['password'],
13 #error_log("[login] received response from freeside: $response");
15 $error = $response['error'];
19 header('Location:index.php?username='. urlencode($username).
20 '&domain='. urlencode($domain).
21 '&email='. urlencode($email).
22 '&error='. urlencode($error)
30 $session_id = $response['session_id'];
32 error_log("[login] logged into freeside with session_id=$session_id, setting cookie");
34 // now what? for now, always redirect to the main page.
35 // eventually, other options?
37 setcookie('session_id', $session_id);
39 header("Location:main.php")