<?php
if (IS_POST)
{
    $arr = array();
    strlen($_POST['pass']) < 5 && yun_error(mlang('密码不能少于5位'),
        'yun_onfocus("pass");');
    strlen($_POST['pass2']) < 5 && yun_error(mlang('密码不能少于5位'),
        'yun_onfocus("pass2");');
    $user['pass'] == md5(md5($_POST['pass'])) or yun_error(mlang('旧密码不正确'),
        'yun_onfocus("pass");');
    $arr['pass'] = md5(md5($_POST['pass']));
    $sql = sql_update($arr);
    if ($db->query("update " . PF . "user set $sql where id='$user[id]'"))
    {
        yun_succeed(mlang('修改成功'), url(RPGM . 'show/'));
    } else
    {
        yun_error(mlang('修改失败'));
    }
}
?>