Beispiel #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;
 }
Beispiel #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;
 }