}
 $url = $IDP_URL . "/userinfo?access_token=" . $access_token;
 curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
 curl_setopt($ch, CURLOPT_URL, $url);
 curl_setopt($ch, CURLOPT_HEADER, FALSE);
 curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
 // check if should use proxy
 //		if( $env_http_proxy != FALSE)
 //			curl_setopt ( $ch, CURLOPT_PROXY, "p-goodway");
 //			curl_setopt ( $ch, CURLOPT_PROXYPORT, 3128);
 $dataText = curl_exec($ch);
 // echo $dataText;
 curl_close($ch);
 // if response is json
 if (substr_startswith($dataText, '{')) {
     // parse user info json
     $userinfos = json_decode($dataText, true);
     $pdo = connect();
     $user = getUser($pdo, $userinfos['sub']);
     if ($user['sub'] != $userinfos['sub']) {
         addUser($pdo, $userinfos['sub'], $userinfos['email'], $userinfos['given_name'], $userinfos['family_name']);
         $user = getUser($pdo, $userinfos['sub']);
     }
     $_SESSION['USER'] = $user;
     if ($proxy_response) {
         header("Location: demo.php/endproxy?sub=" . $userinfos['sub']);
     } else {
         header("Location: index.php");
     }
 } else {
Exemplo n.º 2
0
 /**
  * Met a jour les frais hors forfait d'un visiteur a partir des ID des frais
  * @param $lesFrais tableau associatif de frais (id)(date,libelle,montant,etat)
  */
 public function majFraisHorsForfait($lesFrais, $leMois)
 {
     $lesCles = array_keys($lesFrais);
     foreach ($lesCles as $unIdFrais) {
         $date = dateFrancaisVersAnglais($lesFrais[$unIdFrais]['date']);
         $libelle = $lesFrais[$unIdFrais]['libelle'];
         $montant = $lesFrais[$unIdFrais]['montant'];
         $etat = $lesFrais[$unIdFrais]['etat'];
         if ($etat == 'RF' && !substr_startswith($libelle, 'REFUSE : ')) {
             $libelle = 'REFUSE : ' . $libelle;
         }
         $ajoutReportModif = '';
         if ($etat == 'RP') {
             $mois = moisSuivant($leMois);
             $ajoutReportModif = " lignefraishorsforfait.mois = '{$mois}', ";
             $etat = 'CL';
         }
         $req = "update lignefraishorsforfait set lignefraishorsforfait.date = '{$date}',{$ajoutReportModif} lignefraishorsforfait.libelle = '{$libelle}',\r\n                                lignefraishorsforfait.montant = {$montant}, lignefraishorsforfait.idEtat = '{$etat}'\r\n                         where lignefraishorsforfait.id = {$unIdFrais}";
         PdoGsb::$monPdo->exec($req);
     }
 }
<?php

echo "<div class='content_super_container'><div class='content_container well'>";
if ($row["content_key"] === $row["project_key"]) {
    echo "<h1 class='content_title'>{$row['content_title']}</h1>";
} elseif (!substr_startswith($row["content_title"], "RE: ")) {
    echo "<h3 class='content_title'>{$row['content_title']}</h3>";
} else {
    echo "<h3 class='content_title' style='display:none'>{$row['content_title']}</h3>";
}
echo "\n  <label class='label label-primary'>\n    <a href='{$path_web_root}/projects/?content_key={$row['project_key']}'>Project {$row['project_key']}</a>\n  </label>\n  <label class='label label-default'>created</label>\n  <label class='label label-info'>{$row['content_creation_time']}</label>\n  <label class='label label-primary'>\n    <a href='{$path_web_root}/Profiles/?user_key={$row['content_createdby_user_key']}'>{$row['content_createdby_username']}</a>\n  </label>\n";
if (!empty($row["content_edited_time"])) {
    echo "\n  <label class='label label-default'>edited</label>\n  <label class='label label-info'>{$row['content_edited_time']}</label>\n  <label class='label label-primary'>\n    <a href='{$path_web_root}/Profiles/?user_key={$row['content_editedby_user_key']}'>{$row['content_editedby_username']}</a>\n  </label>\n";
}
?>

<?php 
// if logged in, activate jqvoter, else link to login
if (!empty($_SESSION["user_key"])) {
    $onclick_upvote = "vote_content({$row['content_key']},1)";
    $onclick_downvote = "vote_content({$row['content_key']},-1)";
} else {
    $onclick_upvote = "{$login_page}";
    $onclick_downvote = "{$login_page}";
}
?>

<!-- jqvoter template -->
<div class='row' style='margin-top:10px'>
  <div class='col-xs-1'>
    <div class='upvote'>