<commit_before><?php

/*
 * This file is part of the symfony package.
 * (c) 2004-2006 <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

/**
 *
 * @package    symfony
 * @subpackage plugin
 * @author     <NAME> <<EMAIL>>
 * @version    SVN: $Id: sfGuardSecurityUser.class.php 7745 2008-03-05 11:05:33Z fabien $
 */
class sfGuardSecurityUser extends sfBasicSecurityUser
{
  private $user = null;

  public function getReferer($default)
  {
    $referer = $this->getAttribute('referer', $default);
    $this->getAttributeHolder()->remove('referer');

    return $referer;
  }

  public function setReferer($referer)
  {
    if (!$this->hasAttribute('referer'))
    {
      $this->setAttribute('referer', $referer);
    }
  }

  public function hasCredential($credential, $useAnd = true)
  {
    if (!$this->getGuardUser())
    {
      return false;
    }<commit_msg>[sfDoctrineGuardPlugin][1.0][1.1][1.2][trunk] fixed hasCredential() method to admit an anonymous user to have an empty credential list<commit_after><?php

/*
 * This file is part of the symfony package.
 * (c) 2004-2006 <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

/**
 *
 * @package    symfony
 * @subpackage plugin
 * @author     <NAME> <<EMAIL>>
 * @version    SVN: $Id: sfGuardSecurityUser.class.php 7745 2008-03-05 11:05:33Z fabien $
 */
class sfGuardSecurityUser extends sfBasicSecurityUser
{
  private $user = null;

  public function getReferer($default)
  {
    $referer = $this->getAttribute('referer', $default);
    $this->getAttributeHolder()->remove('referer');

    return $referer;
  }

  public function setReferer($referer)
  {
    if (!$this->hasAttribute('referer'))
    {
      $this->setAttribute('referer', $referer);
    }
  }

  public function hasCredential($credential, $useAnd = true)
  {
    if (empty($credential))
    {
      return true;
    }

    if (!$this->getGuardUser())
    {
      return false;
    }
{'fraction_non_alphanumeric': 0.1396119261713204, 'fraction_numerical': 0.02744912446758164, 'mean_word_length': 3.4318658280922434, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '235242', 'n_tokens_mistral': 711, 'n_tokens_neox': 687, 'n_words': 176}