X-Git-Url: https://dev.renevier.net/?p=syj.git;a=blobdiff_plain;f=application%2Fcontrollers%2FUserController.php;h=f802b16b66d85eba8c80dd595eebf8d71a4dd60d;hp=2bd41d3106b78bbecf9c7d03c6001e255ba853a8;hb=ce001229accb2aff799560eec402344f0dbb1762;hpb=66441b64eacf64a0f7a14246139ed807ab816a04 diff --git a/application/controllers/UserController.php b/application/controllers/UserController.php index 2bd41d3..f802b16 100644 --- a/application/controllers/UserController.php +++ b/application/controllers/UserController.php @@ -5,6 +5,21 @@ class UserController extends Zend_Controller_Action { + public function existsAction() { + $name = $this->getRequest()->getUserParam('name'); + + $userMapper = new Syj_Model_UserMapper(); + $user = new Syj_Model_User(); + + if ($userMapper->findByPseudo($name, $user)) { + $this->_helper->SyjApi->setCode(200); + } else { + // opera needs some body content with 404 code, otherwise, it + // reports a xmlhttprequest.status of 0 + $this->_helper->SyjApi->setCode(404)->setBody(' '); + } + } + public function userAction() { $formData = $this->_helper->SyjPostData->getPostData('Syj_Form_User');