Likes Likes:  0
Resultaten 1 tot 8 van de 8
Geen
  1. #1
    outlook web access en dav
    geregistreerd gebruiker
    280 Berichten
    Ingeschreven
    03/01/08

    Locatie
    Eindhoven

    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    2 Berichten zijn liked


    Registrar SIDN: nee
    KvK nummer: 17167491
    Ondernemingsnummer: nvt

    Thread Starter

    outlook web access en dav

    Ik heb een uitdaging.
    Via een PHP script wil ik gegevens ophalen uit outlook.
    Wil bijvoorbeeld de agenda uitlezen zodat ik deze in een PHP pagina kan laten zien.
    Echter zijn er een aantal voorbeelden: http://www.daniweb.com/code/snippet471.html
    Maar deze werken niet op mijn exchange server die op https is ingesteld.

    Iemand ervaring hiermee binnen php of andere script talen?

  2. #2
    outlook web access en dav
    geregistreerd gebruiker
    4.175 Berichten
    Ingeschreven
    09/12/05

    Locatie
    Almere

    Post Thanks / Like
    Mentioned
    10 Post(s)
    Tagged
    0 Thread(s)
    76 Berichten zijn liked


    Naam: Ramon Fincken
    Bedrijf: Klarned Managed Hosting / Halvar.io
    Functie: CEO
    URL: www.klarned.is
    Registrar SIDN: Nee
    KvK nummer: 30262182
    TrustCloud: ramonfincken
    View ramonfincken's profile on LinkedIn

    hmm, wat voor melding krijg je?

    dezelfde als "chakermed | Newbie Poster | Oct 16th, 2006 " of iets anders?
    Klarned Managed hosting Hosting, optimalisatie & debugging door WP Core developers

  3. #3
    outlook web access en dav
    geregistreerd gebruiker
    280 Berichten
    Ingeschreven
    03/01/08

    Locatie
    Eindhoven

    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    2 Berichten zijn liked


    Registrar SIDN: nee
    KvK nummer: 17167491
    Ondernemingsnummer: nvt

    Thread Starter
    Ja klopt, dezelfde melding.

    Heb je zelf een script wat werkt over https?

  4. #4
    outlook web access en dav
    geregistreerd gebruiker
    4.175 Berichten
    Ingeschreven
    09/12/05

    Locatie
    Almere

    Post Thanks / Like
    Mentioned
    10 Post(s)
    Tagged
    0 Thread(s)
    76 Berichten zijn liked


    Naam: Ramon Fincken
    Bedrijf: Klarned Managed Hosting / Halvar.io
    Functie: CEO
    URL: www.klarned.is
    Registrar SIDN: Nee
    KvK nummer: 30262182
    TrustCloud: ramonfincken
    View ramonfincken's profile on LinkedIn

    Citaat Oorspronkelijk geplaatst door johan.smits Bekijk Berichten
    Ja klopt, dezelfde melding.

    Heb je zelf een script wat werkt over https?
    Nee, maar ik zou een workaround zoeken, googlen levert me op dat:

    * error level of php versie ermee te maken kunnen hebben
    * curl de zaak beter ( is ook meestal zo ) kan oppakken


    Dit is wellicht handig om te lezen:

    http://nl3.php.net/manual/en/functio...t-contents.php
    Warning

    When using SSL, Microsoft IIS will violate the protocol by closing the connection without sending a close_notify indicator. PHP will report this as "SSL: Fatal Protocol Error" when you reach the end of the data. To work around this, the value of error_reporting should be lowered to a level that does not include warnings. PHP 4.3.7 and higher can detect buggy IIS server software when you open the stream using the https:// wrapper and will suppress the warning. When using fsockopen() to create an ssl:// socket, the developer is responsible for detecting and suppressing this warning.
    +
    php [spat] hm2k.org
    16-Jan-2008 12:58

    http://nl2.php.net/manual/en/function.fsockopen.php
    admin at lab-9 dot com
    21-Jul-2008 02:32
    http://deepakssn.blogspot.com/2006/0...-php-with.html
    3. change to fgets() to @fgets() to surpass the ssl error
    ( mwah ... is niet echt een oplossing )

    Hi Figo2476,

    1. uncomment the extension=php_openssl.dll in php.ini
    2. Check the port used for SS
    http://www.phpbuilder.com/board/arch...-10223778.html

    http://www.sitepoint.com/forums/showthread.php?t=411329
    Klarned Managed hosting Hosting, optimalisatie & debugging door WP Core developers

  5. #5
    outlook web access en dav
    geregistreerd gebruiker
    280 Berichten
    Ingeschreven
    03/01/08

    Locatie
    Eindhoven

    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    2 Berichten zijn liked


    Registrar SIDN: nee
    KvK nummer: 17167491
    Ondernemingsnummer: nvt

    Thread Starter
    Ik zal het vandaag eens proberen over http, om te zien of het script wel werkt.

  6. #6
    outlook web access en dav
    geregistreerd gebruiker
    280 Berichten
    Ingeschreven
    03/01/08

    Locatie
    Eindhoven

    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    2 Berichten zijn liked


    Registrar SIDN: nee
    KvK nummer: 17167491
    Ondernemingsnummer: nvt

    Thread Starter
    Het script werkt prima over http. Tijdelijk een simple apache proxy actief voor het ssl iis probleem binnen PHP.

    Ik kan nu de kalender ophalen maar weet iemand hoe enkel de items van vandaag op te halen? Dmv de webdav query?

  7. #7
    outlook web access en dav
    geregistreerd gebruiker
    280 Berichten
    Ingeschreven
    03/01/08

    Locatie
    Eindhoven

    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    2 Berichten zijn liked


    Registrar SIDN: nee
    KvK nummer: 17167491
    Ondernemingsnummer: nvt

    Thread Starter
    Ik heb een mooi stuke PHP code gevonden welke goed werkt:
    PHP Code:
    // OWA Login Check
    // Written by Scott Milliken
    // Permission granted to use under the GPL
    //

    $username = "user";
    $password = "pass";
    // You can just use the base URL for your default mailbox
    // or you can add on to it to specify a group mailbox
    // $mailboxURL = "https://email.mydomain.com" for default
    // or for a shared NOC mailbox in the IT department...
    $mailboxURL = "https://domain.com/Exchange/boardroom/Agenda/";
    $authURL = "https://domain.com/exchweb/bin/auth/owaauth.dll";

    // First go to the URL that a user would use so that you can get your session cookie set

    $pg = curl_init();

    curl_setopt( $pg, CURLOPT_URL, $mailboxURL );
    curl_setopt( $pg, CURLOPT_USERAGENT, "Mozilla/5.0 (compatible; MSIE 5.01; Windows NT 5.0)" );
    curl_setopt( $pg, CURLOPT_FOLLOWLOCATION, true );

    // You need to define a cookie jar to store and retrieve
    // the session cookies or this won't work
    curl_setopt( $pg, CURLOPT_COOKIEJAR, "cookies.txt" );
    curl_setopt( $pg, CURLOPT_COOKIEFILE, "cookies.txt" );
    curl_setopt( $pg, CURLOPT_HEADER, false );
    curl_setopt( $pg, CURLOPT_RETURNTRANSFER, true );

    // Setting these to false is handy for checking multiple
    // frontends that may share the same SSL cert, such as
    // ones in a round robin DNS scheme, but you address
    // them by the "real name" of the host
    curl_setopt( $pg, CURLOPT_SSL_VERIFYPEER, false );
    curl_setopt( $pg, CURLOPT_SSL_VERIFYHOST, false );

    // Set this to true for debugging
    curl_setopt( $pg, CURLOPT_VERBOSE, false );

    $response = curl_exec( $pg );
    $info = curl_getinfo( $pg );

    // Set the form data for posting the login information
    $postData = array();
    $postData["url"] = $mailboxURL;
    $postData["reason"] = "0";
    $postData["destination"] = $mailboxURL;
    $postData["flags"] = "0";
    $postData["username"] = $username;
    $postData["password"] = $password;
    $postData["SubmitCreds"] = "Log On";

    $postText = "";

    foreach( 
    $postData as $key => $value ) {
    $postText .= $key . "=" . $value . "&";
    }

    curl_setopt( $pg, CURLOPT_REFERER, $info["url"] );
    curl_setopt( $pg, CURLOPT_URL, $authURL );
    curl_setopt( $pg, CURLOPT_POST, true );
    curl_setopt( $pg, CURLOPT_POSTFIELDS, $postText );

    $response = curl_exec( $pg );

    // At this point you can either print the following
    // status to show the result of logging in, or you
    // can make another call to the web server for the
    // individual frames, such as
    // $mailboxURL . "/Inbox/?Cmd=contents" will give you
    // the listing of inbox headers (if you call curl again)

    $info = curl_getinfo( $pg );

    $needle = "close all browser windows when you finish using Outlook Web Access";
    //echo $response;
    //exit;
    if ( strpos( $response, $needle ) )
    {
        
    printf( "Logon to OWA successful.\n" );
    }
    else
    {
        
    printf( "Logon to OWA failed.\n" );
    } 
    Alleen nu wil ik deze query erop los laten:
    Code:
    <a:searchrequest xmlns:a="DAV:" xmlns:s="http://schemas.microsoft.com/exchange/security/">
       <a:sql>
           SELECT "DAV:displayname"
           ,"urn:schemas:httpmail:subject"
    	   ,"urn:schemas:calendar:location"
    	   ,"urn:schemas:calendar:dtstart"
    	   ,"urn:schemas:calendar:duration"
    	   ,"urn:schemas:calendar:dtend"
    	   ,"urn:schemas:httpmail:textdescription"
    	   ,"urn:schemas:calendar:busystatus"
           FROM "$mailboxURL"
    	   WHERE "urn:schemas:calendar:dtend" >= '$date'
    	   ORDER BY "urn:schemas:calendar:dtstart" ASC
       </a:sql>
    </a:searchrequest>
    Hoe kan ik dit doen?
    ik krijg steeds een 409 error met een conflict als ik het zo doe:
    PHP Code:
        $date = gmdate("Y-m-d H:i:s", gmmktime(gmdate('H'),gmdate('i'),gmdate('s'),gmdate('m'),gmdate('d'),gmdate('Y')));
        $putString = '<?xml version="1.0"?>';
        $putString .= <<<END
    <a:searchrequest xmlns:a="DAV:" xmlns:s="http://schemas.microsoft.com/exchange/security/">
       <a:sql>
           SELECT "DAV:displayname"
           ,"urn:schemas:httpmail:subject"
           ,"urn:schemas:calendar:location"
           ,"urn:schemas:calendar:dtstart"
           ,"urn:schemas:calendar:duration"
           ,"urn:schemas:calendar:dtend"
           ,"urn:schemas:httpmail:textdescription"
           ,"urn:schemas:calendar:busystatus"
           FROM "$mailboxURL"
           WHERE "urn:schemas:calendar:dtend" >= '$date'
           ORDER BY "urn:schemas:calendar:dtstart" ASC
       </a:sql>
    </a:searchrequest>
    END;
    //echo $putString;
                // IMPORTANT -- The END line above must be completely left-aligned. No white-space.
                
                // The 'fetch' method does the work of sending and receiving the request.
                // NOTICE the last parameter passed--'SEARCH' in this example. That is the
                // HTTP verb that you must correctly set according to the type of WebDAV request
                // you are making.  The examples on this page use either 'PROPFIND' or 'SEARCH'.

                $headers = array();
                //$headers[] = 'User-Agent: Mozilla/5.0 (X11; U; Linux i686; nl; rv:1.9.0.1) Gecko/2008072820 Firefox/3.0.1';
                //$headers[] = 'Authorization: Basic '.base64_encode($exchange_username.":".$exchange_password);
                $headers[] = 'Content-Type: text/xml; charset="UTF-8"';
                $headers[] = 'Depth: 0';
                $headers[] = 'Translate: f';
                //$headers[] = 'Content-Length: '.strlen($h->xmlrequest);
                //$putString = $h->xmlrequest;
                $putData = tmpfile();
                fwrite($putData, $putString);
                fseek($putData, 0);
                
                $pg = curl_init();
                curl_setopt( $pg, CURLOPT_URL, $mailboxURL. "" );
                curl_setopt( $pg, CURLOPT_USERAGENT, "Mozilla/5.0 (compatible; MSIE 5.01; Windows NT 5.0)" );
                curl_setopt( $pg, CURLOPT_FOLLOWLOCATION, true );
                
                // You need to define a cookie jar to store and retrieve
                // the session cookies or this won't work
                curl_setopt( $pg, CURLOPT_COOKIEJAR, "cookies.txt" );
                curl_setopt( $pg, CURLOPT_COOKIEFILE, "cookies.txt" );
                curl_setopt($pg, CURLOPT_HTTPHEADER, $headers);
                //curl_setopt( $pg, CURLOPT_HEADER, false );
                curl_setopt( $pg, CURLOPT_RETURNTRANSFER, true );
                
                // Setting these to false is handy for checking multiple
                // frontends that may share the same SSL cert, such as
                // ones in a round robin DNS scheme, but you address
                // them by the "real name" of the host
                curl_setopt( $pg, CURLOPT_SSL_VERIFYPEER, false );
                curl_setopt( $pg, CURLOPT_SSL_VERIFYHOST, false );
                
                // Set this to true for debugging
                curl_setopt( $pg, CURLOPT_VERBOSE, false );

                
                curl_setopt($pg, CURLOPT_PUT, true);
                curl_setopt($pg, CURLOPT_INFILE, $putData);
                curl_setopt($pg, CURLOPT_INFILESIZE, strlen($putString));
                
                $content = curl_exec ($pg);
                curl_close ($pg);
    Iemand een idee?

  8. #8
    outlook web access en dav
    geregistreerd gebruiker
    280 Berichten
    Ingeschreven
    03/01/08

    Locatie
    Eindhoven

    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    2 Berichten zijn liked


    Registrar SIDN: nee
    KvK nummer: 17167491
    Ondernemingsnummer: nvt

    Thread Starter
    Niemand die dit eventueel dit tegen betaling wil maken?

Webhostingtalk.nl

Contact

  • Rokin 113-115
  • 1012 KP, Amsterdam
  • Nederland
  • Contact
© Copyright 2001-2026 Webhostingtalk.nl.
Web Statistics