function demoapp()
{
    $sharedkey = 'abrakadabra';
    $corto = join("/", array_slice(explode("/", 'http' . (nvl($_SERVER, 'HTTPS') ? 's' : '') . '://' . $_SERVER['HTTP_HOST'] . $_SERVER['SCRIPT_NAME']), 0, -1));
    $self = $corto . '/index.php';
    $corto = $corto . '/corto.php';
    if (isset($_POST['doslo'])) {
        $request = array('__t' => 'samlp:LogoutRequest', '_ID' => ID(), '_Version' => '2.0', '_IssueInstant' => gmdate('Y-m-d\\TH:i:s\\Z', time()), '_Destination' => "{$corto}/sp/Mads/SLO", 'saml:Issuer' => array('__v' => $self), 'saml:NameID' => json_decode(stripcslashes($_POST['subject']), 1), '_NotOnOrAfter' => timeStamp(10));
        $location = $request['_Destination'];
        $location .= "?SAMLRequest=" . urlencode(base64_encode(gzdeflate(json_encode($request))));
        print render('redirect', array('location' => $location, 'message' => $request));
        exit;
    }
    if (isset($_POST['doit'])) {
        $idp = empty($_POST['idp']) ? NULL : $_POST['idp'];
        if (!$idp) {
            $idp = "sp";
        }
        $request = array('_ID' => ID(), '_Version' => '2.0', '_IssueInstant' => gmdate('Y-m-d\\TH:i:s\\Z', time()), '_Destination' => "{$corto}/{$idp}/Mads", '_ForceAuthn' => !empty($_REQUEST['ForceAuthn']) ? 'true' : 'false', '_IsPassive' => !empty($_REQUEST['IsPassive']) ? 'true' : 'false', 'AssertionConsumerServiceIndex' => 0, '_AttributeConsumingServiceIndex' => 5, '_ProtocolBinding' => 'JSON-Redirect', 'saml:Issuer' => array('__v' => $self));
        if (!empty($_REQUEST['IDPList'])) {
            foreach ((array) $_REQUEST['IDPList'] as $idp) {
                $idpList[] = array('_ProviderID' => $idp);
                $request['samlp:Scoping']['samlp:IDPList']['samlp:IDPEntry'] = $idpList;
            }
        }
        $relayState = 'Dummy RelayState ...';
        #$request['samlp:Scoping']['_ProxyCount'] = 2;
        $location = $request['_Destination'];
        $location .= "?SAMLRequest=" . urlencode(base64_encode(gzdeflate(json_encode($request)))) . ($relayState ? '&RelayState=' . urlencode($relayState) : '');
        print render('redirect', array('location' => $location, 'message' => $request));
        exit;
    }
    $relayState = $rs = $message = null;
    $response = nvl($_GET, 'SAMLResponse');
    $SAMLResponse = json_decode(gzinflate(base64_decode($response)), 1);
    if (isset($_POST['RelayState']) && ($rs = $_POST['RelayState'])) {
        $rs = '&RelayState=' . $rs;
    }
    print render('demo', array('action' => $self, 'SAMLResponse' => $SAMLResponse, 'message' => "RelayState: " . nvl($_GET, 'RelayState'), 'self' => $self));
}
 public function getNewId()
 {
     return ID();
 }
Exemple #3
0
					    <li data-target="#myCarouselMini" data-slide-to="4"></li>
					  </ol>
					
					  <!-- Wrapper for slides -->
					  <div class="carousel-inner" role="listbox" style="height: 370px;width:295px;">
					  <?php 
for ($i = 0; $i < 5; $i++) {
    $class = "";
    $imgs_tend = images($oeuvretend, $i);
    $p = pubData($oeuvretend, $i);
    $title = body_title($oeuvretend, $i);
    if ($i == 0) {
        $class = "active";
    }
    echo '<div class="item ' . $class . '">';
    echo '<a href="oeuvre.php?artiste=' . $p[0] . '&oeuvre=' . ID($oeuvretend, $i) . '&type=' . Type($oeuvretend, $i) . '"><div class="oeuvre_detail"><strong>&ldquo;' . $p[0] . '&rdquo;</strong><br>' . $title . '</div><br/><img src="' . $imgs_tend[count($imgs_tend) - 1] . '" width="295"/></a>';
    echo '</div>';
}
?>
					  </div>
					
					</div>
                    

                   


                    <div class="sub_seagreen"><a href="contact.php?q=oeuvre"><span style="color:#fff;">Ajouter une Oeuvre</span></a></div><br>
                    

