Example #1
0
 public function getConvLimitAction()
 {
     $re = array("returncode" => ReturnCode::$SUCCESS);
     $request = $this->getRequest();
     $user = $this->get('security.context')->getToken()->getUser();
     $da = $this->get('we_data_access');
     $circle_id = $request->get("circle_id");
     try {
         if (empty($circle_id)) {
             throw new \Exception("param is null");
         }
         $conv = new \Justsy\BaseBundle\Business\Conv();
         $allowcopy = $conv->getCircleLimit($da, $circle_id);
         $re["allow_copy"] = $allowcopy["allow_copy"];
     } catch (\Exception $e) {
         $re["returncode"] = ReturnCode::$SYSERROR;
         $this->get('logger')->err($e);
     }
     $response = new Response($request->get('jsoncallback') ? $request->get('jsoncallback') . "(" . json_encode($re) . ");" : json_encode($re));
     $response->headers->set('Content-Type', 'text/json');
     return $response;
 }
 public function getConvLimitAction()
 {
     $re = "";
     $user = $this->get('security.context')->getToken()->getUser();
     $request = $this->getRequest();
     $network_domain = $request->get('network_domain');
     $da = $this->get('we_data_access');
     $conv = new \Justsy\BaseBundle\Business\Conv();
     $re = $conv->getCircleLimit($da, $user->get_circle_id($network_domain));
     $response = new Response(json_encode($re));
     $response->headers->set('Content-Type', 'text/json');
     return $response;
 }