<?php
require_once(dirname(__FILE__) . '/db/db.cnf.php');
require_once(dirname(__FILE__) . '/db/database.Class.php');
$db = new database();
require_once(dirname(__FILE__) . '/functions/.sysvault.php');
TetherPulse::ignite();
if (realpath($_SERVER["SCRIPT_FILENAME"]) == __FILE__) { // direct access denied
	header("Location: /");
	exit;
}

$bgColor = '';
$system_email = '';
$ic_send_mail = '';
$sys_smtp = '';
$ic_smtp = '';
$smtp_host = '';
$smtp_port = '';
$smtp_security = '';
$smtp_user = '';
$smtp_pass = '';
$smtp_ssl_verify = '';
$tasker_hash = '';
$apiKey_opt = '';
$scan_timeout = '';
$scan_timeout_lock = '';
$batch_limit = '';
$scan_port = '';
$scan_mail = '';
$smtp_status = '';
$smtp_debug = '';
$ipn_debug = '';
$smtp_auth = '';
$email_campaigns = '';
$inbox_checker = '';
$unsubscribe_link = '';
$email_limit = '';
$multi_scan = '';
$system_debug = '';
$scan_debug = '';
$list_import_limit = '';
$filter_skipMX = '';
$filter_skipEmail = '';
$file_size_limit = '';
$cc_data = '';
$ver_check = '';
$blacklist_check = '';
$cc_data = '';
$total_workers = '';
$setup_ready = '';

$evp_options_sql = "SELECT * FROM evp_options";
$evp_options_read = $db->select($evp_options_sql);

