<?php

	$extra = null;

	if(!login_control() || $verify['email']) {

		header("Location: ".site());

	} else {



		if($settings['register_system'] == 0){

			header('Location:'.site());

			exit();

		}



		if(get("r")) {

			session("r", intval(get("r")));

		}

		$dcq = $db->from('integrations')->where('app_id', 1)->first();

		$recaptcha = json_decode($dcq['app_data'], true);

		$recaptcha_text = "";

		if($recaptcha["register_page"]) {

			$recaptcha_text = '<div class="form-group">

								<div class="g-recaptcha" data-sitekey="'.$recaptcha["site_key"].'"></div>

							</div>';

		}



		$integration = "";

		foreach($plugins as $plugin){



			if ($plugin['app_id'] !== 1 && $plugin['app_id'] !== 2 && $plugin['app_id'] !== 3 && $plugin['app_id'] !== 4 && $plugin['app_id'] !== 5) {



				@$data = json_decode($plugin['app_data'], true);



				if(@$data['visibility'] == 0){ // Tüm Sayfalar

					@$integration .= $data['code'];

				}elseif(@$data['visibility'] == 2){ // Giriş Yapanlar

					@$integration .= $data['code'];

				}



			}



		}



		$extra = [

			"{INTEGRATIONS}" => $integration,

			"{reCAPTCHA}" => $recaptcha_text

		];

		$title = "{MAIL_VERIFY_TITLE}";

		$skype = $user['user_email'];

		require view("mail-verify");

	}

	$output = ob_get_clean();

	echo replace($output, $extra);