<?php
if($_POST){
  InitGP(array('S'),'P');
  $pass=md5($S['password']);
  $U=DB()->one("users","uid,ismaster","username='$S[username]' and password='$pass' and ismaster='1'");
  !$U && jump('error','用户名或密码不正确');
  $uid=$U['uid'];
  $cookie=StrCode("$uid\t$S[username]\t$U[ismaster]","ENCODE");
  _cookie('users',$cookie);
  !$S['jumpurl'] && $S['jumpurl']='?a=home&b=main';
  jump('notice','登录成功',$S['jumpurl']);
}
theme_header();
$ot->borderA('#content2','box2');
$ot->addhead('修改密码');
$ot->addinput('旧密码','pass0','','password',1,"");
$ot->addinput('新密码','pass1','','password',1,"");
$ot->addinput('确认新密码','pass2','','password',1,"Repeat",array('to'=>'S[pass1]','msg'=>'两次密码不一致'));
$ot->setform('提交');
$ot->borderB(1);
$ot->flush();
theme_footer();
?>