<?php



	if(!login_control()) {



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

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

			exit();

		}



		if(route(1)) {



			$hash = route(1);

			$query = $db->from('reset_password_requests')

			->where('request_hash', $hash)

			->where('request_status', 1)

			->first();



			if($query) {

				$user = $query['user_id'];

				$title = "{RESET_PAGE_TITLE}";



				$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'];

						}



					}



				}



				require view("reset");



				$extra = [

					"{INTEGRATIONS}" => $integration

				];



			} else {

				require controller("404");

			}



		} else {

			require controller("404");

		}

	} else {

		require controller("404");

	}

	$output = ob_get_clean();

	echo replace($output, $extra);