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

Changeset 9710


Ignore:
Timestamp:
Dec 26, 2008, 6:58:31 PM (11 years ago)
Author:
ebihara
Message:

#3224:added the opAuthRegisterForm class and the sfOpenPNEAuthForm class has been deprecated

Location:
OpenPNE3/trunk/lib
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE3/trunk/lib/action/sfOpenPNEMemberAction.class.php

    r9670 r9710  
    6565  public function executeRegisterInput($request)
    6666  {
    67     $this->form = $this->getUser()->getAuthForm();
    68     $this->form->setForRegisterWidgets($this->getUser()->getMember());
     67    $this->form = $this->getUser()->getAuthAdapter()->getAuthRegisterForm();
    6968
    7069    if ($request->isMethod('post'))
  • OpenPNE3/trunk/lib/user/opAuthAdapter.class.php

    r9685 r9710  
    1818  {
    1919    $this->setAuthModeName($name);
    20     $formClass = sfOpenPNESecurityUser::getAuthFormClassName($this->authModeName);
     20    $formClass = self::getAuthFormClassName($this->authModeName);
    2121    $this->authForm = new $formClass($this);
    2222
     
    3939  }
    4040
     41  public function getAuthRegisterForm()
     42  {
     43    $form = null;
     44
     45    $formClass = self::getAuthRegisterFormClassName($this->authModeName);
     46    $member = sfContext::getInstance()->getUser()->getMember();
     47
     48    if (class_exists($formClass))
     49    {
     50      $form = new $formClass(array(), array('member' => $member));
     51    }
     52    // deprecated
     53    else
     54    {
     55      $form = $this->getAuthForm();
     56      $form->setForRegisterWidgets($member);
     57      sfContext::getInstance()->getConfiguration()->getEventDispatcher()->notify(new sfEvent(null, 'application.log', array('The '.self::getAuthFormClassName($this->authModeName).' is deprecated. Please create the class is named '.self::getAuthRegisterFormClassName($this->authModeName), 'priority' => sfLogger::ERR)));
     58    }
     59
     60    return $form;
     61  }
     62
    4163  public function authenticate()
    4264  {
     
    5476  }
    5577
     78  public static function getAuthRegisterFormClassName($authMode)
     79  {
     80    return 'opAuthRegisterForm'.ucfirst($authMode);
     81  }
     82
     83 /**
     84  * @deprecated
     85  */
     86  public static function getAuthFormClassName($authMode)
     87  {
     88    return 'sfOpenPNEAuthForm_'.$authMode;
     89  }
     90
     91 /**
     92  * Gets name of this authentication method
     93  */
     94  public function getAuthModeName()
     95  {
     96    return $this->authModeName;
     97  }
     98
    5699 /**
    57100  * Names this authentication method.
     
    61104 public function setAuthModeName($name)
    62105 {
    63   $this->authModeName = $name;
     106   $this->authModeName = $name;
    64107 }
    65108
  • OpenPNE3/trunk/lib/user/sfOpenPNESecurityUser.class.php

    r9677 r9710  
    6868  }
    6969
    70   public static function getAuthFormClassName($authMode)
    71   {
    72     return 'sfOpenPNEAuthForm_'.$authMode;
    73   }
    74 
    7570  public static function getAuthAdapterClassName($authMode)
    7671  {
Note: See TracChangeset for help on using the changeset viewer.