<?php
/**
* @author moufer<moufer@163.com>
* @copyright www.modoer.com
* @version $Id 3 2008-08-25 18:35 $
*/
!defined('IN_MUDDER') && exit('Access Denied');

if($in_ajax) {

    if($op=='changepw'){

        $caption = '修改密码';
        if(!$user->isLogin) dialog($caption, '', 'login');
        require_once template('ajax_changepw','member','./templates/member');
        output();

    } else {
        dialog('系统提示','未定义的操作。');
    }

} elseif(check_submit('changepwsubmit')) {

    if(!function_exists('changePassword')) {
        require_once(MUDDER_ROOT.'./member/include/fun_member.php');
    }
    echo changePassword($user, $old_pw, $new_pw, $new_pw2);
    output();

} elseif(!check_submit('mysubmit')) {

    $result = $db->query("SELECT * FROM {$dbpre}spaces WHERE uid = '{$user->uid}' ");
    if(!$result){
        $db->query("INSERT INTO {$dbpre}spaces(uid,style,pageviews) VALUES('{$user->uid}','default','0')");
    }

} else {

}
?>