public function resetPasswd() { parent::checkAdmin(); if (isset($_POST['send'])) { $model = new AdminModel(); $model->oldPassword = sha1(trim($_POST['oldPassword'])); $model->password = sha1(trim($_POST['password'])); if ($model->resetPasswd()) { Tool::alert('密码修改成功'); } else { Tool::alertBackNoRefresh('原密码不正确或密码修改失败:('); } } $this->render('default/resetPasswd'); }