Пример #1
0
 public function getAuthSetsForMethod(Request $request)
 {
     $params = $request->getMethodParams();
     MethodUtils::checkSignature(array(Types::STRING), $params);
     $parts = explode('.', $params[0]);
     if (count($parts) != 2 || count_chars($parts[0]) < 1 || count_chars($parts[1]) < 1) {
         throw new InvalidParameterException('methodId must consist of an ' . 'owner object and a method name separated by a single dot.');
     }
     return new ReturnValue(call_user_func_array(array($this->authenticator, 'getAuthSetsForMethod'), $parts));
 }
 public function resolve(Request $request, Response $response)
 {
     if (!$this->canResolve($request)) {
         throw new MethodNotFoundException($request->getMethodOwner() . '.' . $request->getMethodName());
     }
     $methodName = $request->getMethodName();
     $params = $request->getMethodParams();
     try {
         MethodUtils::checkSignature($this->methodInfo[$methodName], $params);
         $result = call_user_func_array(array($this->target, $methodName), $params);
         if ($result != null) {
             $response->setReturnValue(new ReturnValue($result));
         }
     } catch (InvalidSignatureException $e) {
         $response->setFault(FaultCodes::INVALID_METHOD_PARAMS, $e->getMessage());
     } catch (InvalidParameterException $e) {
         $response->setFault(FaultCodes::INVALID_METHOD_PARAMS, $e->getMessage());
     }
 }
 public function solveCaptcha(Request $request)
 {
     $params = $request->getMethodParams();
     MethodUtils::checkSignature(array(Types::INT, Types::STRING), $params);
     call_user_func_array(array($this->captchaAuth, 'solveCaptcha'), $params);
 }
 public function getAll(array $params)
 {
     MethodUtils::checkSignature(array(), $params);
     return new ReturnValue($this->configuration->getAll());
 }