aboutsummaryrefslogtreecommitdiff
path: root/admin/login/index.php
blob: 9a12ac590970bf591f9c03e33087363ee5d64888 (plain)
1
2
3
4
5
6
7
8
9
10
11
<?php

function isSecure() {
    return
        (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off')
        || $_SERVER['SERVER_PORT'] == 443;
}


header("Location: https://github.com/login/oauth/authorize?client_id=" . json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/github.json"), true)["id"] . "&redirect_uri=http" . (isSecure() ? "s"  : "") . "://$_SERVER[HTTP_HOST]/admin/callback/&allow_signups=false&scope=read:user");
die();