peter@tch #$locationStr = '@demo'; // must be the same as in poinths DB phs_client_address location_str include('hotpoint-inc.php'); # Uncomment the following line if you want to use ordinary user-password # for radius authentication. Must be used together with $uamsecret. #$userpassword=1; $loginpath = "hotpoint.acl"; # possible Cases: # attempt to login login=login # 1: Login successful res=success # 2: Login failed res=failed # 3: Logged out res=logoff # 4: Tried to login while already logged in res=already # 5: Not logged in yet res=notyet #11: Popup res=popup1 #12: Popup res=popup2 #13: Popup res=popup3 # 0: It was not a form request res="" #Read query parameters which we care about # $_GET['res']; # $_GET['challenge']; # $_GET['uamip']; # $_GET['uamport']; # $_GET['reply']; # $_GET['userurl']; # $_GET['timeleft']; # $_GET['redirurl']; #Read form parameters which we care about # $_GET['username']; # $_GET['password']; # $_GET['chal']; # $_GET['login']; # $_GET['logout']; # $_GET['prelogin']; # $_GET['res']; # $_GET['uamip']; # $_GET['uamport']; # $_GET['userurl']; # $_GET['timeleft']; # $_GET['redirurl']; $title = ''; $headline = ''; $bodytext = ''; $body_onload = ''; //$footer_text = '

//$footer_text = '
31-May-2008 - Systen down for maintenance. Be right back!


$footer_text = '

'; // # attempt to login if ($_GET['login'] == login) { $hexchal = pack ("H32", $_GET['chal']); if (isset ($uamsecret)) { $newchal = pack ("H*", md5($hexchal . $uamsecret)); } else { $newchal = $hexchal; } $response = md5("\0" . $_GET['Password'] . $newchal); $newpwd = pack("a32", $_GET['Password']); $pappassword = implode ("", unpack("H32", ($newpwd ^ $newchal))); $title = 'Logging in to pointHotspot.com'; $headline = 'Logging in to pointHotspot.com'; $bodytext = ''; print_header(); if ((isset ($uamsecret)) && isset($userpassword)) { print ''; } else { print ''; } print_body(); print_footer(); } # 1: Login successful if ($_GET['res'] == success) { $result = 1; $title = 'Logged in to pointHotspot.com'; $headline = 'Logged in to pointHotspot.com'; $bodytext = 'Welcome to pointHotspot'; $body_onload = 'onLoad="javascript:popUp(' . $loginpath . '?res=popup&uamip=' . $_GET['uamip'] . '&uamport=' . $_GET['uamport'] . '&timeleft=' . $_GET['timeleft'] . ')"'; print_header(); print_body(); if ($reply) { print '
' . $reply . '

'; } print '
Logout
'; print_footer(); } # 2: Login failed if ($_GET['res'] == failed) { $result = 2; $title = 'pointHotspot.com Login Failed'; $headline = 'pointHotspot.com Login Failed'; $bodytext = 'Sorry, try again
'; print_header(); print_body(); if ($_GET['reply']) { print '
' . $_GET['reply'] . '
'; } print_login_form(); print_footer(); } # 3: Logged out if ($_GET['res'] == logoff) { $result = 3; $title = 'Logged out from pointHotspot.com'; $headline = 'Logged out from pointHotspot.com'; $bodytext = 'Login'; print_header(); print_body(); print_footer(); } # 4: Tried to login while already logged in if ($_GET['res'] == already) { $result = 4; $title = 'Already logged in to pointHotspot.com'; $headline = 'Already logged in to pointHotspot.com'; $bodytext = 'Logout'; print_header(); print_body(); print_footer(); } # 5: Not logged in yet if ($_GET['res'] == notyet) { // main login screem $result = 5; $title = 'Logged out from pointHotspot.com'; $headline = 'Welcome to pointHotspot'; $bodytext = 'Internet Access Verification
Please use your username and password you received from us.
'; print_header(); print_body(); print_login_form(); print_footer(); } #11: Popup1 if ($_GET['res'] == popup1) { $result = 11; $title = 'Logging into pointHotspot.com'; $headline = 'Logged in to pointHotspot.com'; $bodytext = 'please wait...'; print_header(); print_body(); print_footer(); } #12: Popup2 if ($_GET['res'] == popup2) { $result = 12; $title = 'Logged in to pointHotspot.com'; $headline = 'Logged in to pointHotspot.com'; //$bodytext = 'Logout'. '

Please reduce this page to the task bar.


It will display your remaining time.
You should use this page to log out when you are finished.
This will stop the timer and save your remaining credit for future use.
Thank you for choosing pointHotspot.com.
Feedback'; $bodytext = 'Logout'. '

This page will show your remaining online time.

Your Internet Connection will shutdown after expiry!

Thank you for choosing pointHotspot.com.
Feedback'; print_header(); print_body(); print_footer(); } #13: Popup3 if ($_GET['res'] == popup3) { $result = 13; $title = 'Logged out from pointHotspot.com 3'; //$headline = 'Welcome to pointHotspot.com'; $headline = 'Welcome to pointHotspot'; $bodytext = '

Internet Access Expired

Login'; print_header(); print_body(); print_footer(); } # 0: It was not a form request # Send out an error message if ($_GET['res'] == "") { $result = 0; $title = 'Invalid access'; $headline = 'Access Denied'; //$bodytext = 'Login must be performed through pointHotspot.com daemon!'; print_header(); print_body(); print_footer(); } # functions function print_header(){ global $title, $loginpath; $uamip = $_GET['uamip']; $uamport = $_GET['uamport']; print " $title "; } function print_body(){ global $headline, $bodytext, $body_onload, $result, $loginpath; $uamip = $_GET['uamip']; $uamport = $_GET['uamport']; $userurl = $_GET['userurl']; $redirurl = $_GET['redirurl']; $userurldecode = $_GET['userurl']; $redirurldecode = $_GET['redirurl']; $timeleft = $_GET['timeleft']; print "

$headline

$bodytext

"; # begin debugging # print '
THE INPUT (for debugging):
'; #print('
Time left: '.$timeleft); # foreach ($_GET as $key => $value) { # print $key . '=' . $value . '
'; # } # print '
'; # end debugging } function print_login_form(){ global $loginpath; print '
Login:
Password:
'; } function print_footer(){ global $footer_text; print $footer_text . ''; exit(0); } exit(0); ?>