Version 4.1.19
This commit is contained in:
1 parent
28bd025b35
commit
2bd5025018
2674 files changed
+233518
-77766
No files matched your search
@@ -2,9 +2,9 @@
|
||||
/**
|
||||
* @brief IP Address Tools
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @package IPS Community Suite
|
||||
* @since 19 Apr 2013
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
@@ -66,24 +66,38 @@ class _ip extends \IPS\Dispatcher\Controller
|
||||
$exploded = explode( '_', \IPS\Request::i()->area );
|
||||
$extensions = \IPS\Application::load( $exploded[0] )->extensions( 'core', 'IpAddresses' );
|
||||
$class = $extensions[ mb_substr( \IPS\Request::i()->area, mb_strlen( $exploded[0] ) + 1 ) ];
|
||||
\IPS\Output::i()->output = $class->findByIp( $ip, $url->setQueryString( 'area', \IPS\Request::i()->area ) );
|
||||
\IPS\Output::i()->output = $class->findByIp( str_replace( '*', '%', $ip ), $url->setQueryString( 'area', \IPS\Request::i()->area ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
$geolocation = NULL;
|
||||
$map = NULL;
|
||||
try
|
||||
$geolocation = NULL;
|
||||
$map = NULL;
|
||||
$hostName = $ip;
|
||||
|
||||
if( filter_var( $ip, FILTER_VALIDATE_IP ) !== false )
|
||||
{
|
||||
$geolocation = \IPS\GeoLocation::getByIp( $ip );
|
||||
$map = $geolocation->map()->render( 400, 350, 0.6 );
|
||||
try
|
||||
{
|
||||
$geolocation = \IPS\GeoLocation::getByIp( $ip );
|
||||
$map = $geolocation->map()->render( 400, 350, 0.6 );
|
||||
}
|
||||
catch ( \Exception $e ) {}
|
||||
|
||||
$hostName = @gethostbyaddr( $ip );
|
||||
}
|
||||
catch ( \Exception $e ) {}
|
||||
|
||||
$contentCounts = array();
|
||||
$otherCounts = array();
|
||||
foreach ( \IPS\Application::allExtensions( 'core', 'IpAddresses' ) as $k => $ext )
|
||||
{
|
||||
$count = $ext->findByIp( $ip );
|
||||
{
|
||||
/* If the method does not exist, we presume it is supported - this is for legacy purposes as the method is new so
|
||||
third parties won't have it present */
|
||||
if( method_exists( $ext, 'supportedInAcp' ) AND !$ext->supportedInAcp() )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$count = $ext->findByIp( str_replace( '*', '%', $ip ) );
|
||||
if ( $count !== NULL )
|
||||
{
|
||||
if ( isset( $ext->class ) )
|
||||
@@ -101,7 +115,7 @@ class _ip extends \IPS\Dispatcher\Controller
|
||||
}
|
||||
}
|
||||
|
||||
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'members', 'core', 'global' )->ipLookup( $url, $geolocation, $map, array_merge( $otherCounts, $contentCounts ) );
|
||||
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'members', 'core', 'global' )->ipLookup( $url, $geolocation, $map, $hostName, array_merge( $otherCounts, $contentCounts ) );
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -109,9 +123,9 @@ class _ip extends \IPS\Dispatcher\Controller
|
||||
$form = new \IPS\Helpers\Form( 'form', 'continue' );
|
||||
$form->add( new \IPS\Helpers\Form\Text( 'ip_address', NULL, TRUE, array(), function( $val )
|
||||
{
|
||||
if( filter_var( $val, FILTER_VALIDATE_IP ) === false )
|
||||
if( trim( $val, '*' ) == '' )
|
||||
{
|
||||
throw new \DomainException('ip_address_bad');
|
||||
throw new \DomainException('not_just_asterisk');
|
||||
}
|
||||
} ) );
|
||||
|
||||
@@ -119,9 +133,17 @@ class _ip extends \IPS\Dispatcher\Controller
|
||||
{
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=core&module=members&controller=ip' )->setQueryString( 'ip', $values['ip_address'] ) );
|
||||
}
|
||||
|
||||
$members = new \IPS\Helpers\Form( 'members', 'continue' );
|
||||
$members->add( new \IPS\Helpers\Form\Member( 'ip_username', NULL, TRUE ) );
|
||||
|
||||
if ( $values = $members->values() )
|
||||
{
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=core&module=members&controller=members&do=ip' )->setQueryString( 'id', $values['ip_username']->member_id ) );
|
||||
}
|
||||
|
||||
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack('menu__core_members_ip');
|
||||
\IPS\Output::i()->output = $form;
|
||||
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'members' )->ipform( $form, $members );
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user