. * * ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗ * ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝ * ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝ * ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗ * ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗ * ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝ */ class Ai1wm_Resolve_Controller { public static function resolve( $params = array() ) { // Set params if ( empty( $params ) ) { $params = stripslashes_deep( $_REQUEST ); } // Set secret key $secret_key = null; if ( isset( $params['secret_key'] ) ) { $secret_key = trim( $params['secret_key'] ); } try { // Ensure that unauthorized people cannot access resolve action ai1wm_verify_secret_key( $secret_key ); } catch ( Ai1wm_Not_Valid_Secret_Key_Exception $e ) { exit; } // Set IP address if ( isset( $params['url_ip'] ) && ( $ip = $params['url_ip'] ) ) { update_option( AI1WM_URL_IP, $ip ); } // Set adapter if ( isset( $params['url_adapter'] ) && ( $adapter = $params['url_adapter'] ) ) { if ( $adapter === 'curl' ) { update_option( AI1WM_URL_ADAPTER, 'curl' ); } else { update_option( AI1WM_URL_ADAPTER, 'stream' ); } } } }