<?php

class changePwd_sxExe extends xIExecutor {

	public function main() {
		if($_POST['newpwd'] == $_POST['renewpwd']) {
			if(xUser::$cur->editPassword($_POST['oldpwd'], $_POST['newpwd'])) {
				xUser::$cur->logout();
				echo json_encode(array(
					'result' => '1'
				));
			} else {
				echo json_encode(array(
					'result' => '0',
					'msg' => '您的原密码输入不正确'
				));
			}
		} else {
			echo json_encode(array(
				'result' => '0',
				'msg' => '重输密码与新密码不一致'
			));
		}
	}

	public function onError($result) {

	}
}

