Ejemplo n.º 1
0
 /**
  * Asserts user is authenticated
  * 
  * @param \sfAltumoPlugin\Api\ApiRequest $request
  * 
  * @throws wfException	// if user is not authenticated
  * 
  * @return ApiActions
  */
 protected function assertRequestAuthenticated($request)
 {
     try {
         $request->authenticate();
     } catch (Exception $e) {
         $this->getResponse()->setStatusCode('401');
         throw $e;
     }
     return $this;
 }
Ejemplo n.º 2
0
 /**
  * Override inorder to ignore trailing slashes in requests.
  *   @see \sfWebRequest::getPathInfo()
  */
 public function getPathInfo()
 {
     $pathInfo = parent::getPathInfo();
     // remove trailing slash.
     $pathInfo = preg_replace('/\\/$/', '', $pathInfo);
     return $pathInfo;
 }