コード例 #1
0
ファイル: smi-controller.php プロジェクト: Maharaja1/drdata
 public function saveresearcherpass()
 {
     try {
         if (!Check::digits($rid = $_SESSION['user']['researcher_id'])) {
             throw new Exception("invalid researcher id!");
         }
         if ($_POST['password'] != $_POST['confirmpassword']) {
             throw new Exception("passwords don't match!");
         } else {
             $password = $_POST['password'];
         }
         if (!Check::validpassword($password)) {
             throw new Exception(Check::err());
         }
         $r = new Researcher();
         if ($r->upd($rid, array('password' => md5($password))) === false) {
             throw new Exception($r->err());
         }
         return 'home.tpl';
     } catch (Exception $e) {
         $this->err($e);
         View::assign('error', $this->error);
         return 'error.tpl';
     }
 }