[e3d4e0a] | 1 | <?php
|
---|
| 2 | session_start();
|
---|
| 3 |
|
---|
| 4 | require __DIR__ . "/vendor/autoload.php";
|
---|
| 5 |
|
---|
| 6 | $client = new Google\Client;
|
---|
| 7 |
|
---|
| 8 | $client->setClientId("");
|
---|
| 9 | $client->setClientSecret("");
|
---|
| 10 | $client->setRedirectUri('http://localhost:8000/redirect.php');
|
---|
| 11 |
|
---|
| 12 | $client->addScope("email");
|
---|
| 13 | $client->addScope("profile");
|
---|
| 14 |
|
---|
| 15 | $url = $client->createAuthUrl();
|
---|
| 16 | ?>
|
---|
| 17 |
|
---|
| 18 | <!DOCTYPE html>
|
---|
| 19 | <html lang="en">
|
---|
| 20 | <head>
|
---|
| 21 | <meta charset="UTF-8">
|
---|
| 22 | <meta name="viewport" content="width=device-width, initial-scale=1.0">
|
---|
| 23 | <title>Innova</title>
|
---|
| 24 | <link rel="stylesheet" href="CSS/TOS.css">
|
---|
| 25 | <link rel="stylesheet" href="CSS/Entry.css">
|
---|
| 26 | </head>
|
---|
| 27 | <body>
|
---|
| 28 | <h1>
|
---|
| 29 | Добредојдовте назад!
|
---|
| 30 | </h1>
|
---|
| 31 | <form action="./validateLogIn.php" method="POST">
|
---|
| 32 | <div class="inputfield">
|
---|
| 33 | <input type="text" name="email" id="EMAIL_ID" required>
|
---|
| 34 | <span class="labeline" id="emailLabel">Email address</span>
|
---|
| 35 | </div>
|
---|
| 36 | <div class="inputfield">
|
---|
| 37 | <input type="password" name="password" id="PASSWORD_ID" required>
|
---|
| 38 | <span class="labeline" id="passwordLabel">Password</span>
|
---|
| 39 | </div>
|
---|
| 40 |
|
---|
| 41 | <div>
|
---|
| 42 | <button id="continue" type="sumbit">Продолжете</button>
|
---|
| 43 | <p>Немате корисничка сметка? <a href="./Sign Up.php">Sign up</a></p>
|
---|
| 44 | </div>
|
---|
| 45 | <div class="oauth-container">
|
---|
| 46 | <a href="<?= $url ?>">Google Sign Up</a>
|
---|
| 47 | </div>
|
---|
| 48 | </form>
|
---|
| 49 |
|
---|
| 50 | <div class="TOSContainer">
|
---|
| 51 | <h5><a href="./Information/Contact.html">Контакт</a></h5>
|
---|
| 52 | <h5>|</h5>
|
---|
| 53 | <h5><a href="./Information/">За нас</a></h5>
|
---|
| 54 | <h5>|</h5>
|
---|
| 55 | <h5><a href="./Information/">Политика на приватност</a></h5>
|
---|
| 56 | </div>
|
---|
| 57 |
|
---|
| 58 | <?php
|
---|
| 59 |
|
---|
| 60 | if(!empty($_GET['error']))
|
---|
| 61 | {
|
---|
| 62 | switch($_GET['error'])
|
---|
| 63 | {
|
---|
| 64 | case 'INVALID_EMAIL':
|
---|
| 65 | echo '
|
---|
| 66 | <script>
|
---|
| 67 | document.getElementById("EMAIL_ID").style.border = "1px solid red";
|
---|
| 68 | document.getElementById("EMAIL_ID").placeholder = "That email doesn\'t exist!";
|
---|
| 69 | document.getElementById("emailLabel").style.display = "none";
|
---|
| 70 | </script>
|
---|
| 71 | ';
|
---|
| 72 | break;
|
---|
| 73 | case 'INVALID_PASSWORD':
|
---|
| 74 | echo '
|
---|
| 75 | <script>
|
---|
| 76 | document.getElementById("PASSWORD_ID").style.border = "1px solid red";
|
---|
| 77 | document.getElementById("PASSWORD_ID").placeholder = "Incorrect Password!";
|
---|
| 78 | document.getElementById("passwordLabel").style.display = "none";
|
---|
| 79 | </script>
|
---|
| 80 | ';
|
---|
| 81 | break;
|
---|
| 82 | default:
|
---|
| 83 | break;
|
---|
| 84 | }
|
---|
| 85 | }
|
---|
| 86 | ?>
|
---|
| 87 | </body>
|
---|
| 88 | </html> |
---|