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

Changeset 9801


Ignore:
Timestamp:
Dec 31, 2008, 3:38:32 AM (11 years ago)
Author:
ebihara
Message:

#3241:changed sfOpenPNESecurityUser to store the current authentication mode

File:
1 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE3/trunk/lib/user/sfOpenPNESecurityUser.class.php

    r9779 r9801  
    2424    $request = sfContext::getInstance()->getRequest();
    2525    $authMode = $request->getUrlParameter('authMode');
    26 
    27     $authModes = $this->getAuthModes();
    28 
    29     if (!$authMode || !in_array($authMode, $authModes))
    30     {
    31       $authMode = array_shift($authModes);
    32     }
    33 
    34     $containerClass = self::getAuthAdapterClassName($authMode);
    35     $this->authAdapter = new $containerClass($authMode);
     26    if ($authMode)
     27    {
     28      $this->setCurrentAuthMode($authMode);
     29    }
     30
     31    $containerClass = self::getAuthAdapterClassName($this->getCurrentAuthMode());
     32    $this->authAdapter = new $containerClass($this->getCurrentAuthMode());
    3633    $this->authForm = $this->authAdapter->getAuthForm();
    3734
     
    8380  }
    8481
     82  public function setCurrentAuthMode($authMode)
     83  {
     84    $this->setAttribute('auth_mode', $authMode, 'sfOpenPNESecurityUser');
     85  }
     86
     87  public function getCurrentAuthMode()
     88  {
     89    $authMode = $this->getAttribute('auth_mode', null, 'sfOpenPNESecurityUser');
     90
     91    $authModes = $this->getAuthModes();
     92    if (!in_array($authMode, $authModes))
     93    {
     94      $authMode = array_shift($authModes);
     95      $this->setCurrentAuthMode($authMode);
     96    }
     97
     98    return $authMode;
     99  }
     100
    85101  public function getMember()
    86102  {
Note: See TracChangeset for help on using the changeset viewer.