prep for 2023. Fixed many bugs. Added pdf guide

This commit is contained in:
2023-03-29 22:47:51 +02:00
parent 7f97a60334
commit e6025e3be1
589 changed files with 172718 additions and 212 deletions

View File

@@ -1,78 +1,16 @@
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL & ~E_NOTICE );
// start session
$cfg = include('accred_config.php');
if (session_status() == PHP_SESSION_NONE) {
session_start();
$userid = $_SESSION['uid'];
}
// If we are logged-in, redirect to the list page.
if($userid) {
header("location: accred_list");
die();
}
?>
<!doctype html>
<html>
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL & ~E_NOTICE );
$cfg = include('accred_config.php');
//
// Load the auth module, this will redirect us to login if we aren't already logged in.
include '../inc/auth.php';
$Auth = new modAuth();
<head>
<meta charset="utf-8">
<meta name="google-signin-client_id" content="538635499162-g21v86gk87qm863u03er6vnm3q15bl82.apps.googleusercontent.com">
<script src="https://apis.google.com/js/platform.js" async defer></script>
<title>Carbana Accréditations</title>
<link rel="stylesheet" type="text/css" href="accred_style.css">
</head>
<body>
<div id="signin">
<span id="logo">
<img class="loginlogo" src="Caribana_2019_logo_hor.png"/></span>
<h2>Identification</h2><br>
<h2> Saisis ton nom d'utilisateur et mot de passe gmail pour t'identifier et accéder aux demandes d'accréditation en utilisant le bouton ci-dessous.</h2>
<h3>Le mot de passe n'est pas transmis &agrave; Caribana.</h3>
<br>
<br>
<br>
<div class="g-signin2" data-onsuccess="onSignIn"></div>
<br>
<br>
</div>
<script>
function onSignIn(googleUser) {
var profile = googleUser.getBasicProfile();
var id_token = googleUser.getAuthResponse().id_token;
console.log('ID: ' + profile.getId()); // Do not send to your backend! Use an ID token instead.
console.log('Name: ' + profile.getName());
console.log('Image URL: ' + profile.getImageUrl());
console.log('Email: ' + profile.getEmail()); // This is null if the 'email' scope is not present.
console.log('Token: ' + id_token);
console.log("Preparing to call tokensignin");
var xhr = new XMLHttpRequest();
xhr.open('POST', 'https://accred.caribana-festival.ch/tokensignin');
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xhr.onload = function() {
console.log('Signed in as: ' + xhr.responseText);
self.location = 'accred_list';
};
xhr.onerror = function() {
console.log("ERROR");
alert("Error");
};
console.log(xhr);
xhr.send('idtoken=' + id_token);
}
</script>
</body>
</html>
// We get here if authenticated
// If we are logged-in, redirect to the list page.
header("location: accred_list");
die();
//