24 lines
758 B
PHP
24 lines
758 B
PHP
<?php
|
|
session_start();
|
|
|
|
if (!isset($_SESSION['role']) || $_SESSION['role'] !== 'praticien') {
|
|
die("Accès refusé.");
|
|
}
|
|
|
|
$praticien_id = $_SESSION['reference_id'];
|
|
$state = base64_encode(json_encode(['praticien_id' => $praticien_id]));
|
|
|
|
$client_id = '2936c00e-7452-453a-af62-944cc3ad021e';
|
|
$tenant_id = '4b1704a1-7a2a-4618-a6ac-3ffe46e6b3b4';
|
|
$redirect_uri = urlencode('https://uslugi.fr/outlook_callback.php');
|
|
$resource = urlencode('https://graph.microsoft.com');
|
|
|
|
$url = "https://login.microsoftonline.com/consumers/oauth2/v2.0/authorize?" .
|
|
"client_id=$client_id&response_type=code&redirect_uri=$redirect_uri" .
|
|
"&scope=offline_access%20User.Read%20Calendars.ReadWrite&state=$state&prompt=consent";
|
|
|
|
|
|
header("Location: $url");
|
|
exit;
|
|
?>
|