<?php

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

/**
 * defaultActions module.
 *
 * @package    symfony
 * @subpackage action
 * @author     Fabien Potencier <fabien.potencier@symfony-project.com>
 * @version    SVN: $Id: actions.class.php 3313 2007-01-20 07:00:37Z fabien $
 */
class defaultActions extends sfActions
{
  /**
   * Congratulations page for creating an application
   *
   */
  public function executeIndex()
  {
  }

  /**
   * Congratulations page for creating a module
   *
   */
  public function executeModule()
  {
  }

  /**
   * Error page for page not found (404) error
   *
   */
  public function executeError404()
  {
    $this->currentUrl = $this->getRequest()->getUri();
    $this->prevUrl = $this->getRequest()->getReferer();
    $this->message404 = $this->getRequest()->getError('message404');

    if (!$this->message404 ||
      preg_match('@/(present|document|entry)/(show)?$@', $this->currentUrl) ||
      preg_match('@/(cat_id|entry_id|doc_id|pr_id)/([^0-9].*)?$@', $this->currentUrl)) {
      myUtility::log($this->currentUrl.' <== '.$this->prevUrl, 'errorrequest2.log');
      return;
    }
    myUtility::log($this->message404.' ('.$this->currentUrl.' <== '.$this->prevUrl.')', 'error404.log');
  }

  /**
   * Warning page for restricted area - requires login
   *
   */
  public function executeSecure()
  {
    $this->currentUrl = $this->getRequest()->getUri();
    $this->prevUrl = $this->getRequest()->getReferer();
    myUtility::log($this->currentUrl.' <== '.$this->prevUrl, 'errorsecure.log');
  }

  /**
   * Warning page for restricted area - requires credentials
   *
   */
  public function executeLogin()
  {
    $this->currentUrl = $this->getRequest()->getUri();
    $this->prevUrl = $this->getRequest()->getReferer();
    myUtility::log($this->currentUrl.' <== '.$this->prevUrl, 'errorlogin.log');
  }

  /**
   * Website temporarily unavailable
   *
   */
  public function executeUnavailable()
  {
  }

  /**
   * Website disabled by the site administrator (in settings.yml)
   *
   */
  public function executeDisabled()
  {
  }
}
