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