File Manager / wp-content Search Upload New Item Settings File "db5.php" Full path: /home1/epichome/public_html/wp-content/db5.php File size: 60.67 B (60.67 KB bytes) MIME-type: text/x-php Charset: utf-8 Download Open Edit Advanced Editor Back
/home/pabloaso/public_html/wp-content/plugins/ithemes-security-pro/pro/geolocation/rest.php
<?php

register_rest_route( 'ithemes-security/rpc', 'geolocation/maxmind-db-check', [
	'callback'            => function () {
		require_once( __DIR__ . '/geolocators/class-itsec-geolocator-maxmind-db.php' );

		return [
			'path'      => ITSEC_Geolocator_MaxMind_DB::get_db_path(),
			'available' => ( new ITSEC_Geolocator_MaxMind_DB() )->is_available(),
		];
	},
	'permission_callback' => 'ITSEC_Core::current_user_can_manage',
] );

register_rest_route( 'ithemes-security/rpc', 'geolocation/maxmind-db-download', [
	'methods'             => WP_REST_Server::CREATABLE,
	'args'                => [
		'api_key' => [
			'type'      => 'string',
			'minLength' => 1,
			'required'  => true,
		],
	],
	'callback'            => function ( $request ) {
		require_once( __DIR__ . '/geolocators/class-itsec-geolocator-maxmind-db.php' );

		$downloaded = ITSEC_Geolocator_MaxMind_DB::download( $request['api_key'] );

		if ( is_wp_error( $downloaded ) ) {
			return $downloaded;
		}

		return [
			'path' => ITSEC_Geolocator_MaxMind_DB::get_db_path(),
		];
	},
	'permission_callback' => 'ITSEC_Core::current_user_can_manage',
] );