Show
Ignore:
Timestamp:
10/01/08 07:39:26 (3 months ago)
Author:
anatoo
Message:

レスポンス周り追加

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • events/phpframework/plain_php/trunk/core/Action.php

    r20040 r20336  
    1313        $this->context = $c; 
    1414        $this->baseUrl = $c->baseUrl; 
    15         if (in_array($req->REQUEST_METHOD, array('POST', 'GET')))  
    16             return $this->{$req->REQUEST_METHOD}(); 
     15        if (in_array($req->REQUEST_METHOD, array('POST', 'GET'))) { 
     16            $_ = $this->{'before' . $req->REQUEST_METHOD}()  
     17                or $_ = $this->{$req->REQUEST_METHOD}(); 
     18            $this->{'after' . $req->REQUEST_METHOD}(); 
     19            return $_; 
     20        } 
    1721        throw new Exception; 
    1822    } 
     23    function beforePOST() { } 
     24    function beforeGET() { } 
     25     
     26    function afterGET() { } 
     27    function afterPOST() { }  
     28     
    1929    function POST() 
    2030    { 
     
    4555    protected function hasExternalReferer() 
    4656    { 
    47         return  
    48             strpos($this->req->HTTP_REFERER, $this->baseUrl . '/') !== 0 || 
    49             $this->req->HTTP_REFERER === $this->baseUrl; 
     57        if ($this->req->HTTP_REFERER === $this->baseUrl) return false; 
     58        return strpos($this->req->HTTP_REFERER, $this->baseUrl . '/') !== 0; 
    5059    } 
    5160