public function regAction() { $username = strip_tags(trim($this->getRequest()->getParam("username"))); $pwd = strip_tags(trim($this->getRequest()->getParam("pwd"))); if (empty($username) || empty($pwd)) { echo "nullError"; exit; } $pwd = md5($pwd); $UserMapper = new Application_Model_userMapper(); $result = $UserMapper->addUser($username, $pwd); if ($result) { $status = "success"; $info = "regSuccess"; } else { $status = "error"; $info = "pwdError"; } Json($status, $info); }
/** * Get json contents. * * @return Json */ public function json() { if (!$this->json) { $this->json = Json($this->getPath() . '/module.json', $this->app['files']); } return $this->json; }