function toggle_auth_checked_in_redirect() { $url = phpCAS::getServiceURL(); $without_auth_checked = removeParameterFromUrl('auth_checked', $url); if ($url == $without_auth_checked) { $url .= (strpos($url, '?') === false ? '?' : '&') . 'auth_checked=true'; } else { $url = $without_auth_checked; debug_msg("removing auth_checked from url to have a clean final url: {$url}"); } phpCAS::setFixedServiceURL($url); }
$res = $mysqli->query("SELECT * FROM users WHERE onid='{$onid}'"); $userrow = $res->fetch_array(MYSQLI_ASSOC); //keep an array of elements in the user's table for easy access if (isset($_REQUEST['payment_method']) && $_REQUEST['payment_method'] != 0) { $payment_method = mysqli_real_escape_string($mysqli, check_input($_REQUEST['payment_method'])); } else { echo '<h2>You need to select a payment method</h2>'; exit; } if ($payment_method == 3) { phpCAS::client(SAML_VERSION_1_1, 'login.oregonstate.edu', 443, 'cas'); phpCAS::setNoCasServerValidation(); phpCAS::forceAuthentication(); //$t = phpCAS::getAttributes(); //print_r($t); $service = $url = strtok(phpCAS::getServiceURL(), '?'); if (strtolower(phpCAS::getUser()) != NULL) { //Logged in echo 'User: '******'User needs to login'; } } else { if ($payment_method == 1) { echo "<div class='row'><div class='col-sm-8 col-sm-offset-2'><strong>When paying by credit card...</strong></div></div>\n\t<div class='row' style='padding-top:1%;'><div class='col-sm-4 col-sm-offset-2'><b>Your Email:</b> (Must be valid to confirm order)</div>\n<div class='col-sm-4'><input class='fi form-control' type='email' pattern='[a-z0-9._%+-]+@[a-z0-9.-]+\\.[a-z]{2,4}\$' name='email'></div></div>\n<div class='row' style='padding-top:1%;'><div class='col-sm-4 col-sm-offset-2'><b>First Name:</b></div>\n<div class='col-sm-4'><input class='fi form-control' type=text size=55 name='firstname'></div></div>\n<div class='row' style='padding-top:1%;'><div class='col-sm-4 col-sm-offset-2'><b>Last Name:</b></div>\n<div class='col-sm-4'><input class='fi form-control' type=text size=55 name='lastname'></div></div>"; } else { if ($payment_method == 2) { echo "<div class='row' style='padding-top:1%;'><div class='col-sm-4 col-sm-offset-2'><b>Your Email:</b> (Must be valid to confirm order)</div>\n<div class='col-sm-4'><input class='fi form-control' type='email' pattern='[a-z0-9._%+-]+@[a-z0-9.-]+\\.[a-z]{2,4}\$' name='email'></div></div>\n<div class='row' style='padding-top:1%;'><div class='col-sm-4 col-sm-offset-2'><b>First Name: </b></div>\n<div class='col-sm-4'><input class='fi form-control' type=text size=55 name='firstname'></div></div>\n<div class='row' style='padding-top:1%;'><div class='col-sm-4 col-sm-offset-2'><b>Last Name: </b></div>\n<div class='col-sm-4'><input class='fi form-control' type=text size=55 name='lastname'></div></div>\n<div class='row' style='padding-top:1%;'><div class='col-sm-4 col-sm-offset-2'><b>OSU Grant Account Code: </b></div>\n<div class='col-sm-4'><input class='fi form-control' type=text size=55 name='account'></div></div>"; } } }