Exemple #4
0
               <?php 
$result = requete('{"query":{"bool":{"must":[{"query_string":{"default_field":"oeuvre.parentUrl","query":"tendance"}}],"must_not":[],"should":[{"query_string":{"default_field":"_all","query":"tendance"}}]}},"from":0,"size":10,"sort":[],"facets":{}}');
for ($i = 0; $i < 8; $i++) {
    $imgs = images($result, $i);
    $p = pubData($result, $i);
    if (preg_match('`Inconnu`i', $p[0])) {
        $a = body_title($result, $i);
    } else {
        $a = $p[0];
    }
    //echo $a;
    echo '<div class="oeuvres">';
    echo '<img src=' . $imgs[count($imgs) - 1] . '>';
    echo '<div class="oeuvres_detail">';
    echo '<div id="oeuvres_detail_title" class="oeuvres_titre"><span>' . $a . '</span><br></div>';
    echo '<div id="oeuvres_detail_img" class="oeuvres_servol"><span><a href="oeuvre.php?artiste=' . $p[0] . '&;oeuvre=' . ID($result, $i) . '"><img src="images/survol2.png"></a></span></div>';
    echo '</div>';
    echo '</div>';
}
?>
              
               </div>
               <div class="animation_image" style="display:none; position: relative; top: 30px; left: 160px;" align="center"><img src="ajax-loader.gif"></div>
                <br>
                <br>
                <br>
              
             
           </section>
            
          
