<?php

/**
 * [Discuz!] (C)2001-2099 Discuz! Team
 * This is NOT a freeware, use is subject to license terms
 * https://license.discuz.vip
 */

namespace admin;
use table_common_setting;

if(!defined('IN_DISCUZ')) {
	exit('Access Denied');
}

class optimizer_emailregister {

	public function __construct() {

	}

	public function check() {
		$sendregister = table_common_setting::t()->fetch_setting('sendregisterurl');
		if($sendregister) {
			$return = ['status' => 2, 'type' => 'header', 'lang' => lang('optimizer', 'optimizer_emailregister_normal'), 'extraurl' => '&checkemail=1'];
		} else {
			$return = ['status' => 2, 'type' => 'header', 'lang' => lang('optimizer', 'optimizer_emailregister_tip')];
		}
		return $return;
	}

	public function optimizer() {
		$adminfile = defined(ADMINSCRIPT) ? ADMINSCRIPT : 'admin.php';
		if($_GET['checkemail']) {
			$url = '?action=setting&operation=mail';
		} else {
			$url = '?action=setting&operation=access';
		}
		dheader('Location: '.$_G['siteurl'].$adminfile.$url);
	}
}

