public function checkLogin()
    {
        $this->defaultData();
        $userService = $this->getServiceLocator()->get(tao_models_classes_UserService::class);
        if (!$this->isXmlHttpRequest()) {
            throw new common_exception_BadRequest('wrong request mode');
        }

        $data = array('available' => false);
        if ($this->hasRequestParameter('login')) {
            $data['available'] = $userService->loginAvailable($this->getRequestParameter('login'));
        }

        $this->returnJson($data);
    }