Development

Changeset 1438

You must first sign up to be able to contribute.

Changeset 1438

Show
Ignore:
Timestamp:
06/13/06 14:34:52 (2 years ago)
Author:
fabien
Message:

updated removeCredential() method to not rely on index values for removal (closes #524 - patch from hartym)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/user/sfBasicSecurityUser.class.php

    r1415 r1438  
    5252   * 
    5353   * @param  mixed credential 
    54    */ 
     54   */   
    5555  public function removeCredential($credential) 
    5656  { 
    5757    if ($this->hasCredential($credential)) 
    5858    { 
    59       for ($i = 0, $z = count($this->credentials); $i < $z; $i++
     59      foreach ($this->credentials as $key => $value
    6060      { 
    61         if ($credential == $this->credentials[$i]
     61        if ($credential == $value
    6262        { 
    6363          if (sfConfig::get('sf_logging_active')) $this->getContext()->getLogger()->info('{sfUser} remove credential "'.$credential.'"'); 
    6464 
    65           unset($this->credentials[$i]); 
     65          unset($this->credentials[$key]); 
    6666          return; 
    6767        } 
    6868      } 
    6969    } 
    70   } 
     70  }   
    7171 
    7272  /**