ここの情報は古いです。ご理解頂いた上でお取り扱いください。

Ignore:
Timestamp:
Apr 22, 2008, 1:47:01 AM (13 years ago)
Author:
ogawa
Message:

#1762:webapp/modules/openid/lib作成

File:
1 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE/branches/work/ogawa/openid/webapp/modules/openid/do/server.php

    r6683 r6690  
    44 * @license   http://www.php.net/license/3_01.txt PHP License 3.01
    55 */
    6 
    7 require_once 'Auth/OpenID/Server.php';
    8 require_once 'Auth/OpenID/FileStore.php';
    96
    107class openid_do_server extends OpenPNE_Action
     
    1714    function execute($requests)
    1815    {
    19         $op_endpoint = openpne_gen_url('openid', 'page_auth', $requests);
    20         $oserver =& new Auth_OpenID_Server(new Auth_OpenID_FileStore(OPENPNE_VAR_DIR . '/tmp'), $op_endpoint);
    21         $request = $oserver->decodeRequest();
     16        $server =& openid_util_get_server($requests['id']);
     17        $openid_request = $server->decodeRequest();
    2218
    2319        $response = null;
    24         if (in_array($request->mode, array('checkid_immediate', 'checkid_setup'))) {
    25             if ($request->immediate) {
    26                 $response = $request->answer(false);
     20        if (in_array($openid_request->mode, array('checkid_immediate', 'checkid_setup'))) {
     21            if ($openid_request->immediate) {
     22                $response = $openid_request->answer(false);
    2723            } else {
    2824                openpne_forward('openid', 'page', 'server_confirm');
     
    3026            }
    3127        } else {
    32             $response = $oserver->handleRequest($request);
     28            $response = $server->handleRequest($openid_request);
    3329        }
    3430
    35         $webresponse = $oserver->encodeResponse($response);
    36 
    37         foreach ($webresponse->headers as $k => $v) {
    38             header("$k: $v");
    39         }
    40         header('Connection: close');
    41         echo $webresponse->body;
    42         exit;
     31        $webresponse = $server->encodeResponse($response);
     32        openid_util_write_response($webresponse);
    4333    }
    4434}
Note: See TracChangeset for help on using the changeset viewer.