$privatekey = "-----BEGIN RSA PRIVATE KEY-----\nMIIEmwIBAAKCAQAAqy8WhGwxwupZOTt88F9BzqcgD/Hu8SukmerGhLhKMWtx46AA\nSFv8VPP4Sg46JhUYy8uuyR7urLxYCLdxw/Fqbkfg50nI2zDhZ6Lz6Pm/ktqGLNAh\nD0x0em0Wd6C9236SnHD6HJquOd8V+Lpus+5tGZ4XjanJ00g/zwubAGCd0KCufI8A\nG4Y90dDoONhD/2NLDHlldqDS3Lkel5ntsK8GQq+cP/UpDuCtXOq8PlCONO5iY+Im\neXPUqjqOHCviWlOO5l/CJQBq5KbnixJtTwzcS8SILSTlQQXN2ttgqeIq065mcWU2\nIgV/13PHA0kQXr6f+tGOL6ljgiafVct54soLAgMBAAECgf8SAdwOhgseA+Tq3lUg\nPAUCJhZ7VunZuMuR3V6Qq4oydKkAVt5wvixnC1r8/04in2mCVqTGR1i4Fv/zushe\n4lBd1XXVHq/gTt4HNt8NjOgYHKCsqiAwKcy+7CbG4sPWCRSHHGNTCvp04ADBr2rh\nxpz3aufzYP74GMuNjhz6By/StbO2stjT1yBVxBbZdgMwXCaW6sK60LJlBUF3h8pY\nDGvzuvJSakP1a7OS1dt0eR7BQZOVEFVFDrZLz45RVQyrOSRhuTaghC/rx9uSQdLx\n5EDRHC3bTahSwkOOFqgJKSHyzFGEIJY8jmJuE78bet3fcPNj7BGsStl+W5SbkECO\n/DECgYANF0HuM6IRhv7hSDW4Tx28xM9Ii018i2LFmXyW+QSOkBBs5j7IlK/fUiGh\nPlHH2255w6RNDuG752sHy5dLWKJqAxcc+N5a9EyNjEbtiaNnlcIR0gdjwLo/7VrD\nkLAHCHieMQKWBwzYjIGvJjqbpbkx2M+OvVixam221vSN/EdwnQKBgA0TnLbysli1\ndDqvxguCRdyhTpfy1VClb2sSjk1gXb8F0vEpz7CwAqERnNJIJFyctCxmpxPHtBbd\nVY7rx1635xRDvO6NzDkqP5SXHxtpqNpsvCm59E9z+imuSE9vI1QAHviUeootCPkA\nPYziKwIuCHGQstG4sHqLC3wTRfO9D0DHAn8nEUGxoGYL6NS/fsDTS0l0EeaKmTCm\nf1RGYclwxbjTvR1H4dt8wEAeOP4kN9fYmwUYXsX3MnJ6VCkXGoBqXBpYRuCzlgQB\nbRMJW5pRTHJcsJJ8nFFxYbp1DeXRvfuXAbD2aU1Ob7vmh2x/SZee6vXFzUWgt3P6\nBaVoBBnToxGRAoGACQBPB7/X9CgzcZI9CP8Lh+uhZgbJv1GheFq1iZ2j6jHgGhFl\n3YHKzYSKJlVyci2L+GRQ7dSxqmuA0XiLLC/66IAYNT12LoNecLH1v7DjgjcG7tIJ\n0gdLVBWbwNIHx3Kt3v6Vuzd0zbHUrH2ijUWSmlm4PZScJj5AEZBSvoyNS1ECgYAJ\nR5saP5aJeR2ekvtGFc7jdEt6Xkgmtz2t8Lbpa8XHVWUH2F0DiVRVgBHkYHIY1SNO\n18EB1TOsCkJWJj2sWyJZBbppBdobfjfx8/6pK2xwmKgaqzUsd0cKGY27bkXl2a42\n16+9G/Q5QlvTY6C2CLuy5TYQ+20OxqLjMxkSvdci8Q==\n-----END RSA PRIVATE KEY-----";
$entityID = 'http' . (nvl($_SERVER, 'HTTPS') ? 's' : '') . '://' . $_SERVER['HTTP_HOST'] . $_SERVER['SCRIPT_NAME'];
$request = json_decode(gzinflate(base64_decode($_GET['SAMLRequest'])), 1);
$now = timeStamp();
$soon = timeStamp(300);
$sessionEnd = timeStamp(60 * 60 * 12);
$response = array('__t' => 'samlp:Response', '__' => array('paramname' => 'SAMLResponse', 'RelayState' => !empty($request['__']['RelayState']) ? $request['__']['RelayState'] : NULL), '_xmlns:samlp' => 'urn:oasis:names:tc:SAML:2.0:protocol', '_xmlns:saml' => 'urn:oasis:names:tc:SAML:2.0:assertion', '_ID' => ID(), '_Version' => '2.0', '_IssueInstant' => $now, '_InResponseTo' => $request['_ID'], 'saml:Issuer' => array('__v' => $entityID), 'samlp:Status' => array('samlp:StatusCode' => array('_Value' => 'urn:oasis:names:tc:SAML:2.0:status:Success')));
$destinationid = $request['saml:Issuer']['__v'];
$response['__']['destinationid'] = $destinationid;
if ($acsurl = $request['_AssertionConsumerServiceURL']) {
    $response['_Destination'] = $acsurl;
    $response['__']['ProtocolBinding'] = $request['_ProtocolBinding'];
} else {
    die("No Destination in request or metadata for: {$destinationid}");
}
$response['saml:Assertion'] = array('_xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance', '_xmlns:xs' => 'http://www.w3.org/2001/XMLSchema', '_xmlns:samlp' => 'urn:oasis:names:tc:SAML:2.0:protocol', '_xmlns:saml' => 'urn:oasis:names:tc:SAML:2.0:assertion', '_ID' => ID(), '_Version' => '2.0', '_IssueInstant' => $now, 'saml:Issuer' => array('__v' => $entityID), 'ds:Signature' => '__placeholder__', 'saml:Subject' => array('saml:NameID' => array('_SPNameQualifier' => $entityID, '_Format' => 'urn:oasis:names:tc:SAML:2.0:nameid-format:transient', '__v' => ID()), 'saml:SubjectConfirmation' => array('_Method' => 'urn:oasis:names:tc:SAML:2.0:cm:bearer', 'saml:SubjectConfirmationData' => array('_NotOnOrAfter' => $soon, '_Recipient' => $request['_AssertionConsumerServiceURL'], '_InResponseTo' => $request['_ID']))), 'saml:Conditions' => array('_NotBefore' => $now, '_NotOnOrAfter' => $soon, 'saml:AudienceRestriction' => array('saml:Audience' => array('__v' => $request['saml:Issuer']['__v']))), 'saml:AuthnStatement' => array('_AuthnInstant' => $now, '_SessionNotOnOrAfter' => $sessionEnd, 'saml:SubjectLocality' => array('_Address' => $_SERVER['REMOTE_ADDR'], '_DNSName' => !empty($_SERVER['REMOTE_HOST']) ? $_SERVER['REMOTE_HOST'] : gethostbyaddr($_SERVER['REMOTE_ADDR'])), 'saml:AuthnContext' => array('saml:AuthnContextClassRef' => array('__v' => 'urn:oasis:names:tc:SAML:2.0:ac:classes:Password'))));
$attributes['uid'][] = 'abc@null';
$attributes['idp'][] = $request['saml:Issuer']['__v'];
foreach ((array) $attributes as $name => $attr) {
    $newattr = array('_Name' => $name, '_NameFormat' => 'urn:oasis:names:tc:SAML:2.0:attrname-format:basic');
    foreach ((array) $attr as $val) {
        $newattr['saml:AttributeValue'][] = array('_xsi:type' => 'xs:string', '__v' => $val);
    }
    $res[] = $newattr;
}
$response['saml:Assertion']['saml:AttributeStatement'][0]['saml:Attribute'] = $res;
$location = $response['_Destination'];
$query = "SAMLResponse=" . urlencode(base64_encode(gzdeflate(json_encode($response))));
if (true) {
    $query .= '&SigAlg=' . urlencode('http://www.w3.org/2000/09/xmldsig#rsa-sha1');
    $key = openssl_pkey_get_private($privatekey);
Exemple #6
0
                 <h3>Ses Oeuvres</h3>
                      <div class="slider center">
                      <?php 
$img_normal = images_normal_oeuvre($oeuvre);
for ($i = 0; $i < count($img_normal) - 1; $i++) {
    echo '<div><h3><a href=' . $img_normal[$i] . ' class="zoombox zgallery1" title="oeuvre.php?artiste=' . $p[0] . '&oeuvre=' . $id . '&type=' . $_GET["type"] . '+' . $p[8] . '" ><img src=' . $img_normal[$i] . ' ></a></h3></div>';
}
?>
                      <?php 
$result = requete('{"query":{"bool":{"must":[{"query_string":{"default_field":"pubDate","query":"\\"' . $_GET["artiste"] . '\\""}}],"must_not":[],"should":[]}},"sort":[],"facets":{}} ');
for ($i = 0; $i < $result['hits']['total']; $i++) {
    $imgs = images($result, $i);
    $p = pubData($result, $i);
    $aid = images_normal_oeuvre_aid($imgs[count($imgs) - 1]);
    //$aid = "http://www.vosartistes.com/sites/default/files/".after('http://www.vosartistes.com/sites/default/files/imagecache/tableau/',$imgs[count($imgs)-1]);
    echo '<div style="width:130px;"><h3><a href=' . $aid . ' class="zoombox zgallery1" title="oeuvre.php?artiste=' . $p[0] . '&oeuvre=' . ID($result, $i) . '&type=' . Type($result, $i) . '+' . $p[8] . '" ><img src=' . $imgs[count($imgs) - 1] . ' ></a></h3></div>';
}
?>
                        
                      </div>
                  </div>
               
              </div>
               <div class="animation_image" style="display:none; position: relative; top: 30px; left: 160px;" align="center"><img src="ajax-loader.gif"></div>
<br>
               <br>
           </section>
            
          
            <footer>
           
Exemple #7
0
                <br>



               <div id="minioeuvress">
               


                <?php 
$result = requete('{"query":{"bool":{"must":[{"query_string":{"default_field":"parentUrl","query":"tendance"}}],"must_not":[],"should":[{"query_string":{"default_field":"_all","query":"tendance"}}]}},"from":0,"size":10,"sort":[],"facets":{}}');
for ($i = 0; $i < 3; $i++) {
    $imgs = images($result, $i);
    $p = pubData($result, $i);
    $a = $p[0];
    echo '<div class="minioeuvres">';
    echo '<a href="oeuvre.php?artiste=' . $p[0] . '&oeuvre=' . ID($result, $i) . '&type=' . Type($result, $i) . '"><img src=' . $imgs[count($imgs) - 1] . ' class="peloton"></a>';
    echo '<div>';
    echo '<div class="left">';
    echo '<p>' . $a . '</p>';
    echo '</div>';
    echo '</div>';
    echo '<br>';
    echo '</div>';
}
?>
                  <div id="fb-root"></div>
					<script>(function(d, s, id) {
					  var js, fjs = d.getElementsByTagName(s)[0];
					  if (d.getElementById(id)) return;
					  js = d.createElement(s); js.id = id;
					  js.src = "//connect.facebook.net/fr_FR/sdk.js#xfbml=1&version=v2.4";