Exemplo n.º 1
0
 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);
 }
Exemplo n.º 2
0
 /**
  * Get json contents.
  *
  * @return Json
  */
 public function json()
 {
     if (!$this->json) {
         $this->json = Json($this->getPath() . '/module.json', $this->app['files']);
     }
     return $this->json;
 }