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

Changeset 12684


Ignore:
Timestamp:
Aug 18, 2009, 5:50:13 AM (10 years ago)
Author:
ebihara
Message:

#4243:added support for permanently trusting OpenID RP

Location:
OpenPNE3/trunk/apps/pc_frontend/modules/OpenID
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE3/trunk/apps/pc_frontend/modules/OpenID/actions/actions.class.php

    r12683 r12684  
    5656          $this->forwardUnless($this->getUser()->isAuthenticated() && $this->getUser()->getMember(), 'member', 'login');
    5757
     58          $trusted = unserialize($this->getUser()->getMember()->getConfig('trusted_openid_rp'));
     59          if ($trusted && in_array($openIDRequest->trust_root, $trusted))
     60          {
     61            $request->setParameter('trust', '1');
     62            $this->forward('OpenID', 'trust');
     63          }
     64
    5865          $this->info = $openIDRequest;
    5966          return 'Trust';
     
    7178      {
    7279        $this->forwardUnless($this->getUser()->isAuthenticated() && $this->getUser()->getMember(), 'member', 'login');
     80
     81        $trusted = unserialize($this->getUser()->getMember()->getConfig('trusted_openid_rp'));
     82        if ($trusted && in_array($openIDRequest->trust_root, $trusted))
     83        {
     84          $request->setParameter('trust', '1');
     85          $this->forward('OpenID', 'trust');
     86        }
    7387
    7488        $this->info = $openIDRequest;
     
    96110    $this->forward404Unless($info);
    97111
    98     $trusted = $request->hasParameter('trust');
     112    $trusted = ($request->hasParameter('trust') || $request->hasParameter('permanent'));
    99113    if (!$trusted)
    100114    {
     
    108122    {
    109123      $this->forward404Unless($reqUrl === $info->identity, 'request:'.$reqUrl.'/identity:'.$info->identity);
     124    }
     125
     126    if ($request->hasParameter('permanent'))
     127    {
     128      $trusted = unserialize($this->getUser()->getMember()->getConfig('trusted_openid_rp'));
     129      if (!$trusted)
     130      {
     131        $trusted = array();
     132      }
     133
     134      $trusted[] = $info->trust_root;
     135
     136      $this->getUser()->getMember()->setConfig('trusted_openid_rp', serialize($trusted));
    110137    }
    111138
  • OpenPNE3/trunk/apps/pc_frontend/modules/OpenID/templates/indexTrust.php

    r10297 r12684  
    44      . "<form method=\"post\" action=\"".url_for('OpenID/trust')."\">\n"
    55      . "<input type=\"submit\" name=\"trust\" value=\"Continue\" />\n"
     6      . "<input type=\"submit\" name=\"permanent\" value=\"Continue (permanently)\" />\n"
    67      . "<input type=\"submit\" value=\"Cancel\" />\n"
    78      . "</form>";
Note: See TracChangeset for help on using the changeset viewer.