isPackageActive()) { return; } $file = $registrarHelper->creatreFunctionsFile(str_replace( DS.'mgLibs'.DS.'custom'.DS.'helpers','', realpath(dirname(__FILE__)))); if(!file_exists($file)) { throw new \Exception( $file.' '. main\mgLibs\lang::T('not found').'.' ); } require_once($file); } catch(Exception $ex) { main\addon::dump($ex); logModuleCall( 'DNS Manager', __FUNCTION__, $ex->getMessage(), $ex->getMessage(), $ex->getTraceAsString() ); } } /** * Function is used to parse URL address and detect if user is in avaialbe action section
* What daoe it mean means it allow to run run action only when Domain ID is avaialble */ public static function paresUrl() { $availableActions = array( 'domaindetails', 'domaindns' ); global $CONFIG; $host = parse_url($CONFIG['SystemURL'])['host']; $url = "http" . (($_SERVER['SERVER_PORT'] == 443) ? "s://" : "://") . $host . $_SERVER['REQUEST_URI']; $urlDetails = parse_url($url); foreach ($urlDetails as $key) { foreach ($availableActions as $action) { preg_match("/$action/", $key, $match); if (isset($match[0])) { return true; } } } return false; } }