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

Changeset 6690


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

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

Location:
OpenPNE/branches/work/ogawa/openid/webapp/modules/openid
Files:
4 added
4 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}
  • OpenPNE/branches/work/ogawa/openid/webapp/modules/openid/do/server_confirm.php

    r6683 r6690  
    55 */
    66
    7 require_once 'Auth/OpenID/Server.php';
    8 require_once 'Auth/OpenID/FileStore.php';
    9 
    107class openid_do_server_confirm extends OpenPNE_Action
    118{
     
    1310    {
    1411        if ($requests['id'] != $GLOBALS['AUTH']->uid()) {
    15             $GLOBALS['AUTH']->logout();
    16             client_redirect_login();
     12            openpne_redirect('openid', 'page_server_error');
    1713        }
    1814
    19         $info = unserialize($_SESSION['request']);
    20         $req_url = $info->identity;
     15        $openid_request = openid_util_get_session();
     16        openid_util_set_session();
    2117
    22         $op_endpoint = openpne_gen_url('openid', 'page_auth', $requests);
    23         $server =& new Auth_OpenID_Server(new Auth_OpenID_FileStore(OPENPNE_VAR_DIR . '/tmp'), $op_endpoint);
    24         $response =& $info->answer(true, null, $req_url);
     18        $server =& openid_util_get_server($requests['id']);
     19        $response =& $openid_request->answer(true);
    2520
    2621        $webresponse =& $server->encodeResponse($response);
    27 
    28         foreach ($webresponse->headers as $k => $v) {
    29             header("$k: $v");
    30         }
    31         header('Connection: close');
    32         echo $webresponse->body;
    33         exit;
     22        openid_util_write_response($webresponse);
    3423    }
    3524}
  • OpenPNE/branches/work/ogawa/openid/webapp/modules/openid/init.inc

    r6678 r6690  
    55 */
    66
    7 $GLOBALS['__Framework']['default_page'] = 'home';
    8 
    97if (!OPENPNE_IS_OPENID_SERVER) {
    108    exit;
    119}
    1210
     11$GLOBALS['__Framework']['default_page'] = 'home';
     12
     13// ライブラリ読み込み
     14require_once openpne_ext_search('openid/lib/util.php');
     15
    1316?>
  • OpenPNE/branches/work/ogawa/openid/webapp/modules/openid/page/server_confirm.php

    r6683 r6690  
    55 */
    66
    7 require_once 'Auth/OpenID/Server.php';
    8 require_once 'Auth/OpenID/FileStore.php';
    9 
    107class openid_page_server_confirm extends OpenPNE_Action
    118{
     
    1310    {
    1411        if ($requests['id'] != $GLOBALS['AUTH']->uid()) {
    15             exit('error');
     12            openpne_redirect('openid', 'page_server_error');
    1613        }
    1714
    18         $op_endpoint = openpne_gen_url('openid', 'page_auth', $requests);
    19         $oserver =& new Auth_OpenID_Server(new Auth_OpenID_FileStore(OPENPNE_VAR_DIR . '/tmp'), $op_endpoint);
    20         $request = $oserver->decodeRequest();
    21         $_SESSION['request'] = serialize($request);
     15        $server =& openid_util_get_server($requests['id']);
     16        $openid_request = $server->decodeRequest();
     17        openid_util_set_session($openid_request);
    2218
    2319        return 'success';
Note: See TracChangeset for help on using the changeset viewer.