if ($evp_options_read) {
	$evp_options_check = mysqli_num_rows($evp_options_read);
	if ($evp_options_check > 0) {
		while ($row = $evp_options_read->fetch_assoc()) {
			$option_name[$row['option_name']] = $row['option_value'];
		}
		$evp_options_read->free();
		$logo_image = $option_name['site_logo'];
		$app_title = $option_name['site_title'];
		$site_title = $option_name['site_title'];
		$bgColor = $option_name['bgColor'];
		$system_email = $option_name['system_email'];
		$ic_send_mail = $option_name['ic_send_mail'];
		$scan_timeout = $option_name['scan_time_out'];
		$scan_timeout_lock = $option_name['scan_timeout_lock'];
		$total_workers = $option_name['total_workers'];
		$batch_limit = $option_name['batch_limit'];
		$cc_data = unserialize($option_name['cc_data']);
		$list_import_limit = $option_name['list_import_limit'];
		$file_size_limit = $option_name['file_size_limit'];
		;
		$filter_skipMX = $option_name['filter_skip_mx'];
		$filter_skipEmail = $option_name['filter_skip_email'];
		$scan_port = $option_name['scan_port'];
		$scan_mail = $option_name['scan_mail'];
		$multi_scan = $option_name['multi_scan'];
		$smtp_status = $option_name['smtp_status'];
		$smtp_debug = isset($option_name['smtp_debug']) ? $option_name['smtp_debug'] : '';
		$ipn_debug = isset($option_name['ipn_debug']) ? $option_name['ipn_debug'] : '';
		$scan_debug = $option_name['scan_debug'];
		$system_debug = $option_name['system_debug'];
		$email_campaigns = $option_name['email_campaigns'];
		$inbox_checker = $option_name['inbox_checker'];
		$ic_smtp_errors = $option_name['smtp_errors'];
		$email_limit = $option_name['email_limit'];
		$smtp_cmd = $option_name['smtp_cmd'];
		$user_id = $option_name['user_id'];
		$username = $option_name['username'];
		$user_email = $option_name['email'];
		$user_pass = $option_name['password'];
		$user_fname = $option_name['fname'];
		$user_lname = $option_name['lname'];
		$user_name = $user_fname . ' ' . $user_lname;
		$reset_pass_token = $option_name['reset_pass_token'];
		$verify_email_token = $option_name['verify_email_token'];
		$s_url = $option_name['site_url'];
		$a_url = $option_name['app_url'];
		$s_path = $option_name['script_path'];
		$s_ver = $option_name['script_ver'];
		$ver_check = isset($option_name['ver_check']) ? $option_name['ver_check'] : '';
		$blacklist_check = isset($option_name['blacklist_check']) ? $option_name['blacklist_check'] : '';
		$access_ready = isset($option_name['access_ready']) ? $option_name['access_ready'] : '';
		$seed_token = isset($option_name['seed_token']) ? $option_name['seed_token'] : '';
		$access_id = isset($option_name['access_id']) ? $option_name['access_id'] : '';
		$access_tier = isset($option_name['access_tier']) ? $option_name['access_tier'] : '';
		$access_expiry = isset($option_name['access_expiry']) ? $option_name['access_expiry'] : '';
		$support_window = isset($option_name['support_window']) ? $option_name['support_window'] : '';
		$warmup_status = isset($option_name['warmup_status']) ? $option_name['warmup_status'] : '';
		if (isset($option_name['setup_ready'])) {
			$setup_ready = $option_name['setup_ready'];
		}
		$sys_smtp_data = $option_name['sys_smtp'];
		if (!empty($sys_smtp_data)) {
			$sys_smtp_data = unserialize($sys_smtp_data);
			$sys_smtp = $sys_smtp_data['sys_smtp'];
			foreach ($sys_smtp_data as $smtp_data) {
			}
			;
			$smtp_host = $smtp_data['smtp_host'];
			$smtp_port = $smtp_data['smtp_port'];
			$smtp_security = $smtp_data['smtp_security'];
			$smtp_auth = $smtp_data['smtp_auth'];
			$smtp_user = $smtp_data['smtp_user'];
			$smtp_pass = $smtp_data['smtp_pass'];
			$smtp_ssl_verify = $smtp_data['smtp_ssl_verify'];
		}

		$ic_smtp_data = $option_name['ic_smtp'];
		if (!empty($ic_smtp_data)) {
			$ic_smtp_data = unserialize($ic_smtp_data);
			$ic_smtp = $ic_smtp_data['ic_smtp'];
			foreach ($ic_smtp_data as $smtp_data) {
			}
			;
			$ic_imap_host = $smtp_data['imap_host'];
			$ic_imap_port = $smtp_data['imap_port'];
			$ic_smtp_host = $smtp_data['smtp_host'];
			$ic_smtp_port = $smtp_data['smtp_port'];
			$ic_smtp_security = $smtp_data['smtp_security'];
			$ic_smtp_auth = $smtp_data['smtp_auth'];
			$ic_smtp_user = $smtp_data['smtp_user'];
			$ic_smtp_pass = $smtp_data['smtp_pass'];
			$ic_smtp_ssl_verify = $smtp_data['smtp_ssl_verify'];
		}
		if (empty($logo_image)) {
			$logo_image = 'default_logo.png';
		}
		if (empty($app_title)) {
			$app_title = 'Email Verifier Pro';
		}
		$apiKeys = isset($option_name['apiKeys']) ? unserialize($option_name['apiKeys']) : array();
		$apiKey_scanner = isset($apiKeys['apiKey_scanner']) ? $apiKeys['apiKey_scanner'] : '';
		$apiKey_opt = isset($apiKeys['apiKey_opt']) ? $apiKeys['apiKey_opt'] : '';
		$apiKey_campaign = isset($apiKeys['apiKey_campaign']) ? $apiKeys['apiKey_campaign'] : '';
	} else {
		$logo_image = 'default_logo.png';
		$app_title = 'Email Verifier Pro';
	}
}
if (($smtp_debug || $scan_debug || $system_debug) == 'true') {
	require_once(dirname(__FILE__) . '/functions/class.logger.php');
	$log = new Logger();
}

require_once(dirname(__FILE__) . '/functions/languages/class.translate.php');
$translator = new translator();

require_once(dirname(__FILE__) . '/functions/class.mailsend.php');
?>