require('freeside.class.php');
$freeside = new FreesideSelfService();
+$ip = $_SERVER['REMOTE_ADDR'];
+
+if ($_POST['domain'] == "ip_mac") {
+ $mac_addr = $freeside->get_mac_address( array('ip' => $ip, ) );
+ $_POST['username'] = $mac_addr['mac_address'];
+}
+
$response = $freeside->login( array(
+ 'email' => strtolower($_POST['email']),
'username' => strtolower($_POST['username']),
'domain' => strtolower($_POST['domain']),
'password' => $_POST['password'],
if ( $error ) {
- header('Location:index.php?username='. urlencode($username).
- '&domain='. urlencode($domain).
- '&error='. urlencode($error)
+ header('Location:index.php?username='. urlencode($_POST['username']).
+ '&domain='. urlencode($_POST['domain']).
+ '&email='. urlencode($_POST['email']).
+ '&error='. urlencode($error)
);
die();
setcookie('session_id', $session_id);
-header("Location:main.php")
+header("Location:main.php");
#die();
-?>
+?>
\ No newline at end of file