0) { $row = $db->query("SELECT dump FROM eventlog WHERE rowid=$id")->fetch(); $dump = $row['dump']; if ($dump[0] == '<') { header("Content-type: text/xml"); echo "\n"; echo $dump; } else { header("Content-type: text/plain"); echo $dump; } exit; } if ($cmd == 'mo' && $id > 0) { $mo = $_GET["mo"]; if (!isset($mo)) exit; if ($mo != "devinfo" && $mo != "devdetail" && $mo != "pps") exit; $row = $db->query("SELECT $mo FROM users WHERE rowid=$id")->fetch(); header("Content-type: text/xml"); echo "\n"; echo $row[$mo]; exit; } if ($cmd == 'cert' && $id > 0) { $row = $db->query("SELECT cert_pem FROM users WHERE rowid=$id")->fetch(); header("Content-type: text/plain"); echo $row['cert_pem']; exit; } ?> HS 2.0 users 0) { $db->exec("UPDATE users SET remediation='' WHERE rowid=$id"); } if ($cmd == 'subrem-add-user' && $id > 0) { $db->exec("UPDATE users SET remediation='user' WHERE rowid=$id"); } if ($cmd == 'subrem-add-machine' && $id > 0) { $db->exec("UPDATE users SET remediation='machine' WHERE rowid=$id"); } if ($cmd == 'subrem-add-policy' && $id > 0) { $db->exec("UPDATE users SET remediation='policy' WHERE rowid=$id"); } if ($cmd == 'subrem-add-free' && $id > 0) { $db->exec("UPDATE users SET remediation='free' WHERE rowid=$id"); } if ($cmd == 'fetch-pps-on' && $id > 0) { $db->exec("UPDATE users SET fetch_pps=1 WHERE rowid=$id"); } if ($cmd == 'fetch-pps-off' && $id > 0) { $db->exec("UPDATE users SET fetch_pps=0 WHERE rowid=$id"); } if ($cmd == 'reset-pw' && $id > 0) { $db->exec("UPDATE users SET password='ChangeMe' WHERE rowid=$id"); } if ($cmd == "policy" && $id > 0 && isset($_GET["policy"])) { $policy = $_GET["policy"]; if ($policy == "no-policy" || is_readable("$osu_root/spp/policy/$policy.xml")) { $db->exec("UPDATE users SET policy='$policy' WHERE rowid=$id"); } } if ($cmd == "account-type" && $id > 0 && isset($_GET["type"])) { $type = $_GET["type"]; if ($type == "shared") $db->exec("UPDATE users SET shared=1 WHERE rowid=$id"); if ($type == "default") $db->exec("UPDATE users SET shared=0 WHERE rowid=$id"); } if ($cmd == "set-osu-cred" && $id > 0) { $osu_user = $_POST["osu_user"]; $osu_password = $_POST["osu_password"]; if (strlen($osu_user) == 0) $osu_password = ""; $db->exec("UPDATE users SET osu_user='$osu_user', osu_password='$osu_password' WHERE rowid=$id"); } if ($cmd == 'clear-t-c' && $id > 0) { $db->exec("UPDATE users SET t_c_timestamp=NULL WHERE rowid=$id"); } $dump = 0; if ($id > 0) { if (isset($_GET["dump"])) { $dump = $_GET["dump"]; if (!is_numeric($dump)) $dump = 0; } else $dump = 0; echo "[All users] "; if ($dump == 0) echo "[Include debug dump] "; else echo "[Without debug dump] "; echo "
\n"; $row = $db->query("SELECT rowid,* FROM users WHERE rowid=$id")->fetch(); echo "

" . $row['identity'] . "@" . $row['realm'] . "

\n"; echo "MO: "; if (strlen($row['devinfo']) > 0) { echo "[DevInfo]\n"; } if (strlen($row['devdetail']) > 0) { echo "[DevDetail]\n"; } if (strlen($row['pps']) > 0) { echo "[PPS]\n"; } if (strlen($row['cert_pem']) > 0) { echo "[Certificate]\n"; } echo "
\n"; echo "Fetch PPS MO: "; if ($row['fetch_pps'] == "1") { echo "On next connection " . "[" . "do not fetch]
\n"; } else { echo "Do not fetch " . "[" . "request fetch]
\n"; } $cert = $row['cert']; if (strlen($cert) > 0) { echo "Certificate fingerprint: $cert
\n"; } echo "Remediation: "; $rem = $row['remediation']; if ($rem == "") { echo "Not required"; echo " [add:user]"; echo " [add:machine]"; echo " [add:policy]"; echo " [add:free]"; } else if ($rem == "user") { echo "User [clear]"; } else if ($rem == "policy") { echo "Policy [clear]"; } else if ($rem == "free") { echo "Free [clear]"; } else { echo "Machine [clear]"; } echo "
\n"; echo "
Policy:
\n"; echo "
Account type:
\n"; echo "Phase 2 method(s): " . $row['methods'] . "
\n"; echo "
\n"; echo "Reset AAA password
\n"; echo "
\n"; echo "
\n"; echo "OSU credentials (if username empty, AAA credentials are used):
\n"; echo "username: \n"; echo "password: \n"; echo "\n"; echo "
\n"; if (strlen($row['t_c_timestamp']) > 0) { echo "
\n"; echo "Clear Terms and Conditions acceptance
\n"; } echo "
\n"; $user = $row['identity']; $osu_user = $row['osu_user']; $realm = $row['realm']; } if ($id > 0 || ($id == 0 && $cmd == 'eventlog')) { if ($id == 0) { echo "[All users] "; echo "
\n"; } echo "\n"; echo ""; if ($id == 0) { echo ""; if ($id == 0) { echo "
userrealm"; } echo "timeaddresssessionIDnotes"; if ($dump > 0) echo "dump"; echo "\n"; if (isset($_GET["limit"])) { $limit = $_GET["limit"]; if (!is_numeric($limit)) $limit = 20; } else $limit = 20; if ($id == 0) $res = $db->query("SELECT rowid,* FROM eventlog ORDER BY timestamp DESC LIMIT $limit"); else if (strlen($osu_user) > 0) $res = $db->query("SELECT rowid,* FROM eventlog WHERE (user='$user' OR user='$osu_user') AND realm='$realm' ORDER BY timestamp DESC LIMIT $limit"); else $res = $db->query("SELECT rowid,* FROM eventlog WHERE user='$user' AND realm='$realm' ORDER BY timestamp DESC LIMIT $limit"); foreach ($res as $row) { echo "
" . $row['user'] . "\n"; echo "" . $row['realm'] . "\n"; } echo "" . $row['timestamp'] . "\n"; echo "" . $row['addr'] . "\n"; echo "" . $row['sessionid'] . "\n"; echo "" . $row['notes'] . "\n"; $d = $row['dump']; if (strlen($d) > 0) { echo "["; if ($d[0] == '<') echo "XML"; else echo "txt"; echo "]\n"; if ($dump > 0) echo "" . htmlspecialchars($d) . "\n"; } } echo "
\n"; } if ($id == 0 && $cmd != 'eventlog') { echo "[Eventlog] "; echo "
\n"; echo "\n"; echo "
UserRealmRemediationPolicyAccount typePhase 2 method(s)DevIdT&C\n"; $res = $db->query('SELECT rowid,* FROM users WHERE phase2=1'); foreach ($res as $row) { echo "
" . $row['identity'] . " "; echo "" . $row['realm']; $rem = $row['remediation']; echo ""; if ($rem == "") { echo "Not required"; } else if ($rem == "user") { echo "User"; } else if ($rem == "policy") { echo "Policy"; } else if ($rem == "free") { echo "Free"; } else { echo "Machine"; } echo "" . $row['policy']; if ($row['shared'] > 0) echo "shared"; else echo "default"; echo "" . $row['methods']; echo ""; $xml = xml_parser_create(); xml_parse_into_struct($xml, $row['devinfo'], $devinfo); foreach($devinfo as $k) { if ($k['tag'] == 'DEVID') { echo $k['value']; break; } } echo "" . $row['t_c_timestamp']; echo "\n"; } echo "
\n"; } ?>