From a288c2733ae05f04af707133671e79f32efd9eb2 Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 23 Jan 2009 01:23:41 +0000 Subject: add the start at PHP self-service as a quick early renew example --- fs_selfservice/php/process_login.php | 38 ++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 fs_selfservice/php/process_login.php (limited to 'fs_selfservice/php/process_login.php') diff --git a/fs_selfservice/php/process_login.php b/fs_selfservice/php/process_login.php new file mode 100644 index 000000000..1f4fd9a6b --- /dev/null +++ b/fs_selfservice/php/process_login.php @@ -0,0 +1,38 @@ +login( array( + 'username' => strtolower($_POST['username']), + 'domain' => strtolower($_POST['domain']), + 'password' => strtolower($_POST['password']), +) ); + +#error_log("[login] received response from freeside: $response"); + +$error = $response['error']; + +if ( $error ) { + + header('Location:login.php?username='. urlencode($username). + '&domain='. urlencode($domain). + '&error='. urlencode($error) + ); + die(); + +} + +// sucessful login + +$session_id = $response['session_id']; + +#error_log("[login] logged into freeside with session_id=$session_id"); + +// now what? for now, always redirect to the main page. +// eventually, other options? + +header("Location:main.php?session_id=$session_id") +#die(); + +?> -- cgit v1.2.1