<?php

class verify_sxExe extends xIExecutor {

	public function main() {
		if($_SERVER['HTTP_USER_AGENT'] != 'Mozilla/4.0') {
			global $_APP;
			$_GET['key'] = isset($_GET['key']) ? $_GET['key'] : '';
			$key = new xKey($_GET['key']);
			if($key->verify(11, 0, $key->user)) {
				$user = new xUser($key->user);
				if(!$user->is(USR_R0_EMAILVER)) {
					$user->class = $_APP['register']['group'];
					$user->mr0 |= USR_R0_EMAILVER;
					$user->update();
					define('KEY_ISVALID',			true);
				} else {
					define('KEY_ISVALID',			false);
				}
			} else {
				define('KEY_ISVALID',			false);
			}
			xUI::loadPage('verify.php');
		}
	}

	public function onError($result) {

	}
}