diff --git a/application/modules/default/views/scripts/authorization/login.phtml b/application/modules/default/views/scripts/authorization/login.phtml index 1a7290ed0..3e9eefad0 100644 --- a/application/modules/default/views/scripts/authorization/login.phtml +++ b/application/modules/default/views/scripts/authorization/login.phtml @@ -1,203 +1,199 @@ . **/ $users = $this->newUsers($limit = 216,'created_at','DESC'); $buildMemberUrl = new Default_View_Helper_BuildMemberUrl(); $url_param_redirect = isset($this->redirect) ? 'redirect/'.$this->redirect : null; $this->headMeta()->setName('robots', 'noindex, nofollow'); $imageHelper = new Default_View_Helper_Image(); $regs=""; $ip = $_SERVER[REMOTE_ADDR]; ?> client_ipv6; if (empty($client_ipv6)) { ?> client_ipv4; if (empty($client_ipv4)) { ?>
render('authorization/partials/loginForm.phtml') ?>
$user) { ?>
client_fp; if (empty($fp)) : ?> inlineScript()->appendScript( ' $(document).ready(function(){ PartialJsonLogin.setup(); }); '); diff --git a/httpdocs/tools/iptool/iptool.js b/httpdocs/tools/iptool/iptool.js deleted file mode 100644 index 312518f34..000000000 --- a/httpdocs/tools/iptool/iptool.js +++ /dev/null @@ -1,105 +0,0 @@ -const os = require('os'); - -function _normalizeFamily(family) { - return family ? family.toLowerCase() : 'ipv4'; -} - -function isLoopback(addr) { - return /^(::f{4}:)?127\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})/ - .test(addr) || - /^fe80::1$/.test(addr) || - /^::1$/.test(addr) || - /^::$/.test(addr); -}; - -function isPrivate(addr) { - return /^(::f{4}:)?10\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/i - .test(addr) || - /^(::f{4}:)?192\.168\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(addr) || - /^(::f{4}:)?172\.(1[6-9]|2\d|30|31)\.([0-9]{1,3})\.([0-9]{1,3})$/i - .test(addr) || - /^(::f{4}:)?127\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(addr) || - /^(::f{4}:)?169\.254\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(addr) || - /^f[cd][0-9a-f]{2}:/i.test(addr) || - /^fe80:/i.test(addr) || - /^::1$/.test(addr) || - /^::$/.test(addr); -}; - -function isPublic(addr) { - return !isPrivate(addr); -}; - -// -// Default to `ipv4` -// -function loopback(family) { - family = _normalizeFamily(family); - - if (family !== 'ipv4' && family !== 'ipv6') { - throw new Error('family must be ipv4 or ipv6'); - } - - return family === 'ipv4' ? '127.0.0.1' : 'fe80::1'; -}; - - -// -// ### function address (name, family) -// #### @name {string|'public'|'private'} **Optional** Name or security -// of the network interface. -// #### @family {ipv4|ipv6} **Optional** IP family of the address (defaults -// to ipv4). -// -// Returns the address for the network interface on the current system with -// the specified `name`: -// * String: First `family` address of the interface. -// If not found see `undefined`. -// * 'public': the first public ip address of family. -// * 'private': the first private ip address of family. -// * undefined: First address with `ipv4` or loopback address `127.0.0.1`. -// -function localIpUrl(name, family) { - var interfaces = os.networkInterfaces(); - var all; - // - // Default to `ipv4` - // - family = _normalizeFamily(family); - - // - // If a specific network interface has been named, - // return the address. - // - if (name && name !== 'private' && name !== 'public') { - var res = interfaces[name].filter(function (details) { - var itemFamily = details.family.toLowerCase(); - return itemFamily === family; - }); - if (res.length === 0) - return undefined; - return res[0].address; - } - - var all = Object.keys(interfaces).map(function (nic) { - // - // Note: name will only be `public` or `private` - // when this is called. - // - var addresses = interfaces[nic].filter(function (details) { - details.family = details.family.toLowerCase(); - if (details.family !== family || isLoopback(details.address)) { - return false; - } else if (!name) { - return true; - } - - return name === 'public' ? isPrivate(details.address) : isPublic(details.address); - }); - - return addresses.length ? addresses[0].address : undefined; - }).filter(Boolean); - - return !all.length ? loopback(family) : all[0]; -} -