Skip to content
Snippets Groups Projects
Commit 91b272cb authored by Nicolas Borboën's avatar Nicolas Borboën
Browse files

[refactor] tequila instantiation

parent 274d288b
No related branches found
No related tags found
No related merge requests found
<?php <?php
require('configs/db.php'); require('configs/db.php');
require_once("tequila/tequila.php"); require_once("tequila/tequila.php");
$oClient = new TequilaClient(); require_once('tequila/tequila_instance.inc'); // $oClient->SetWishedAttributes(array('user'));
$oClient->SetApplicationName('Formulaire apprentissage');
$oClient->SetWantedAttributes(array('uniqueid','firstname','name', 'email'));
// $oClient->SetWishedAttributes(array('user'));
$oClient->SetAllowsFilter('categorie=epfl-guests');
$oClient->Authenticate();
$user = $oClient->getValue('email');
$firstname = $oClient->getValue('firstname');
$name = $oClient->getValue('name');
$guest_sciper = $oClient->getValue('uniqueid');
$sKey = $oClient->GetKey();
?> ?>
<!doctype html> <!doctype html>
<html lang="fr"> <html lang="fr">
......
...@@ -2,17 +2,7 @@ ...@@ -2,17 +2,7 @@
require('configs/db.php'); require('configs/db.php');
include('./helpers.php'); include('./helpers.php');
require_once("tequila/tequila.php"); require_once("tequila/tequila.php");
$oClient = new TequilaClient(); require_once('tequila/tequila_instance.inc');
$oClient->SetApplicationName('Formulaire apprentissage');
$oClient->SetWantedAttributes(array('uniqueid','firstname','name'));
$oClient->SetWishedAttributes(array('user'));
$oClient->SetAllowsFilter('categorie=epfl-guests');
$oClient->Authenticate();
$user = $oClient->getValue('user');
$firstname = $oClient->getValue('firstname');
$name = $oClient->getValue('name');
$guest_sciper = $oClient->getValue('uniqueid');
$sKey = $oClient->GetKey();
if (isset($_GET['id'])) { if (isset($_GET['id'])) {
// check if sciper is linked to file // check if sciper is linked to file
......
<?php
/**
* Instanciation de Tequila
**/
$oClient = new TequilaClient();
$oClient->SetApplicationName('Formulaire apprentissage');
$oClient->SetWantedAttributes(array('uniqueid','firstname','name', 'email'));
$oClient->SetWishedAttributes(array('user'));
$oClient->SetAllowsFilter('categorie=epfl-guests');
$oClient->Authenticate();
$user = $oClient->getValue('email');
$firstname = $oClient->getValue('firstname');
$name = $oClient->getValue('name');
$guest_sciper = $oClient->getValue('uniqueid');
$sKey = $oClient->GetKey();
...@@ -5,17 +5,7 @@ ...@@ -5,17 +5,7 @@
<title>Postulation Apprentis | Consultation</title> <title>Postulation Apprentis | Consultation</title>
<?php <?php
require_once("tequila/tequila.php"); require_once("tequila/tequila.php");
$oClient = new TequilaClient(); require_once('tequila/tequila_instance.inc');
$oClient->SetApplicationName('Formulaire apprentissage');
$oClient->SetWantedAttributes(array('uniqueid','firstname','name'));
$oClient->SetWishedAttributes(array('user'));
$oClient->SetAllowsFilter('categorie=epfl-guests');
$oClient->Authenticate();
$user = $oClient->getValue('user');
$firstname = $oClient->getValue('firstname');
$name = $oClient->getValue('name');
$guest_sciper = $oClient->getValue('uniqueid');
$sKey = $oClient->GetKey();
include('templates/head.php'); include('templates/head.php');
include('./helpers.php'); include('./helpers.php');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment