function pagemodifypwd($inPath) { $admin_id = (int) $_COOKIE['admin_id']; if ($_POST) { $adminObj = new m_admin(); $post = base_Utils::shtmlspecialchars($_POST); $resPwd = $adminObj->get("admin_id = {$admin_id}", 'admin_pwd'); if ($resPwd['admin_pwd'] == md5($post['old_pwd']) and $post['new_pwd'] == $post['new_pwd2'] and $post['new_pwd']) { $pwd = md5($post['new_pwd']); $rs = $adminObj->update("admin_id = {$admin_id}", "admin_pwd = '{$pwd}'"); if ($rs) { $this->ShowMsg('修改成功', $this->createUrl('/account/modifypwd'), '', 1); } else { $this->ShowMsg('修改失败,请重试!错误原因:' . $adminObj->getError()); } } else { $this->ShowMsg('原密码错误或者两次新密码不一致!'); } } return $this->render('account/modifypwd.html', $this->params); }