auth action added

We can now call an auth action along with the token and it will set our
flag
As a follow up, it continues what we were previously doing - showing
manager pane or toggling file display
Note: 2 x JS files can probably be removed for now. Was going to look
into auth token validation here, but until I do, they're not needed.
This commit is contained in:
Matt Pass
2014-07-27 12:49:39 +01:00
parent cc152db8ba
commit c988f76612

View File

@@ -13,6 +13,30 @@ if (!extension_loaded('openssl') || !in_array('https', $wrappers)) {
// If we have an action to perform
if (!$demoMode && isset($_SESSION['loggedIn']) && $_SESSION['loggedIn'] && isset($_GET['action']) && $sslAvail) {
// ====
// AUTH
// ====
if ($_GET['action']=="auth") {
$_SESSION['githubAuthToken'] = xssClean($_GET['token']);
echo '<!DOCTYPE html>
<html>
<head>
<script src="base64.js"></script>
<script src="github.js"></script>
</body>
<script>
top.ICEcoder.githubAuthTokenSet = true;
goNext = "'.xssClean($_GET['goNext']).'";
if (goNext=="showManager") {
top.ICEcoder.githubManager();
}
if (goNext=="loadFiles") {
top.ICEcoder.githubDiffToggle();
}
</script>
</body>
</html>';
}
// =====
// CLONE