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 Groups
|
||||
* @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 25 Mar 2013
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
@@ -50,6 +50,7 @@ class _groups extends \IPS\Dispatcher\Controller
|
||||
$table = new \IPS\Helpers\Table\Db( 'core_groups', \IPS\Http\Url::internal( 'app=core&module=members&controller=groups' ) );
|
||||
|
||||
$table->include = array( 'word_custom', 'members' );
|
||||
$table->noSort = array( 'members' );
|
||||
$table->langPrefix = 'acpgroups_';
|
||||
|
||||
$table->joins = array(
|
||||
@@ -68,9 +69,8 @@ class _groups extends \IPS\Dispatcher\Controller
|
||||
$onlineGuests = \IPS\Db::i()->select( 'COUNT(*)', 'core_sessions', array( 'login_type=? AND running_time>?', \IPS\Session\Front::LOGIN_TYPE_GUEST, \IPS\DateTime::create()->sub( new \DateInterval( 'PT30M' ) )->getTimeStamp() ) )->first();
|
||||
return \IPS\Member::loggedIn()->language()->addToStack( 'online_guests', FALSE, array( 'pluralize' => array( $onlineGuests ) ) );
|
||||
}
|
||||
|
||||
$count = \IPS\Db::i()->select( 'COUNT(*)', 'core_members', array( 'member_group_id=? OR FIND_IN_SET( ?, mgroup_others )', $row['g_id'], $row['g_id'] ) )->first();
|
||||
return "<!--{$count}--><a href='" . \IPS\Http\Url::internal( 'app=core&module=members&controller=members&advanced_search_submitted=1&csrfKey=' . \IPS\Session::i()->csrfKey . '&members_member_group_id=' . $row['g_id'] ) . "'>{$count}</a>";
|
||||
|
||||
return \IPS\Theme::i()->getTemplate( 'members' )->memberCounts( $row );
|
||||
}
|
||||
);
|
||||
|
||||
@@ -123,6 +123,15 @@ class _groups extends \IPS\Dispatcher\Controller
|
||||
);
|
||||
}
|
||||
|
||||
if ( \IPS\Member::loggedIn()->hasAcpRestriction( 'core', 'members', 'member_export' ) )
|
||||
{
|
||||
$return['download'] = array(
|
||||
'icon' => 'cloud-download',
|
||||
'title' => 'members_export',
|
||||
'link' => \IPS\Http\Url::internal( 'app=core&module=members&controller=members&do=export&_new=1&group=' ) . $row['g_id'],
|
||||
);
|
||||
}
|
||||
|
||||
if ( \IPS\Member::loggedIn()->hasAcpRestriction( 'core', 'members', 'groups_delete' ) AND !in_array( $row['g_id'], array( \IPS\Settings::i()->guest_group, \IPS\Settings::i()->member_group, \IPS\Settings::i()->admin_group ) ) )
|
||||
{
|
||||
$return['delete'] = array(
|
||||
@@ -140,6 +149,17 @@ class _groups extends \IPS\Dispatcher\Controller
|
||||
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack('groups');
|
||||
\IPS\Output::i()->output .= \IPS\Theme::i()->getTemplate( 'global' )->block( 'groups', (string) $table );
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch the number of members in this group
|
||||
*
|
||||
* @note Fetched via AJAX after the page is loaded as this can be intensive with lots of groups and lots of members
|
||||
* @return void
|
||||
*/
|
||||
public function getCount()
|
||||
{
|
||||
\IPS\Output::i()->sendOutput( \IPS\Member\Group::load( \IPS\Request::i()->group )->getCount(), 200, 'text/html' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Add/Edit Group
|
||||
@@ -239,7 +259,7 @@ class _groups extends \IPS\Dispatcher\Controller
|
||||
|
||||
/* Start a new section */
|
||||
$form->addTab( '__app_' . $class::$permApp );
|
||||
$matrix = new \IPS\Helpers\Form\Matrix;
|
||||
$matrix = new \IPS\Helpers\Form\Matrix( $class );
|
||||
$matrix->classes = array( 'cGroupPermissions' );
|
||||
$matrix->showTooltips = TRUE;
|
||||
|
||||
@@ -268,7 +288,7 @@ class _groups extends \IPS\Dispatcher\Controller
|
||||
foreach( $current[ $class::$permApp ][ $class::$permType ] AS $x => $y )
|
||||
{
|
||||
$matrix->checkAlls[ $class::$permissionLangPrefix . 'perm__' . $k ] = TRUE;
|
||||
if ( mb_stripos( $y["perm_{$v}"], $group->g_id ) === FALSE AND $y["perm_{$v}"] !== '*' )
|
||||
if ( $y["perm_{$v}"] !== '*' AND !in_array( $group->g_id, explode( ',', $y["perm_{$v}"] ) ) )
|
||||
{
|
||||
$matrix->checkAlls[ $class::$permissionLangPrefix . 'perm__' . $k ] = FALSE;
|
||||
break;
|
||||
@@ -304,6 +324,8 @@ class _groups extends \IPS\Dispatcher\Controller
|
||||
$class::load( $permTypeId )->changePermissions( $group, $perms );
|
||||
}
|
||||
}
|
||||
/* Log */
|
||||
\IPS\Session::i()->log( 'permissions_adjusted_node', array( "core_group_". $group->g_id => TRUE ) );
|
||||
|
||||
/* Redirect */
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=core&module=members&controller=groups' ), 'saved' );
|
||||
@@ -351,6 +373,9 @@ class _groups extends \IPS\Dispatcher\Controller
|
||||
public function delete()
|
||||
{
|
||||
\IPS\Dispatcher::i()->checkAcpPermission( 'groups_delete' );
|
||||
|
||||
/* Make sure the user confirmed the deletion */
|
||||
\IPS\Request::i()->confirmedDelete();
|
||||
|
||||
/* Load group */
|
||||
try
|
||||
@@ -362,6 +387,7 @@ class _groups extends \IPS\Dispatcher\Controller
|
||||
{
|
||||
$form = new \IPS\Helpers\Form( 'form', 'delete' );
|
||||
$form->add( new \IPS\Helpers\Form\Select( 'delete_group_move_to', NULL, TRUE, array( 'options' => \IPS\Member\Group::groups( \IPS\Member::loggedIn()->hasAcpRestriction( 'core', 'members', 'member_move_admin2' ), FALSE ), 'parse' => 'normal' ) ) );
|
||||
$form->hiddenValues['wasConfirmed'] = 1;
|
||||
if ( $values = $form->values() )
|
||||
{
|
||||
\IPS\Db::i()->update( 'core_members', array( 'member_group_id' => $values['delete_group_move_to'] ), array( 'member_group_id=?', $group->g_id ) );
|
||||
|
||||
@@ -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 );
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -2,9 +2,9 @@
|
||||
/**
|
||||
* @brief Recount and Reset 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 24 Oct 2013
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
@@ -33,96 +33,26 @@ class _reset extends \IPS\Dispatcher\Controller
|
||||
\IPS\Dispatcher::i()->checkAcpPermission( 'member_recount_content' );
|
||||
return parent::execute();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Redirector to rebuild things
|
||||
*
|
||||
* Queue the content recount task
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __call( $method, $args )
|
||||
public function posts()
|
||||
{
|
||||
\IPS\Output::i()->output = new \IPS\Helpers\MultipleRedirect(
|
||||
\IPS\Http\Url::internal( 'app=core&module=members&controller=reset&do=redirector&member_recount_each_content_check=' . intval( $method == 'posts' ) . '&member_recount_each_reputation_check=' . intval( $method == 'rep' ) ),
|
||||
function( $data )
|
||||
{
|
||||
/* Is this the first cycle? */
|
||||
if ( ! is_array( $data ) )
|
||||
{
|
||||
/* Start importing */
|
||||
$data = array(
|
||||
'member_recount_each_content_check' => \IPS\Request::i()->member_recount_each_content_check,
|
||||
'member_recount_each_reputation_check' => \IPS\Request::i()->member_recount_each_reputation_check,
|
||||
'lastId' => 0,
|
||||
'processing' => true,
|
||||
'total' => \IPS\Db::i()->select( 'COUNT(*)', 'core_members' )->first(),
|
||||
'done' => 0
|
||||
);
|
||||
|
||||
return array( $data, \IPS\Member::loggedIn()->language()->addToStack('processing') );
|
||||
}
|
||||
|
||||
/* Grab something to build */
|
||||
if ( $data['processing'] )
|
||||
{
|
||||
try
|
||||
{
|
||||
$member_id = \IPS\Db::i()->select( 'member_id', 'core_members', array( 'member_id > ?', intval( $data['lastId'] ) ), 'member_id ASC', array( 0, 1 ) )->first();
|
||||
|
||||
if ( ! empty( $member_id ) )
|
||||
{
|
||||
$member = \IPS\Member::load( $member_id );
|
||||
if ( $data['member_recount_each_content_check'] )
|
||||
{
|
||||
$member->recountContent();
|
||||
}
|
||||
|
||||
if ( $data['member_recount_each_reputation_check'] )
|
||||
{
|
||||
$member->recountReputation();
|
||||
}
|
||||
|
||||
$data['lastId'] = $member_id;
|
||||
$data['done']++;
|
||||
}
|
||||
else
|
||||
{
|
||||
$data['lastId'] = 0;
|
||||
$data['processing'] = false;
|
||||
}
|
||||
|
||||
return array( $data, \IPS\Member::loggedIn()->language()->addToStack('processing'), 100 / $data['total'] * $data['done'] );
|
||||
}
|
||||
catch( \UnderflowException $ex )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* All Done.. */
|
||||
return null;
|
||||
}
|
||||
},
|
||||
function()
|
||||
{
|
||||
/* Finished */
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=core&module=members&controller=members' ), 'completed' );
|
||||
}
|
||||
);
|
||||
|
||||
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack('member_reset_recount_title');
|
||||
|
||||
/* Output */
|
||||
if ( \IPS\Request::i()->isAjax() )
|
||||
{
|
||||
\IPS\Output::i()->sendOutput( \IPS\Theme::i()->getTemplate( 'global', 'core' )->blankTemplate( \IPS\Output::i()->output ), 200, 'text/html', \IPS\Output::i()->httpHeaders );
|
||||
}
|
||||
else
|
||||
{
|
||||
\IPS\Output::i()->buildMetaTags();
|
||||
\IPS\Output::i()->sendOutput( \IPS\Theme::i()->getTemplate( 'global', 'core' )->globalTemplate( \IPS\Output::i()->title, \IPS\Output::i()->output, array( 'app' => \IPS\Dispatcher::i()->application->directory, 'module' => \IPS\Dispatcher::i()->module->key, 'controller' => \IPS\Dispatcher::i()->controller ) ), 200, 'text/html', \IPS\Output::i()->httpHeaders );
|
||||
}
|
||||
|
||||
return;
|
||||
\IPS\Task::queue( 'core', 'RecountMemberContent', array(), 4 );
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=core&module=members&controller=members' ), \IPS\Member::loggedIn()->language()->addToStack( 'member_recount_content_process' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Queue the reputation recount task
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function rep()
|
||||
{
|
||||
\IPS\Task::queue( 'core', 'RecountMemberReputation', array(), 4 );
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=core&module=members&controller=members' ), \IPS\Member::loggedIn()->language()->addToStack( 'member_recount_rep_process' ) );
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user