Version 3.2.3
This commit is contained in:
1 parent
ae5c01cc78
commit
78706903a2
2641 files changed
+228363
-201264
No files matched your search
@@ -5,6 +5,6 @@
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -3,19 +3,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Member form manipulation
|
||||
* Last Updated: $Date: 2010-01-15 14:28:09 -0500 (Fri, 15 Jan 2010) $
|
||||
* Last Updated: $Date: 2011-03-10 21:04:50 -0500 (Thu, 10 Mar 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: josh $
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since 1st march 2002
|
||||
* @version $Revision: 5715 $
|
||||
* @version $Revision: 8024 $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -33,7 +33,6 @@ class admin_member_form__members implements admin_member_form
|
||||
* This can be left blank and the application title will
|
||||
* be used
|
||||
*
|
||||
* @access public
|
||||
* @var string Tab name
|
||||
*/
|
||||
public $tab_name = "";
|
||||
@@ -51,7 +50,6 @@ class admin_member_form__members implements admin_member_form
|
||||
* Use the format:
|
||||
* $array[] = array( 'img' => '', 'url' => '', 'title' => '' );
|
||||
*
|
||||
* @access public
|
||||
* @author Matt Mecham
|
||||
* @param array Member data
|
||||
* @return array Array of links
|
||||
@@ -106,7 +104,6 @@ class admin_member_form__members implements admin_member_form
|
||||
/**
|
||||
* Returns content for the page.
|
||||
*
|
||||
* @access public
|
||||
* @author Matt Mecham
|
||||
* @param array Member data
|
||||
* @return array Array of tabs, content
|
||||
@@ -119,7 +116,6 @@ class admin_member_form__members implements admin_member_form
|
||||
/**
|
||||
* Process the entries for saving and return
|
||||
*
|
||||
* @access public
|
||||
* @author Brandon Farber
|
||||
* @return array Multi-dimensional array (core, extendedProfile) for saving
|
||||
*/
|
||||
|
||||
@@ -5,6 +5,6 @@
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -3,19 +3,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* IP.Board messenger attachments plugin
|
||||
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* Last Updated: $Date: 2011-09-20 21:18:18 -0400 (Tue, 20 Sep 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since 6/24/2008
|
||||
* @version $Revision: 5713 $
|
||||
* @version $Revision: 9520 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
@@ -29,7 +29,6 @@ class plugin_msg extends class_attach
|
||||
/**
|
||||
* Module type
|
||||
*
|
||||
* @access public
|
||||
* @var string
|
||||
*/
|
||||
public $module = 'msg';
|
||||
@@ -37,7 +36,6 @@ class plugin_msg extends class_attach
|
||||
/**
|
||||
* Checks the attachment and checks for download / show perms
|
||||
*
|
||||
* @access public
|
||||
* @param integer Attachment id
|
||||
* @return array Attachment data
|
||||
*/
|
||||
@@ -77,7 +75,7 @@ class plugin_msg extends class_attach
|
||||
// Check..
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! isset( $attach['msg_id'] ) OR empty( $attach['msg_id'] ) )
|
||||
if ( empty( $attach['msg_id'] ) )
|
||||
{
|
||||
if( $attach['attach_member_id'] != $this->memberData['member_id'] )
|
||||
{
|
||||
@@ -115,7 +113,6 @@ class plugin_msg extends class_attach
|
||||
/**
|
||||
* Check the attachment and make sure its OK to display
|
||||
*
|
||||
* @access public
|
||||
* @param array Array of ids
|
||||
* @param array Array of relationship ids
|
||||
* @return array Attachment data
|
||||
@@ -216,7 +213,6 @@ class plugin_msg extends class_attach
|
||||
/**
|
||||
* Recounts number of attachments for the articles row
|
||||
*
|
||||
* @access public
|
||||
* @param string Post key
|
||||
* @param integer Related ID
|
||||
* @param array Arguments for query
|
||||
@@ -236,7 +232,7 @@ class plugin_msg extends class_attach
|
||||
|
||||
if ( ! $post_key )
|
||||
{
|
||||
return 0;
|
||||
return array( 'count' => 0 );
|
||||
}
|
||||
|
||||
|
||||
@@ -255,7 +251,6 @@ class plugin_msg extends class_attach
|
||||
/**
|
||||
* Recounts number of attachments for the articles row
|
||||
*
|
||||
* @access public
|
||||
* @param array Attachment data
|
||||
* @return boolean
|
||||
*/
|
||||
@@ -320,7 +315,6 @@ class plugin_msg extends class_attach
|
||||
* Returns TRUE or FALSE
|
||||
* IT really does
|
||||
*
|
||||
* @access public
|
||||
* @param array Ids to check against
|
||||
* @return boolean
|
||||
*/
|
||||
@@ -334,7 +328,6 @@ class plugin_msg extends class_attach
|
||||
* Returns TRUE or FALSE
|
||||
* IT really does
|
||||
*
|
||||
* @access public
|
||||
* @param array Attachment data
|
||||
* @return boolean
|
||||
*/
|
||||
@@ -388,7 +381,6 @@ class plugin_msg extends class_attach
|
||||
* Return 'space_allowed' as 0 to allow unlimited uploads
|
||||
* Return 'max_single_upload' as 0 to not set a limit
|
||||
*
|
||||
* @access public
|
||||
* @param string MD5 post key
|
||||
* @param id Member ID
|
||||
* @return array [ 'space_used', 'space_left', 'space_allowed', 'max_single_upload' ]
|
||||
@@ -432,7 +424,7 @@ class plugin_msg extends class_attach
|
||||
'from' => 'attachments',
|
||||
'where' => "attach_post_key='".$post_key."'" ) );
|
||||
|
||||
$space_used = intval( $_space_used['figure'] );
|
||||
$space_used = $_space_used['figure'] ? $_space_used['figure'] : 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -444,7 +436,7 @@ class plugin_msg extends class_attach
|
||||
'from' => 'attachments',
|
||||
'where' => 'attach_member_id='.$member_id . " AND attach_rel_module IN( 'post', 'msg' )" ) );
|
||||
|
||||
$space_used = intval( $_space_used['figure'] );
|
||||
$space_used = $_space_used['figure'] ? $_space_used['figure'] : 0;
|
||||
}
|
||||
//-----------------------------------------
|
||||
// Generate space allowed figure
|
||||
@@ -458,9 +450,9 @@ class plugin_msg extends class_attach
|
||||
'from' => 'attachments',
|
||||
'where' => 'attach_member_id='.$member_id . " AND attach_rel_module IN( 'post', 'msg' )" ) );
|
||||
|
||||
$g_space_used = intval( $_g_space_used['figure'] );
|
||||
$g_space_used = $_g_space_used['figure'] ? $_g_space_used['figure'] : 0;
|
||||
|
||||
if( intval( ( $this->memberData['g_attach_max'] * 1024 ) - $g_space_used ) < 0 )
|
||||
if( ( $this->memberData['g_attach_max'] * 1024 ) - $g_space_used < 0 )
|
||||
{
|
||||
$space_used = $g_space_used;
|
||||
$total_space_allowed = $this->memberData['g_attach_max'] * 1024;
|
||||
@@ -537,7 +529,6 @@ class plugin_msg extends class_attach
|
||||
* You can omit any of these settings and IPB will use the default
|
||||
* settings (which are the ones entered into the ACP for post thumbnails)
|
||||
*
|
||||
* @access public
|
||||
* @return boolean
|
||||
*/
|
||||
public function getSettings()
|
||||
|
||||
@@ -3,19 +3,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Core extensions
|
||||
* Last Updated: $Date: 2010-09-15 19:24:12 -0400 (Wed, 15 Sep 2010) $
|
||||
* Last Updated: $Date: 2011-03-10 21:04:50 -0500 (Thu, 10 Mar 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since 20th February 2002
|
||||
* @version $Rev: 6882 $
|
||||
* @version $Rev: 8024 $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -33,7 +33,6 @@ class publicSessions__members
|
||||
* current_appcomponent, current_module and current_section are automatically
|
||||
* stored. This function allows you to add specific variables in.
|
||||
*
|
||||
* @access public
|
||||
* @author Matt Mecham
|
||||
* @return array
|
||||
*/
|
||||
@@ -48,7 +47,7 @@ class publicSessions__members
|
||||
'location_2_type' => '',
|
||||
'location_2_id' => 0 );
|
||||
|
||||
if( ( isset(ipsRegistry::$request['id']) AND ipsRegistry::$request['id'] ) AND ipsRegistry::$request['section'] == 'view' AND ipsRegistry::$request['module'] == 'profile' )
|
||||
if( !empty(ipsRegistry::$request['id']) AND ipsRegistry::$request['section'] == 'view' AND ipsRegistry::$request['module'] == 'profile' )
|
||||
{
|
||||
$array['location_1_type'] = 'profile';
|
||||
$array['location_1_id'] = ipsRegistry::$request['id'];
|
||||
@@ -60,7 +59,6 @@ class publicSessions__members
|
||||
/**
|
||||
* Parse/format the online list data for the records
|
||||
*
|
||||
* @access public
|
||||
* @author Brandon Farber
|
||||
* @param array Online list rows to check against
|
||||
* @return array Online list rows parsed
|
||||
|
||||
@@ -2,19 +2,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Core variables extension file
|
||||
* Last Updated: $Date: 2010-09-22 11:32:51 -0400 (Wed, 22 Sep 2010) $
|
||||
* Last Updated: $Date: 2010-12-19 21:06:50 -0500 (Sun, 19 Dec 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: terabyte $
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since 1st march 2002
|
||||
* @version $Revision: 6904 $
|
||||
* @version $Revision: 7452 $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -76,7 +76,7 @@ if( isset( $_GET['section'] ) && $_GET['section'] == 'status' )
|
||||
}
|
||||
|
||||
# PROFILE
|
||||
if ( ( isset( $_GET['showuser'] ) && $_GET['showuser'] ) OR $_GET['module'] == 'profile' AND $_GET['section'] == 'view' )
|
||||
if ( !empty( $_GET['showuser'] ) OR ( $_GET['module'] == 'profile' AND $_GET['section'] == 'view' ) )
|
||||
{
|
||||
$_LOAD['ranks'] = 1;
|
||||
$_LOAD['profilefields'] = 1;
|
||||
@@ -87,6 +87,11 @@ if ( ( isset( $_GET['showuser'] ) && $_GET['showuser'] ) OR $_GET['module'] == '
|
||||
$_LOAD['moderators'] = 1;
|
||||
}
|
||||
|
||||
if( IN_ACP )
|
||||
{
|
||||
$_LOAD['moderators'] = 1;
|
||||
}
|
||||
|
||||
/* Never, ever remove or re-order these options!!
|
||||
* Feel free to add, though. :) */
|
||||
|
||||
|
||||
@@ -3,17 +3,17 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Dashboard Notifications
|
||||
* Last Updated: $Date
|
||||
*
|
||||
* @author $Author: mark $
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 6688 $
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 8397 $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -44,12 +44,13 @@ class dashboardNotifications__members
|
||||
{
|
||||
if( $this->settings['reg_auth_type'] == 'admin' )
|
||||
{
|
||||
$where = " new_reg=1";
|
||||
$where = "v.new_reg=1";
|
||||
}
|
||||
else
|
||||
{
|
||||
$where = "new_reg=1 AND user_verified=1";
|
||||
$where = "v.new_reg=1 AND v.user_verified=1";
|
||||
}
|
||||
|
||||
$count = $this->DB->buildAndFetch( array( 'select' => 'COUNT(*) as count',
|
||||
'from' => array( 'validating' => 'v' ),
|
||||
'where' => "v.lost_pass=0 AND m.member_group_id={$this->settings['auth_group']} AND {$where}",
|
||||
@@ -61,7 +62,7 @@ class dashboardNotifications__members
|
||||
|
||||
if ( $count )
|
||||
{
|
||||
$entries[] = array( $this->lang->words['cp_validations'], sprintf( $this->lang->words['cp_validations_info'], $count ) . ' <a href="' . ipsRegistry::getClass('output')->buildUrl( 'app=members&module=members§ion=members§ion=tools&do=validating', 'admin' ) . '">' . $this->lang->words['cp_validations_review'] . '</a>' );
|
||||
$entries[] = array( $this->lang->words['cp_validations'], sprintf( $this->lang->words['cp_validations_info'], $count ) . ' <a href="' . ipsRegistry::getClass('output')->buildUrl( 'app=members&module=members&section=members&do=members_overview&type=validating', 'admin' ) . '">' . $this->lang->words['cp_validations_review'] . '</a>' );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,18 +2,18 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Define data hook locations (Members)
|
||||
* Last Updated: $Date: 2010-10-12 13:04:59 -0400 (Tue, 12 Oct 2010) $
|
||||
* Last Updated: $Date: 2011-05-18 04:49:10 -0400 (Wed, 18 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 6964 $
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 8812 $
|
||||
*/
|
||||
|
||||
$dataHookLocations = array(
|
||||
@@ -27,8 +27,4 @@ $dataHookLocations = array(
|
||||
array( 'profileCommentNew', 'Profile: New comment' ),
|
||||
array( 'profileFriendsNew', 'Profile: New friend' ),
|
||||
|
||||
/* OUTPUT ARRAYS */
|
||||
array( 'memberListData', 'Member List View Output' ),
|
||||
array( 'onlineUsersListData', 'Online Users List Output' ),
|
||||
|
||||
);
|
||||
@@ -3,19 +3,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* BBCode Management : Determines if bbcode can be used in this section
|
||||
* Last Updated: $LastChangedDate: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* Last Updated: $LastChangedDate: 2010-12-17 07:40:13 -0500 (Fri, 17 Dec 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since 27th January 2004
|
||||
* @version $Rev: 5713 $
|
||||
* @version $Rev: 7442 $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -7,10 +7,10 @@
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package Invision Power Board
|
||||
* @subpackage Members
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since 20th February 2002
|
||||
* @version $Rev: 4136 $
|
||||
*
|
||||
|
||||
@@ -3,19 +3,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* RSS output plugin :: posts
|
||||
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since 6/24/2008
|
||||
* @version $Revision: 5713 $
|
||||
* @version $Revision: 8644 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
@@ -29,24 +29,22 @@ class furlRedirect_members
|
||||
/**
|
||||
* Key type: Type of action (topic/forum)
|
||||
*
|
||||
* @access private
|
||||
* @var string
|
||||
*/
|
||||
private $_type = '';
|
||||
protected $_type = '';
|
||||
|
||||
/**
|
||||
* Key ID
|
||||
*
|
||||
* @access private
|
||||
* @var int
|
||||
*/
|
||||
private $_id = 0;
|
||||
protected $_id = 0;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
*/
|
||||
function __construct( ipsRegistry $registry )
|
||||
public function __construct( ipsRegistry $registry )
|
||||
{
|
||||
$this->registry = $registry;
|
||||
$this->DB = $registry->DB();
|
||||
@@ -57,7 +55,6 @@ class furlRedirect_members
|
||||
* Set the key ID
|
||||
* <code>furlRedirect_forums::setKey( 'topic', 12 );</code>
|
||||
*
|
||||
* @access public
|
||||
* @param string Type
|
||||
* @param mixed Value
|
||||
*/
|
||||
@@ -70,9 +67,8 @@ class furlRedirect_members
|
||||
/**
|
||||
* Set up the key by URI
|
||||
*
|
||||
* @access public
|
||||
* @param string URI (example: index.php?showtopic=5&view=getlastpost)
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function setKeyByUri( $uri )
|
||||
{
|
||||
@@ -103,7 +99,6 @@ class furlRedirect_members
|
||||
/**
|
||||
* Return the SEO title
|
||||
*
|
||||
* @access public
|
||||
* @return string The SEO friendly name
|
||||
*/
|
||||
public function fetchSeoTitle()
|
||||
@@ -122,7 +117,6 @@ class furlRedirect_members
|
||||
/**
|
||||
* Return the SEO title for a user
|
||||
*
|
||||
* @access public
|
||||
* @return string The SEO friendly name
|
||||
*/
|
||||
public function _fetchSeoTitle_user()
|
||||
|
||||
@@ -2,19 +2,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Sets up SEO templates
|
||||
* Last Updated: $Date: 2010-06-15 03:53:37 -0400 (Tue, 15 Jun 2010) $
|
||||
* Last Updated: $Date: 2011-04-11 06:49:17 -0400 (Mon, 11 Apr 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: matt $
|
||||
* @author $Author: mmecham $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since 20th February 2002
|
||||
* @version $Rev: 6531 $
|
||||
* @version $Rev: 8294 $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -52,6 +52,17 @@ $_SEOTEMPLATES = array(
|
||||
'in' => array( 'regex' => "#/user/(\d+?)-#i",
|
||||
'matches' => array( array( 'showuser', '$1' ) ) ) ),
|
||||
|
||||
|
||||
'members_status_single' => array( 'app' => 'members',
|
||||
'allowRedirect' => 0,
|
||||
'out' => array( '#app=members(?:&|&)module=profile(?:&|&)section=status(?:&|&)type=single(?:&|&)status_id=(\d+?)(&|$)#i', 'statuses/id/$1/$2' ),
|
||||
'in' => array( 'regex' => "#/statuses/id/(\d+?)/#i",
|
||||
'matches' => array( array( 'app' , 'members' ),
|
||||
array( 'section', 'status' ),
|
||||
array( 'module' , 'profile' ),
|
||||
array( 'type' , 'single' ),
|
||||
array( 'status_id', '$1' ) ) ) ),
|
||||
|
||||
'members_status_friends'=> array( 'app' => 'members',
|
||||
'allowRedirect' => 0,
|
||||
'out' => array( '#app=members(?:&|&)module=profile(?:&|&)section=status(?:&|&)type=friends(&|$)#i', 'statuses/friends/$2' ),
|
||||
|
||||
@@ -5,6 +5,6 @@
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -3,19 +3,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Forum permissions mappings
|
||||
* Last Updated: $Date: 2010-04-26 19:40:44 +0100 (Mon, 26 Apr 2010) $
|
||||
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $author$
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 6179 $
|
||||
**/
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 8644 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
@@ -28,18 +28,17 @@ if ( ! defined( 'IN_IPB' ) )
|
||||
*
|
||||
* @author $author$
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 6179 $
|
||||
**/
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 8644 $
|
||||
*/
|
||||
class membersMemberSync
|
||||
{
|
||||
/**
|
||||
* Registry reference
|
||||
*
|
||||
* @access public
|
||||
* @var object
|
||||
*/
|
||||
public $registry;
|
||||
@@ -47,9 +46,8 @@ class membersMemberSync
|
||||
/**
|
||||
* CONSTRUCTOR
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
**/
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->registry = ipsRegistry::instance();
|
||||
@@ -58,10 +56,9 @@ class membersMemberSync
|
||||
/**
|
||||
* This method is run when a member is flagged as a spammer
|
||||
*
|
||||
* @access public
|
||||
* @param array $member Array of member data
|
||||
* @return void
|
||||
**/
|
||||
* @return @e void
|
||||
*/
|
||||
public function onSetAsSpammer( $member )
|
||||
{
|
||||
/* Load status class */
|
||||
@@ -80,10 +77,9 @@ class membersMemberSync
|
||||
/**
|
||||
* This method is run when a member is un-flagged as a spammer
|
||||
*
|
||||
* @access public
|
||||
* @param array $member Array of member data
|
||||
* @return void
|
||||
**/
|
||||
* @return @e void
|
||||
*/
|
||||
public function onUnSetAsSpammer( $member )
|
||||
{
|
||||
|
||||
@@ -92,10 +88,9 @@ class membersMemberSync
|
||||
/**
|
||||
* This method is called after a member account has been removed
|
||||
*
|
||||
* @access public
|
||||
* @param string $ids SQL IN() clause
|
||||
* @return void
|
||||
**/
|
||||
* @return @e void
|
||||
*/
|
||||
public function onDelete( $mids )
|
||||
{
|
||||
/* Delete Status Updates - note, we can't do this via memberStatus class, since we no longer have the member data */
|
||||
|
||||
+1
-1
@@ -5,6 +5,6 @@
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,184 @@
|
||||
<?php
|
||||
/**
|
||||
* @file plugin_banned.php Moderator control panel plugin: banned members
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $Author: bfarber $
|
||||
* @since 2/17/2011
|
||||
* $LastChangedDate: 2011-08-29 22:12:22 -0400 (Mon, 29 Aug 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 9425 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @class plugin_members_banned
|
||||
* @brief Moderator control panel plugin: banned members
|
||||
*
|
||||
*/
|
||||
class plugin_members_banned
|
||||
{
|
||||
/**
|
||||
* Registry Object Shortcuts
|
||||
*
|
||||
* @var $registry
|
||||
* @var $DB
|
||||
* @var $settings
|
||||
* @var $request
|
||||
* @var $lang
|
||||
* @var $member
|
||||
* @var $memberData
|
||||
* @var $cache
|
||||
* @var $caches
|
||||
*/
|
||||
protected $registry;
|
||||
protected $DB;
|
||||
protected $settings;
|
||||
protected $request;
|
||||
protected $lang;
|
||||
protected $member;
|
||||
protected $memberData;
|
||||
protected $cache;
|
||||
protected $caches;
|
||||
|
||||
/**
|
||||
* Main function executed automatically by the controller
|
||||
*
|
||||
* @param object $registry Registry object
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Make shortcuts
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry = $registry;
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
$this->member = $this->registry->member();
|
||||
$this->memberData =& $this->registry->member()->fetchMemberData();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
$this->lang = $this->registry->class_localization;
|
||||
|
||||
/* Load language strings.. */
|
||||
$this->lang->loadLanguageFile( array( 'public_list' ), 'members' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the primary tab key for the navigation bar
|
||||
*
|
||||
* @return @e string
|
||||
*/
|
||||
public function getPrimaryTab()
|
||||
{
|
||||
return 'manage_members';
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the secondary tab key for the navigation bar
|
||||
*
|
||||
* @return @e string
|
||||
*/
|
||||
public function getSecondaryTab()
|
||||
{
|
||||
return 'banned';
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if we can view tab
|
||||
*
|
||||
* @param array $permissions Moderator permissions
|
||||
* @return @e bool
|
||||
*/
|
||||
public function canView( $permissions )
|
||||
{
|
||||
if( $this->memberData['g_is_supmod'] OR ( $this->memberData['is_mod'] AND $permissions['allow_warn'] AND $this->settings['warn_mod_ban'] ) )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute plugin
|
||||
*
|
||||
* @param array $permissions Moderator permissions
|
||||
* @return @e string
|
||||
*/
|
||||
public function executePlugin( $permissions )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Check permissions
|
||||
//-----------------------------------------
|
||||
|
||||
if( !$this->canView( $permissions ) )
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
/* Add some CSS */
|
||||
$this->registry->output->addToDocumentHead( 'importcss', "{$this->settings['css_base_url']}style_css/{$this->registry->output->skin['_csscacheid']}/ipb_mlist.css" );
|
||||
|
||||
//-----------------------------------------
|
||||
// Get 10 banned members
|
||||
//-----------------------------------------
|
||||
|
||||
$members = array();
|
||||
$_bannedGroup = '';
|
||||
|
||||
if( $this->settings['banned_group'] )
|
||||
{
|
||||
$_bannedGroup = " OR m.member_group_id=" . $this->settings['banned_group'];
|
||||
}
|
||||
|
||||
$st = intval($this->request['st']);
|
||||
$total = $this->DB->buildAndFetch( array( 'select' => 'count(*) as members', 'from' => 'members', 'where' => "member_banned=1" . str_replace( 'm.', '', $_bannedGroup ) ) );
|
||||
|
||||
$this->DB->build( array(
|
||||
'select' => 'm.*',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'order' => 'm.joined DESC',
|
||||
'limit' => array( $st, 10 ),
|
||||
'where' => "m.member_banned=1" . $_bannedGroup,
|
||||
'add_join' => array(
|
||||
array(
|
||||
'select' => 'pp.*',
|
||||
'from' => array( 'profile_portal' => 'pp' ),
|
||||
'where' => 'm.member_id=pp.pp_member_id',
|
||||
'type' => 'left',
|
||||
),
|
||||
),
|
||||
) );
|
||||
$outer = $this->DB->execute();
|
||||
|
||||
while( $r = $this->DB->fetch($outer) )
|
||||
{
|
||||
$r['_language'] = $this->lang->words['modcp_modq_indef'];
|
||||
|
||||
$members[] = IPSMember::buildDisplayData( $r );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Page links
|
||||
//-----------------------------------------
|
||||
|
||||
$pages = $this->registry->output->generatePagination( array( 'totalItems' => $total['members'],
|
||||
'itemsPerPage' => 10,
|
||||
'currentStartValue' => $st,
|
||||
'baseUrl' => "app=core&module=modcp&fromapp=members&tab=banned",
|
||||
) );
|
||||
|
||||
return $this->registry->output->getTemplate('modcp')->membersList( 'banned', $members, $pages );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,356 @@
|
||||
<?php
|
||||
/**
|
||||
* @file plugin_iplookup.php Moderator control panel plugin: IP lookup tool
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $Author: bfarber $
|
||||
* @since 2/18/2011
|
||||
* $LastChangedDate: 2011-03-16 21:13:06 -0400 (Wed, 16 Mar 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 8110 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @class plugin_members_iplookup
|
||||
* @brief Moderator control panel plugin: IP lookup tool
|
||||
*
|
||||
*/
|
||||
class plugin_members_iplookup
|
||||
{
|
||||
/**
|
||||
* Registry Object Shortcuts
|
||||
*
|
||||
* @var $registry
|
||||
* @var $DB
|
||||
* @var $settings
|
||||
* @var $request
|
||||
* @var $lang
|
||||
* @var $member
|
||||
* @var $memberData
|
||||
* @var $cache
|
||||
* @var $caches
|
||||
*/
|
||||
protected $registry;
|
||||
protected $DB;
|
||||
protected $settings;
|
||||
protected $request;
|
||||
protected $lang;
|
||||
protected $member;
|
||||
protected $memberData;
|
||||
protected $cache;
|
||||
protected $caches;
|
||||
|
||||
/**
|
||||
* Main function executed automatically by the controller
|
||||
*
|
||||
* @param object $registry Registry object
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Make shortcuts
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry = $registry;
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
$this->member = $this->registry->member();
|
||||
$this->memberData =& $this->registry->member()->fetchMemberData();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
$this->lang = $this->registry->class_localization;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the primary tab key for the navigation bar
|
||||
*
|
||||
* @return @e string
|
||||
*/
|
||||
public function getPrimaryTab()
|
||||
{
|
||||
return 'ip_tools';
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the secondary tab key for the navigation bar
|
||||
*
|
||||
* @return @e string
|
||||
*/
|
||||
public function getSecondaryTab()
|
||||
{
|
||||
return 'iplookup';
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if we can view tab
|
||||
*
|
||||
* @param array $permissions Moderator permissions
|
||||
* @return @e bool
|
||||
*/
|
||||
public function canView( $permissions )
|
||||
{
|
||||
if( $this->memberData['g_is_supmod'] )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute plugin
|
||||
*
|
||||
* @param array $permissions Moderator permissions
|
||||
* @return @e string
|
||||
*/
|
||||
public function executePlugin( $permissions )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Check permissions
|
||||
//-----------------------------------------
|
||||
|
||||
if( !$this->canView( $permissions ) )
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Check permissions
|
||||
//-----------------------------------------
|
||||
|
||||
if( $this->request['_do'] == 'submit' )
|
||||
{
|
||||
return $this->_doLookup();
|
||||
}
|
||||
|
||||
return $this->registry->getClass('output')->getTemplate('modcp')->membersModIPForm( $this->request['ip'] );
|
||||
}
|
||||
|
||||
/**
|
||||
* Lookup IP address info
|
||||
*
|
||||
* @return @e string
|
||||
*/
|
||||
protected function _doLookup()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$exactMatch = 1;
|
||||
$finalIPString = trim( $this->request['ip'] );
|
||||
$startVal = intval($this->request['st']);
|
||||
$ipTool = $this->request['iptool'];
|
||||
|
||||
//-----------------------------------------
|
||||
// Remove trailing periods
|
||||
//-----------------------------------------
|
||||
|
||||
if ( strstr( $finalIPString, '*' ) )
|
||||
{
|
||||
$exactMatch = 0;
|
||||
$finalIPString = preg_replace( "/^(.+?)\*(.+?)?$/", "\\1", $finalIPString ).'%';
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// H'okay, what have we been asked to do?
|
||||
// (that's a metaphorical "we" in a rhetorical question)
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $ipTool == 'resolve' )
|
||||
{
|
||||
$resolved = @gethostbyaddr( $finalIPString );
|
||||
|
||||
if ( $resolved == "" )
|
||||
{
|
||||
return $this->registry->getClass('output')->getTemplate('modcp')->membersModIPForm( $this->request['ip'], $this->registry->getClass('output')->getTemplate('modcp')->inlineModIPMessage( $this->lang->words['cp_no_matches'] ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
return $this->registry->getClass('output')->getTemplate('modcp')->membersModIPForm( $this->request['ip'], $this->registry->getClass('output')->getTemplate('modcp')->inlineModIPMessage( sprintf( $this->lang->words['ip_resolve_result'], $finalIPString, $resolved ) ) );
|
||||
}
|
||||
}
|
||||
else if ( $ipTool == 'members' )
|
||||
{
|
||||
$sql = $exactMatch ? "ip_address='$finalIPString'" : "ip_address LIKE '$finalIPString'";
|
||||
|
||||
if ( !$this->memberData['g_access_cp'] )
|
||||
{
|
||||
$sql .= "AND g.g_access_cp != 1";
|
||||
}
|
||||
|
||||
$total_possible = $this->DB->buildAndFetch( array(
|
||||
'select' => 'count(m.member_id) as max',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => $sql,
|
||||
'add_join' => array(
|
||||
array(
|
||||
'from' => array( 'groups' => 'g' ),
|
||||
'type' => 'left',
|
||||
'where' => 'g.g_id=m.member_group_id',
|
||||
)
|
||||
)
|
||||
) );
|
||||
|
||||
if ( $total_possible['max'] < 1 )
|
||||
{
|
||||
return $this->registry->getClass('output')->getTemplate('modcp')->membersModIPForm( $this->request['ip'], $this->registry->getClass('output')->getTemplate('modcp')->inlineModIPMessage( $this->lang->words['cp_no_matches'] ) );
|
||||
}
|
||||
|
||||
$pages = $this->registry->getClass('output')->generatePagination( array( 'totalItems' => $total_possible['max'],
|
||||
'itemsPerPage' => 20,
|
||||
'currentStartValue' => $startVal,
|
||||
'baseUrl' => "app=core&module=modcp&tab=iplookup&fromapp=members&_do=submit&iptool=members&ip=" . $this->request['ip'],
|
||||
) );
|
||||
|
||||
$this->DB->build( array(
|
||||
'select' => 'm.name, m.members_display_name, m.members_seo_name, m.member_id, m.ip_address, m.posts, m.joined, m.member_group_id',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => 'm.' . $sql,
|
||||
'order' => "m.joined DESC",
|
||||
'limit' => array( $startVal, 20 ),
|
||||
'add_join' => array(
|
||||
array( 'select' => 'g.g_access_cp',
|
||||
'from' => array( 'groups' => 'g' ),
|
||||
'type' => 'left',
|
||||
'where' => 'g.g_id=m.member_group_id',
|
||||
)
|
||||
)
|
||||
) );
|
||||
$this->DB->execute();
|
||||
|
||||
while( $row = $this->DB->fetch() )
|
||||
{
|
||||
$row['joined'] = $this->registry->getClass( 'class_localization')->getDate( $row['joined'], 'JOINED' );
|
||||
$row['groupname'] = IPSMember::makeNameFormatted( $this->caches['group_cache'][ $row['member_group_id'] ]['g_title'], $row['member_group_id'] );
|
||||
|
||||
$members[ $row['member_id'] ] = $row;
|
||||
}
|
||||
|
||||
return $this->registry->getClass('output')->getTemplate('modcp')->membersModIPForm( $this->request['ip'], $this->registry->getClass('output')->getTemplate('modcp')->membersModIPFormMembers( $pages, $members ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql = $exactMatch ? "p.ip_address LIKE '$finalIPString'" : "p.ip_address='$finalIPString'";
|
||||
|
||||
//-----------------------------------------
|
||||
// Get forums we can view
|
||||
//-----------------------------------------
|
||||
|
||||
$aforum = $this->registry->getClass('class_forums')->fetchSearchableForumIds();
|
||||
|
||||
if ( count($aforum) < 1)
|
||||
{
|
||||
return $this->registry->getClass('output')->getTemplate('modcp')->membersModIPForm( $this->request['ip'], $this->registry->getClass('output')->getTemplate('modcp')->inlineModIPMessage( $this->lang->words['cp_no_matches'] ) );
|
||||
}
|
||||
|
||||
$the_forums = implode( ",", $aforum );
|
||||
|
||||
$count = $this->DB->buildAndFetch( array(
|
||||
'select' => 'COUNT(*) as total',
|
||||
'from' => array( 'posts' => 'p' ),
|
||||
'where' => "t.forum_id IN({$the_forums}) AND {$sql}",
|
||||
'add_join' => array(
|
||||
array(
|
||||
'from' => array( 'topics' => 't' ),
|
||||
'where' => 't.tid=p.topic_id',
|
||||
'type' => 'left'
|
||||
),
|
||||
)
|
||||
) );
|
||||
|
||||
//-----------------------------------------
|
||||
// Do we have any results?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( !$count['total'] )
|
||||
{
|
||||
return $this->registry->getClass('output')->getTemplate('modcp')->membersModIPForm( $this->request['ip'], $this->registry->getClass('output')->getTemplate('modcp')->inlineModIPMessage( $this->lang->words['cp_no_matches'] ) );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Pages
|
||||
//-----------------------------------------
|
||||
|
||||
$pageLinks = $this->registry->getClass('output')->generatePagination( array( 'totalItems' => $count['total'],
|
||||
'itemsPerPage' => 10,
|
||||
'currentStartValue' => $startVal,
|
||||
'baseUrl' => "app=core&module=modcp&tab=iplookup&fromapp=members&_do=submit&iptool=posts&ip=" . $this->request['ip'],
|
||||
) );
|
||||
|
||||
$results = array();
|
||||
|
||||
$this->DB->build( array(
|
||||
'select' => 'p.*',
|
||||
'from' => array( 'posts' => 'p' ),
|
||||
'where' => "t.forum_id IN({$the_forums}) AND {$sql}",
|
||||
'limit' => array( $startVal, 10 ),
|
||||
'order' => 'p.pid DESC',
|
||||
'add_join' => array(
|
||||
array(
|
||||
'select' => 't.forum_id',
|
||||
'from' => array( 'topics' => 't' ),
|
||||
'where' => 't.tid=p.topic_id',
|
||||
'type' => 'left'
|
||||
),
|
||||
array(
|
||||
'select' => 'm.*',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => 'm.member_id=p.author_id',
|
||||
'type' => 'left'
|
||||
),
|
||||
array(
|
||||
'select' => 'pp.*',
|
||||
'from' => array( 'profile_portal' => 'pp' ),
|
||||
'where' => 'pp.pp_member_id=m.member_id',
|
||||
'type' => 'left'
|
||||
),
|
||||
array(
|
||||
'select' => 'pf.*',
|
||||
'from' => array( 'pfields_content' => 'pf' ),
|
||||
'where' => 'pf.member_id=m.member_id',
|
||||
'type' => 'left'
|
||||
),
|
||||
)
|
||||
) );
|
||||
$outer = $this->DB->execute();
|
||||
|
||||
while ( $row = $this->DB->fetch($outer) )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Parse the member
|
||||
//-----------------------------------------
|
||||
|
||||
$row = IPSMember::buildDisplayData( $row, array( 'customFields' => 1, 'signature' => 1, 'warn' => 1 ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// Parse the post
|
||||
//-----------------------------------------
|
||||
|
||||
IPSText::getTextClass( 'bbcode' )->parse_smilies = $row['use_emo'];
|
||||
IPSText::getTextClass( 'bbcode' )->parse_html = ( $this->registry->class_forums->allForums[ $row['forum_id'] ]['use_html'] and $this->caches['group_cache'][ $row['member_group_id'] ]['g_dohtml'] and $row['post_htmlstate'] ) ? 1 : 0;
|
||||
IPSText::getTextClass( 'bbcode' )->parse_nl2br = $row['post_htmlstate'] == 2 ? 1 : 0;
|
||||
IPSText::getTextClass( 'bbcode' )->parse_bbcode = $this->registry->class_forums->allForums[ $row['forum_id'] ]['use_ibc'];
|
||||
IPSText::getTextClass( 'bbcode' )->parsing_section = 'topics';
|
||||
IPSText::getTextClass( 'bbcode' )->parsing_mgroup = $row['member_group_id'];
|
||||
IPSText::getTextClass( 'bbcode' )->parsing_mgroup_others = $row['mgroup_others'];
|
||||
|
||||
$row['post'] = IPSText::getTextClass( 'bbcode' )->preDisplayParse( $row['post'] );
|
||||
|
||||
$results[] = $row;
|
||||
}
|
||||
|
||||
return $this->registry->getClass('output')->getTemplate('modcp')->membersModIPForm( $this->request['ip'], $this->registry->getClass('output')->getTemplate('modcp')->membersModIPFormPosts( $count['total'], $pageLinks, $results ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,192 @@
|
||||
<?php
|
||||
/**
|
||||
* @file plugin_modposts.php Moderator control panel plugin: show members on mod queue
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $Author: bfarber $
|
||||
* @since 2/17/2011
|
||||
* $LastChangedDate: 2011-08-29 22:12:22 -0400 (Mon, 29 Aug 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 9425 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @class plugin_members_modposts
|
||||
* @brief Moderator control panel plugin: show members on mod queue
|
||||
*
|
||||
*/
|
||||
class plugin_members_modposts
|
||||
{
|
||||
/**
|
||||
* Registry Object Shortcuts
|
||||
*
|
||||
* @var $registry
|
||||
* @var $DB
|
||||
* @var $settings
|
||||
* @var $request
|
||||
* @var $lang
|
||||
* @var $member
|
||||
* @var $memberData
|
||||
* @var $cache
|
||||
* @var $caches
|
||||
*/
|
||||
protected $registry;
|
||||
protected $DB;
|
||||
protected $settings;
|
||||
protected $request;
|
||||
protected $lang;
|
||||
protected $member;
|
||||
protected $memberData;
|
||||
protected $cache;
|
||||
protected $caches;
|
||||
|
||||
/**
|
||||
* Main function executed automatically by the controller
|
||||
*
|
||||
* @param object $registry Registry object
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Make shortcuts
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry = $registry;
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
$this->member = $this->registry->member();
|
||||
$this->memberData =& $this->registry->member()->fetchMemberData();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
$this->lang = $this->registry->class_localization;
|
||||
|
||||
/* Load language strings.. */
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'public_list' ), 'members' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the primary tab key for the navigation bar
|
||||
*
|
||||
* @return @e string
|
||||
*/
|
||||
public function getPrimaryTab()
|
||||
{
|
||||
return 'manage_members';
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the secondary tab key for the navigation bar
|
||||
*
|
||||
* @return @e string
|
||||
*/
|
||||
public function getSecondaryTab()
|
||||
{
|
||||
return 'modposts';
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if we can view tab
|
||||
*
|
||||
* @param array $permissions Moderator permissions
|
||||
* @return @e bool
|
||||
*/
|
||||
public function canView( $permissions )
|
||||
{
|
||||
if( $this->memberData['g_is_supmod'] OR ( $this->memberData['is_mod'] AND $permissions['allow_warn'] AND $this->settings['warn_mod_modq'] ) )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute plugin
|
||||
*
|
||||
* @param array $permissions Moderator permissions
|
||||
* @return @e string
|
||||
*/
|
||||
public function executePlugin( $permissions )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Check permissions
|
||||
//-----------------------------------------
|
||||
|
||||
if( !$this->canView( $permissions ) )
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
/* Add some additional CSS */
|
||||
$this->registry->output->addToDocumentHead( 'importcss', "{$this->settings['css_base_url']}style_css/{$this->registry->output->skin['_csscacheid']}/ipb_mlist.css" );
|
||||
|
||||
//-----------------------------------------
|
||||
// Get 10 members on mod queue
|
||||
//-----------------------------------------
|
||||
|
||||
$st = intval($this->request['st']);
|
||||
$total = $this->DB->buildAndFetch( array( 'select' => 'count(*) as members', 'from' => 'members', 'where' => "mod_posts!=0 AND mod_posts!='' AND mod_posts " . $this->DB->buildIsNull( false ) ) );
|
||||
$members = array();
|
||||
|
||||
$this->DB->build( array(
|
||||
'select' => 'm.*',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'order' => 'm.joined DESC',
|
||||
'limit' => array( $st, 10 ),
|
||||
'where' => "m.mod_posts!=0 AND m.mod_posts!='' AND m.mod_posts " . $this->DB->buildIsNull( false ),
|
||||
'add_join' => array(
|
||||
array(
|
||||
'select' => 'pp.*',
|
||||
'from' => array( 'profile_portal' => 'pp' ),
|
||||
'where' => 'm.member_id=pp.pp_member_id',
|
||||
'type' => 'left',
|
||||
),
|
||||
),
|
||||
) );
|
||||
$outer = $this->DB->execute();
|
||||
|
||||
while( $r = $this->DB->fetch($outer) )
|
||||
{
|
||||
$mod_arr = IPSMember::processBanEntry( $r['mod_posts'] );
|
||||
|
||||
if( $mod_arr['date_end'] AND $mod_arr['date_end'] < time() )
|
||||
{
|
||||
IPSMember::save( $r['member_id'], array( 'core' => array( 'mod_posts' => 0 ) ) );
|
||||
continue;
|
||||
}
|
||||
|
||||
if( $mod_arr['date_start'] == 1 )
|
||||
{
|
||||
$r['_language'] = $this->lang->words['modcp_modq_indef'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$r['_language'] = $this->registry->getClass('class_localization')->getDate( $mod_arr['date_end'], 'SHORT' );
|
||||
}
|
||||
|
||||
$members[] = IPSMember::buildDisplayData( $r );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Page links
|
||||
//-----------------------------------------
|
||||
|
||||
$pages = $this->registry->output->generatePagination( array( 'totalItems' => $total['members'],
|
||||
'itemsPerPage' => 10,
|
||||
'currentStartValue' => $st,
|
||||
'baseUrl' => "app=core&module=modcp&fromapp=members&tab=modposts",
|
||||
) );
|
||||
|
||||
return $this->registry->output->getTemplate('modcp')->membersList( 'modposts', $members, $pages );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,192 @@
|
||||
<?php
|
||||
/**
|
||||
* @file plugin_restrictposts.php Moderator control panel plugin: show members with post restriction
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $Author: bfarber $
|
||||
* @since 2/17/2011
|
||||
* $LastChangedDate: 2011-08-29 22:12:22 -0400 (Mon, 29 Aug 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 9425 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @class plugin_members_restrictposts
|
||||
* @brief Moderator control panel plugin: show members with post restriction
|
||||
*
|
||||
*/
|
||||
class plugin_members_restrictposts
|
||||
{
|
||||
/**
|
||||
* Registry Object Shortcuts
|
||||
*
|
||||
* @var $registry
|
||||
* @var $DB
|
||||
* @var $settings
|
||||
* @var $request
|
||||
* @var $lang
|
||||
* @var $member
|
||||
* @var $memberData
|
||||
* @var $cache
|
||||
* @var $caches
|
||||
*/
|
||||
protected $registry;
|
||||
protected $DB;
|
||||
protected $settings;
|
||||
protected $request;
|
||||
protected $lang;
|
||||
protected $member;
|
||||
protected $memberData;
|
||||
protected $cache;
|
||||
protected $caches;
|
||||
|
||||
/**
|
||||
* Main function executed automatically by the controller
|
||||
*
|
||||
* @param object $registry Registry object
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Make shortcuts
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry = $registry;
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
$this->member = $this->registry->member();
|
||||
$this->memberData =& $this->registry->member()->fetchMemberData();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
$this->lang = $this->registry->class_localization;
|
||||
|
||||
/* Load language strings.. */
|
||||
$this->lang->loadLanguageFile( array( 'public_list' ), 'members' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the primary tab key for the navigation bar
|
||||
*
|
||||
* @return @e string
|
||||
*/
|
||||
public function getPrimaryTab()
|
||||
{
|
||||
return 'manage_members';
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the secondary tab key for the navigation bar
|
||||
*
|
||||
* @return @e string
|
||||
*/
|
||||
public function getSecondaryTab()
|
||||
{
|
||||
return 'restrictposts';
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if we can view tab
|
||||
*
|
||||
* @param array $permissions Moderator permissions
|
||||
* @return @e bool
|
||||
*/
|
||||
public function canView( $permissions )
|
||||
{
|
||||
if( $this->memberData['g_is_supmod'] OR ( $this->memberData['is_mod'] AND $permissions['allow_warn'] AND $this->settings['warn_mod_post'] ) )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute plugin
|
||||
*
|
||||
* @param array $permissions Moderator permissions
|
||||
* @return @e string
|
||||
*/
|
||||
public function executePlugin( $permissions )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Check permissions
|
||||
//-----------------------------------------
|
||||
|
||||
if( !$this->canView( $permissions ) )
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
/* Add some CSS.. */
|
||||
$this->registry->output->addToDocumentHead( 'importcss', "{$this->settings['css_base_url']}style_css/{$this->registry->output->skin['_csscacheid']}/ipb_mlist.css" );
|
||||
|
||||
//-----------------------------------------
|
||||
// Get 10 members on mod queue
|
||||
//-----------------------------------------
|
||||
|
||||
$st = intval($this->request['st']);
|
||||
$total = $this->DB->buildAndFetch( array( 'select' => 'count(*) as members', 'from' => 'members', 'where' => "restrict_post!=0 AND restrict_post!='' AND restrict_post " . $this->DB->buildIsNull( false ) ) );
|
||||
$members = array();
|
||||
|
||||
$this->DB->build( array(
|
||||
'select' => 'm.*',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'order' => 'm.joined DESC',
|
||||
'limit' => array( $st, 10 ),
|
||||
'where' => "m.restrict_post!=0 AND m.restrict_post!='' AND m.restrict_post " . $this->DB->buildIsNull( false ),
|
||||
'add_join' => array(
|
||||
array(
|
||||
'select' => 'pp.*',
|
||||
'from' => array( 'profile_portal' => 'pp' ),
|
||||
'where' => 'm.member_id=pp.pp_member_id',
|
||||
'type' => 'left',
|
||||
),
|
||||
),
|
||||
) );
|
||||
$outer = $this->DB->execute();
|
||||
|
||||
while( $r = $this->DB->fetch($outer) )
|
||||
{
|
||||
$mod_arr = IPSMember::processBanEntry( $r['restrict_post'] );
|
||||
|
||||
if( $mod_arr['date_end'] AND $mod_arr['date_end'] < time() )
|
||||
{
|
||||
IPSMember::save( $r['member_id'], array( 'core' => array( 'restrict_post' => 0 ) ) );
|
||||
continue;
|
||||
}
|
||||
|
||||
if( $mod_arr['date_start'] == 1 )
|
||||
{
|
||||
$r['_language'] = $this->lang->words['modcp_modq_indef'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$r['_language'] = $this->registry->getClass('class_localization')->getDate( $mod_arr['date_end'], 'SHORT' );
|
||||
}
|
||||
|
||||
$members[] = IPSMember::buildDisplayData( $r );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Page links
|
||||
//-----------------------------------------
|
||||
|
||||
$pages = $this->registry->output->generatePagination( array( 'totalItems' => $total['members'],
|
||||
'itemsPerPage' => 10,
|
||||
'currentStartValue' => $st,
|
||||
'baseUrl' => "app=core&module=modcp&fromapp=members&tab=restrictposts",
|
||||
) );
|
||||
|
||||
return $this->registry->output->getTemplate('modcp')->membersList( 'restrictposts', $members, $pages );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,192 @@
|
||||
<?php
|
||||
/**
|
||||
* @file plugin_suspended.php Moderator control panel plugin: temporarily suspended members
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $Author: bfarber $
|
||||
* @since 2/17/2011
|
||||
* $LastChangedDate: 2011-08-29 22:12:22 -0400 (Mon, 29 Aug 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 9425 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @class plugin_members_suspended
|
||||
* @brief Moderator control panel plugin: temporarily suspended members
|
||||
*
|
||||
*/
|
||||
class plugin_members_suspended
|
||||
{
|
||||
/**
|
||||
* Registry Object Shortcuts
|
||||
*
|
||||
* @var $registry
|
||||
* @var $DB
|
||||
* @var $settings
|
||||
* @var $request
|
||||
* @var $lang
|
||||
* @var $member
|
||||
* @var $memberData
|
||||
* @var $cache
|
||||
* @var $caches
|
||||
*/
|
||||
protected $registry;
|
||||
protected $DB;
|
||||
protected $settings;
|
||||
protected $request;
|
||||
protected $lang;
|
||||
protected $member;
|
||||
protected $memberData;
|
||||
protected $cache;
|
||||
protected $caches;
|
||||
|
||||
/**
|
||||
* Main function executed automatically by the controller
|
||||
*
|
||||
* @param object $registry Registry object
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Make shortcuts
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry = $registry;
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
$this->member = $this->registry->member();
|
||||
$this->memberData =& $this->registry->member()->fetchMemberData();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
$this->lang = $this->registry->class_localization;
|
||||
|
||||
/* Load language strings.. */
|
||||
$this->lang->loadLanguageFile( array( 'public_list' ), 'members' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the primary tab key for the navigation bar
|
||||
*
|
||||
* @return @e string
|
||||
*/
|
||||
public function getPrimaryTab()
|
||||
{
|
||||
return 'manage_members';
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the secondary tab key for the navigation bar
|
||||
*
|
||||
* @return @e string
|
||||
*/
|
||||
public function getSecondaryTab()
|
||||
{
|
||||
return 'suspended';
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if we can view tab
|
||||
*
|
||||
* @param array $permissions Moderator permissions
|
||||
* @return @e bool
|
||||
*/
|
||||
public function canView( $permissions )
|
||||
{
|
||||
if( $this->memberData['g_is_supmod'] OR ( $this->memberData['is_mod'] AND $permissions['allow_warn'] AND $this->settings['warn_mod_ban'] ) )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute plugin
|
||||
*
|
||||
* @param array $permissions Moderator permissions
|
||||
* @return @e string
|
||||
*/
|
||||
public function executePlugin( $permissions )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Check permissions
|
||||
//-----------------------------------------
|
||||
|
||||
if( !$this->canView( $permissions ) )
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
/* Add some CSS.. */
|
||||
$this->registry->output->addToDocumentHead( 'importcss', "{$this->settings['css_base_url']}style_css/{$this->registry->output->skin['_csscacheid']}/ipb_mlist.css" );
|
||||
|
||||
//-----------------------------------------
|
||||
// Get 10 members on suspension
|
||||
//-----------------------------------------
|
||||
|
||||
$st = intval($this->request['st']);
|
||||
$total = $this->DB->buildAndFetch( array( 'select' => 'count(*) as members', 'from' => 'members', 'where' => "temp_ban!=0 AND temp_ban!='' AND temp_ban " . $this->DB->buildIsNull( false ) ) );
|
||||
$members = array();
|
||||
|
||||
$this->DB->build( array(
|
||||
'select' => 'm.*',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'order' => 'm.joined DESC',
|
||||
'limit' => array( $st, 10 ),
|
||||
'where' => "m.temp_ban!=0 AND m.temp_ban!='' AND m.temp_ban " . $this->DB->buildIsNull( false ),
|
||||
'add_join' => array(
|
||||
array(
|
||||
'select' => 'pp.*',
|
||||
'from' => array( 'profile_portal' => 'pp' ),
|
||||
'where' => 'm.member_id=pp.pp_member_id',
|
||||
'type' => 'left',
|
||||
),
|
||||
),
|
||||
) );
|
||||
$outer = $this->DB->execute();
|
||||
|
||||
while( $r = $this->DB->fetch($outer) )
|
||||
{
|
||||
$mod_arr = IPSMember::processBanEntry( $r['temp_ban'] );
|
||||
|
||||
if( $mod_arr['date_end'] AND $mod_arr['date_end'] < time() )
|
||||
{
|
||||
IPSMember::save( $r['member_id'], array( 'core' => array( 'temp_ban' => 0 ) ) );
|
||||
continue;
|
||||
}
|
||||
|
||||
if( $mod_arr['date_start'] == 1 )
|
||||
{
|
||||
$r['_language'] = $this->lang->words['modcp_modq_indef'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$r['_language'] = $this->registry->getClass('class_localization')->getDate( $mod_arr['date_end'], 'SHORT' );
|
||||
}
|
||||
|
||||
$members[] = IPSMember::buildDisplayData( $r );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Page links
|
||||
//-----------------------------------------
|
||||
|
||||
$pages = $this->registry->output->generatePagination( array( 'totalItems' => $total['members'],
|
||||
'itemsPerPage' => 10,
|
||||
'currentStartValue' => $st,
|
||||
'baseUrl' => "app=core&module=modcp&fromapp=members&tab=suspended",
|
||||
) );
|
||||
|
||||
return $this->registry->output->getTemplate('modcp')->membersList( 'suspended', $members, $pages );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,210 @@
|
||||
<?php
|
||||
/**
|
||||
* @file plugin_warn.php Moderator control panel plugin: show latest warnings
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $Author: ips_terabyte $
|
||||
* @since 2/14/2011
|
||||
* $LastChangedDate: 2011-03-09 17:51:33 -0500 (Wed, 09 Mar 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 8003 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @class plugin_members_warn
|
||||
* @brief Moderator control panel plugin: show latest warnings
|
||||
*
|
||||
*/
|
||||
class plugin_members_warn
|
||||
{
|
||||
/**
|
||||
* Registry Object Shortcuts
|
||||
*
|
||||
* @var $registry
|
||||
* @var $DB
|
||||
* @var $settings
|
||||
* @var $request
|
||||
* @var $lang
|
||||
* @var $member
|
||||
* @var $memberData
|
||||
* @var $cache
|
||||
* @var $caches
|
||||
*/
|
||||
protected $registry;
|
||||
protected $DB;
|
||||
protected $settings;
|
||||
protected $request;
|
||||
protected $lang;
|
||||
protected $member;
|
||||
protected $memberData;
|
||||
protected $cache;
|
||||
protected $caches;
|
||||
|
||||
/**
|
||||
* Main function executed automatically by the controller
|
||||
*
|
||||
* @param object $registry Registry object
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Make shortcuts
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry = $registry;
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
$this->member = $this->registry->member();
|
||||
$this->memberData =& $this->registry->member()->fetchMemberData();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
$this->lang = $this->registry->class_localization;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the primary tab key for the navigation bar
|
||||
*
|
||||
* @return @e string
|
||||
*/
|
||||
public function getPrimaryTab()
|
||||
{
|
||||
return 'manage_members';
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the secondary tab key for the navigation bar
|
||||
*
|
||||
* @return @e string
|
||||
*/
|
||||
public function getSecondaryTab()
|
||||
{
|
||||
return 'warn';
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if we can view tab
|
||||
*
|
||||
* @param array $permissions Moderator permissions
|
||||
* @return @e bool
|
||||
*/
|
||||
public function canView( $permissions )
|
||||
{
|
||||
if( $this->memberData['g_is_supmod'] OR ( $this->memberData['is_mod'] AND $permissions['allow_warn'] ) )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute plugin
|
||||
*
|
||||
* @param array $permissions Moderator permissions
|
||||
* @return @e string
|
||||
*/
|
||||
public function executePlugin( $permissions )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Check permissions
|
||||
//-----------------------------------------
|
||||
|
||||
if( !$this->canView( $permissions ) )
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Get last 10 warnings
|
||||
//-----------------------------------------
|
||||
|
||||
$st = intval($this->request['st']);
|
||||
$total = $this->DB->buildAndFetch( array( 'select' => 'count(*) as warns', 'from' => 'warn_logs' ) );
|
||||
$warnings = array();
|
||||
|
||||
$this->DB->build( array(
|
||||
'select' => 'w.*',
|
||||
'from' => array( 'warn_logs' => 'w' ),
|
||||
'order' => 'w.wlog_date DESC',
|
||||
'limit' => array( $st, 10 ),
|
||||
'add_join' => array(
|
||||
array(
|
||||
'select' => 'm.*',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => 'm.member_id=w.wlog_mid',
|
||||
'type' => 'left',
|
||||
),
|
||||
array(
|
||||
'select' => 'pp.*',
|
||||
'from' => array( 'profile_portal' => 'pp' ),
|
||||
'where' => 'm.member_id=pp.pp_member_id',
|
||||
'type' => 'left',
|
||||
),
|
||||
array(
|
||||
'select' => 'mm.member_id as punisher_id, mm.members_display_name as punisher_name, mm.members_seo_name as punisher_seo_name',
|
||||
'from' => array( 'members' => 'mm' ),
|
||||
'where' => 'mm.member_id=w.wlog_addedby',
|
||||
'type' => 'left',
|
||||
),
|
||||
array(
|
||||
'select' => 'ppp.pp_main_photo as punisher_check, ppp.pp_thumb_photo as punisher_photo, ppp.pp_thumb_width as punisher_width, ppp.pp_thumb_height as punisher_height',
|
||||
'from' => array( 'profile_portal' => 'ppp' ),
|
||||
'where' => 'mm.member_id=ppp.pp_member_id',
|
||||
'type' => 'left',
|
||||
),
|
||||
),
|
||||
) );
|
||||
$outer = $this->DB->execute();
|
||||
|
||||
while( $r = $this->DB->fetch($outer) )
|
||||
{
|
||||
if ( strstr( $r['wlog_notes'], '<content>' ) )
|
||||
{
|
||||
$raw = preg_match( "#<content>(.+?)</content>#is", $r['wlog_notes'], $match );
|
||||
}
|
||||
else
|
||||
{
|
||||
$_array = unserialize( $r['wlog_notes'] );
|
||||
|
||||
if ( is_array( $_array ) AND $_array['content'] )
|
||||
{
|
||||
$match[1] = $_array['content'];
|
||||
}
|
||||
}
|
||||
|
||||
IPSText::getTextClass( 'bbcode' )->parse_smilies = 1;
|
||||
IPSText::getTextClass( 'bbcode' )->parse_html = 0;
|
||||
IPSText::getTextClass( 'bbcode' )->parse_bbcode = 1;
|
||||
IPSText::getTextClass( 'bbcode' )->parsing_section = 'warn';
|
||||
IPSText::getTextClass( 'bbcode' )->parsing_mgroup = $r['member_group_id'];
|
||||
IPSText::getTextClass( 'bbcode' )->parsing_mgroup_others = $r['mgroup_others'];
|
||||
|
||||
$r['content'] = IPSText::getTextClass( 'bbcode' )->preDisplayParse( $match[1] );
|
||||
|
||||
$r['punisher_photo'] = IPSMember::buildProfilePhoto( array( 'pp_main_photo' => $r['punisher_check'], 'pp_thumb_photo' => $r['punisher_photo'], 'pp_thumb_width' => $r['punisher_width'], 'pp_thumb_height' => $r['punisher_height'] ), 'mini' );
|
||||
$warnings[] = IPSMember::buildDisplayData( $r );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Page links
|
||||
//-----------------------------------------
|
||||
|
||||
$pages = $this->registry->output->generatePagination( array( 'totalItems' => $total['warns'],
|
||||
'itemsPerPage' => 10,
|
||||
'currentStartValue' => $st,
|
||||
'baseUrl' => "app=core&module=modcp&fromapp=members&tab=warn",
|
||||
) );
|
||||
|
||||
return $this->registry->output->getTemplate('modcp')->latestWarnLogs( $warnings, $pages );
|
||||
}
|
||||
}
|
||||
+14
-17
@@ -3,19 +3,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Define the core notification types
|
||||
* Last Updated: $Date: 2010-04-16 21:25:51 -0400 (Fri, 16 Apr 2010) $
|
||||
* Last Updated: $Date: 2011-04-27 07:31:56 -0400 (Wed, 27 Apr 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @author $Author: mmecham $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since 20th February 2002
|
||||
* @version $Rev: 6142 $
|
||||
* @version $Rev: 8490 $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -37,20 +37,17 @@ class members_notifications
|
||||
* Notification types - Needs to be a method so when require_once is used, $_NOTIFY isn't empty
|
||||
*/
|
||||
$_NOTIFY = array(
|
||||
array( 'key' => 'profile_comment', 'default' => array( 'pm' ), 'disabled' => array(), 'icon' => 'notify_profilecomment' ),
|
||||
array( 'key' => 'profile_comment_pending', 'default' => array( 'pm' ), 'disabled' => array(), 'icon' => 'notify_profilecomment' ),
|
||||
array( 'key' => 'friend_request', 'default' => array( 'pm' ), 'disabled' => array(), 'icon' => 'notify_friendrequest' ),
|
||||
array( 'key' => 'friend_request_pending', 'default' => array( 'pm' ), 'disabled' => array(), 'icon' => 'notify_friendrequest' ),
|
||||
array( 'key' => 'friend_request_approve', 'default' => array( 'pm' ), 'disabled' => array(), 'icon' => 'notify_friendrequest' ),
|
||||
array( 'key' => 'new_private_message', 'default' => array( 'email', 'inline' ), 'disabled' => array( 'pm' ), 'icon' => 'notify_pm' ),
|
||||
array( 'key' => 'reply_private_message', 'default' => array( 'email', 'inline' ), 'disabled' => array( 'pm' ), 'icon' => 'notify_pm' ),
|
||||
array( 'key' => 'invite_private_message', 'default' => array( 'email', 'inline' ), 'disabled' => array( 'pm' ), 'icon' => 'notify_pm' ),
|
||||
array( 'key' => 'profile_comment', 'default' => array( 'inline' ), 'disabled' => array(), 'icon' => 'notify_profilecomment' ),
|
||||
array( 'key' => 'friend_request', 'default' => array( 'inline' ), 'disabled' => array(), 'icon' => 'notify_friendrequest' ),
|
||||
array( 'key' => 'friend_request_approve', 'default' => array( 'inline' ), 'disabled' => array(), 'icon' => 'notify_friendrequest' ),
|
||||
array( 'key' => 'new_private_message', 'default' => array( 'email' ), 'disabled' => array( 'inline' ), 'icon' => 'notify_pm' ),
|
||||
array( 'key' => 'reply_private_message', 'default' => array( 'email' ), 'disabled' => array( 'inline' ), 'icon' => 'notify_pm' ),
|
||||
array( 'key' => 'invite_private_message', 'default' => array( 'email' ), 'disabled' => array( 'inline' ), 'icon' => 'notify_pm' ),
|
||||
array( 'key' => 'reply_your_status', 'default' => array(), 'disabled' => array(), 'icon' => 'notify_statusreply' ),
|
||||
array( 'key' => 'reply_any_status', 'default' => array(), 'disabled' => array(), 'icon' => 'notify_statusreply' ),
|
||||
array( 'key' => 'friend_status_update', 'default' => array(), 'disabled' => array(), 'icon' => 'notify_statusreply' ),
|
||||
);
|
||||
);/*noLibHook*/
|
||||
|
||||
return $_NOTIFY;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+1
-1
@@ -5,6 +5,6 @@
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
<a href="http://www.invisionpower.com/">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,106 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Fetches meta data for notifications
|
||||
* Last Updated: $Date: 2011-09-21 10:55:45 -0400 (Wed, 21 Sep 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $author$
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 9528 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class members_class_notifications
|
||||
{
|
||||
/**
|
||||
* Construct
|
||||
*
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
/* Make object */
|
||||
$this->registry = ipsRegistry::instance();
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
$this->lang = $this->registry->getClass('class_localization');
|
||||
$this->member = $this->registry->member();
|
||||
$this->memberData =& $this->registry->member()->fetchMemberData();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'members' ) . '/sources/classes/messaging/messengerFunctions.php', 'messengerFunctions', 'members' );
|
||||
$this->messengerFunctions = new $classToLoad( $this->registry );
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches data by meta data
|
||||
* Must return: authorId, content, title, date
|
||||
* @param array $metaData
|
||||
*/
|
||||
public function getLinkedDataByMetaData( array $metaData )
|
||||
{
|
||||
/* Fetch topic */
|
||||
$topic = $this->messengerFunctions->fetchTopicDataWithMessage( $metaData['meta_id'] );
|
||||
|
||||
/* Get participants */
|
||||
$parts = $this->messengerFunctions->fetchTopicParticipants( $metaData['meta_id'] );
|
||||
|
||||
/* New or reply? */
|
||||
if ( ! empty( $parts[ $this->memberData['member_id'] ]['map_read_time'] ) && ! empty( $parts[ $this->memberData['member_id'] ]['map_has_unread'] ) )
|
||||
{
|
||||
/* Is reply */
|
||||
$msg = $this->messengerFunctions->fetchMessageData( $metaData['meta_id'], $topic['mt_last_msg_id'] );
|
||||
|
||||
$topic['msg_author_id'] = $msg['msg_author_id'];
|
||||
$topic['msg_post'] = $msg['msg_post'];
|
||||
$topic['msg_date'] = $msg['msg_date'];
|
||||
}
|
||||
|
||||
/* Is this a new topic or reply? */
|
||||
return array( 'authorId' => $topic['msg_author_id'],
|
||||
'content' => $this->_formatMessageForDisplay( $topic['msg_post'], $this->memberData ),
|
||||
'title' => $topic['mt_title'],
|
||||
'date' => $topic['msg_date'],
|
||||
'type' => $this->lang->words['gbl_notify_pm'] );
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to format the actual message (applies BBcode, etc)
|
||||
*
|
||||
* @param string Raw text
|
||||
* @param array PM data
|
||||
* @return string Processed text
|
||||
*/
|
||||
private function _formatMessageForDisplay( $msgContent, $data=array() )
|
||||
{
|
||||
IPSText::resetTextClass('bbcode');
|
||||
|
||||
$this->settings['max_emos'] = 0;
|
||||
|
||||
IPSText::getTextClass('bbcode')->parse_smilies = 1;
|
||||
IPSText::getTextClass('bbcode')->parse_nl2br = 1;
|
||||
IPSText::getTextClass('bbcode')->parse_html = 0;
|
||||
IPSText::getTextClass('bbcode')->parse_bbcode = 1;
|
||||
IPSText::getTextClass('bbcode')->parsing_section = 'pms';
|
||||
IPSText::getTextClass( 'bbcode' )->parsing_mgroup = $data['member_group_id'];
|
||||
IPSText::getTextClass( 'bbcode' )->parsing_mgroup_others = $data['mgroup_others'];
|
||||
|
||||
$msgContent = IPSText::getTextClass('bbcode')->preDisplayParse( $msgContent );
|
||||
|
||||
return $msgContent;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,77 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Portal plugin: online users
|
||||
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 1st march 2002
|
||||
* @version $Revision: 5713 $
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
* This file must be named {file_name_minus_php}-cfg.php
|
||||
*
|
||||
* Please see each variable for more information
|
||||
* $PORTAL_CONFIG is OK for each file, do not change
|
||||
* this array name.
|
||||
*/
|
||||
|
||||
$PORTAL_CONFIG = array();
|
||||
|
||||
/**
|
||||
* Main plug in title
|
||||
*
|
||||
*/
|
||||
$PORTAL_CONFIG['pc_title'] = 'Онлайн пользователи';
|
||||
|
||||
/**
|
||||
* Plug in mini description
|
||||
*
|
||||
*/
|
||||
$PORTAL_CONFIG['pc_desc'] = "Блок онлайн пользователей";
|
||||
|
||||
/**
|
||||
* Keyword for settings. This is the keyword
|
||||
* entered into ibf_conf_settings_titles -> conf_title_keyword
|
||||
* Can be left blank.
|
||||
* PLEASE stick to the naming convention when entering a setting
|
||||
* keyword: portal_{file_name_minus_php} This will prevent
|
||||
* other keyword clashes. Likewise, when creating settings, choose
|
||||
* NOT to cache them (they will be loaded at run time) and always
|
||||
* prefix with {file_name_minus_php}_setting_key - for example
|
||||
* If you had a setting called "export_forums" then please name it
|
||||
* "recent_topics_export_forums". This will be available in
|
||||
* $this->settings['recent_topics_export_forums'] in the
|
||||
* main module.
|
||||
*/
|
||||
$PORTAL_CONFIG['pc_settings_keyword'] = "";
|
||||
|
||||
/**
|
||||
* Exportable tags key must be in the naming format of:
|
||||
* {file_name_minus_php}-tag. The value *MUST* be the function
|
||||
* which it corresponds to. For example:
|
||||
* 'recent_topics_last_x' => 'recent_topics_last_x'
|
||||
* The portal will look for function 'recent_topics_last_x' in
|
||||
* module "sources/portal_plugins/recent_topics.php" when it parses
|
||||
* the tag <!--::recent_topics_last_x::-->
|
||||
*
|
||||
* @param array[ TAG ] = array( FUNCTION NAME, DESCRIPTION );
|
||||
*/
|
||||
$PORTAL_CONFIG['pc_exportable_tags']['online_users_show'] = array( 'online_users_show', 'Shows the online users' );
|
||||
@@ -1,58 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Portal plugin: online users
|
||||
* Last Updated: $Date: 2010-10-21 07:08:38 -0400 (Thu, 21 Oct 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 1st march 2002
|
||||
* @version $Revision: 7007 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class ppi_online_users extends public_portal_portal_portal
|
||||
{
|
||||
/**
|
||||
* Initialize module
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function init()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the online users
|
||||
*
|
||||
* @return string HTML content to replace tag with
|
||||
*/
|
||||
public function online_users_show()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Get the users from the DB
|
||||
//-----------------------------------------
|
||||
|
||||
$classToLoad = IPSLib::loadActionOverloader( IPSLib::getAppDir( 'forums', 'forums' ) . '/boards.php', 'public_forums_forums_boards' );
|
||||
$boards = new $classToLoad();
|
||||
$boards->makeRegistryShortcuts( $this->registry );
|
||||
|
||||
$active = $boards->getActiveUserDetails();
|
||||
$active['visitors'] = $active['GUESTS'] + $active['ANON'];
|
||||
$active['members'] = $active['MEMBERS'];
|
||||
|
||||
return $this->registry->getClass('output')->getTemplate('portal')->onlineUsers( $active );
|
||||
}
|
||||
}
|
||||
@@ -2,20 +2,21 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Config for about me tab
|
||||
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since 20th February 2002
|
||||
* @version $Rev: 5713 $
|
||||
*
|
||||
* @note This file is only included in order to *disable* the tab for 3.1 upgrades
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
@@ -42,7 +43,7 @@ $CONFIG['plugin_key'] = 'aboutme';
|
||||
/**
|
||||
* Show tab?
|
||||
*/
|
||||
$CONFIG['plugin_enabled'] = 1;
|
||||
$CONFIG['plugin_enabled'] = 0;
|
||||
|
||||
/**
|
||||
* Order
|
||||
|
||||
@@ -1,96 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Profile Plugin Library
|
||||
* Last Updated: $Date: 2010-05-24 11:38:42 -0400 (Mon, 24 May 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: michael $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 20th February 2002
|
||||
* @version $Revision: 6381 $
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class profile_aboutme extends profile_plugin_parent
|
||||
{
|
||||
/**
|
||||
* Feturn HTML block
|
||||
*
|
||||
* @access public
|
||||
* @param array Member information
|
||||
* @return string HTML block
|
||||
*/
|
||||
public function return_html_block( $member=array() )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Got a member?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! is_array( $member ) OR ! count( $member ) )
|
||||
{
|
||||
return $this->registry->getClass('output')->getTemplate('profile')->tabNoContent( 'err_no_aboutme_to_show' );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Format signature
|
||||
//-----------------------------------------
|
||||
|
||||
if( $member['signature'] )
|
||||
{
|
||||
IPSText::getTextClass('bbcode')->parse_bbcode = $this->settings[ 'msg_allow_code' ];
|
||||
IPSText::getTextClass('bbcode')->parse_smilies = 0;
|
||||
IPSText::getTextClass('bbcode')->parse_html = $this->settings[ 'msg_allow_html' ];
|
||||
IPSText::getTextClass('bbcode')->parse_nl2br = 1;
|
||||
IPSText::getTextClass('bbcode')->parsing_section = 'signatures';
|
||||
IPSText::getTextClass( 'bbcode' )->parsing_mgroup = $member['member_group_id'];
|
||||
IPSText::getTextClass( 'bbcode' )->parsing_mgroup_others = $member['mgroup_others'];
|
||||
|
||||
$member['signature'] = IPSText::getTextClass( 'bbcode' )->preDisplayParse( $member['signature'] );
|
||||
|
||||
$member['signature'] = $this->registry->getClass('output')->getTemplate('global')->signature_separator( $member['signature'] );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Format 'About me'
|
||||
//-----------------------------------------
|
||||
|
||||
IPSText::getTextClass( 'bbcode' )->parse_html = intval($this->settings['aboutme_html']);
|
||||
IPSText::getTextClass( 'bbcode' )->parse_nl2br = 1;
|
||||
IPSText::getTextClass( 'bbcode' )->parse_smilies = $this->settings['aboutme_emoticons'];
|
||||
IPSText::getTextClass( 'bbcode' )->parse_bbcode = $this->settings['aboutme_bbcode'];
|
||||
IPSText::getTextClass( 'bbcode' )->parsing_section = 'aboutme';
|
||||
IPSText::getTextClass( 'bbcode' )->parsing_mgroup = $member['member_group_id'];
|
||||
IPSText::getTextClass( 'bbcode' )->parsing_mgroup_others = $member['mgroup_others'];
|
||||
|
||||
$member['pp_about_me'] = IPSText::getTextClass( 'bbcode' )->preDisplayParse( $member['pp_about_me'] );
|
||||
|
||||
$content = $this->registry->getClass('output')->getTemplate('profile')->tabAboutMe( $member );
|
||||
|
||||
//-----------------------------------------
|
||||
// Macros...
|
||||
//-----------------------------------------
|
||||
|
||||
$content = $this->registry->output->replaceMacros( $content );
|
||||
|
||||
//-----------------------------------------
|
||||
// Return content..
|
||||
//-----------------------------------------
|
||||
|
||||
return $content ? $content : $this->registry->getClass('output')->getTemplate('profile')->tabNoContent( 'err_no_aboutme_to_show' );
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Config for about me tab
|
||||
* Last Updated: $Date: 2011-03-14 13:48:27 -0400 (Mon, 14 Mar 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://hatynka.in
|
||||
* @since 20th February 2002
|
||||
* @version $Rev: 8063 $
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
* Plug in name (Default tab name)
|
||||
*/
|
||||
$CONFIG['plugin_name'] = 'Friends';
|
||||
|
||||
/**
|
||||
* Language string for the tab
|
||||
*/
|
||||
$CONFIG['plugin_lang_bit'] = 'pp_tab_friends';
|
||||
|
||||
/**
|
||||
* Plug in key (must be the same as the main {file}.php name
|
||||
*/
|
||||
$CONFIG['plugin_key'] = 'friends';
|
||||
|
||||
/**
|
||||
* Show tab?
|
||||
*/
|
||||
$CONFIG['plugin_enabled'] = 1;
|
||||
|
||||
/**
|
||||
* Order
|
||||
*/
|
||||
$CONFIG['plugin_order'] = 2;
|
||||
@@ -0,0 +1,99 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Profile Plugin Library
|
||||
* Last Updated: $Date: 2011-05-31 15:22:26 -0400 (Tue, 31 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://hatynka.in
|
||||
* @since 20th February 2002
|
||||
* @version $Revision: 8931 $
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class profile_friends extends profile_plugin_parent
|
||||
{
|
||||
/**
|
||||
* Feturn HTML block
|
||||
*
|
||||
* @param array Member information
|
||||
* @return string HTML block
|
||||
*/
|
||||
public function return_html_block( $member=array() )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Got a member?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! is_array( $member ) OR ! count( $member ) )
|
||||
{
|
||||
return $this->registry->getClass('output')->getTemplate('profile')->tabNoContent( 'err_no_aboutme_to_show' );
|
||||
}
|
||||
|
||||
$friends = array();
|
||||
|
||||
//-----------------------------------------
|
||||
// Grab the friends
|
||||
//-----------------------------------------
|
||||
|
||||
$this->DB->build( array( 'select' => 'f.*',
|
||||
'from' => array( 'profile_friends' => 'f' ),
|
||||
'where' => 'f.friends_member_id=' . $member['member_id'] . ' AND f.friends_approved=1',
|
||||
//'order' => 'm.members_display_name ASC',
|
||||
'add_join' => array(
|
||||
1 => array( 'select' => 'pp.*',
|
||||
'from' => array( 'profile_portal' => 'pp' ),
|
||||
'where' => 'pp.pp_member_id=f.friends_friend_id',
|
||||
'type' => 'left' ),
|
||||
2 => array( 'select' => 'm.*',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => 'm.member_id=f.friends_friend_id',
|
||||
'type' => 'left' )
|
||||
)
|
||||
) );
|
||||
$outer = $this->DB->execute();
|
||||
|
||||
//-----------------------------------------
|
||||
// Get and store...
|
||||
//-----------------------------------------
|
||||
|
||||
while( $row = $this->DB->fetch($outer) )
|
||||
{
|
||||
if( $row['member_id'] )
|
||||
{
|
||||
$friends[ $row['members_display_name'] ] = IPSMember::buildDisplayData( $row, 0 );
|
||||
}
|
||||
}
|
||||
|
||||
ksort($friends);
|
||||
|
||||
$content = $this->registry->getClass('output')->getTemplate('profile')->tabFriends( $friends, $member );
|
||||
|
||||
//-----------------------------------------
|
||||
// Macros...
|
||||
//-----------------------------------------
|
||||
|
||||
$content = $this->registry->output->replaceMacros( $content );
|
||||
|
||||
//-----------------------------------------
|
||||
// Return content..
|
||||
//-----------------------------------------
|
||||
|
||||
return $content ? $content : $this->registry->getClass('output')->getTemplate('profile')->tabNoContent( 'err_no_aboutme_to_show' );
|
||||
}
|
||||
|
||||
}
|
||||
@@ -5,6 +5,6 @@
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -2,19 +2,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Config for about me tab
|
||||
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* Last Updated: $Date: 2010-12-17 07:40:13 -0500 (Fri, 17 Dec 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since 20th February 2002
|
||||
* @version $Rev: 5713 $
|
||||
* @version $Rev: 7442 $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -3,19 +3,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Profile Plugin Library
|
||||
* Last Updated: $Date: 2010-07-15 21:31:17 -0400 (Thu, 15 Jul 2010) $
|
||||
* Last Updated: $Date: 2011-08-25 07:46:38 -0400 (Thu, 25 Aug 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @author $Author: mmecham $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since 20th February 2002
|
||||
* @version $Revision: 6661 $
|
||||
* @version $Revision: 9413 $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -30,7 +30,6 @@ class profile_status extends profile_plugin_parent
|
||||
/**
|
||||
* Feturn HTML block
|
||||
*
|
||||
* @access public
|
||||
* @param array Member information
|
||||
* @return string HTML block
|
||||
*/
|
||||
@@ -49,12 +48,9 @@ class profile_status extends profile_plugin_parent
|
||||
}
|
||||
|
||||
/* Fetch */
|
||||
$statuses = $this->registry->getClass('memberStatus')->fetch( $this->memberData, array( 'member_id' => $member['member_id'], 'limit' => 2 ) );
|
||||
|
||||
/* Fetch actions */
|
||||
$actions = $this->registry->getClass('memberStatus')->fetchActions( $this->memberData, array( 'member_id' => $member['member_id'], 'limit' => 10, 'not_theirs' => 1, 'custom' => 0 ) );
|
||||
|
||||
$content = $this->registry->getClass('output')->getTemplate('profile')->tabStatusUpdates( $statuses, $actions, $member );
|
||||
$statuses = $this->registry->getClass('memberStatus')->fetch( $this->memberData, array( 'relatedTo' => $member['member_id'], 'isApproved' => true, 'limit' => 10 ) );
|
||||
|
||||
$content = $this->registry->getClass('output')->getTemplate('profile')->tabStatusUpdates( $statuses, array(), $member );
|
||||
|
||||
/* Replace Macros and return */
|
||||
$content = $this->registry->output->replaceMacros( $content );
|
||||
|
||||
@@ -5,6 +5,6 @@
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -2,19 +2,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Report Center :: Private Messages plugin
|
||||
* Last Updated: $LastChangedDate: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* Last Updated: $LastChangedDate: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @author $Author: ips_terabyte $
|
||||
* @author Based on original "Report Center" by Luke Scott
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 5713 $
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 8644 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
@@ -25,25 +25,32 @@ if ( ! defined( 'IN_IPB' ) )
|
||||
|
||||
class messages_plugin
|
||||
{
|
||||
/**#@+
|
||||
* Registry objects
|
||||
/**
|
||||
* Registry Object Shortcuts
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
*/
|
||||
* @var $registry
|
||||
* @var $DB
|
||||
* @var $settings
|
||||
* @var $request
|
||||
* @var $lang
|
||||
* @var $member
|
||||
* @var $memberData
|
||||
* @var $cache
|
||||
* @var $caches
|
||||
*/
|
||||
protected $registry;
|
||||
protected $DB;
|
||||
protected $settings;
|
||||
protected $request;
|
||||
protected $lang;
|
||||
protected $member;
|
||||
protected $memberData;
|
||||
protected $cache;
|
||||
/**#@-*/
|
||||
protected $caches;
|
||||
|
||||
/**
|
||||
* Holds extra data for the plugin
|
||||
*
|
||||
* @access private
|
||||
* @var array Data specific to the plugin
|
||||
*/
|
||||
public $_extra;
|
||||
@@ -51,9 +58,8 @@ class messages_plugin
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry object
|
||||
* @return void
|
||||
* @param object $registry Registry object
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct( ipsRegistry $registry )
|
||||
{
|
||||
@@ -75,7 +81,6 @@ class messages_plugin
|
||||
/**
|
||||
* Display the form for extra data in the ACP
|
||||
*
|
||||
* @access public
|
||||
* @param array Plugin data
|
||||
* @param object HTML object
|
||||
* @return string HTML to add to the form
|
||||
@@ -114,7 +119,6 @@ class messages_plugin
|
||||
/**
|
||||
* Process the plugin's form fields for saving
|
||||
*
|
||||
* @access public
|
||||
* @param array Plugin data for save
|
||||
* @return string Error message
|
||||
*/
|
||||
@@ -128,7 +132,6 @@ class messages_plugin
|
||||
/**
|
||||
* Update timestamp for report
|
||||
*
|
||||
* @access public
|
||||
* @param array New reports
|
||||
* @param array New members cache
|
||||
* @return boolean
|
||||
@@ -141,7 +144,6 @@ class messages_plugin
|
||||
/**
|
||||
* Get report permissions
|
||||
*
|
||||
* @access public
|
||||
* @param string Type of perms to check
|
||||
* @param array Permissions data
|
||||
* @param array group ids
|
||||
@@ -163,7 +165,6 @@ class messages_plugin
|
||||
/**
|
||||
* Show the report form for this module
|
||||
*
|
||||
* @access public
|
||||
* @param array Application data
|
||||
* @return string HTML form information
|
||||
*/
|
||||
@@ -220,7 +221,6 @@ class messages_plugin
|
||||
/**
|
||||
* Get section and link
|
||||
*
|
||||
* @access public
|
||||
* @param array Report data
|
||||
* @return array Section/link
|
||||
*/
|
||||
@@ -235,7 +235,6 @@ class messages_plugin
|
||||
/**
|
||||
* Process a report and save the data appropriate
|
||||
*
|
||||
* @access public
|
||||
* @param array Report data
|
||||
* @return array Data from saving the report
|
||||
*/
|
||||
@@ -357,12 +356,27 @@ class messages_plugin
|
||||
return $return_data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Accepts an array of data from rc_reports_index and returns an array formatted nearly identical to processReport()
|
||||
*
|
||||
* @param array Report data
|
||||
* @return array Formatted report data
|
||||
*/
|
||||
public function formatReportData( $report_data )
|
||||
{
|
||||
return array(
|
||||
'REDIRECT_URL' => $report_data['url'],
|
||||
'REPORT_INDEX' => $report_data['id'],
|
||||
'SAVED_URL' => str_replace( '&', '&', $report_data['url'] ),
|
||||
'REPORT' => '',
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Where to send user after report is submitted
|
||||
*
|
||||
* @access public
|
||||
* @param array Report data
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function reportRedirect( $report_data )
|
||||
{
|
||||
@@ -372,7 +386,6 @@ class messages_plugin
|
||||
/**
|
||||
* Retrieve list of users to send notifications to
|
||||
*
|
||||
* @access public
|
||||
* @param string Group ids
|
||||
* @param array Report data
|
||||
* @return array Array of users to PM/Email
|
||||
@@ -382,16 +395,16 @@ class messages_plugin
|
||||
$notify = array();
|
||||
|
||||
$this->DB->build( array(
|
||||
'select' => 'noti.*',
|
||||
'from' => array( 'rc_modpref' => 'noti' ),
|
||||
'where' => 'mem.member_group_id IN(' . $group_ids . ')',
|
||||
'add_join' => array(
|
||||
array(
|
||||
'select' => 'mem.member_id, mem.members_display_name as name, mem.language, mem.members_disable_pm, mem.email, mem.member_group_id',
|
||||
'from' => array( 'members' => 'mem' ),
|
||||
'where' => 'mem.member_id=noti.mem_id',
|
||||
)
|
||||
'select' => 'mem.member_id, mem.members_display_name as name, mem.language, mem.members_disable_pm, mem.email, mem.member_group_id',
|
||||
'from' => array( 'members' => 'mem' ),
|
||||
'where' => 'mem.member_group_id IN(' . $group_ids . ')',
|
||||
'add_join' => array(
|
||||
array(
|
||||
'select' => 'noti.*',
|
||||
'from' => array( 'rc_modpref' => 'noti' ),
|
||||
'where' => 'mem.member_id=noti.mem_id',
|
||||
)
|
||||
)
|
||||
) );
|
||||
$this->DB->execute();
|
||||
|
||||
|
||||
@@ -2,19 +2,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Report Center :: Profiles plugin
|
||||
* Last Updated: $LastChangedDate: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* Last Updated: $LastChangedDate: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @author $Author: ips_terabyte $
|
||||
* @author Based on original "Report Center" by Luke Scott
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 5713 $
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 8644 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
@@ -25,25 +25,32 @@ if ( ! defined( 'IN_IPB' ) )
|
||||
|
||||
class profiles_plugin
|
||||
{
|
||||
/**#@+
|
||||
* Registry objects
|
||||
/**
|
||||
* Registry Object Shortcuts
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
*/
|
||||
* @var $registry
|
||||
* @var $DB
|
||||
* @var $settings
|
||||
* @var $request
|
||||
* @var $lang
|
||||
* @var $member
|
||||
* @var $memberData
|
||||
* @var $cache
|
||||
* @var $caches
|
||||
*/
|
||||
protected $registry;
|
||||
protected $DB;
|
||||
protected $settings;
|
||||
protected $request;
|
||||
protected $lang;
|
||||
protected $member;
|
||||
protected $memberData;
|
||||
protected $cache;
|
||||
/**#@-*/
|
||||
protected $caches;
|
||||
|
||||
/**
|
||||
* Holds extra data for the plugin
|
||||
*
|
||||
* @access private
|
||||
* @var array Data specific to the plugin
|
||||
*/
|
||||
public $_extra;
|
||||
@@ -51,9 +58,8 @@ class profiles_plugin
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry object
|
||||
* @return void
|
||||
* @param object $registry Registry object
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct( ipsRegistry $registry )
|
||||
{
|
||||
@@ -75,7 +81,6 @@ class profiles_plugin
|
||||
/**
|
||||
* Display the form for extra data in the ACP
|
||||
*
|
||||
* @access public
|
||||
* @param array Plugin data
|
||||
* @param object HTML object
|
||||
* @return string HTML to add to the form
|
||||
@@ -90,7 +95,6 @@ class profiles_plugin
|
||||
/**
|
||||
* Process the plugin's form fields for saving
|
||||
*
|
||||
* @access public
|
||||
* @param array Plugin data for save
|
||||
* @return string Error message
|
||||
*/
|
||||
@@ -102,7 +106,6 @@ class profiles_plugin
|
||||
/**
|
||||
* Update timestamp for report
|
||||
*
|
||||
* @access public
|
||||
* @param array New reports
|
||||
* @param array New members cache
|
||||
* @return boolean
|
||||
@@ -115,7 +118,6 @@ class profiles_plugin
|
||||
/**
|
||||
* Get report permissions (only supermods can moderate profiles)
|
||||
*
|
||||
* @access public
|
||||
* @param string Type of perms to check
|
||||
* @param array Permissions data
|
||||
* @param array group ids
|
||||
@@ -137,7 +139,6 @@ class profiles_plugin
|
||||
/**
|
||||
* Show the report form for this module
|
||||
*
|
||||
* @access public
|
||||
* @param array Application data
|
||||
* @return string HTML form information
|
||||
*/
|
||||
@@ -176,7 +177,6 @@ class profiles_plugin
|
||||
/**
|
||||
* Get section and link
|
||||
*
|
||||
* @access public
|
||||
* @param array Report data
|
||||
* @return array Section/link
|
||||
*/
|
||||
@@ -193,7 +193,6 @@ class profiles_plugin
|
||||
/**
|
||||
* Process a report and save the data appropriate
|
||||
*
|
||||
* @access public
|
||||
* @param array Report data
|
||||
* @return array Data from saving the report
|
||||
*/
|
||||
@@ -293,13 +292,30 @@ class profiles_plugin
|
||||
|
||||
return $return_data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Accepts an array of data from rc_reports_index and returns an array formatted nearly identical to processReport()
|
||||
*
|
||||
* @param array Report data
|
||||
* @return array Formatted report data
|
||||
*/
|
||||
public function formatReportData( $report_data )
|
||||
{
|
||||
return array(
|
||||
'REDIRECT_URL' => $report_data['url'],
|
||||
'REPORT_INDEX' => $report_data['id'],
|
||||
'SAVED_URL' => str_replace( '&', '&', $report_data['url'] ),
|
||||
'REPORT' => '',
|
||||
'SEOTITLE' => $report_data['seoname'],
|
||||
'TEMPLATE' => 'showuser',
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Where to send user after report is submitted
|
||||
*
|
||||
* @access public
|
||||
* @param array Report data
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function reportRedirect( $report_data )
|
||||
{
|
||||
@@ -318,7 +334,6 @@ class profiles_plugin
|
||||
/**
|
||||
* Retrieve list of users to send notifications to
|
||||
*
|
||||
* @access public
|
||||
* @param string Group ids
|
||||
* @param array Report data
|
||||
* @return array Array of users to PM/Email
|
||||
@@ -328,16 +343,16 @@ class profiles_plugin
|
||||
$notify = array();
|
||||
|
||||
$this->DB->build( array(
|
||||
'select' => 'noti.*',
|
||||
'from' => array( 'rc_modpref' => 'noti' ),
|
||||
'where' => 'mem.member_group_id IN(' . $group_ids . ')',
|
||||
'add_join' => array(
|
||||
array(
|
||||
'select' => 'mem.member_id, mem.members_display_name as name, mem.language, mem.members_disable_pm, mem.email, mem.member_group_id',
|
||||
'from' => array( 'members' => 'mem' ),
|
||||
'where' => 'mem.member_id=noti.mem_id',
|
||||
)
|
||||
'select' => 'mem.member_id, mem.members_display_name as name, mem.language, mem.members_disable_pm, mem.email, mem.member_group_id',
|
||||
'from' => array( 'members' => 'mem' ),
|
||||
'where' => 'mem.member_group_id IN(' . $group_ids . ')',
|
||||
'add_join' => array(
|
||||
array(
|
||||
'select' => 'noti.*',
|
||||
'from' => array( 'rc_modpref' => 'noti' ),
|
||||
'where' => 'mem.member_id=noti.mem_id',
|
||||
)
|
||||
)
|
||||
) );
|
||||
$this->DB->execute();
|
||||
|
||||
|
||||
@@ -2,19 +2,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Config file
|
||||
* Last Updated: $Date: 2010-02-19 01:29:54 +0000 (Fri, 19 Feb 2010) $
|
||||
* Last Updated: $Date: 2011-04-14 23:16:18 -0400 (Thu, 14 Apr 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $author$
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 5855 $
|
||||
**/
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 8347 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
@@ -23,16 +23,22 @@ if ( ! defined( 'IN_IPB' ) )
|
||||
}
|
||||
|
||||
/* Can search with this app */
|
||||
$CONFIG['can_search'] = 1;
|
||||
$CONFIG['can_search'] = 1;
|
||||
|
||||
/* Can view new content with this app */
|
||||
$CONFIG['can_viewNewContent'] = 1;
|
||||
|
||||
/* Can fetch active content with this app */
|
||||
$CONFIG['can_activeContent'] = 1;
|
||||
$CONFIG['can_viewNewContent'] = 1;
|
||||
$CONFIG['can_vnc_filter_by_followed'] = 0;
|
||||
$CONFIG['can_vnc_unread_content'] = 0;
|
||||
|
||||
/* Can fetch user generated content */
|
||||
$CONFIG['can_userContent'] = 1;
|
||||
$CONFIG['can_userContent'] = 1;
|
||||
|
||||
/* Content types, put the default one first */
|
||||
$CONFIG['contentTypes'] = array( 'members', 'comments' );
|
||||
if( $_REQUEST['do'] == 'user_activity' )
|
||||
{
|
||||
$CONFIG['contentTypes'] = array( 'comments' );
|
||||
}
|
||||
else
|
||||
{
|
||||
$CONFIG['contentTypes'] = array( 'members', 'comments' );
|
||||
}
|
||||
@@ -5,6 +5,6 @@
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -2,18 +2,18 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Basic Forum Search
|
||||
* Last Updated: $Date: 2010-02-23 12:38:11 +0000 (Tue, 23 Feb 2010) $
|
||||
* Last Updated: $Date: 2011-07-28 18:01:32 -0400 (Thu, 28 Jul 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: matt $
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 5861 $
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 9330 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
@@ -35,11 +35,13 @@ class search_engine_members extends search_engine
|
||||
/**
|
||||
* Decide what type of search we're using
|
||||
*
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function search()
|
||||
{
|
||||
/* Hard limit */
|
||||
IPSSearchRegistry::set('set.hardLimit', ( ipsRegistry::$settings['search_hardlimit'] ) ? ipsRegistry::$settings['search_hardlimit'] : 200 );
|
||||
|
||||
/* Ok, now because the top bar search box defaults to members default search, which is profile comments, we need
|
||||
to convince it to default to members if the user used the top search bar with members selected */
|
||||
if ( $this->request['fromMainBar'] )
|
||||
@@ -47,13 +49,17 @@ class search_engine_members extends search_engine
|
||||
IPSSearchRegistry::set('members.searchInKey', 'members');
|
||||
}
|
||||
|
||||
if ( IPSSearchRegistry::get('members.searchInKey') AND IPSSearchRegistry::get('members.searchInKey') != 'comments' )
|
||||
if ( IPSSearchRegistry::get('members.searchInKey') == 'comments' )
|
||||
{
|
||||
return $this->_membersSearch();
|
||||
$this->request['search_app_filters']['members']['searchInKey'] = 'comments';
|
||||
|
||||
return $this->_commentsSearch();
|
||||
}
|
||||
else
|
||||
{
|
||||
return $this->_commentsSearch();
|
||||
$this->request['search_app_filters']['members']['searchInKey'] = 'members';
|
||||
|
||||
return $this->_membersSearch();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,86 +70,123 @@ class search_engine_members extends search_engine
|
||||
*
|
||||
* So if we had 1000 replies, and we are on page 2 of 25 per page, we'd return 25 items offset by 25
|
||||
*
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function _commentsSearch()
|
||||
{
|
||||
/* INIT */
|
||||
$count = 0;
|
||||
$results = array();
|
||||
$sort_by = IPSSearchRegistry::get('in.search_sort_by');
|
||||
$sort_order = IPSSearchRegistry::get('in.search_sort_order');
|
||||
$search_term = IPSSearchRegistry::get('in.clean_search_term');
|
||||
$content_title_only = IPSSearchRegistry::get('opt.searchTitleOnly');
|
||||
$post_search_only = IPSSearchRegistry::get('opt.onlySearchPosts');
|
||||
$order_dir = ( $sort_order == 'asc' ) ? 'asc' : 'desc';
|
||||
$sortKey = '';
|
||||
$sortType = '';
|
||||
$rows = array();
|
||||
$got = 0;
|
||||
|
||||
/* Sorting */
|
||||
switch( $sort_by )
|
||||
{
|
||||
default:
|
||||
case 'date':
|
||||
$sortKey = 'comment_date';
|
||||
$sortType = 'numerical';
|
||||
break;
|
||||
}
|
||||
|
||||
/* Not allowed to see profile information */
|
||||
if ( ! $this->memberData['g_mem_info'] )
|
||||
{
|
||||
return array( 'count' => 0, 'resultSet' => array() );
|
||||
}
|
||||
|
||||
/* Query the count */
|
||||
$count = $this->DB->buildAndFetch( array('select' => 'COUNT(*) as total_results',
|
||||
'from' => array( 'profile_comments' => 'c' ),
|
||||
'where' => $this->_buildCommentsWhereStatement( $search_term, $content_title_only ),
|
||||
'add_join' => array( array( 'from' => array( 'profile_portal' => 'p' ),
|
||||
'where' => "p.pp_member_id=c.comment_by_member_id",
|
||||
'type' => 'left' ) ) ) );
|
||||
/* INIT */
|
||||
$sort_order = IPSSearchRegistry::get('in.search_sort_order');
|
||||
$search_term = IPSSearchRegistry::get('in.clean_search_term');
|
||||
$rows = array();
|
||||
|
||||
|
||||
|
||||
/* Fetch data */
|
||||
$this->DB->build( array('select' => 'c.*',
|
||||
'from' => array( 'profile_comments' => 'c' ),
|
||||
'where' => $this->_buildCommentsWhereStatement( $search_term, $content_title_only ),
|
||||
'order' => $sortKey . ' ' . $sort_order,
|
||||
'limit' => array( IPSSearchRegistry::get('in.start'), IPSSearchRegistry::get('opt.search_per_page') ),
|
||||
'add_join' => array( array( 'select' => 'x.members_display_name as members_display_name_from, x.members_seo_name as members_seo_name_from',
|
||||
'from' => array( 'members' => 'x' ),
|
||||
'where' => "x.member_id=c.comment_by_member_id",
|
||||
'type' => 'left' ),
|
||||
array( 'select' => 'm.*',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => "m.member_id=c.comment_for_member_id",
|
||||
'type' => 'left' ),
|
||||
array( 'select' => 'p.*',
|
||||
'from' => array( 'profile_portal' => 'p' ),
|
||||
'where' => "p.pp_member_id=c.comment_for_member_id",
|
||||
'type' => 'left' ) ) ) );
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$this->DB->execute();
|
||||
$this->DB->build( array(
|
||||
'select' => "s.status_id, s.status_date",
|
||||
'from' => 'member_status_updates s',
|
||||
'where' => $this->_buildCommentsWhereStatement( $search_term ),
|
||||
'limit' => array(0, IPSSearchRegistry::get('set.hardLimit') + 1),
|
||||
'order' => 's.status_date ' . $sort_order ) );
|
||||
|
||||
/* Sort */
|
||||
while ( $_row = $this->DB->fetch() )
|
||||
{
|
||||
$rows[ $got ] = $_row;
|
||||
|
||||
$got++;
|
||||
$DB = $this->DB->execute();
|
||||
|
||||
/* Fetch all to sort */
|
||||
while( $r = $this->DB->fetch( $DB ) )
|
||||
{
|
||||
if ( IPSSearchRegistry::get('opt.noPostPreview') )
|
||||
{
|
||||
$_rows[ $r['status_id'] ] = $r;
|
||||
}
|
||||
else
|
||||
{
|
||||
$_rows[ $r['status_id'] ] = $r;
|
||||
}
|
||||
}
|
||||
|
||||
/* Got any replies? */
|
||||
if ( count( IPSSearchRegistry::get('_internal.replyIds') ) )
|
||||
{
|
||||
$this->DB->build( array(
|
||||
'select' => "r.*, r.reply_date as status_date",
|
||||
'from' => array( 'member_status_replies' => 'r' ),
|
||||
'where' => 'r.reply_id IN( ' . implode( ',', IPSSearchRegistry::get('_internal.replyIds') ) . ')',
|
||||
'add_join' => array_merge( array( array( 'select' => 's.status_id, s.status_member_id, s.status_author_id',
|
||||
'from' => array( 'member_status_updates' => 's' ),
|
||||
'where' => 's.status_id=r.reply_status_id',
|
||||
'type' => 'left' ),
|
||||
array( 'select' => 'm.member_id as owner_id, m.members_display_name as owner_display_name, m.members_seo_name as owner_seo_name',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => 'm.member_id=s.status_member_id',
|
||||
'type' => 'left' ),
|
||||
array( 'select' => 'mem.member_id as author_id, mem.members_display_name as author_display_name, mem.members_seo_name as author_seo_name',
|
||||
'from' => array( 'members' => 'mem' ),
|
||||
'where' => 'mem.member_id=s.status_author_id',
|
||||
'type' => 'left' ) ) ) ) );
|
||||
/* Grab data */
|
||||
$this->DB->execute();
|
||||
|
||||
/* Grab the results */
|
||||
while( $row = $this->DB->fetch() )
|
||||
{
|
||||
$_rows[ $row['reply_status_id'] ] = $row;
|
||||
$_replies[ $row['reply_status_id'] ] = $row;
|
||||
}
|
||||
}
|
||||
|
||||
/* Store */
|
||||
IPSSearchRegistry::set('_internal.replyData', $_replies );
|
||||
|
||||
/* Fetch count */
|
||||
$count = count( $_rows );
|
||||
$c = 0;
|
||||
$rows = array();
|
||||
$got = 0;
|
||||
|
||||
if ( $count > IPSSearchRegistry::get('set.hardLimit') )
|
||||
{
|
||||
$count = IPSSearchRegistry::get('set.hardLimit');
|
||||
|
||||
IPSSearchRegistry::set('set.resultsCutToLimit', true );
|
||||
}
|
||||
|
||||
/* Set vars */
|
||||
IPSSearch::$ask = 'status_date';
|
||||
IPSSearch::$aso = strtolower( $sort_order );
|
||||
IPSSearch::$ast = 'numerical';
|
||||
|
||||
/* Sort */
|
||||
if ( count( $_rows ) )
|
||||
{
|
||||
usort( $_rows, array("IPSSearch", "usort") );
|
||||
|
||||
/* Build result array */
|
||||
foreach( $_rows as $r )
|
||||
{
|
||||
$c++;
|
||||
|
||||
if ( IPSSearchRegistry::get('in.start') AND IPSSearchRegistry::get('in.start') >= $c )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$rows[ $got ] = $r['status_id'];
|
||||
|
||||
$got++;
|
||||
|
||||
/* Done? */
|
||||
if ( IPSSearchRegistry::get('opt.search_per_page') AND $got >= IPSSearchRegistry::get('opt.search_per_page') )
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Return it */
|
||||
return array( 'count' => $count['total_results'], 'resultSet' => $rows );
|
||||
return array( 'count' => $count, 'resultSet' => $rows );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -153,26 +196,18 @@ class search_engine_members extends search_engine
|
||||
*
|
||||
* So if we had 1000 replies, and we are on page 2 of 25 per page, we'd return 25 items offset by 25
|
||||
*
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function _membersSearch()
|
||||
{
|
||||
/* INIT */
|
||||
$count = 0;
|
||||
$results = array();
|
||||
$sort_by = IPSSearchRegistry::get('in.search_sort_by');
|
||||
$sort_order = IPSSearchRegistry::get('in.search_sort_order');
|
||||
$search_term = IPSSearchRegistry::get('in.clean_search_term');
|
||||
$content_title_only = IPSSearchRegistry::get('opt.searchTitleOnly');
|
||||
$post_search_only = IPSSearchRegistry::get('opt.onlySearchPosts');
|
||||
$order_dir = ( $sort_order == 'asc' ) ? 'asc' : 'desc';
|
||||
$sortKey = '';
|
||||
$sortType = '';
|
||||
$rows = array();
|
||||
$got = 0;
|
||||
/* INIT */
|
||||
$sort_by = IPSSearchRegistry::get('in.search_sort_by');
|
||||
$sort_order = IPSSearchRegistry::get('in.search_sort_order');
|
||||
$search_term = IPSSearchRegistry::get('in.clean_search_term');
|
||||
$sortKey = '';
|
||||
$rows = array();
|
||||
|
||||
if ( IPSSearchRegistry::get('opt.noPostPreview') OR IPSSearchRegistry::get('display.onlyTitles') )
|
||||
if ( IPSSearchRegistry::get('opt.noPostPreview') OR IPSSearchRegistry::get('opt.searchType') == 'titles' )
|
||||
{
|
||||
$group_by = 'm.member_id';
|
||||
}
|
||||
@@ -182,19 +217,17 @@ class search_engine_members extends search_engine
|
||||
{
|
||||
default:
|
||||
case 'date':
|
||||
$sortKey = ( $content_title_only ) ? 'member_id' : 'member_id';
|
||||
$sortType = 'numerical';
|
||||
$sortKey = 'member_id';
|
||||
break;
|
||||
case 'title':
|
||||
$sortKey = 'members_l_display_name';
|
||||
$sortType = 'string';
|
||||
break;
|
||||
}
|
||||
|
||||
/* Query the count */
|
||||
$count = $this->DB->buildAndFetch( array('select' => 'COUNT(*) as total_results',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => $this->_buildWhereStatement( $search_term, $content_title_only ),
|
||||
'where' => $this->_buildWhereStatement( $search_term ),
|
||||
'group' => $group_by,
|
||||
'add_join' => array( array( 'from' => array( 'profile_portal' => 'p' ),
|
||||
'where' => "p.pp_member_id=m.member_id",
|
||||
@@ -205,7 +238,7 @@ class search_engine_members extends search_engine
|
||||
/* Fetch data */
|
||||
$this->DB->build( array('select' => 'm.*',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => $this->_buildWhereStatement( $search_term, $content_title_only ),
|
||||
'where' => $this->_buildWhereStatement( $search_term ),
|
||||
'group' => $group_by,
|
||||
'order' => $sortKey . ' ' . $sort_order,
|
||||
'limit' => array( IPSSearchRegistry::get('in.start'), IPSSearchRegistry::get('opt.search_per_page') ),
|
||||
@@ -213,41 +246,144 @@ class search_engine_members extends search_engine
|
||||
'from' => array( 'profile_portal' => 'p' ),
|
||||
'where' => "p.pp_member_id=m.member_id",
|
||||
'type' => 'left' ) ) ) );
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$this->DB->execute();
|
||||
|
||||
/* Sort */
|
||||
/* Get results */
|
||||
while ( $_row = $this->DB->fetch() )
|
||||
{
|
||||
$rows[ $got ] = $_row;
|
||||
|
||||
$got++;
|
||||
$rows[] = IPSMember::buildProfilePhoto( $_row );
|
||||
}
|
||||
|
||||
/* Return it */
|
||||
return array( 'count' => $count['total_results'], 'resultSet' => $rows );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Perform the viewNewContent search
|
||||
* Populates $this->_count and $this->_results
|
||||
*
|
||||
* @access public
|
||||
* @return array
|
||||
* @note Does not support 'Content I have not read' because events are not tracked through topic marker class
|
||||
* @note Does not support 'Content I am following' because you cannot 'follow' members at this point in time
|
||||
*/
|
||||
public function viewNewContent()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Init
|
||||
//-----------------------------------------
|
||||
|
||||
IPSSearchRegistry::set('in.search_sort_by', 'date' );
|
||||
IPSSearchRegistry::set('in.search_sort_order', 'desc' );
|
||||
IPSSearchRegistry::set('opt.searchType', 'titles' );
|
||||
IPSSearchRegistry::set('opt.noPostPreview', true );
|
||||
|
||||
//-----------------------------------------
|
||||
// Set time limit
|
||||
//-----------------------------------------
|
||||
|
||||
if ( IPSSearchRegistry::get('in.period_in_seconds') !== false )
|
||||
{
|
||||
$this->search_begin_timestamp = ( IPS_UNIX_TIME_NOW - IPSSearchRegistry::get('in.period_in_seconds') );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->search_begin_timestamp = intval( $this->memberData['last_visit'] ) ? intval( $this->memberData['last_visit'] ) : IPS_UNIX_TIME_NOW;
|
||||
}
|
||||
|
||||
return $this->search();
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds the where portion of a search string
|
||||
*
|
||||
* @access private
|
||||
* @param string $search_term The string to use in the search
|
||||
* @param bool $content_title_only Search only title records
|
||||
* @param string $search_term The string to use in the search
|
||||
* @param bool $searchType Search only title records
|
||||
* @return string
|
||||
**/
|
||||
private function _buildCommentsWhereStatement( $search_term, $content_title_only=false )
|
||||
*/
|
||||
protected function _buildCommentsWhereStatement( $search_term, $searchType=null )
|
||||
{
|
||||
/* INI */
|
||||
$where_clause = array();
|
||||
|
||||
if( $search_term )
|
||||
$where_clause = array();
|
||||
$searchType = ( $searchType === null ) ? IPSSearchRegistry::get('opt.searchType') : $searchType;
|
||||
$sort_order = IPSSearchRegistry::get('in.search_sort_order');
|
||||
|
||||
if ( $search_term )
|
||||
{
|
||||
$where_clause[] = "c.comment_content LIKE '%" . mb_strtolower( $search_term ) . "%'";
|
||||
if ( $searchType == 'titles' )
|
||||
{
|
||||
$where_clause[] = $this->DB->buildSearchStatement( 's.status_content', $search_term, true, false, false );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( $searchType == 'content' )
|
||||
{
|
||||
$where_clause[] = $this->DB->buildSearchStatement( 'r.reply_content', $search_term, true, false, false );
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Set vars */
|
||||
IPSSearch::$ask = 'status_date';
|
||||
IPSSearch::$aso = strtolower( $sort_order );
|
||||
IPSSearch::$ast = 'numerical';
|
||||
|
||||
/* Find topic ids that match */
|
||||
$tids = array();
|
||||
$pids = array();
|
||||
|
||||
$this->DB->build( array('select' => "s.status_id, s.status_date",
|
||||
'from' => 'member_status_updates s',
|
||||
'where' => $this->_buildCommentsWhereStatement( $search_term, 'titles' ),
|
||||
'order' => 's.status_date ' . $sort_order,
|
||||
'limit' => array(0, IPSSearchRegistry::get('set.hardLimit')) ) );
|
||||
|
||||
$i = $this->DB->execute();
|
||||
|
||||
/* Grab the results */
|
||||
while( $row = $this->DB->fetch( $i ) )
|
||||
{
|
||||
$_rows[ $row['status_id'] ] = $row;
|
||||
}
|
||||
|
||||
/* Sort */
|
||||
if ( count( $_rows ) )
|
||||
{
|
||||
usort( $_rows, array("IPSSearch", "usort") );
|
||||
|
||||
foreach( $_rows as $id => $row )
|
||||
{
|
||||
$tids[] = $row['status_id'];
|
||||
}
|
||||
}
|
||||
|
||||
/* Set vars */
|
||||
IPSSearch::$ask = 'reply_date';
|
||||
IPSSearch::$aso = strtolower( $sort_order );
|
||||
IPSSearch::$ast = 'numerical';
|
||||
|
||||
$this->DB->build( array( 'select' => "r.reply_id, r.reply_date, r.reply_status_id as status_id",
|
||||
'from' => 'member_status_replies r',
|
||||
'where' => $this->_buildCommentsWhereStatement( $search_term, 'content' ),
|
||||
'order' => IPSSearch::$ask . ' ' . IPSSearch::$aso,
|
||||
'limit' => array(0, IPSSearchRegistry::get('set.hardLimit') ) ) );
|
||||
|
||||
$i = $this->DB->execute();
|
||||
|
||||
/* Grab the results */
|
||||
while( $row = $this->DB->fetch( $i ) )
|
||||
{
|
||||
$tids[] = $row['status_id'];
|
||||
$pids[] = $row['reply_id'];
|
||||
}
|
||||
|
||||
if ( count( $pids ) )
|
||||
{
|
||||
IPSSearchRegistry::set('_internal.replyIds', $pids );
|
||||
}
|
||||
|
||||
$where_clause[] = '( s.status_id IN (' . ( count($tids) ? implode( ',', $tids ) : 0 ) .') )';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Add in AND where conditions */
|
||||
@@ -264,51 +400,54 @@ class search_engine_members extends search_engine
|
||||
|
||||
/* Date Restrict */
|
||||
if( $this->search_begin_timestamp && $this->search_end_timestamp )
|
||||
{
|
||||
$where_clause[] = $this->DB->buildBetween( "c.comment_date", $this->search_begin_timestamp, $this->search_end_timestamp );
|
||||
{
|
||||
$where_clause[] = $this->DB->buildBetween( $searchType == 'content' ? "r.reply_date" : "s.status_date", $this->search_begin_timestamp, $this->search_end_timestamp );
|
||||
}
|
||||
else
|
||||
{
|
||||
if( $this->search_begin_timestamp )
|
||||
{
|
||||
$where_clause[] = "c.comment_date > {$this->search_begin_timestamp}";
|
||||
$where_clause[] = $searchType == 'content' ? "r.reply_date > {$this->search_begin_timestamp}" : "s.status_date > {$this->search_begin_timestamp}";
|
||||
}
|
||||
|
||||
if( $this->search_end_timestamp )
|
||||
{
|
||||
$where_clause[] = "c.comment_date < {$this->search_end_timestamp}";
|
||||
$where_clause[] = $searchType == 'content' ? "r.reply_date < {$this->search_end_timestamp}" : "s.status_date < {$this->search_end_timestamp}";
|
||||
}
|
||||
}
|
||||
|
||||
$where_clause[] = "c.comment_approved=1";
|
||||
|
||||
/* Build and return the string */
|
||||
return implode( " AND ", $where_clause );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Builds the where portion of a search string
|
||||
*
|
||||
* @access private
|
||||
* @param string $search_term The string to use in the search
|
||||
* @param bool $content_title_only Search only title records
|
||||
* @return string
|
||||
**/
|
||||
private function _buildWhereStatement( $search_term, $content_title_only=false )
|
||||
*/
|
||||
protected function _buildWhereStatement( $search_term )
|
||||
{
|
||||
/* INI */
|
||||
$where_clause = array();
|
||||
|
||||
if( $search_term )
|
||||
{
|
||||
if( $content_title_only )
|
||||
switch( IPSSearchRegistry::get('opt.searchType') )
|
||||
{
|
||||
$where_clause[] = "m.members_l_display_name LIKE '%" . mb_strtolower( $search_term ) . "%'";
|
||||
}
|
||||
else
|
||||
{
|
||||
$where_clause[] = "m.members_l_display_name LIKE '%" . mb_strtolower( $search_term ) . "%' OR p.signature LIKE '%{$search_term}%' OR p.pp_about_me LIKE '%{$search_term}%'";
|
||||
case 'both':
|
||||
default:
|
||||
$where_clause[] = "(m.members_l_display_name LIKE '%" . mb_strtolower( $search_term ) . "%' OR p.signature LIKE '%{$search_term}%' OR p.pp_about_me LIKE '%{$search_term}%')";
|
||||
break;
|
||||
|
||||
case 'titles':
|
||||
$where_clause[] = "m.members_l_display_name LIKE '%" . mb_strtolower( $search_term ) . "%'";
|
||||
break;
|
||||
|
||||
case 'content':
|
||||
$where_clause[] = "(p.signature LIKE '%{$search_term}%' OR p.pp_about_me LIKE '%{$search_term}%')";
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -349,16 +488,15 @@ class search_engine_members extends search_engine
|
||||
/**
|
||||
* Remap standard columns (Apps can override )
|
||||
*
|
||||
* @access public
|
||||
* @param string $column sql table column for this condition
|
||||
* @return string column
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function remapColumn( $column )
|
||||
{
|
||||
if ( IPSSearchRegistry::get( 'members.searchInKey') == 'comments' )
|
||||
{
|
||||
$column = ( $column == 'member_id' ) ? 'c.comment_by_member_id' : '';
|
||||
$column = ( $column == 'member_id' ) ? 'status_author_id' : '';
|
||||
}
|
||||
|
||||
return $column;
|
||||
@@ -367,62 +505,21 @@ class search_engine_members extends search_engine
|
||||
/**
|
||||
* Returns an array used in the searchplugin's setCondition method
|
||||
*
|
||||
* @access public
|
||||
* @param array $data Array of forums to view
|
||||
* @return array Array with column, operator, and value keys, for use in the setCondition call
|
||||
**/
|
||||
*/
|
||||
public function buildFilterSQL( $data )
|
||||
{
|
||||
/* INIT */
|
||||
$return = array();
|
||||
|
||||
/* Set up some defaults */
|
||||
IPSSearchRegistry::set( 'opt.noPostPreview' , false );
|
||||
IPSSearchRegistry::set( 'opt.onlySearchPosts', false );
|
||||
//IPSSearchRegistry::set( 'members.searchInKey' , 'comments' );
|
||||
|
||||
/* member specific search */
|
||||
/* Make default search type topics */
|
||||
if( isset( $data ) && is_array( $data ) && count( $data ) )
|
||||
{
|
||||
foreach( $data as $field => $_data )
|
||||
{
|
||||
/* CONTENT ONLY */
|
||||
if ( $field == 'searchInKey' AND $_data['searchInKey'] == 'members' )
|
||||
{
|
||||
//IPSSearchRegistry::set( 'member.searchType', 'members' );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Can handle boolean searching
|
||||
*
|
||||
* @access public
|
||||
* @return boolean
|
||||
*/
|
||||
public function isBoolean()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform the viewNewContent search
|
||||
* Forum Version
|
||||
* Populates $this->_count and $this->_results
|
||||
*
|
||||
* @access public
|
||||
* @return nothin'
|
||||
*/
|
||||
public function viewNewContent()
|
||||
{
|
||||
/* Set up some vars */
|
||||
IPSSearchRegistry::set('set.resultCutToDate', intval( $this->memberData['last_visit'] ) );
|
||||
|
||||
return parent::viewNewContent();
|
||||
}
|
||||
}
|
||||
@@ -2,19 +2,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Returns HTML for the form (optional class, not required)
|
||||
* Last Updated: $Date: 2010-02-19 01:29:54 +0000 (Fri, 19 Feb 2010) $
|
||||
* Last Updated: $Date: 2011-04-14 23:16:18 -0400 (Thu, 14 Apr 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $author$
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 5855 $
|
||||
**/
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 8347 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
@@ -45,8 +45,6 @@ class search_form_members
|
||||
/**
|
||||
* Return sort drop down
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function fetchSortDropDown()
|
||||
@@ -63,13 +61,19 @@ class search_form_members
|
||||
* Optional function to allow apps to define searchable 'sub-apps'.
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function fetchSortIn()
|
||||
{
|
||||
$array = array( 0 => array( 'members', $this->lang->words['s_msin_members'] ),
|
||||
1 => array( 'comments', $this->lang->words['s_msin_comments'] ) );
|
||||
if( $this->request['do'] == 'user_activity' )
|
||||
{
|
||||
$array = array();
|
||||
}
|
||||
else
|
||||
{
|
||||
$array = array( 0 => array( 'members', $this->lang->words['s_msin_members'] ),
|
||||
1 => array( 'comments', $this->lang->words['s_msin_comments'] ) );
|
||||
}
|
||||
|
||||
return $array;
|
||||
}
|
||||
|
||||
@@ -2,19 +2,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Formats forum search results
|
||||
* Last Updated: $Date: 2010-02-19 01:29:54 +0000 (Fri, 19 Feb 2010) $
|
||||
* Last Updated: $Date: 2011-06-15 07:22:24 -0400 (Wed, 15 Jun 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $author$
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 5855 $
|
||||
**/
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 9043 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
@@ -35,7 +35,6 @@ class search_format_members extends search_format
|
||||
/**
|
||||
* Parse search results
|
||||
*
|
||||
* @access private
|
||||
* @param array $r Search result
|
||||
* @return array $html Blocks of HTML
|
||||
*/
|
||||
@@ -47,35 +46,148 @@ class search_format_members extends search_format
|
||||
/**
|
||||
* Formats the forum search result for display
|
||||
*
|
||||
* @access public
|
||||
* @param array $search_row Array of data
|
||||
* @return mixed Formatted content, ready for display, or array containing a $sub section flag, and content
|
||||
**/
|
||||
*/
|
||||
public function formatContent( $data )
|
||||
{
|
||||
$data['misc'] = unserialize( $data['misc'] );
|
||||
$template = ( IPSSearchRegistry::get('members.searchInKey') AND IPSSearchRegistry::get('members.searchInKey') != 'comments' ) ? 'memberSearchResult' : 'memberCommentsSearchResult';
|
||||
$data['misc'] = unserialize( $data['misc'] );
|
||||
$template = IPSSearchRegistry::get('members.searchInKey') == 'comments' ? 'memberCommentsSearchResult' : 'memberSearchResult';
|
||||
|
||||
return array( ipsRegistry::getClass( 'output' )->getTemplate( 'search' )->$template( $data, IPSSearchRegistry::get('display.onlyTitles') ), 0 );
|
||||
return array( ipsRegistry::getClass( 'output' )->getTemplate( 'search' )->$template( $data, IPSSearchRegistry::get('opt.searchType') == 'titles' ? true : false ), 0 );
|
||||
}
|
||||
|
||||
/**
|
||||
* Formats / grabs extra data for results
|
||||
* Takes an array of IDS (can be IDs from anything) and returns an array of expanded data.
|
||||
*
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function processResults( $ids )
|
||||
{
|
||||
$rows = array();
|
||||
|
||||
foreach( $ids as $i => $d )
|
||||
if ( IPSSearchRegistry::get('members.searchInKey') == 'comments' )
|
||||
{
|
||||
$rows[ $i ] = $this->genericizeResults( $d );
|
||||
return $this->processResultsComments( $ids );
|
||||
}
|
||||
else
|
||||
{
|
||||
$rows = array();
|
||||
|
||||
foreach( $ids as $i => $d )
|
||||
{
|
||||
$rows[ $i ] = $this->genericizeResults( $d );
|
||||
}
|
||||
|
||||
return $rows;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Formats / grabs extra data for results
|
||||
* Takes an array of IDS (can be IDs from anything) and returns an array of expanded data.
|
||||
*
|
||||
* @param array $ids Ids
|
||||
* @return array
|
||||
*/
|
||||
public function processResultsComments( $ids )
|
||||
{
|
||||
/* INIT */
|
||||
$sort_order = IPSSearchRegistry::get('in.search_sort_order');
|
||||
$search_term = IPSSearchRegistry::get('in.clean_search_term');
|
||||
$content_title_only = IPSSearchRegistry::get('opt.searchType') == 'content' ? false : true;
|
||||
$members = array();
|
||||
$results = array();
|
||||
$statusIds = array();
|
||||
$replyIds = IPSSearchRegistry::get('_internal.replyIds');
|
||||
$replyData = IPSSearchRegistry::get('_internal.replyData');
|
||||
$replies = array();
|
||||
$sortKey = '';
|
||||
|
||||
/* Got some? */
|
||||
if ( count( $ids ) )
|
||||
{
|
||||
/* Set vars */
|
||||
IPSSearch::$ask = 'status_date';
|
||||
IPSSearch::$aso = strtolower( $sort_order );
|
||||
IPSSearch::$ast = 'numerical';
|
||||
|
||||
/* Get the status updates */
|
||||
$this->DB->build( array('select' => "s.*",
|
||||
'from' => array( 'member_status_updates' => 's' ),
|
||||
'where' => 's.status_id IN( ' . implode( ',', $ids ) . ')',
|
||||
'add_join' => array_merge( array( array( 'select' => 'm.member_id as owner_id, m.members_display_name as owner_display_name, m.members_seo_name as owner_seo_name',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => 'm.member_id=s.status_member_id',
|
||||
'type' => 'left' ),
|
||||
array( 'select' => 'mem.member_id as author_id, mem.members_display_name as author_display_name, mem.members_seo_name as author_seo_name',
|
||||
'from' => array( 'members' => 'mem' ),
|
||||
'where' => 'mem.member_id=s.status_author_id',
|
||||
'type' => 'left' ) ) ) ) );
|
||||
|
||||
/* Grab data */
|
||||
$this->DB->execute();
|
||||
|
||||
/* Grab the results */
|
||||
while( $row = $this->DB->fetch() )
|
||||
{
|
||||
$statusIds[ $row['status_id'] ] = $row;
|
||||
}
|
||||
|
||||
/* Sort */
|
||||
if ( count( $statusIds ) )
|
||||
{
|
||||
usort( $statusIds, array("IPSSearch", "usort") );
|
||||
|
||||
foreach( $statusIds as $id => $row )
|
||||
{
|
||||
/* Do we have any reply data? */
|
||||
if ( ! empty( $replyData[ $id ] ) )
|
||||
{
|
||||
$row = array_merge( $row, $replyData[ $id ] );
|
||||
}
|
||||
|
||||
/* Get author data? */
|
||||
if ( ! empty( $row['status_author_id'] ) )
|
||||
{
|
||||
$members[ $row['status_author_id'] ] = $row['status_author_id'];
|
||||
}
|
||||
|
||||
if ( ! empty( $row['status_member_id'] ) )
|
||||
{
|
||||
$members[ $row['status_member_id'] ] = $row['status_member_id'];
|
||||
}
|
||||
|
||||
if ( ! empty( $row['reply_member_id'] ) )
|
||||
{
|
||||
$members[ $row['reply_member_id'] ] = $row['reply_member_id'];
|
||||
}
|
||||
|
||||
$results[ $row['status_id'] ] = $row;
|
||||
}
|
||||
}
|
||||
|
||||
/* Need to load members? */
|
||||
if ( count( $members ) )
|
||||
{
|
||||
$mems = IPSMember::load( $members, 'all' );
|
||||
|
||||
foreach( $results as $id => $r )
|
||||
{
|
||||
$_status_member = IPSMember::buildDisplayData( $mems[ $r['status_member_id'] ], array( 'reputation' => 0, 'warn' => 0 ) );
|
||||
$_status_author = IPSMember::buildDisplayData( $mems[ $r['status_author_id'] ], array( 'reputation' => 0, 'warn' => 0 ) );
|
||||
|
||||
$results[ $id ]['status_member'] = $_status_member;
|
||||
$results[ $id ]['status_author'] = $_status_author;
|
||||
|
||||
if ( ! empty( $r['reply_member_id'] ) )
|
||||
{
|
||||
$results[ $id ]['reply_author'] = IPSMember::buildDisplayData( $mems[ $r['reply_member_id'] ], array( 'reputation' => 0, 'warn' => 0 ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $rows;
|
||||
return $results;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -83,38 +195,38 @@ class search_format_members extends search_format
|
||||
*
|
||||
* @param array $r
|
||||
* @return array
|
||||
**/
|
||||
*/
|
||||
public function genericizeResults( $r )
|
||||
{
|
||||
if ( IPSSearchRegistry::get('members.searchInKey') AND IPSSearchRegistry::get('members.searchInKey') != 'comments' )
|
||||
if ( IPSSearchRegistry::get('members.searchInKey') == 'comments' )
|
||||
{
|
||||
$r['app'] = 'members';
|
||||
$r['content'] = $r['signature'] . ' ' . $r['pp_about_me'];
|
||||
$r['content_title'] = $r['members_display_name'];
|
||||
$r['updated'] = time();
|
||||
$r['type_2'] = 'profile_view';
|
||||
$r['type_id_2'] = $r['member_id'];
|
||||
$r['misc'] = serialize( array(
|
||||
'pp_thumb_photo' => $r['pp_thumb_photo'],
|
||||
'pp_thumb_width' => $r['pp_thumb_width'],
|
||||
'pp_thumb_height' => $r['pp_thumb_height']
|
||||
) );
|
||||
}
|
||||
else
|
||||
{
|
||||
$r['app'] = 'members';
|
||||
$r['content'] = $r['comment_content'];
|
||||
$r['content_title'] = $r['member_display_name_owner'];
|
||||
$r['updated'] = $r['comment_date'];
|
||||
$r['type_2'] = 'comment_id';
|
||||
$r['type_id_2'] = $r['comment_id'];
|
||||
$r['misc'] = serialize( array(
|
||||
$r['app'] = 'members';
|
||||
$r['content'] = $r['comment_content'];
|
||||
$r['content_title'] = $r['member_display_name_owner'];
|
||||
$r['updated'] = $r['comment_date'];
|
||||
$r['type_2'] = 'comment_id';
|
||||
$r['type_id_2'] = $r['comment_id'];
|
||||
$r['misc'] = serialize( array(
|
||||
'members_display_name' => $r['members_display_name'],
|
||||
'pp_thumb_photo' => $r['pp_thumb_photo'],
|
||||
'pp_thumb_width' => $r['pp_thumb_width'],
|
||||
'pp_thumb_height' => $r['pp_thumb_height']
|
||||
) );
|
||||
}
|
||||
else
|
||||
{
|
||||
$r['app'] = 'members';
|
||||
$r['content'] = $r['signature'] . ' ' . $r['pp_about_me'];
|
||||
$r['content_title'] = $r['members_display_name'];
|
||||
$r['updated'] = time();
|
||||
$r['type_2'] = 'profile_view';
|
||||
$r['type_id_2'] = $r['member_id'];
|
||||
$r['misc'] = serialize( array(
|
||||
'pp_thumb_photo' => $r['pp_thumb_photo'],
|
||||
'pp_thumb_width' => $r['pp_thumb_width'],
|
||||
'pp_thumb_height' => $r['pp_thumb_height']
|
||||
) );
|
||||
}
|
||||
|
||||
return $r;
|
||||
}
|
||||
|
||||
@@ -5,6 +5,6 @@
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -3,95 +3,20 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Sphinx template file
|
||||
* Last Updated: $Date: 2010-06-22 03:39:59 -0400 (Tue, 22 Jun 2010) $
|
||||
* Last Updated: $Date: 2011-06-02 17:57:20 -0400 (Thu, 02 Jun 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: matt $
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 6566 $
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 8953 $
|
||||
* @since 3.0.0
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
$appSphinxTemplate = <<<EOF
|
||||
|
||||
############################## --- MEMBERS --- ##############################
|
||||
|
||||
source members_search_main : ipb_source_config
|
||||
{
|
||||
# Set our forum PID counter
|
||||
sql_query_pre = REPLACE INTO <!--SPHINX_DB_PREFIX-->cache_store VALUES( 'sphinx_members_counter', (SELECT max(member_id) FROM <!--SPHINX_DB_PREFIX-->members), '', 0, UNIX_TIMESTAMP() )
|
||||
|
||||
# Query posts for the main source
|
||||
sql_query = SELECT m.member_id, m.member_id as search_id, m.member_group_id, m.email, m.joined, m.members_display_name, m.name, \
|
||||
REPLACE( pi.perm_view, '*', 0 ) as perm_view, \
|
||||
CASE WHEN pi.authorized_users IS NULL THEN 0 ELSE pi.authorized_users END AS authorized_users, \
|
||||
CASE WHEN pi.friend_only=0 THEN 0 ELSE m.member_id END AS friend_only, \
|
||||
CASE WHEN pi.owner_only=0 THEN 0 ELSE m.member_id END AS owner_only \
|
||||
FROM <!--SPHINX_DB_PREFIX-->members m \
|
||||
LEFT JOIN <!--SPHINX_DB_PREFIX-->permission_index pi ON ( pi.perm_type_id=1 AND pi.perm_type='profile_view' ) \
|
||||
WHERE m.member_id <= ( SELECT cs_value FROM <!--SPHINX_DB_PREFIX-->cache_store WHERE cs_key='sphinx_members_counter' )
|
||||
|
||||
# Fields
|
||||
sql_attr_uint = search_id
|
||||
sql_attr_uint = friend_only
|
||||
sql_attr_uint = owner_only
|
||||
sql_attr_timestamp = joined
|
||||
sql_attr_multi = uint perm_view from field
|
||||
sql_attr_multi = uint authorized_users from field
|
||||
|
||||
sql_ranged_throttle = 0
|
||||
}
|
||||
|
||||
source members_search_delta : members_search_main
|
||||
{
|
||||
# Override the base sql_query_pre
|
||||
sql_query_pre =
|
||||
|
||||
# Query posts for the main source
|
||||
sql_query = SELECT m.member_id, m.member_id as search_id, m.member_group_id, m.email, m.joined, m.members_display_name, m.name, \
|
||||
REPLACE( pi.perm_view, '*', 0 ) as perm_view, \
|
||||
CASE WHEN pi.authorized_users IS NULL THEN 0 ELSE pi.authorized_users END AS authorized_users, \
|
||||
CASE WHEN pi.friend_only=0 THEN 0 ELSE m.member_id END AS friend_only, \
|
||||
CASE WHEN pi.owner_only=0 THEN 0 ELSE m.member_id END AS owner_only \
|
||||
FROM <!--SPHINX_DB_PREFIX-->members m \
|
||||
LEFT JOIN <!--SPHINX_DB_PREFIX-->permission_index pi ON ( pi.perm_type_id=1 AND pi.perm_type='profile_view' ) \
|
||||
WHERE m.member_id > ( SELECT cs_value FROM <!--SPHINX_DB_PREFIX-->cache_store WHERE cs_key='sphinx_members_counter' )
|
||||
}
|
||||
|
||||
index members_search_main
|
||||
{
|
||||
source = members_search_main
|
||||
path = <!--SPHINX_BASE_PATH-->/members_search_main
|
||||
|
||||
docinfo = extern
|
||||
mlock = 0
|
||||
morphology = none
|
||||
min_word_len = 2
|
||||
charset_type = sbcs
|
||||
html_strip = 0
|
||||
#infix_fields = members_display_name, email, name
|
||||
#min_infix_len = 3
|
||||
#enable_star = 1
|
||||
}
|
||||
|
||||
index members_search_delta : members_search_main
|
||||
{
|
||||
source = members_search_delta
|
||||
path = <!--SPHINX_BASE_PATH-->/members_search_delta
|
||||
}
|
||||
|
||||
|
||||
EOF;
|
||||
/* This is just an empty sphinx template to ensure we overwrite outdated ones on upgrade */
|
||||
$appSphinxTemplate = "";
|
||||
File diff suppressed because it is too large.
Load diff
@@ -5,6 +5,6 @@
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,61 @@
|
||||
/************************************************/
|
||||
/* IPB3 Javascript */
|
||||
/* -------------------------------------------- */
|
||||
/* acp.banfilters.js - Banfilters functions */
|
||||
/* (c) IPS, Inc 2011 */
|
||||
/* -------------------------------------------- */
|
||||
/* Author: Terabyte */
|
||||
/************************************************/
|
||||
|
||||
var _banfilters = window.IPBACP;
|
||||
_banfilters.prototype.banfilters = {
|
||||
popups: null,
|
||||
|
||||
init: function()
|
||||
{
|
||||
Debug.write("Initializing acp.banfilters.js");
|
||||
document.observe("dom:loaded", function(){
|
||||
/* Setup add filter button */
|
||||
if( $('add_banfilter') )
|
||||
{
|
||||
$('add_banfilter').observe( 'click', acp.banfilters.addNewFilter );
|
||||
}
|
||||
|
||||
/* Setup delete form */
|
||||
if( $('ban-delete') )
|
||||
{
|
||||
$('ban-delete').observe( 'submit', function( e ){
|
||||
var checkboxes = $('ban-delete').getElementsByTagName('input');
|
||||
|
||||
for( var i = 0; i < checkboxes.length; i++ )
|
||||
{
|
||||
if( checkboxes[i].checked )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
alert( ipb.lang['no_ban_to_delete'] );
|
||||
|
||||
Event.stop( e );
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
addNewFilter: function( e )
|
||||
{
|
||||
Event.stop(e);
|
||||
|
||||
if( acp.banfilters.popup )
|
||||
{
|
||||
acp.banfilters.popup.show();
|
||||
}
|
||||
else
|
||||
{
|
||||
acp.banfilters.popup = new ipb.Popup('add_banfilter_popup', { type: 'pane', modal: false, hideAtStart: false, w: '600px', initial: ipb.templates['add_banfilter'] } );
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
acp.banfilters.init();
|
||||
@@ -5,6 +5,6 @@
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -48,9 +48,9 @@ function setUpForm()
|
||||
field = elem.readAttribute('unlimited-field');
|
||||
input = elem.down('input');
|
||||
|
||||
cbox = new Element('input', { type: 'checkbox', name: field + '_cb', id: field + '_cb' } );
|
||||
span = new Element('span').addClassName('desctext').update(" Unlimited");
|
||||
div = new Element('div').setStyle( 'padding-bottom: 3px' ).insert( cbox ).insert( span );
|
||||
var cbox = new Element('input', { type: 'checkbox', name: field + '_cb', id: field + '_cb' } );
|
||||
var span = new Element('label', { 'for': field + '_cb', 'class': 'desctext clickable' } ).update( ' ' + ipb.lang['unlimited_text'] );
|
||||
var div = new Element('div').setStyle( 'padding-bottom: 3px' ).insert( cbox ).insert( span );
|
||||
|
||||
input.insert( { before: div } );
|
||||
|
||||
@@ -93,12 +93,4 @@ function stripGuestLegend()
|
||||
elem.hide();
|
||||
}
|
||||
);
|
||||
//$('tabtab-GROUPS|6').hide();
|
||||
|
||||
$('g_view_board_no').observe('click', function(e){
|
||||
$('g_view_board_warning').style.display = 'inline';
|
||||
});
|
||||
$('g_view_board_yes').observe('click', function(e){
|
||||
$('g_view_board_warning').style.display = 'none';
|
||||
});
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
function check_boxes()
|
||||
{
|
||||
var ticked = $('maincheckbox').checked;
|
||||
|
||||
var checkboxes = document.getElementsByTagName('input');
|
||||
|
||||
for ( var i = 0 ; i <= checkboxes.length ; i++ )
|
||||
{
|
||||
var e = checkboxes[i];
|
||||
|
||||
if ( typeof(e) != 'undefined' && e.type == 'checkbox')
|
||||
{
|
||||
var boxname = e.id;
|
||||
var boxcheck = boxname.replace( /^(.+?)_.+?$/, "$1" );
|
||||
|
||||
if ( boxcheck == 'mid' )
|
||||
{
|
||||
e.checked = ticked;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function checkThisForm()
|
||||
{
|
||||
var selectedOpt = $F('manage_type');
|
||||
|
||||
if( selectedOpt == 'delete' )
|
||||
{
|
||||
return confirm( "Вы действительно хотите удалить все отмеченные учетные записи?\n\nЭто действие невозможно будет остановить и/или отменить!" );
|
||||
}
|
||||
else if( selectedOpt == 'unban' )
|
||||
{
|
||||
return confirm( "Данной действие только убирает флаг 'Блокировки пользователя'!\n\nЕсли пользователь был перенесен в группу для заблокированных, или был добавлен IP адрес, email адрес или логин пользователя в список заблокированных, вам необходимо самостоятельно убрать эти ограничения.\n\nВы также можете нажать кнопку 'Отменить' и кликнув по имени пользователя перейти в централизованную панель управления блокировкой пользоватля." );
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -1,32 +1,14 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Define the default ajax section
|
||||
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://www.invisionpower.com
|
||||
* @file defaultSection.php Define the default section for the 'ajax' module
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $Author: ips_terabyte $
|
||||
* @since 20th February 2002
|
||||
* @version $Rev: 5713 $
|
||||
*
|
||||
* $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 8655 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
* Very simply returns the default section if one is not
|
||||
* passed in the URL
|
||||
*/
|
||||
|
||||
$DEFAULT_SECTION = 'editform';
|
||||
$DEFAULT_SECTION = 'editform';
|
||||
@@ -2,18 +2,18 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Member property updater (AJAX)
|
||||
* Last Updated: $Date: 2010-10-21 07:08:38 -0400 (Thu, 21 Oct 2010) $
|
||||
* Last Updated: $Date: 2011-06-09 18:03:22 -0400 (Thu, 09 Jun 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Revision: 7007 $
|
||||
* @link http://hatynka.in
|
||||
* @version $Revision: 9021 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
@@ -28,7 +28,7 @@ class admin_members_ajax_editform extends ipsAjaxCommand
|
||||
* Main class entry point
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
@@ -40,18 +40,6 @@ class admin_members_ajax_editform extends ipsAjaxCommand
|
||||
case 'show':
|
||||
$this->show();
|
||||
break;
|
||||
case 'save_display_name':
|
||||
$this->save_member_name( 'members_display_name' );
|
||||
break;
|
||||
case 'save_name':
|
||||
$this->save_member_name( 'name' );
|
||||
break;
|
||||
case 'save_password':
|
||||
$this->save_password();
|
||||
break;
|
||||
case 'save_email':
|
||||
$this->save_email();
|
||||
break;
|
||||
case 'remove_photo':
|
||||
$this->remove_photo();
|
||||
break;
|
||||
@@ -61,7 +49,7 @@ class admin_members_ajax_editform extends ipsAjaxCommand
|
||||
/**
|
||||
* Remove user's photo
|
||||
*
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
protected function remove_photo()
|
||||
{
|
||||
@@ -93,35 +81,9 @@ class admin_members_ajax_editform extends ipsAjaxCommand
|
||||
exit();
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Sort out upload dir
|
||||
//-----------------------------------------
|
||||
|
||||
/* Fix for bug 5075 */
|
||||
$this->settings[ 'upload_dir'] = str_replace( '.', '.', $this->settings['upload_dir'] );
|
||||
|
||||
$upload_path = $this->settings['upload_dir'];
|
||||
|
||||
//-----------------------------------------
|
||||
// Already a dir?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( file_exists( $upload_path . "/profile" ) )
|
||||
{
|
||||
# Set path and dir correct
|
||||
$upload_path .= "/profile";
|
||||
$upload_dir = "profile/";
|
||||
}
|
||||
|
||||
IPSMember::getFunction()->removeUploadedPhotos( $member_id, $upload_path );
|
||||
|
||||
IPSMember::save( $member_id, array( 'extendedProfile' => array( 'pp_main_photo' => '',
|
||||
'pp_main_width' => 0,
|
||||
'pp_main_height' => 0,
|
||||
'pp_thumb_photo' => '',
|
||||
'pp_thumb_width' => 0,
|
||||
'pp_thumb_height' => 0,
|
||||
) ) );
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/member/photo.php', 'classes_member_photo' );
|
||||
$photos = new $classToLoad( $this->registry );
|
||||
$photos->remove( $member_id );
|
||||
|
||||
ipsRegistry::getClass('adminFunctions')->saveAdminLog( sprintf($this->lang->words['m_imgremlog'], $member_id ) );
|
||||
|
||||
@@ -140,352 +102,10 @@ class admin_members_ajax_editform extends ipsAjaxCommand
|
||||
) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Change a member's email address
|
||||
*
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
protected function save_email()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$member_id = intval( $this->request['member_id'] );
|
||||
$email = trim( $this->request['email'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Get member
|
||||
//-----------------------------------------
|
||||
|
||||
$member = IPSMember::load( $member_id );
|
||||
|
||||
if ( ! $member['member_id'] )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['m_noid'] );
|
||||
exit();
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Allowed to edit administrators?
|
||||
//-----------------------------------------
|
||||
|
||||
if( $member['g_access_cp'] AND !$this->registry->getClass('class_permissions')->checkPermission( 'member_edit_admin', 'members', 'members' ) )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['m_editadmin'] );
|
||||
exit();
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Is this email addy taken? CONVERGE THIS??
|
||||
//-----------------------------------------
|
||||
|
||||
$email_check = IPSMember::load( mb_strtolower($email) );
|
||||
|
||||
if ( $email_check['member_id'] AND $email_check['member_id'] != $member_id )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['m_emailalready'] );
|
||||
exit();
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Load handler...
|
||||
//-----------------------------------------
|
||||
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/handlers/han_login.php', 'han_login' );
|
||||
$han_login = new $classToLoad( $this->registry );
|
||||
$han_login->init();
|
||||
$han_login->changeEmail( trim( mb_strtolower( $member['email'] ) ), trim( mb_strtolower( $email ) ), $member );
|
||||
|
||||
//-----------------------------------------
|
||||
// We don't want to die just from a Converge error
|
||||
//-----------------------------------------
|
||||
|
||||
/*if ( $han_login->return_code AND ( $han_login->return_code != 'METHOD_NOT_DEFINED' AND $han_login->return_code != 'SUCCESS' ) )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['m_emailalready'] );
|
||||
exit();
|
||||
}*/
|
||||
|
||||
//-----------------------------------------
|
||||
// Update member
|
||||
//-----------------------------------------
|
||||
|
||||
IPSLib::runMemberSync( 'onEmailChange', $member_id, mb_strtolower( $email ), $member['email'] );
|
||||
|
||||
IPSMember::save( $member_id, array( 'core' => array( 'email' => mb_strtolower( $email ) ) ) );
|
||||
|
||||
ipsRegistry::getClass('adminFunctions')->saveAdminLog( sprintf( $this->lang->words['m_emailchangelog'], $member['email'], $email, $member_id ) );
|
||||
|
||||
$this->returnJsonArray( array(
|
||||
'success' => 1,
|
||||
'email' => $email
|
||||
) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Change a member's password
|
||||
*
|
||||
* @return void [Outputs to screen]
|
||||
* @todo This method is no longer working via AJAX (on purpose). It should be moved out of the AJAX controller as such.
|
||||
*/
|
||||
protected function save_password()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$member_id = intval( $this->request['member_id'] );
|
||||
$password = IPSText::parseCleanValue( urldecode( $_POST['password'] ) );
|
||||
$password2 = IPSText::parseCleanValue( urldecode( $_POST['password2'] ) );
|
||||
$new_key = intval( $this->request['new_key'] );
|
||||
$new_salt = intval( $this->request['new_salt'] );
|
||||
$salt = str_replace( '\\', "\\\\", IPSMember::generatePasswordSalt(5) );
|
||||
$key = IPSMember::generateAutoLoginKey();
|
||||
$md5_once = md5( trim($password) );
|
||||
|
||||
//-----------------------------------------
|
||||
// AJAX debug
|
||||
//-----------------------------------------
|
||||
|
||||
IPSDebug::fireBug( 'info', array( 'Password: ' . $password ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// Check
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $password OR ! $password2 )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['password_nogood'] );
|
||||
}
|
||||
|
||||
if ( $password != $password2 )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['m_passmatch'] );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Get member
|
||||
//-----------------------------------------
|
||||
|
||||
$member = IPSMember::load( $member_id );
|
||||
|
||||
//-----------------------------------------
|
||||
// Allowed to edit administrators?
|
||||
//-----------------------------------------
|
||||
|
||||
if( $member['g_access_cp'] AND !$this->registry->getClass('class_permissions')->checkPermission( 'member_edit_admin', 'members', 'members' ) )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['m_editadmin'] );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Check Converge: Password
|
||||
//-----------------------------------------
|
||||
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/handlers/han_login.php', 'han_login' );
|
||||
$han_login = new $classToLoad( $this->registry );
|
||||
$han_login->init();
|
||||
$han_login->changePass( $member['email'], $md5_once, $password, $member );
|
||||
|
||||
/*if ( $han_login->return_code != 'METHOD_NOT_DEFINED' AND $han_login->return_code != 'SUCCESS' )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['m_passchange']);
|
||||
exit();
|
||||
}*/
|
||||
|
||||
//-----------------------------------------
|
||||
// Local DB
|
||||
//-----------------------------------------
|
||||
|
||||
$update = array();
|
||||
|
||||
if( $new_salt )
|
||||
{
|
||||
$update['members_pass_salt'] = $salt;
|
||||
}
|
||||
|
||||
if( $new_key )
|
||||
{
|
||||
$update['member_login_key'] = $key;
|
||||
}
|
||||
|
||||
if( count($update) )
|
||||
{
|
||||
IPSMember::save( $member_id, array( 'core' => $update ) );
|
||||
}
|
||||
|
||||
IPSMember::updatePassword( $member_id, $md5_once );
|
||||
IPSLib::runMemberSync( 'onPassChange', $member_id, $password );
|
||||
|
||||
ipsRegistry::getClass('adminFunctions')->saveAdminLog( sprintf( $this->lang->words['m_passlog'], $member_id ) );
|
||||
|
||||
//$this->returnJsonArray( array(
|
||||
// 'success' => 1,
|
||||
// 'password' => "*************"
|
||||
// ) );
|
||||
|
||||
$this->registry->output->global_message = $this->lang->words['pw_updated_success'];
|
||||
$this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . 'module=members&do=viewmember&member_id=' . $member_id );
|
||||
}
|
||||
|
||||
/**
|
||||
* Update a user's login or display name
|
||||
*
|
||||
* @param string Field to update
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
protected function save_member_name( $field='members_display_name' )
|
||||
{
|
||||
$member_id = intval( $this->request['member_id'] );
|
||||
|
||||
$member = IPSMember::load( $member_id );
|
||||
|
||||
//-----------------------------------------
|
||||
// Allowed to edit administrators?
|
||||
//-----------------------------------------
|
||||
|
||||
if( $member['g_access_cp'] AND !$this->registry->getClass('class_permissions')->checkPermission( 'member_edit_admin', 'members', 'members' ) )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['m_editadmin'] );
|
||||
}
|
||||
|
||||
if ( $field == 'members_display_name' )
|
||||
{
|
||||
$display_name = $this->convertAndMakeSafe( $_POST['display_name'], 1 );
|
||||
$display_name = str_replace("+", "+", $display_name );
|
||||
}
|
||||
else
|
||||
{
|
||||
$display_name = $this->convertAndMakeSafe( $_POST['name'], 1 );
|
||||
$display_name = str_replace("+", "+", $display_name );
|
||||
|
||||
$display_name = str_replace( '|', '|' , $display_name );
|
||||
$display_name = trim( preg_replace( "/\s{2,}/", " ", $display_name ) );
|
||||
}
|
||||
|
||||
if ( $this->settings['strip_space_chr'] )
|
||||
{
|
||||
// use hexdec to convert between '0xAD' and chr
|
||||
$display_name = IPSText::removeControlCharacters( $display_name );
|
||||
}
|
||||
|
||||
if ( $field == 'members_display_name' AND preg_match( "#[\[\];,\|]#", str_replace(''', "'", str_replace('&', '&', $display_name) ) ) )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['m_displaynames'] );
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
if ( IPSMember::getFunction()->updateName( $member_id, $display_name, $field ) === TRUE )
|
||||
{
|
||||
if ( $field == 'members_display_name' )
|
||||
{
|
||||
ipsRegistry::getClass('adminFunctions')->saveAdminLog(sprintf( $this->lang->words['m_dnamelog'], $member['members_display_name'], $display_name ));
|
||||
}
|
||||
else
|
||||
{
|
||||
ipsRegistry::getClass('adminFunctions')->saveAdminLog(sprintf( $this->lang->words['m_namelog'], $member['name'], $display_name ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// If updating a name, and display names
|
||||
// disabled, update display name too
|
||||
//-----------------------------------------
|
||||
|
||||
if( !ipsRegistry::$settings['auth_allow_dnames'] )
|
||||
{
|
||||
IPSMember::getFunction()->updateName( $member_id, $display_name, 'members_display_name' );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// I say, did we choose to email 'dis member?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $this->request['send_email'] == 1 )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// By golly, we did!
|
||||
//-----------------------------------------
|
||||
|
||||
$msg = trim( IPSText::stripslashes( nl2br( $_POST['email_contents'] ) ) );
|
||||
|
||||
$msg = str_replace( "{old_name}", $member['name'], $msg );
|
||||
$msg = str_replace( "{new_name}", $display_name , $msg );
|
||||
$msg = str_replace( "<#BOARD_NAME#>", $this->settings['board_name'], $msg );
|
||||
$msg = str_replace( "<#BOARD_ADDRESS#>", $this->settings['board_url'] . '/index.' . $this->settings['php_ext'], $msg );
|
||||
|
||||
IPSText::getTextClass('email')->message = stripslashes( IPSText::getTextClass('email')->cleanMessage($msg) );
|
||||
IPSText::getTextClass('email')->subject = $this->lang->words['m_changesubj'];
|
||||
IPSText::getTextClass('email')->to = $member['email'];
|
||||
IPSText::getTextClass('email')->sendMail();
|
||||
}
|
||||
}
|
||||
|
||||
$this->cache->rebuildCache( 'stats', 'global' );
|
||||
}
|
||||
else
|
||||
{
|
||||
# We should absolutely never get here. So this is a fail-safe, really to
|
||||
# prevent a "false" positive outcome for the end-user
|
||||
$this->registry->output->showError( $this->lang->words['m_namealready'] );
|
||||
}
|
||||
}
|
||||
catch( Exception $error )
|
||||
{
|
||||
// $this->returnJsonError( $error->getMessage() );
|
||||
|
||||
switch( $error->getMessage() )
|
||||
{
|
||||
case 'NO_USER':
|
||||
$this->registry->output->showError( $this->lang->words['m_noid'] );
|
||||
break;
|
||||
case 'NO_PERMISSION':
|
||||
case 'NO_NAME':
|
||||
$this->registry->output->showError( sprintf($this->lang->words['m_morethan3'], $this->settings['max_user_name_length'] ) );
|
||||
break;
|
||||
case 'ILLEGAL_CHARS':
|
||||
$this->registry->output->showError( $this->lang->words['m_illegal'] );
|
||||
break;
|
||||
case 'USER_NAME_EXISTS':
|
||||
$this->registry->output->showError( $this->lang->words['m_namealready'] );
|
||||
break;
|
||||
default:
|
||||
$this->registry->output->showError( $error->getMessage() );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Load handler...
|
||||
//-----------------------------------------
|
||||
|
||||
if( $field == 'name' )
|
||||
{
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/handlers/han_login.php', 'han_login' );
|
||||
$han_login = new $classToLoad( $this->registry );
|
||||
$han_login->init();
|
||||
$han_login->changeName( $member['name'], $display_name, $member['email'], $member );
|
||||
}
|
||||
else
|
||||
{
|
||||
IPSLib::runMemberSync( 'onNameChange', $member_id, $display_name );
|
||||
}
|
||||
|
||||
$__display_name = addslashes( $display_name );
|
||||
|
||||
//$this->returnJsonArray( array(
|
||||
// 'success' => 1,
|
||||
// 'display_name' => "$__display_name"
|
||||
// ) );
|
||||
|
||||
$this->registry->output->global_message = $this->lang->words[ $field . '_updated_success'];
|
||||
$this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . 'module=members&do=viewmember&member_id=' . $member_id );
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form
|
||||
*
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
protected function show()
|
||||
{
|
||||
|
||||
@@ -5,6 +5,6 @@
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,762 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Member list AJAX handler
|
||||
* Last Updated: $Date: 2011-09-27 21:33:45 -0400 (Tue, 27 Sep 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://hatynka.in
|
||||
* @version $Revision: 9556 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class admin_members_ajax_members extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'admin_member' ), 'members' );
|
||||
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
default:
|
||||
case 'show':
|
||||
$this->show();
|
||||
break;
|
||||
|
||||
case 'do_validating':
|
||||
$this->registry->getClass('class_permissions')->return = true;
|
||||
|
||||
if( ! $this->registry->getClass('class_permissions')->checkPermission( 'membertools_validating', 'members', 'members' ) )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['no_permission'] );
|
||||
}
|
||||
|
||||
$this->_manageValidating();
|
||||
break;
|
||||
|
||||
case 'unappemail':
|
||||
$this->registry->getClass('class_permissions')->return = true;
|
||||
|
||||
if( ! $this->registry->getClass('class_permissions')->checkPermission( 'membertools_validating', 'members', 'members' ) )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['no_permission'] );
|
||||
}
|
||||
|
||||
$this->_emailUnapprove();
|
||||
break;
|
||||
|
||||
case 'do_locked':
|
||||
$this->registry->getClass('class_permissions')->return = true;
|
||||
|
||||
if( ! $this->registry->getClass('class_permissions')->checkPermission( 'membertools_locked', 'members', 'members' ) )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['no_permission'] );
|
||||
}
|
||||
|
||||
$this->_unlock();
|
||||
break;
|
||||
|
||||
case 'do_spam':
|
||||
$this->registry->getClass('class_permissions')->return = true;
|
||||
|
||||
if( ! $this->registry->getClass('class_permissions')->checkPermission( 'membertools_spam', 'members', 'members' ) )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['no_permission'] );
|
||||
}
|
||||
|
||||
$this->_unSpam();
|
||||
break;
|
||||
|
||||
case 'do_banned':
|
||||
$this->registry->getClass('class_permissions')->return = true;
|
||||
|
||||
if( ! $this->registry->getClass('class_permissions')->checkPermission( 'membertools_banned', 'members', 'members' ) )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['no_permission'] );
|
||||
}
|
||||
|
||||
$this->_unban();
|
||||
break;
|
||||
|
||||
case 'do_incomplete':
|
||||
$this->registry->getClass('class_permissions')->return = true;
|
||||
|
||||
if( ! $this->registry->getClass('class_permissions')->checkPermission( 'membertools_incomplete', 'members', 'members' ) )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['no_permission'] );
|
||||
}
|
||||
|
||||
$this->_doIncomplete();
|
||||
break;
|
||||
|
||||
case 'do_delete':
|
||||
$this->registry->getClass('class_permissions')->return = true;
|
||||
|
||||
if( ! $this->registry->getClass('class_permissions')->checkPermission( 'member_delete', 'members', 'members' ) )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['no_permission'] );
|
||||
}
|
||||
|
||||
$this->_doDelete();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete members [form+process]
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _doDelete()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Check input
|
||||
//-----------------------------------------
|
||||
|
||||
$ids = IPSLib::fetchInputAsArray( 'mid_' );
|
||||
|
||||
if ( !count($ids) )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['m_nomember'] );
|
||||
}
|
||||
|
||||
/* Don't delete our selves */
|
||||
if( in_array( $this->memberData['member_id'], $ids ) )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['m_nodeleteslefr'] );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Get accounts
|
||||
//-----------------------------------------
|
||||
|
||||
$this->DB->build( array( 'select' => 'member_id, name, member_group_id, mgroup_others', 'from' => 'members', 'where' => 'member_id IN(' . implode( ',', $ids ) . ')' ) );
|
||||
$this->DB->execute();
|
||||
|
||||
$names = array();
|
||||
$newIds = array();
|
||||
|
||||
while ( $r = $this->DB->fetch() )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// r u trying to kill teh admin?
|
||||
//-----------------------------------------
|
||||
|
||||
if( ! $this->registry->getClass('class_permissions')->checkPermission( 'member_delete_admin' ) )
|
||||
{
|
||||
if( $this->caches['group_cache'][ $r['member_group_id'] ]['g_access_cp'] )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
$other_mgroups = explode( ',', IPSText::cleanPermString( $r['mgroup_others'] ) );
|
||||
|
||||
if( count($other_mgroups) )
|
||||
{
|
||||
foreach( $other_mgroups as $other_mgroup )
|
||||
{
|
||||
if( $this->caches['group_cache'][ $other_mgroup ]['g_access_cp'] )
|
||||
{
|
||||
continue 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$names[] = $r['name'];
|
||||
$newIds[] = $r['member_id'];
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Check
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! count( $names ) )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['m_nomember'] );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Delete
|
||||
//-----------------------------------------
|
||||
|
||||
IPSMember::remove( $newIds, true );
|
||||
|
||||
ipsRegistry::getClass('adminFunctions')->saveAdminLog( sprintf( $this->lang->words['m_deletedlog'], implode( ",", $names ) ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// Respond
|
||||
//-----------------------------------------
|
||||
|
||||
$this->returnJsonArray( array( 'ok' => 1, 'msg' => sprintf( $this->lang->words['m_deletedlog'], implode( ",", $names ) ) ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the results
|
||||
*
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
protected function show()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir('members') . '/sources/adminSearch.php', 'adminMemberSearch' );
|
||||
$searchHelper = new $classToLoad( $this->registry );
|
||||
$html = $this->registry->output->loadTemplate('cp_skin_member');;
|
||||
|
||||
//-----------------------------------------
|
||||
// Get the number of results
|
||||
//-----------------------------------------
|
||||
|
||||
$count = $searchHelper->getSearchResultsCount();
|
||||
|
||||
IPSDebug::fireBug( 'info', array( 'Total results:' . $count ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// Generate pagination
|
||||
//-----------------------------------------
|
||||
|
||||
$st = intval($this->request['st']);
|
||||
$perpage = 20;
|
||||
|
||||
$pages = $this->registry->output->generatePagination( array(
|
||||
'totalItems' => $count,
|
||||
'itemsPerPage' => $perpage,
|
||||
'currentStartValue' => $st,
|
||||
'baseUrl' => $this->settings['base_url'] . 'module=members&section=members',
|
||||
) );
|
||||
|
||||
//-----------------------------------------
|
||||
// Run the query
|
||||
//-----------------------------------------
|
||||
|
||||
$members = $searchHelper->getSearchResults( $st, $perpage );
|
||||
|
||||
IPSDebug::fireBug( 'info', array( 'Total results (2):' . count($members) ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// Format results
|
||||
//-----------------------------------------
|
||||
|
||||
$_memberOutput = '';
|
||||
|
||||
if( count($members) )
|
||||
{
|
||||
foreach( $members as $member )
|
||||
{
|
||||
/* Ensure encoding is safe */
|
||||
//$member['members_display_name'] = IPSText::encodeForXml( $member['members_display_name'] );
|
||||
//$member['name'] = IPSText::encodeForXml( $member['name'] );
|
||||
/* The above causes strings returned on utf-8 sites to be entirely corrupted
|
||||
@link http://community.invisionpower.com/tracker/issue-32444-ajax-for-text-in-acp */
|
||||
$member['members_display_name'] = $member['members_display_name'];
|
||||
$member['name'] = $member['name'];
|
||||
|
||||
|
||||
IPSDebug::fireBug( 'info', array( 'Showing member:' . $member['members_display_name'] . ' (' . $member['email'] . ' - ' . $member['member_id'] . ')' ) );
|
||||
|
||||
switch( $searchHelper->getMemberType() )
|
||||
{
|
||||
case 'all':
|
||||
default:
|
||||
$_memberOutput .= $html->memberListRow( $member );
|
||||
break;
|
||||
|
||||
case 'spam':
|
||||
$_memberOutput .= $html->memberListRow_spam( $member );
|
||||
break;
|
||||
|
||||
case 'banned':
|
||||
$_memberOutput .= $html->memberListRow_banned( $member );
|
||||
break;
|
||||
|
||||
case 'locked':
|
||||
$_memberOutput .= $html->memberListRow_locked( $member );
|
||||
break;
|
||||
|
||||
case 'validating':
|
||||
$_memberOutput .= $html->memberListRow_validating( $member );
|
||||
break;
|
||||
|
||||
case 'incomplete':
|
||||
$_memberOutput .= $html->memberListRow_incomplete( $member );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$_memberOutput = $html->memberListRow_empty();
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Return as JSON
|
||||
//-----------------------------------------
|
||||
|
||||
$this->returnJsonArray( array(
|
||||
'count' => $count,
|
||||
'pages' => $pages,
|
||||
'members' => $_memberOutput ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Manage incomplete members
|
||||
*
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
protected function _doIncomplete()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Check
|
||||
//-----------------------------------------
|
||||
|
||||
$ids = IPSLib::fetchInputAsArray( 'mid_' );
|
||||
|
||||
if ( count($ids) < 1 )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['t_nomemsel'] );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// DELETE
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $this->request['type'] == 'delete' )
|
||||
{
|
||||
$this->registry->getClass('class_permissions')->return = true;
|
||||
|
||||
if( ! $this->registry->getClass('class_permissions')->checkPermission( 'member_delete', 'members', 'members' ) )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['no_permission'] );
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
$message = $this->_getManagementClass()->deleteMembers( $ids, 't_inc_removed' );
|
||||
}
|
||||
catch( Exception $error )
|
||||
{
|
||||
$this->returnJsonError( $error->getMessage() );
|
||||
}
|
||||
|
||||
$this->returnJsonArray( array( 'ok' => 1, 'msg' => $message ) );
|
||||
}
|
||||
else if( $this->request['type'] == 'finalize' )
|
||||
{
|
||||
try
|
||||
{
|
||||
$message = $this->_getManagementClass()->finalizeMembers( $ids );
|
||||
}
|
||||
catch( Exception $error )
|
||||
{
|
||||
$this->returnJsonError( $error->getMessage() );
|
||||
}
|
||||
|
||||
$this->returnJsonArray( array( 'ok' => 1, 'msg' => $message ) );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Manage validating members
|
||||
*
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
protected function _manageValidating()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Check
|
||||
//-----------------------------------------
|
||||
|
||||
$ids = IPSLib::fetchInputAsArray( 'mid_' );
|
||||
|
||||
if ( count($ids) < 1 )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['t_nomemsel'] );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// APPROVE
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $this->request['type'] == 'approve' )
|
||||
{
|
||||
try
|
||||
{
|
||||
$message = $this->_getManagementClass()->approveMembers( $ids );
|
||||
}
|
||||
catch( Exception $error )
|
||||
{
|
||||
$this->returnJsonError( $error->getMessage() );
|
||||
}
|
||||
|
||||
$this->returnJsonArray( array( 'ok' => 1, 'msg' => $message ) );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Resend validation email
|
||||
//-----------------------------------------
|
||||
|
||||
else if ( $this->request['type'] == 'resend' )
|
||||
{
|
||||
try
|
||||
{
|
||||
$message = $this->_getManagementClass()->resendValidationEmails( $ids );
|
||||
}
|
||||
catch( Exception $error )
|
||||
{
|
||||
$this->returnJsonError( $error->getMessage() );
|
||||
}
|
||||
|
||||
$this->returnJsonArray( array( 'ok' => 1, 'msg' => $message ) );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Ban
|
||||
//-----------------------------------------
|
||||
|
||||
else if( $this->request['type'] == 'ban' )
|
||||
{
|
||||
$this->registry->getClass('class_permissions')->return = true;
|
||||
|
||||
if( ! $this->registry->getClass('class_permissions')->checkPermission( 'member_ban', 'members', 'members' ) )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['no_permission'] );
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
$message = $this->_getManagementClass()->banMembers( $ids );
|
||||
}
|
||||
catch( Exception $error )
|
||||
{
|
||||
$this->returnJsonError( $error->getMessage() );
|
||||
}
|
||||
|
||||
$this->returnJsonArray( array( 'ok' => 1, 'msg' => $message ) );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// SPAMMER
|
||||
//-----------------------------------------
|
||||
|
||||
else if ( $this->request['type'] == 'spam' )
|
||||
{
|
||||
try
|
||||
{
|
||||
$message = $this->_getManagementClass()->markMembersAsSpam( $ids );
|
||||
}
|
||||
catch( Exception $error )
|
||||
{
|
||||
$this->returnJsonError( $error->getMessage() );
|
||||
}
|
||||
|
||||
$this->returnJsonArray( array( 'ok' => 1, 'msg' => $message ) );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// DELETE
|
||||
//-----------------------------------------
|
||||
|
||||
else
|
||||
{
|
||||
$this->registry->getClass('class_permissions')->return = true;
|
||||
|
||||
if( ! $this->registry->getClass('class_permissions')->checkPermission( 'member_delete', 'members', 'members' ) )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['no_permission'] );
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
$message = $this->_getManagementClass()->denyMembers( $ids );
|
||||
}
|
||||
catch( Exception $error )
|
||||
{
|
||||
$this->returnJsonError( $error->getMessage() );
|
||||
}
|
||||
|
||||
$this->returnJsonArray( array( 'ok' => 1, 'msg' => $message ) );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Manage spam requests
|
||||
*
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
protected function _unSpam()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Check
|
||||
//-----------------------------------------
|
||||
|
||||
$ids = IPSLib::fetchInputAsArray( 'mid_' );
|
||||
|
||||
if ( count($ids) < 1 )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['t_nomemunspammed'] );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Unspam
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $this->request['type'] == 'unspam' OR $this->request['type'] == 'unspam_posts' )
|
||||
{
|
||||
try
|
||||
{
|
||||
$message = $this->_getManagementClass()->unmarkMembersAsSpam( $ids, $this->request['type'] == 'unspam_posts' ? true : false );
|
||||
}
|
||||
catch( Exception $error )
|
||||
{
|
||||
$this->returnJsonError( $error->getMessage() );
|
||||
}
|
||||
|
||||
$this->returnJsonArray( array( 'ok' => 1, 'msg' => $message ) );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Ban
|
||||
//-----------------------------------------
|
||||
|
||||
else if ( $this->request['type'] == 'ban' OR $this->request['type'] == 'ban_blacklist' )
|
||||
{
|
||||
$this->registry->getClass('class_permissions')->return = true;
|
||||
|
||||
if( ! $this->registry->getClass('class_permissions')->checkPermission( 'member_ban', 'members', 'members' ) )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['no_permission'] );
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
$message = $this->_getManagementClass()->banSpammers( $ids, $this->request['type'] == 'ban_blacklist' ? true : false );
|
||||
}
|
||||
catch( Exception $error )
|
||||
{
|
||||
$this->returnJsonError( $error->getMessage() );
|
||||
}
|
||||
|
||||
$this->returnJsonArray( array( 'ok' => 1, 'msg' => $message ) );
|
||||
}
|
||||
else if( $this->request['type'] == 'delete' )
|
||||
{
|
||||
$this->registry->getClass('class_permissions')->return = true;
|
||||
|
||||
if( ! $this->registry->getClass('class_permissions')->checkPermission( 'member_delete', 'members', 'members' ) )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['no_permission'] );
|
||||
}
|
||||
|
||||
$message = $this->_getManagementClass()->deleteMembers( $ids );
|
||||
|
||||
$this->returnJsonArray( array( 'ok' => 1, 'msg' => $message ) );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Manage banned requests
|
||||
*
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
protected function _unban()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Check
|
||||
//-----------------------------------------
|
||||
|
||||
$ids = IPSLib::fetchInputAsArray( 'mid_' );
|
||||
|
||||
if ( count($ids) < 1 )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['t_nomemunban'] );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Unlock
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $this->request['type'] == 'unban' )
|
||||
{
|
||||
try
|
||||
{
|
||||
$message = $this->_getManagementClass()->unbanMembers( $ids );
|
||||
}
|
||||
catch( Exception $error )
|
||||
{
|
||||
$this->returnJsonError( $error->getMessage() );
|
||||
}
|
||||
|
||||
$this->returnJsonArray( array( 'ok' => 1, 'msg' => $message ) );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Delete
|
||||
//-----------------------------------------
|
||||
|
||||
else if ( $this->request['type'] == 'delete' )
|
||||
{
|
||||
$this->registry->getClass('class_permissions')->return = true;
|
||||
|
||||
if( ! $this->registry->getClass('class_permissions')->checkPermission( 'member_delete', 'members', 'members' ) )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['no_permission'] );
|
||||
}
|
||||
|
||||
$message = $this->_getManagementClass()->deleteMembers( $ids );
|
||||
|
||||
$this->returnJsonArray( array( 'ok' => 1, 'msg' => $message ) );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Unapprove email change request
|
||||
*
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
protected function _emailUnapprove()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// GET member
|
||||
//-----------------------------------------
|
||||
|
||||
if( !$this->request['mid'] )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['t_noemailloc'] );
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
$message = $this->_getManagementClass()->unapproveEmailChange( $this->request['mid'] );
|
||||
}
|
||||
catch( Exception $error )
|
||||
{
|
||||
$this->returnJsonError( $error->getMessage() );
|
||||
}
|
||||
|
||||
$this->returnJsonArray( array( 'ok' => 1, 'msg' => $message ) );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unlock selected accounts
|
||||
*
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
protected function _unlock()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Check
|
||||
//-----------------------------------------
|
||||
|
||||
$ids = IPSLib::fetchInputAsArray( 'mid_' );
|
||||
|
||||
if ( count($ids) < 1 )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['t_nolockloc'], 11251 );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Unlock
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $this->request['type'] == 'unlock' )
|
||||
{
|
||||
try
|
||||
{
|
||||
$message = $this->_getManagementClass()->unlockMembers( $ids );
|
||||
}
|
||||
catch( Exception $error )
|
||||
{
|
||||
$this->returnJsonError( $error->getMessage() );
|
||||
}
|
||||
|
||||
$this->returnJsonArray( array( 'ok' => 1, 'msg' => $message ) );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Ban
|
||||
//-----------------------------------------
|
||||
|
||||
else if ( $this->request['type'] == 'ban' )
|
||||
{
|
||||
$this->registry->getClass('class_permissions')->return = true;
|
||||
|
||||
if( ! $this->registry->getClass('class_permissions')->checkPermission( 'member_ban', 'members', 'members' ) )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['no_permission'] );
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
$message = $this->_getManagementClass()->banMembers( $ids );
|
||||
}
|
||||
catch( Exception $error )
|
||||
{
|
||||
$this->returnJsonError( $error->getMessage() );
|
||||
}
|
||||
|
||||
$this->returnJsonArray( array( 'ok' => 1, 'msg' => $message ) );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Delete
|
||||
//-----------------------------------------
|
||||
|
||||
else if ( $this->request['type'] == 'delete' )
|
||||
{
|
||||
$this->registry->getClass('class_permissions')->return = true;
|
||||
|
||||
if( ! $this->registry->getClass('class_permissions')->checkPermission( 'member_delete', 'members', 'members' ) )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['no_permission'] );
|
||||
}
|
||||
|
||||
$message = $this->_getManagementClass()->deleteMembers( $ids );
|
||||
|
||||
$this->returnJsonArray( array( 'ok' => 1, 'msg' => $message ) );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the member management class
|
||||
*
|
||||
* @return object
|
||||
*/
|
||||
protected function _getManagementClass()
|
||||
{
|
||||
static $_object;
|
||||
|
||||
if( $_object )
|
||||
{
|
||||
return $_object;
|
||||
}
|
||||
|
||||
$_class = IPSLib::loadLibrary( IPSLib::getAppDir( 'members' ) . '/sources/adminManage.php', 'adminMemberManagement', 'members' );
|
||||
$_object = new $_class( $this->registry );
|
||||
|
||||
return $_object;
|
||||
}
|
||||
}
|
||||
@@ -2,18 +2,18 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Bulk mail management
|
||||
* Last Updated: $Date: 2010-10-21 07:08:38 -0400 (Thu, 21 Oct 2010) $
|
||||
* Last Updated: $Date: 2011-07-27 20:58:18 -0400 (Wed, 27 Jul 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Revision: 7007 $
|
||||
* @link http://hatynka.in
|
||||
* @version $Revision: 9327 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_ACP' ) )
|
||||
@@ -49,7 +49,7 @@ class admin_members_bulkmail_bulkmail extends ipsCommand
|
||||
* Main class entry point
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
@@ -137,7 +137,7 @@ class admin_members_bulkmail_bulkmail extends ipsCommand
|
||||
/**
|
||||
* Delete a bulk mail
|
||||
*
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
protected function _mailDelete()
|
||||
{
|
||||
@@ -159,7 +159,7 @@ class admin_members_bulkmail_bulkmail extends ipsCommand
|
||||
/**
|
||||
* Cancels a bulk mail
|
||||
*
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
protected function _mailSendCancel()
|
||||
{
|
||||
@@ -176,7 +176,7 @@ class admin_members_bulkmail_bulkmail extends ipsCommand
|
||||
/**
|
||||
* Processes a bulk mail
|
||||
*
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function mailSendProcess()
|
||||
{
|
||||
@@ -230,11 +230,6 @@ class admin_members_bulkmail_bulkmail extends ipsCommand
|
||||
{
|
||||
$mail[ $k ] = $v;
|
||||
}
|
||||
|
||||
if ( $mail['mail_html_on'] )
|
||||
{
|
||||
$this->settings['html_email'] = 1;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Format the query
|
||||
@@ -265,6 +260,13 @@ class admin_members_bulkmail_bulkmail extends ipsCommand
|
||||
|
||||
$contents = $this->_convertQuicktags( $mail['mail_content'], $r );
|
||||
|
||||
/* @link http://community.invisionpower.com/tracker/issue-32116-bulk-mail-only-sends-html-to-first-recipient
|
||||
Needs to be set inside the loop because email handler resets it back */
|
||||
if ( $mail['mail_html_on'] )
|
||||
{
|
||||
IPSText::getTextClass('email')->html_email = 1;
|
||||
}
|
||||
|
||||
IPSText::getTextClass('email')->from = $this->settings['email_out'];
|
||||
IPSText::getTextClass('email')->to = $r['email'];
|
||||
IPSText::getTextClass('email')->message = str_replace( "\r\n", "\n", $contents );
|
||||
@@ -281,9 +283,7 @@ class admin_members_bulkmail_bulkmail extends ipsCommand
|
||||
{
|
||||
$done = 1;
|
||||
}
|
||||
|
||||
$this->settings['html_email'] = 0;
|
||||
|
||||
|
||||
//-----------------------------------------
|
||||
// Save out..
|
||||
//-----------------------------------------
|
||||
@@ -308,7 +308,7 @@ class admin_members_bulkmail_bulkmail extends ipsCommand
|
||||
/**
|
||||
* Complete bulk mail processing
|
||||
*
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _mailSendComplete()
|
||||
{
|
||||
@@ -376,7 +376,7 @@ class admin_members_bulkmail_bulkmail extends ipsCommand
|
||||
/**
|
||||
* Start the sending of the bulk mail
|
||||
*
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _mailSendStart()
|
||||
{
|
||||
@@ -437,7 +437,7 @@ class admin_members_bulkmail_bulkmail extends ipsCommand
|
||||
/**
|
||||
* Process the sending of the bulk mail
|
||||
*
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _mailPreviewComplete()
|
||||
{
|
||||
@@ -494,7 +494,7 @@ class admin_members_bulkmail_bulkmail extends ipsCommand
|
||||
/**
|
||||
* Preview the email (javascript popup)
|
||||
*
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _mailPreviewStart()
|
||||
{
|
||||
@@ -506,7 +506,7 @@ class admin_members_bulkmail_bulkmail extends ipsCommand
|
||||
/**
|
||||
* Save the new or edited bulk mail
|
||||
*
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _mailSave()
|
||||
{
|
||||
@@ -639,7 +639,7 @@ class admin_members_bulkmail_bulkmail extends ipsCommand
|
||||
* Show the edit bulk mail form
|
||||
*
|
||||
* @param string [add|edit]
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _mailForm( $type='add' )
|
||||
{
|
||||
@@ -683,7 +683,7 @@ class admin_members_bulkmail_bulkmail extends ipsCommand
|
||||
/**
|
||||
* Show the main bulk mail overview screen
|
||||
*
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _mailStart()
|
||||
{
|
||||
|
||||
@@ -1,32 +1,14 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Define the default bulkmail section
|
||||
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://www.invisionpower.com
|
||||
* @file defaultSection.php Define the default section for the 'bulkmail' module
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $Author: ips_terabyte $
|
||||
* @since 20th February 2002
|
||||
* @version $Rev: 5713 $
|
||||
*
|
||||
* $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 8655 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
* Very simply returns the default section if one is not
|
||||
* passed in the URL
|
||||
*/
|
||||
|
||||
$DEFAULT_SECTION = 'bulkmail';
|
||||
$DEFAULT_SECTION = 'bulkmail';
|
||||
@@ -5,6 +5,6 @@
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -5,6 +5,6 @@
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -6,6 +6,7 @@
|
||||
<subitems>
|
||||
<subitem>
|
||||
<subitemtitle>Рассылки</subitemtitle>
|
||||
<subitemlang>bulkmail</subitemlang>
|
||||
<subsection>bulkmail</subsection>
|
||||
<subitemurl>do=bulk_mail</subitemurl>
|
||||
<subitemrolekey></subitemrolekey>
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
<permissions>
|
||||
<group>
|
||||
<grouptitle>Управление рассылками</grouptitle>
|
||||
<grouplang>mem_bulkmail</grouplang>
|
||||
<items>
|
||||
<item>
|
||||
<key>bulkmail_addedit</key>
|
||||
@@ -15,6 +16,7 @@
|
||||
</group>
|
||||
<group>
|
||||
<grouptitle>Отправка рассылок</grouptitle>
|
||||
<grouplang>mem_bulkmailsend</grouplang>
|
||||
<items>
|
||||
<item>
|
||||
<key>bulkmail_view</key>
|
||||
|
||||
+45
-58
@@ -2,18 +2,18 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Custom field management
|
||||
* Last Updated: $Date: 2010-10-23 08:40:34 -0400 (Sat, 23 Oct 2010) $
|
||||
* Last Updated: $Date: 2011-09-12 20:59:05 -0400 (Mon, 12 Sep 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Revision: 7023 $
|
||||
* @link http://hatynka.in
|
||||
* @version $Revision: 9483 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_ACP' ) )
|
||||
@@ -22,34 +22,34 @@ if ( ! defined( 'IN_ACP' ) )
|
||||
exit();
|
||||
}
|
||||
|
||||
class admin_members_members_customfields extends ipsCommand
|
||||
class admin_members_cfields_customfields extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Skin object
|
||||
*
|
||||
* @var object Skin templates
|
||||
*/
|
||||
private $html;
|
||||
protected $html;
|
||||
|
||||
/**
|
||||
* Shortcut for url
|
||||
*
|
||||
* @var string URL shortcut
|
||||
*/
|
||||
private $form_code;
|
||||
protected $form_code;
|
||||
|
||||
/**
|
||||
* Shortcut for url (javascript)
|
||||
*
|
||||
* @var string JS URL shortcut
|
||||
*/
|
||||
private $form_code_js;
|
||||
protected $form_code_js;
|
||||
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
@@ -60,8 +60,8 @@ class admin_members_members_customfields extends ipsCommand
|
||||
$this->html = $this->registry->output->loadTemplate( 'cp_skin_profilefields' );
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'admin_member' ) );
|
||||
|
||||
$this->form_code = $this->html->form_code = '&module=members&section=customfields&';
|
||||
$this->js_form_code = $this->html->form_code_js = '&module=members§ion=customfields&';
|
||||
$this->form_code = $this->html->form_code = '&module=cfields&section=customfields&';
|
||||
$this->js_form_code = $this->html->form_code_js = '&module=cfields§ion=customfields&';
|
||||
|
||||
//-----------------------------------------
|
||||
// switch-a-magoo
|
||||
@@ -104,12 +104,7 @@ class admin_members_members_customfields extends ipsCommand
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'profilefields_delete' );
|
||||
$this->doDelete();
|
||||
break;
|
||||
|
||||
case 'group_overview':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'profilefieldgroups_global' );
|
||||
$this->groupOverview();
|
||||
break;
|
||||
|
||||
|
||||
case 'group_form_add':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'profilefieldgroups_global' );
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'profilefieldgroups_add' );
|
||||
@@ -159,7 +154,7 @@ class admin_members_members_customfields extends ipsCommand
|
||||
/**
|
||||
* Remove a profile field group
|
||||
*
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function groupDelete()
|
||||
{
|
||||
@@ -177,14 +172,14 @@ class admin_members_members_customfields extends ipsCommand
|
||||
/* Done */
|
||||
$this->registry->output->global_message = $this->lang->words['cf_gremoved'];
|
||||
$this->rebuildCache();
|
||||
$this->groupOverview();
|
||||
$this->mainScreen();
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles the form for adding/editing profile field groups
|
||||
*
|
||||
* @param string $mode Either add or edit
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function groupSave( $mode='add' )
|
||||
{
|
||||
@@ -245,14 +240,14 @@ class admin_members_members_customfields extends ipsCommand
|
||||
|
||||
/* Done */
|
||||
$this->rebuildCache();
|
||||
$this->groupOverview();
|
||||
$this->mainScreen();
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds the form for adding/editing profile field groups
|
||||
*
|
||||
* @param string $mode Either add or edit
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function groupForm( $mode='add' )
|
||||
{
|
||||
@@ -297,33 +292,11 @@ class admin_members_members_customfields extends ipsCommand
|
||||
/* Output */
|
||||
$this->registry->output->html .= $this->html->groupForm( $id, $data, $title, $do );
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds the group listing screen
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function groupOverview()
|
||||
{
|
||||
/* Query Groups */
|
||||
$this->DB->build( array( 'select' => '*', 'from' => 'pfields_groups' ) );
|
||||
$this->DB->execute();
|
||||
|
||||
$fields = array();
|
||||
|
||||
while( $r = $this->DB->fetch() )
|
||||
{
|
||||
$fields[] = $r;
|
||||
}
|
||||
|
||||
/* Output */
|
||||
$this->registry->output->html .= $this->html->groupList( $fields );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Rebuilds the custom profile field cache
|
||||
*
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function rebuildCache()
|
||||
{
|
||||
@@ -359,7 +332,7 @@ class admin_members_members_customfields extends ipsCommand
|
||||
/**
|
||||
* Confirm field deletion form
|
||||
*
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function deleteForm()
|
||||
{
|
||||
@@ -387,7 +360,7 @@ class admin_members_members_customfields extends ipsCommand
|
||||
/**
|
||||
* Removes a field from the database
|
||||
*
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function doDelete()
|
||||
{
|
||||
@@ -410,11 +383,13 @@ class admin_members_members_customfields extends ipsCommand
|
||||
|
||||
/* Remove the filed */
|
||||
$this->DB->dropField( 'pfields_content', "field_{$row['pf_id']}" );
|
||||
$this->DB->buildAndFetch( array( 'delete' => 'pfields_data', 'where' => "pf_id={$id}" ) );
|
||||
$this->DB->delete( 'pfields_data', "pf_id={$id}" );
|
||||
|
||||
/* Rebuild the cache and redirect */
|
||||
$this->rebuildCache();
|
||||
$this->registry->output->doneScreen( $this->lang->words['cf_removed'], $this->lang->words['cf_control'], $this->form_code, 'redirect' );
|
||||
$this->rebuildCache();
|
||||
|
||||
$this->registry->output->global_message = $this->lang->words['cf_removed'];
|
||||
$this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code );
|
||||
}
|
||||
|
||||
|
||||
@@ -422,7 +397,7 @@ class admin_members_members_customfields extends ipsCommand
|
||||
* Saves a custom field form
|
||||
*
|
||||
* @param string Type (add|edit)
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function mainSave( $type='edit' )
|
||||
{
|
||||
@@ -523,7 +498,7 @@ class admin_members_members_customfields extends ipsCommand
|
||||
* Shows a custom field form
|
||||
*
|
||||
* @param string Type (add|edit)
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function mainForm( $type='edit' )
|
||||
{
|
||||
@@ -598,7 +573,7 @@ class admin_members_members_customfields extends ipsCommand
|
||||
/**
|
||||
* Lists the current custom profile fields
|
||||
*
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function mainScreen()
|
||||
{
|
||||
@@ -620,6 +595,7 @@ class admin_members_members_customfields extends ipsCommand
|
||||
|
||||
/* Loop through and build list */
|
||||
$fields = array();
|
||||
|
||||
if ( $this->DB->getTotalRows() )
|
||||
{
|
||||
while ( $r = $this->DB->fetch() )
|
||||
@@ -638,6 +614,17 @@ class admin_members_members_customfields extends ipsCommand
|
||||
}
|
||||
}
|
||||
|
||||
/* Make sure we have all of the groups
|
||||
@link http://community.invisionpower.com/tracker/issue-33386-custom-fields-groups-dont-appear-after-created-while-is-empty */
|
||||
$this->DB->build( array( 'select' => '*', 'from' => 'pfields_groups' ) );
|
||||
$this->DB->execute();
|
||||
|
||||
while( $r = $this->DB->fetch() )
|
||||
{
|
||||
$key = $r['pf_group_name'] ? $r['pf_group_name'] : $this->lang->words['nogroup_other'];
|
||||
$fields[ $key ] = count($fields[ $key ]) ? $fields[ $key ] : $r['pf_group_id'];
|
||||
}
|
||||
|
||||
/* Output */
|
||||
$this->registry->output->html .= $this->html->customProfileFieldsList( $fields );
|
||||
}
|
||||
@@ -645,9 +632,9 @@ class admin_members_members_customfields extends ipsCommand
|
||||
/**
|
||||
* Reorder fields
|
||||
*
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
private function reorder()
|
||||
protected function reorder()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
/**
|
||||
* @file defaultSection.php Define the default section for the 'cfields' module
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $Author: ips_terabyte $
|
||||
* @since 20th February 2002
|
||||
* $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 8655 $
|
||||
*/
|
||||
|
||||
$DEFAULT_SECTION = 'customfields';
|
||||
@@ -0,0 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<menu>
|
||||
<tabitems>
|
||||
<item>
|
||||
<title>Custom Profile Fields</title>
|
||||
<subitems>
|
||||
<subitem>
|
||||
<subitemtitle>Custom Profile Fields</subitemtitle>
|
||||
<subitemlang>customfields</subitemlang>
|
||||
<subsection>customfields</subsection>
|
||||
<subitemurl></subitemurl>
|
||||
<subitemrolekey>profilefields_global</subitemrolekey>
|
||||
<subisredirect>0</subisredirect>
|
||||
</subitem>
|
||||
</subitems>
|
||||
</item>
|
||||
</tabitems>
|
||||
</menu>
|
||||
@@ -0,0 +1,47 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<permissions>
|
||||
<group>
|
||||
<grouptitle>Custom Profile Fields</grouptitle>
|
||||
<grouplang>members_cfields</grouplang>
|
||||
<items>
|
||||
<item>
|
||||
<key>profilefields_global</key>
|
||||
<string>Can access custom profile fields management?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>profilefields_add</key>
|
||||
<string>Can add new profile fields?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>profilefields_edit</key>
|
||||
<string>Can edit profile fields?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>profilefields_delete</key>
|
||||
<string>Can delete profile fields?</string>
|
||||
</item>
|
||||
</items>
|
||||
</group>
|
||||
<group>
|
||||
<grouptitle>Custom Profile Field Groups</grouptitle>
|
||||
<grouplang>members_cfieldgroups</grouplang>
|
||||
<items>
|
||||
<item>
|
||||
<key>profilefieldgroups_global</key>
|
||||
<string>Can access custom profile field group management?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>profilefieldgroups_add</key>
|
||||
<string>Can add new profile field group?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>profilefieldgroups_edit</key>
|
||||
<string>Can edit profile field group?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>profilefieldgroups_delete</key>
|
||||
<string>Can delete profile field group?</string>
|
||||
</item>
|
||||
</items>
|
||||
</group>
|
||||
</permissions>
|
||||
@@ -1,32 +1,14 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Define the default groups section
|
||||
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://www.invisionpower.com
|
||||
* @file defaultSection.php Define the default section for the 'groups' module
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $Author: ips_terabyte $
|
||||
* @since 20th February 2002
|
||||
* @version $Rev: 5713 $
|
||||
*
|
||||
* $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 8655 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
* Very simply returns the default section if one is not
|
||||
* passed in the URL
|
||||
*/
|
||||
|
||||
$DEFAULT_SECTION = 'groups';
|
||||
$DEFAULT_SECTION = 'groups';
|
||||
@@ -2,18 +2,18 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Group management
|
||||
* Last Updated: $Date: 2010-10-23 08:40:34 -0400 (Sat, 23 Oct 2010) $
|
||||
* Last Updated: $Date: 2011-10-05 15:30:51 -0400 (Wed, 05 Oct 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Revision: 7023 $
|
||||
* @link http://hatynka.in
|
||||
* @version $Revision: 9582 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_ACP' ) )
|
||||
@@ -29,27 +29,27 @@ class admin_members_groups_groups extends ipsCommand
|
||||
*
|
||||
* @var object Skin templates
|
||||
*/
|
||||
private $html;
|
||||
protected $html;
|
||||
|
||||
/**
|
||||
* Shortcut for url
|
||||
*
|
||||
* @var string URL shortcut
|
||||
*/
|
||||
private $form_code;
|
||||
protected $form_code;
|
||||
|
||||
/**
|
||||
* Shortcut for url (javascript)
|
||||
*
|
||||
* @var string JS URL shortcut
|
||||
*/
|
||||
private $form_code_js;
|
||||
protected $form_code_js;
|
||||
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
@@ -129,9 +129,9 @@ class admin_members_groups_groups extends ipsCommand
|
||||
/**
|
||||
* List the groups
|
||||
*
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
private function _mainScreen()
|
||||
protected function _mainScreen()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
@@ -141,13 +141,7 @@ class admin_members_groups_groups extends ipsCommand
|
||||
$content = "";
|
||||
$form = array();
|
||||
$rows = array();
|
||||
|
||||
//-----------------------------------------
|
||||
// Page details
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->output->extra_nav[] = array( $this->form_code, $this->lang->words['g_nav'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Get groups
|
||||
//-----------------------------------------
|
||||
@@ -203,7 +197,7 @@ class admin_members_groups_groups extends ipsCommand
|
||||
/**
|
||||
* Exports the groups to a master XML file for distribution
|
||||
*
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function masterXMLExport()
|
||||
{
|
||||
@@ -215,22 +209,17 @@ class admin_members_groups_groups extends ipsCommand
|
||||
$skip = IPSLib::fetchNonDefaultGroupFields();
|
||||
|
||||
//-----------------------------------------
|
||||
// Get XML class
|
||||
// Get xml class
|
||||
//-----------------------------------------
|
||||
|
||||
require_once( IPS_KERNEL_PATH . 'class_xml.php' );
|
||||
|
||||
$xml = new class_xml();
|
||||
$xml->doc_type = IPS_DOC_CHAR_SET;
|
||||
require_once( IPS_KERNEL_PATH.'classXML.php' );/*noLibHook*/
|
||||
|
||||
$xml->xml_set_root( 'export', array( 'exported' => time() ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// Set group
|
||||
//-----------------------------------------
|
||||
|
||||
$xml->xml_add_group( 'group' );
|
||||
$xml = new classXML( IPS_DOC_CHAR_SET );
|
||||
|
||||
$xml->newXMLDocument();
|
||||
$xml->addElement( 'export' );
|
||||
$xml->addElement( 'group', 'export' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Grab our default 6 groups
|
||||
//-----------------------------------------
|
||||
@@ -247,38 +236,31 @@ class admin_members_groups_groups extends ipsCommand
|
||||
$content = array();
|
||||
$r['g_icon'] = '';
|
||||
|
||||
//-----------------------------------------
|
||||
// Sort the fields...
|
||||
//-----------------------------------------
|
||||
|
||||
foreach( $r as $k => $v )
|
||||
if( is_array($skip) AND count($skip) )
|
||||
{
|
||||
if ( ! in_array( $k, $skip ) )
|
||||
foreach( $skip as $_kk )
|
||||
{
|
||||
$content[] = $xml->xml_build_simple_tag( $k, $v );
|
||||
unset( $r[ $_kk ] );
|
||||
}
|
||||
}
|
||||
|
||||
$entry[] = $xml->xml_build_entry( 'row', $content );
|
||||
$xml->addElementAsRecord( 'group', 'row', $r );
|
||||
}
|
||||
|
||||
$xml->xml_add_entry_to_group( 'group', $entry );
|
||||
$xml->xml_format_document();
|
||||
|
||||
//-----------------------------------------
|
||||
// Print to browser
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->output->showDownload( $xml->xml_document, 'groups.xml', '', 0 );
|
||||
$this->registry->output->showDownload( $xml->fetchDocument(), 'groups.xml', '', 0 );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Form to delete a group
|
||||
*
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
private function _deleteForm()
|
||||
protected function _deleteForm()
|
||||
{
|
||||
$group_id = intval($this->request['id']);
|
||||
$group = $this->caches['group_cache'][ $group_id ];
|
||||
@@ -314,9 +296,9 @@ class admin_members_groups_groups extends ipsCommand
|
||||
/**
|
||||
* Delete the group
|
||||
*
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
private function _doDelete()
|
||||
protected function _doDelete()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
@@ -470,9 +452,9 @@ class admin_members_groups_groups extends ipsCommand
|
||||
* Save the group [add/edit]
|
||||
*
|
||||
* @param string 'add' or 'edit'
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
private function _saveGroup( $type='edit' )
|
||||
protected function _saveGroup( $type='edit' )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
@@ -576,9 +558,9 @@ class admin_members_groups_groups extends ipsCommand
|
||||
}
|
||||
}
|
||||
|
||||
$this->request[ 'p_max'] = str_replace( ":", "", $this->request['p_max'] );
|
||||
$this->request[ 'p_width'] = str_replace( ":", "", $this->request['p_width'] );
|
||||
$this->request[ 'p_height'] = str_replace( ":", "", $this->request['p_height'] );
|
||||
$this->request['p_max'] = str_replace( ":", "", $this->request['p_max'] );
|
||||
$this->request['p_width'] = str_replace( ":", "", $this->request['p_width'] );
|
||||
$this->request['p_height'] = str_replace( ":", "", $this->request['p_height'] );
|
||||
|
||||
$sig_limits = array(
|
||||
$this->request['use_signatures'],
|
||||
@@ -593,12 +575,10 @@ class admin_members_groups_groups extends ipsCommand
|
||||
// Set the db array
|
||||
//-----------------------------------------
|
||||
|
||||
$db_string = array(
|
||||
'g_view_board' => intval($this->request['g_view_board']),
|
||||
$db_string = array( 'g_view_board' => intval($this->request['g_view_board']),
|
||||
'g_mem_info' => intval($this->request['g_mem_info']),
|
||||
'g_can_add_friends' => intval($this->request['g_can_add_friends']),
|
||||
'g_use_search' => intval($this->request['g_use_search']),
|
||||
'g_email_friend' => intval($this->request['g_email_friend']),
|
||||
'g_edit_profile' => intval($this->request['g_edit_profile']),
|
||||
'g_use_pm' => intval($this->request['g_use_pm']),
|
||||
'g_pm_perday' => intval($this->request['g_pm_perday']),
|
||||
@@ -614,7 +594,6 @@ class admin_members_groups_groups extends ipsCommand
|
||||
'g_perm_id' => $new_perm_set_id ? $new_perm_set_id : implode( ",", $this->request['permid'] ),
|
||||
'g_icon' => trim( IPSText::safeslashes( $_POST['g_icon'] ) ),
|
||||
'g_attach_max' => $this->request['g_attach_max'],
|
||||
'g_avatar_upload' => intval($this->request['g_avatar_upload']),
|
||||
'g_max_messages' => intval($this->request['g_max_messages']),
|
||||
'g_max_mass_pm' => intval($this->request['g_max_mass_pm']),
|
||||
'g_pm_flood_mins' => intval($this->request['g_pm_flood_mins']),
|
||||
@@ -622,7 +601,6 @@ class admin_members_groups_groups extends ipsCommand
|
||||
'g_promotion' => $promotion_a . '&' . $promotion_b,
|
||||
'g_photo_max_vars' => $this->request['p_max'].':'.$this->request['p_width'].':'.$this->request['p_height'],
|
||||
'g_dohtml' => intval($this->request['g_dohtml']),
|
||||
'g_email_limit' => intval($this->request['join_limit']).':'.intval($this->request['join_flood']),
|
||||
'g_bypass_badwords' => intval($this->request['g_bypass_badwords']),
|
||||
'g_can_msg_attach' => intval($this->request['g_can_msg_attach']),
|
||||
'g_attach_per_post' => intval($this->request['g_attach_per_post']),
|
||||
@@ -636,9 +614,8 @@ class admin_members_groups_groups extends ipsCommand
|
||||
'g_max_bgimg_upload' => intval( $this->request['g_max_bgimg_upload'] ),
|
||||
'g_bitoptions' => IPSBWOPtions::freeze( $this->request, 'groups', 'global' ), # Saves all BW options for all apps
|
||||
);
|
||||
|
||||
/* Leave here in case an application below needs to add a force_data_type */
|
||||
$this->DB->force_data_type = array( 'g_title' => 'string' );
|
||||
|
||||
$this->DB->setDataType( 'g_title', 'string' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Ok? Load interface and child classes
|
||||
@@ -646,21 +623,18 @@ class admin_members_groups_groups extends ipsCommand
|
||||
|
||||
IPSLib::loadInterface( 'admin/group_form.php' );
|
||||
|
||||
foreach( ipsRegistry::$applications as $app_dir => $app_data )
|
||||
$_groupPlugins = array();
|
||||
|
||||
foreach( IPSLib::getEnabledApplications() as $app_dir => $app_data )
|
||||
{
|
||||
if ( ! IPSLib::appIsInstalled( $app_dir ) )
|
||||
if ( is_file( IPSLib::getAppDir( $app_dir ) . '/extensions/admin/group_form.php' ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( file_exists( IPSLib::getAppDir( $app_dir ) . '/extensions/admin/group_form.php' ) )
|
||||
{
|
||||
$_class = IPSLib::loadLibrary( IPSLib::getAppDir( $app_dir ) . '/extensions/admin/group_form.php', 'admin_group_form__'.$app_dir, $app_dir );
|
||||
$_object = new $_class( $this->registry );
|
||||
$_class = IPSLib::loadLibrary( IPSLib::getAppDir( $app_dir ) . '/extensions/admin/group_form.php', 'admin_group_form__'.$app_dir, $app_dir );
|
||||
$_groupPlugins[ $_class ] = new $_class( $this->registry );
|
||||
|
||||
$remote = $_object->getForSave();
|
||||
$remote = $_groupPlugins[ $_class ]->getForSave();
|
||||
|
||||
$db_string = array_merge( $remote, $db_string );
|
||||
$db_string = array_merge( $db_string, $remote );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -668,7 +642,7 @@ class admin_members_groups_groups extends ipsCommand
|
||||
// Editing...do an update
|
||||
//-----------------------------------------
|
||||
|
||||
if ($type == 'edit')
|
||||
if ( $type == 'edit' )
|
||||
{
|
||||
$this->DB->update( 'groups', $db_string, 'g_id=' . $group_id );
|
||||
|
||||
@@ -678,6 +652,8 @@ class admin_members_groups_groups extends ipsCommand
|
||||
|
||||
$this->DB->update( 'moderators', array( 'group_name' => $db_string['g_title'] ), 'group_id=' . $group_id );
|
||||
|
||||
$this->cache->rebuildCache( 'moderators', 'forums' );
|
||||
|
||||
ipsRegistry::getClass('adminFunctions')->saveAdminLog( sprintf( $this->lang->words['g_editedlog'], $db_string['g_title'] ) );
|
||||
|
||||
$this->registry->output->global_message = $this->lang->words['g_edited'];
|
||||
@@ -695,6 +671,21 @@ class admin_members_groups_groups extends ipsCommand
|
||||
|
||||
$this->rebuildGroupCache();
|
||||
|
||||
//-----------------------------------------
|
||||
// Post save callbacks
|
||||
//-----------------------------------------
|
||||
|
||||
if( count($_groupPlugins) )
|
||||
{
|
||||
foreach( $_groupPlugins as $_className => $_object )
|
||||
{
|
||||
if( method_exists( $_object, 'postSave' ) )
|
||||
{
|
||||
$_object->postSave( $group_id );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( $new_perm_set_id )
|
||||
{
|
||||
$from = '';
|
||||
@@ -713,8 +704,8 @@ class admin_members_groups_groups extends ipsCommand
|
||||
}
|
||||
}
|
||||
|
||||
$this->registry->output->doneScreen( $this->lang->words['per_saved'], $this->lang->words['per_manage'], 'module=groups&section=permissions&do=edit_set_form' . $from . '&id=' . $new_perm_set_id, 'redirect' );
|
||||
return;
|
||||
$this->registry->output->global_message = $this->lang->words['per_saved'];
|
||||
$this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . 'module=groups&section=permissions&do=edit_set_form' . $from . '&id=' . $new_perm_set_id );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -739,7 +730,7 @@ class admin_members_groups_groups extends ipsCommand
|
||||
/**
|
||||
* Rebuilds the group cache
|
||||
*
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function rebuildGroupCache()
|
||||
{
|
||||
@@ -752,7 +743,7 @@ class admin_members_groups_groups extends ipsCommand
|
||||
|
||||
while ( $i = $this->DB->fetch() )
|
||||
{
|
||||
$cache[ $i['g_id'] ] = IPSLib::unpackGroup( $i );
|
||||
$cache[ $i['g_id'] ] = IPSMember::unpackGroup( $i );
|
||||
}
|
||||
|
||||
$this->cache->setCache( 'group_cache', $cache, array( 'array' => 1 ) );
|
||||
@@ -762,9 +753,10 @@ class admin_members_groups_groups extends ipsCommand
|
||||
* Show the add/edit group form
|
||||
*
|
||||
* @param string 'add' or 'edit'
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
* @todo _initTab doesn't seem to work anymore with the new tabs, need to update each app to have a unique name/id
|
||||
*/
|
||||
private function _groupForm( $type='edit' )
|
||||
protected function _groupForm( $type='edit' )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Grab group data and start us off
|
||||
@@ -778,7 +770,7 @@ class admin_members_groups_groups extends ipsCommand
|
||||
}
|
||||
|
||||
$group = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'groups', 'where' => "g_id=" . intval($this->request['id']) ) );
|
||||
$group = IPSLib::unpackGroup( $group );
|
||||
$group = IPSMember::unpackGroup( $group );
|
||||
|
||||
//-----------------------------------------
|
||||
// Check restrictions.
|
||||
@@ -796,7 +788,7 @@ class admin_members_groups_groups extends ipsCommand
|
||||
if( $this->request['id'] )
|
||||
{
|
||||
$group = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'groups', 'where' => "g_id=" . intval($this->request['id']) ) );
|
||||
$group = IPSLib::unpackGroup( $group );
|
||||
$group = IPSMember::unpackGroup( $group );
|
||||
}
|
||||
|
||||
$group['g_title'] = 'New Group';
|
||||
@@ -808,7 +800,7 @@ class admin_members_groups_groups extends ipsCommand
|
||||
|
||||
$perm_masks = array();
|
||||
|
||||
$this->DB->build( array( 'select' => '*', 'from' => 'forum_perms' ) );
|
||||
$this->DB->build( array( 'select' => '*', 'from' => 'forum_perms', 'order' => 'perm_name ASC' ) );
|
||||
$this->DB->execute();
|
||||
|
||||
while ( $r = $this->DB->fetch() )
|
||||
@@ -824,33 +816,28 @@ class admin_members_groups_groups extends ipsCommand
|
||||
|
||||
IPSLib::loadInterface( 'admin/group_form.php' );
|
||||
|
||||
$tabsUsed = 2;
|
||||
$firsttab = false;
|
||||
$tabsUsed = 5;
|
||||
$firstTab = empty($this->request['_initTab']) ? false : trim($this->request['_initTab']);
|
||||
|
||||
foreach( ipsRegistry::$applications as $app_dir => $app_data )
|
||||
foreach( IPSLib::getEnabledApplications() as $app_dir => $app_data )
|
||||
{
|
||||
if ( ! IPSLib::appIsInstalled( $app_dir ) )
|
||||
if ( is_file( IPSLib::getAppDir( $app_dir ) . '/extensions/admin/group_form.php' ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( file_exists( IPSLib::getAppDir( $app_dir ) . '/extensions/admin/group_form.php' ) )
|
||||
{
|
||||
$_class = IPSLib::loadLibrary( IPSLib::getAppDir( $app_dir ) . '/extensions/admin/group_form.php', 'admin_group_form__'.$app_dir, $app_dir );
|
||||
$_class = IPSLib::loadLibrary( IPSLib::getAppDir( $app_dir ) . '/extensions/admin/group_form.php', 'admin_group_form__'.$app_dir, $app_dir );
|
||||
|
||||
if ( class_exists( $_class ) )
|
||||
{
|
||||
$_object = new $_class( $this->registry );
|
||||
|
||||
|
||||
$data = $_object->getDisplayContent( $group, $tabsUsed );
|
||||
$blocks['area'][ $app_dir ] = $data['content'];
|
||||
$blocks['tabs'][ $app_dir ] = $data['tabs'];
|
||||
$blocks['area'][ $app_dir ] = $data['content'];
|
||||
$blocks['tabs'][ $app_dir ] = $data['tabs'];
|
||||
|
||||
$tabsUsed = $data['tabsUsed'] ? ( $tabsUsed + $data['tabsUsed'] ) : ( $tabsUsed + 1 );
|
||||
$tabsUsed = $data['tabsUsed'] ? ( $tabsUsed + $data['tabsUsed'] ) : ( $tabsUsed + 1 );
|
||||
|
||||
if ( $this->request['_initTab'] == $app_dir )
|
||||
if ( !empty($this->request['_initTab']) && $this->request['_initTab'] == $app_dir )
|
||||
{
|
||||
$firsttab = $tabsUsed;
|
||||
$firstTab = $tabsUsed;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -860,6 +847,6 @@ class admin_members_groups_groups extends ipsCommand
|
||||
// And output to form
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->output->html .= $this->html->groupsForm( $type, $group, $perm_masks, $blocks, $firsttab );
|
||||
$this->registry->output->html .= $this->html->groupsForm( $type, $group, $perm_masks, $blocks, $firstTab );
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,6 @@
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -2,18 +2,18 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Permissions management
|
||||
* Last Updated: $Date: 2010-10-21 07:08:38 -0400 (Thu, 21 Oct 2010) $
|
||||
* Last Updated: $Date: 2011-09-02 20:55:33 -0400 (Fri, 02 Sep 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Revision: 7007 $
|
||||
* @link http://hatynka.in
|
||||
* @version $Revision: 9450 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_ACP' ) )
|
||||
@@ -30,27 +30,27 @@ class admin_members_groups_permissions extends ipsCommand
|
||||
*
|
||||
* @var object Skin templates
|
||||
*/
|
||||
private $html;
|
||||
protected $html;
|
||||
|
||||
/**
|
||||
* Shortcut for url
|
||||
*
|
||||
* @var string URL shortcut
|
||||
*/
|
||||
private $form_code;
|
||||
protected $form_code;
|
||||
|
||||
/**
|
||||
* Shortcut for url (javascript)
|
||||
*
|
||||
* @var string JS URL shortcut
|
||||
*/
|
||||
private $form_code_js;
|
||||
protected $form_code_js;
|
||||
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
@@ -86,12 +86,12 @@ class admin_members_groups_permissions extends ipsCommand
|
||||
break;
|
||||
|
||||
case 'view_perm_users':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'permmasks_view' );
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'perms_manage' );
|
||||
$this->permissionSetUsers();
|
||||
break;
|
||||
|
||||
case 'remove_mask':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'permmasks_delete' );
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'perms_manage' );
|
||||
$this->removePermissionSet();
|
||||
break;
|
||||
|
||||
@@ -111,7 +111,7 @@ class admin_members_groups_permissions extends ipsCommand
|
||||
/**
|
||||
* Removes permission set(s) from a user
|
||||
*
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function removePermissionSet()
|
||||
{
|
||||
@@ -170,7 +170,7 @@ class admin_members_groups_permissions extends ipsCommand
|
||||
/**
|
||||
* Show users that are assigned the specified permission set
|
||||
*
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function permissionSetUsers()
|
||||
{
|
||||
@@ -260,9 +260,9 @@ class admin_members_groups_permissions extends ipsCommand
|
||||
/**
|
||||
* Deletes a permission set
|
||||
*
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
private function _doDeleteSet()
|
||||
protected function _doDeleteSet()
|
||||
{
|
||||
/* INIT */
|
||||
$id = $this->request['id'];
|
||||
@@ -279,11 +279,11 @@ class admin_members_groups_permissions extends ipsCommand
|
||||
/* Check to see if there is a permission map */
|
||||
$_file = IPSLib::getAppDir( $app['app_directory'] ) . '/extensions/coreExtensions.php';
|
||||
|
||||
if( file_exists( $_file ) )
|
||||
if( is_file( $_file ) )
|
||||
{
|
||||
/* Get the permission mappings */
|
||||
$_PERM_CONFIG = array();
|
||||
require_once( $_file );
|
||||
require_once( $_file );/*noLibHook*/
|
||||
|
||||
/* Check for a config array */
|
||||
if( is_array( $_PERM_CONFIG ) && count( $_PERM_CONFIG ) )
|
||||
@@ -327,18 +327,22 @@ class admin_members_groups_permissions extends ipsCommand
|
||||
}
|
||||
|
||||
/* Delete */
|
||||
$this->DB->delete( 'forum_perms', "perm_id=$id" );
|
||||
$this->DB->delete( 'forum_perms', "perm_id=" . $id );
|
||||
|
||||
/* Fire callbacks */
|
||||
$this->_fireAppCallbacks();
|
||||
|
||||
/* Done */
|
||||
$this->registry->output->doneScreen( $this->lang->words['per_removed'], $this->lang->words['per_manage'], $this->form_code, 'redirect' );
|
||||
$this->registry->output->global_message = $this->lang->words['per_removed'];
|
||||
$this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code );
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a nwe permission set
|
||||
*
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
private function _doCreatePermissionSet()
|
||||
protected function _doCreatePermissionSet()
|
||||
{
|
||||
/* INIT */
|
||||
$set_name = $this->request['new_perm_name'];
|
||||
@@ -363,11 +367,11 @@ class admin_members_groups_permissions extends ipsCommand
|
||||
/* Check to see if there is a permission map */
|
||||
$_file = IPSLib::getAppDir( $app['app_directory'] ) . '/extensions/coreExtensions.php';
|
||||
|
||||
if( file_exists( $_file ) )
|
||||
if( is_file( $_file ) )
|
||||
{
|
||||
/* Get the permission mappings */
|
||||
$_PERM_CONFIG = array();
|
||||
require_once( $_file );
|
||||
require_once( $_file );/*noLibHook*/
|
||||
|
||||
/* Check for a config array */
|
||||
if( is_array( $_PERM_CONFIG ) && count( $_PERM_CONFIG ) )
|
||||
@@ -412,16 +416,20 @@ class admin_members_groups_permissions extends ipsCommand
|
||||
$this->DB->update( 'permission_index', $r, "perm_id=" . $perm_id );
|
||||
}
|
||||
|
||||
/* Fire callbacks */
|
||||
$this->_fireAppCallbacks();
|
||||
|
||||
/* Done */
|
||||
$this->registry->output->doneScreen( $this->lang->words['per_saved'], $this->lang->words['per_manage'], $this->form_code . 'do=edit_set_form&id=' . $new_set_id, 'redirect' );
|
||||
$this->registry->output->global_message = $this->lang->words['per_saved'];
|
||||
$this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code . 'do=edit_set_form&id=' . $new_set_id );
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves the global permission set form
|
||||
*
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
private function _permissionSaveForm()
|
||||
protected function _permissionSaveForm()
|
||||
{
|
||||
/* ID */
|
||||
$id = intval( $this->request['id'] );
|
||||
@@ -442,16 +450,20 @@ class admin_members_groups_permissions extends ipsCommand
|
||||
$this->DB->update( 'forum_perms', array( 'perm_name' => $this->request['perm_name'] ), "perm_id={$id}" );
|
||||
}
|
||||
|
||||
/* Fire callbacks */
|
||||
$this->_fireAppCallbacks();
|
||||
|
||||
/* Done */
|
||||
$this->registry->output->doneScreen( $this->lang->words['per_saved'], $this->lang->words['per_manage'], $this->form_code . '&_from=' . $this->request['_from'], 'redirect' );
|
||||
$this->registry->output->global_message = $this->lang->words['per_saved'];
|
||||
$this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code . '&_from=' . $this->request['_from'] );
|
||||
}
|
||||
|
||||
/**
|
||||
* Form for modifying a permission set
|
||||
*
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
private function _permissionSetForm()
|
||||
protected function _permissionSetForm()
|
||||
{
|
||||
/* ID */
|
||||
$id = intval( $this->request['id'] );
|
||||
@@ -471,11 +483,11 @@ class admin_members_groups_permissions extends ipsCommand
|
||||
/* Check to see if there is a permission map */
|
||||
$_file = IPSLib::getAppDir( $app['app_directory'] ) . '/extensions/coreExtensions.php';
|
||||
|
||||
if( file_exists( $_file ) )
|
||||
if( is_file( $_file ) )
|
||||
{
|
||||
/* Get the permission mappings */
|
||||
$_PERM_CONFIG = array();
|
||||
require_once( $_file );
|
||||
require_once( $_file );/*noLibHook*/
|
||||
|
||||
/* Check for a config array */
|
||||
if( is_array( $_PERM_CONFIG ) && count( $_PERM_CONFIG ) )
|
||||
@@ -484,18 +496,19 @@ class admin_members_groups_permissions extends ipsCommand
|
||||
foreach( $_PERM_CONFIG as $perm_type )
|
||||
{
|
||||
/* Check for a class */
|
||||
$_class = $app['app_directory'] . 'PermMapping' . $perm_type;
|
||||
|
||||
if( class_exists( $_class ) )
|
||||
$classToLoad = IPSLib::loadLibrary( '', $app['app_directory'] . 'PermMapping' . $perm_type, $app['app_directory'] );
|
||||
|
||||
if( class_exists( $classToLoad ) )
|
||||
{
|
||||
/* Create the object */
|
||||
$perm_map = new $_class;
|
||||
$perm_map = new $classToLoad;
|
||||
|
||||
/* Make sure the function exists */
|
||||
if( method_exists( $perm_map, 'getPermItems' ) )
|
||||
{
|
||||
$matricies[$app['app_title']] = $perm_obj->adminItemPermMatrix( $perm_map, $perm_map->getPermItems(), $id, $app['app_directory'], $perm_type );
|
||||
$apps[$app['app_directory']] = $perm_type;
|
||||
$_key = count($_PERM_CONFIG) > 1 ? $app['app_title'] . ' ' . $perm_type : $app['app_title'];
|
||||
$matricies[ $_key ] = $perm_obj->adminItemPermMatrix( $perm_map, $perm_map->getPermItems(), $id, $app['app_directory'], $perm_type );
|
||||
$apps[$app['app_directory']][ $perm_type ] = $perm_type;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -510,9 +523,9 @@ class admin_members_groups_permissions extends ipsCommand
|
||||
/**
|
||||
* List permission masks
|
||||
*
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
private function _mainScreen()
|
||||
protected function _mainScreen()
|
||||
{
|
||||
/* INIT */
|
||||
$perms = array();
|
||||
@@ -598,7 +611,7 @@ class admin_members_groups_permissions extends ipsCommand
|
||||
$groups_used = "{$this->lang->words['per_none']}";
|
||||
}
|
||||
|
||||
if ( isset($mems[ $id ]) AND $mems[ $id ] > 0 )
|
||||
if ( !empty($mems[ $id ]) )
|
||||
{
|
||||
$is_active = 1;
|
||||
}
|
||||
@@ -628,4 +641,35 @@ class admin_members_groups_permissions extends ipsCommand
|
||||
|
||||
$this->registry->output->html .= $this->html->permissionsSplash( $display_groups, $dlist );
|
||||
}
|
||||
|
||||
/**
|
||||
* Fire any application callbacks as needed
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _fireAppCallbacks()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Loop through each application
|
||||
//-----------------------------------------
|
||||
|
||||
foreach( $this->registry->getApplications() as $app )
|
||||
{
|
||||
// Let's skip the app_enabled check to be sure everything is always recached!
|
||||
|
||||
//-----------------------------------------
|
||||
// Check for callback file
|
||||
//-----------------------------------------
|
||||
|
||||
$_file = IPSLib::getAppDir( $app['app_directory'] ) . '/extensions/permissionsSync.php';
|
||||
|
||||
if( is_file( $_file ) )
|
||||
{
|
||||
$classToLoad = IPSLib::loadLibrary( $_file, $app['app_directory'] . 'PermissionsSync', $app['app_directory'] );
|
||||
$_callback = new $classToLoad( $this->registry );
|
||||
|
||||
$_callback->updatePermissions();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,6 @@
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -6,6 +6,7 @@
|
||||
<subitems>
|
||||
<subitem>
|
||||
<subitemtitle>Управление группами пользователей</subitemtitle>
|
||||
<subitemlang>manage_groups</subitemlang>
|
||||
<subsection>groups</subsection>
|
||||
<subitemurl>do=groups_overview</subitemurl>
|
||||
<subitemrolekey></subitemrolekey>
|
||||
@@ -18,9 +19,10 @@
|
||||
<subitems>
|
||||
<subitem>
|
||||
<subitemtitle>Управление масками доступа</subitemtitle>
|
||||
<subitemlang>manage_perms</subitemlang>
|
||||
<subsection>permissions</subsection>
|
||||
<subitemurl>do=overview</subitemurl>
|
||||
<subitemrolekey></subitemrolekey>
|
||||
<subitemrolekey>perms_manage</subitemrolekey>
|
||||
<subisredirect>0</subisredirect>
|
||||
</subitem>
|
||||
</subitems>
|
||||
|
||||
@@ -5,6 +5,6 @@
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,21 +1,14 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Ban Filters
|
||||
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 5713 $
|
||||
*
|
||||
* @file banfilters.php Provides helper methods to add ban filters
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $Author: ips_terabyte $
|
||||
* @since -
|
||||
* $LastChangedDate: 2011-03-22 12:48:06 -0400 (Tue, 22 Mar 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 8149 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_ACP' ) )
|
||||
@@ -24,64 +17,51 @@ if ( ! defined( 'IN_ACP' ) )
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @class admin_members_members_banfilters
|
||||
* @brief Provides helper methods to add ban filters
|
||||
*/
|
||||
class admin_members_members_banfilters extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Skin object
|
||||
* Skin object shortcut
|
||||
*
|
||||
* @access private
|
||||
* @var object Skin templates
|
||||
*/
|
||||
private $html;
|
||||
* @var $html
|
||||
*/
|
||||
public $html;
|
||||
|
||||
/**
|
||||
* Shortcut for url
|
||||
* String for the screen url bit
|
||||
*
|
||||
* @access private
|
||||
* @var string URL shortcut
|
||||
* @var $form_code
|
||||
*/
|
||||
private $form_code;
|
||||
public $form_code = '';
|
||||
|
||||
/**
|
||||
* Shortcut for url (javascript)
|
||||
* String for the JS url bit
|
||||
*
|
||||
* @access private
|
||||
* @var string JS URL shortcut
|
||||
* @var $form_code_js
|
||||
*/
|
||||
private $form_code_js;
|
||||
public $form_code_js = '';
|
||||
|
||||
/**
|
||||
* Main class entry point
|
||||
* Main function executed automatically by the controller
|
||||
*
|
||||
* @access public
|
||||
* @param object ipsRegistry reference
|
||||
* @return void [Outputs to screen]
|
||||
* @param object $registry Registry object
|
||||
* @return @e void
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Load skin
|
||||
//-----------------------------------------
|
||||
/* Load skin & setup some stuff */
|
||||
$this->html = $this->registry->output->loadTemplate( 'cp_skin_banfilters' );
|
||||
$this->form_code = $this->html->form_code = 'module=members&section=banfilters&';
|
||||
$this->form_code_js = $this->html->form_code_js = 'module=members§ion=banfilters&';
|
||||
|
||||
$this->html = $this->registry->output->loadTemplate( 'cp_skin_banfilters' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Set up stuff
|
||||
//-----------------------------------------
|
||||
|
||||
$this->form_code = $this->html->form_code = 'module=members&section=banfilters';
|
||||
$this->form_code_js = $this->html->form_code_js = 'module=members§ion=banfilters';
|
||||
|
||||
//-----------------------------------------
|
||||
// Load lang
|
||||
//-----------------------------------------
|
||||
/* Load lang */
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'admin_member' ), 'members' );
|
||||
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'admin_member' ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// What to do...
|
||||
//-----------------------------------------
|
||||
|
||||
/* What to do... */
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'ban_add':
|
||||
@@ -101,22 +81,76 @@ class admin_members_members_banfilters extends ipsCommand
|
||||
break;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Pass to CP output hander
|
||||
//-----------------------------------------
|
||||
|
||||
/* Output */
|
||||
$this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper();
|
||||
$this->registry->output->sendOutput();
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays the ban overview screen
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function banOverview()
|
||||
{
|
||||
/* INI */
|
||||
$ban = array();
|
||||
$ips = array();
|
||||
$emails = array();
|
||||
$names = array();
|
||||
|
||||
/* Get ban filters */
|
||||
$this->DB->build( array( 'select' => '*', 'from' => 'banfilters', 'order' => 'ban_date desc' ) );
|
||||
$this->DB->execute();
|
||||
|
||||
while ( $r = $this->DB->fetch() )
|
||||
{
|
||||
$ban[ $r['ban_type'] ][ $r['ban_id'] ] = $r;
|
||||
}
|
||||
|
||||
/* IPs */
|
||||
if( isset( $ban['ip'] ) AND is_array( $ban['ip'] ) AND count( $ban['ip'] ) )
|
||||
{
|
||||
foreach( $ban['ip'] as $entry )
|
||||
{
|
||||
$entry['_date'] = $this->registry->class_localization->getDate( $entry['ban_date'], 'SHORT', 1 );
|
||||
$ips[] = $entry;
|
||||
}
|
||||
}
|
||||
|
||||
/* Emails */
|
||||
if( isset( $ban['email'] ) AND is_array( $ban['email'] ) AND count( $ban['email'] ) )
|
||||
{
|
||||
foreach( $ban['email'] as $entry )
|
||||
{
|
||||
$entry['_date'] = $this->registry->class_localization->getDate( $entry['ban_date'], 'SHORT' );
|
||||
$emails[] = $entry;
|
||||
}
|
||||
}
|
||||
|
||||
/* Banned Names */
|
||||
if( isset( $ban['name'] ) AND is_array( $ban['name'] ) AND count( $ban['name'] ) )
|
||||
{
|
||||
foreach( $ban['name'] as $entry )
|
||||
{
|
||||
$entry['_date'] = $this->registry->class_localization->getDate( $entry['ban_date'], 'SHORT' );
|
||||
$names[] = $entry;
|
||||
}
|
||||
}
|
||||
|
||||
/* Output */
|
||||
$this->registry->output->html .= $this->html->banOverview( $ips, $emails, $names );
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a new ban filter
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function banAdd()
|
||||
{
|
||||
$this->request['bantext'] = trim($this->request['bantext']);
|
||||
|
||||
/* Error checking */
|
||||
if( ! $this->request['bantext'] )
|
||||
{
|
||||
@@ -126,11 +160,10 @@ class admin_members_members_banfilters extends ipsCommand
|
||||
}
|
||||
|
||||
/* Check for duplicate */
|
||||
$result = $this->DB->buildAndFetch( array(
|
||||
'select' => '*',
|
||||
'from' => 'banfilters',
|
||||
'where' => "ban_content='{$this->request['bantext']}' and ban_type='{$this->request['bantype']}'"
|
||||
) );
|
||||
$result = $this->DB->buildAndFetch( array( 'select' => '*',
|
||||
'from' => 'banfilters',
|
||||
'where' => "ban_content='{$this->request['bantext']}' and ban_type='{$this->request['bantype']}'"
|
||||
) );
|
||||
|
||||
if ( $result['ban_id'] )
|
||||
{
|
||||
@@ -140,21 +173,24 @@ class admin_members_members_banfilters extends ipsCommand
|
||||
}
|
||||
|
||||
/* Insert the new ban filter */
|
||||
$this->DB->insert( 'banfilters', array( 'ban_type' => $this->request['bantype'], 'ban_content' => trim( $this->request['bantext'] ), 'ban_date' => time() ) );
|
||||
$this->DB->insert( 'banfilters', array( 'ban_type' => trim($this->request['bantype']),
|
||||
'ban_content' => trim($this->request['bantext']),
|
||||
'ban_date' => time(),
|
||||
'ban_reason' => trim($this->request['banreason'])
|
||||
)
|
||||
);
|
||||
|
||||
/* Rebuild cacne and bounce */
|
||||
$this->rebuildBanCache();
|
||||
|
||||
$this->registry->output->global_message = $this->lang->words['ban_added'];
|
||||
$this->banOverview();
|
||||
|
||||
}
|
||||
$this->registry->output->global_message = $this->lang->words['ban_added'];
|
||||
$this->registry->output->silentRedirectWithMessage( $this->settings['base_url'].$this->form_code.'do=ban' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a ban filter
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function banDelete()
|
||||
{
|
||||
@@ -164,7 +200,7 @@ class admin_members_members_banfilters extends ipsCommand
|
||||
/* Loop through the request fields and find checked ban filters */
|
||||
foreach( $this->request as $key => $value )
|
||||
{
|
||||
if( preg_match( "/^id_(\d+)$/", $key, $match ) )
|
||||
if( preg_match( '/^banid_(\d+)$/', $key, $match ) )
|
||||
{
|
||||
if( $this->request[ $match[0] ] )
|
||||
{
|
||||
@@ -180,7 +216,6 @@ class admin_members_members_banfilters extends ipsCommand
|
||||
if ( count( $ids ) )
|
||||
{
|
||||
$this->DB->delete( 'banfilters', 'ban_id IN(' . implode( ",", $ids ) . ')' );
|
||||
$this->DB->execute();
|
||||
}
|
||||
|
||||
/* Rebuild the cache */
|
||||
@@ -188,77 +223,13 @@ class admin_members_members_banfilters extends ipsCommand
|
||||
|
||||
/* Bounce */
|
||||
$this->registry->output->global_message = $this->lang->words['ban_removed'];
|
||||
$this->banOverview();
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays the ban overview screen
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function banOverview()
|
||||
{
|
||||
/* INI */
|
||||
$ban = array();
|
||||
|
||||
/* Get ban filters */
|
||||
$this->DB->build( array( 'select' => '*', 'from' => 'banfilters', 'order' => 'ban_date desc' ) );
|
||||
$this->DB->execute();
|
||||
|
||||
while ( $r = $this->DB->fetch() )
|
||||
{
|
||||
$ban[ $r['ban_type'] ][ $r['ban_id'] ] = $r;
|
||||
}
|
||||
|
||||
/* IPs */
|
||||
$ips = array();
|
||||
|
||||
if( isset( $ban['ip'] ) AND is_array( $ban['ip'] ) AND count( $ban['ip'] ) )
|
||||
{
|
||||
foreach( $ban['ip'] as $entry )
|
||||
{
|
||||
$entry['_checkbox'] = "<input type='checkbox' name='id_{$entry['ban_id']}' value='1' />";
|
||||
$entry['_date'] = $this->registry->class_localization->getDate( $entry['ban_date'], 'SHORT' );
|
||||
$ips[] = $entry;
|
||||
}
|
||||
}
|
||||
|
||||
/* Emails */
|
||||
$emails = array();
|
||||
|
||||
if( isset( $ban['email'] ) AND is_array( $ban['email'] ) AND count( $ban['email'] ) )
|
||||
{
|
||||
foreach( $ban['email'] as $entry )
|
||||
{
|
||||
$entry['_checkbox'] = "<input type='checkbox' name='id_{$entry['ban_id']}' value='1' />";
|
||||
$entry['_date'] = $this->registry->class_localization->getDate( $entry['ban_date'], 'SHORT' );
|
||||
$emails[] = $entry;
|
||||
}
|
||||
}
|
||||
|
||||
/* Banned Names */
|
||||
$names = array();
|
||||
|
||||
if( isset( $ban['name'] ) AND is_array( $ban['name'] ) AND count( $ban['name'] ) )
|
||||
{
|
||||
foreach( $ban['name'] as $entry )
|
||||
{
|
||||
$entry['_checkbox'] = "<input type='checkbox' name='id_{$entry['ban_id']}' value='1' />";
|
||||
$entry['_date'] = $this->registry->class_localization->getDate( $entry['ban_date'], 'SHORT' );
|
||||
$names[] = $entry;
|
||||
}
|
||||
}
|
||||
|
||||
/* Output */
|
||||
$this->registry->output->html .= $this->html->banOverview( $ips, $emails, $names );
|
||||
}
|
||||
$this->registry->output->silentRedirectWithMessage( $this->settings['base_url'].$this->form_code.'do=ban' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Rebuilds the ban cache
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function rebuildBanCache()
|
||||
{
|
||||
@@ -266,7 +237,7 @@ class admin_members_members_banfilters extends ipsCommand
|
||||
$cache = array();
|
||||
|
||||
/* Get the ban filters */
|
||||
$this->DB->build( array( 'select' => 'ban_content', 'from' => 'banfilters', 'where' => "ban_type='ip' AND ban_nocache=0" ) );
|
||||
$this->DB->build( array( 'select' => 'ban_content', 'from' => 'banfilters', 'where' => "ban_type='ip'" ) );
|
||||
$this->DB->execute();
|
||||
|
||||
while ( $r = $this->DB->fetch() )
|
||||
|
||||
@@ -1,32 +1,14 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Define the default members section
|
||||
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://www.invisionpower.com
|
||||
* @file defaultSection.php Define the default section for the 'members' module
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $Author: ips_terabyte $
|
||||
* @since 20th February 2002
|
||||
* @version $Rev: 5713 $
|
||||
*
|
||||
* $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 8655 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
* Very simply returns the default section if one is not
|
||||
* passed in the URL
|
||||
*/
|
||||
|
||||
$DEFAULT_SECTION = 'members';
|
||||
$DEFAULT_SECTION = 'members';
|
||||
@@ -0,0 +1,377 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Member property updater (AJAX)
|
||||
* Last Updated: $Date: 2011-06-06 18:06:01 -0400 (Mon, 06 Jun 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://hatynka.in
|
||||
* @version $Revision: 8982 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class admin_members_members_editform extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'admin_member' ), 'members' );
|
||||
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'save_display_name':
|
||||
$this->save_member_name( 'members_display_name' );
|
||||
break;
|
||||
case 'save_name':
|
||||
$this->save_member_name( 'name' );
|
||||
break;
|
||||
case 'save_password':
|
||||
$this->save_password();
|
||||
break;
|
||||
case 'save_email':
|
||||
$this->save_email();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Change a member's email address
|
||||
*
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
protected function save_email()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$member_id = intval( $this->request['member_id'] );
|
||||
$email = trim( $this->request['email'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Get member
|
||||
//-----------------------------------------
|
||||
|
||||
$member = IPSMember::load( $member_id );
|
||||
|
||||
if ( ! $member['member_id'] )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['m_noid'] );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Allowed to edit administrators?
|
||||
//-----------------------------------------
|
||||
|
||||
if( $member['g_access_cp'] AND !$this->registry->getClass('class_permissions')->checkPermission( 'member_edit_admin', 'members', 'members' ) )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['m_editadmin'] );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Is this email addy taken? CONVERGE THIS??
|
||||
//-----------------------------------------
|
||||
|
||||
$email_check = IPSMember::load( strtolower($email) );
|
||||
|
||||
if ( $email_check['member_id'] AND $email_check['member_id'] != $member_id )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['m_emailalready'] );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Load handler...
|
||||
//-----------------------------------------
|
||||
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/handlers/han_login.php', 'han_login' );
|
||||
$han_login = new $classToLoad( $this->registry );
|
||||
$han_login->init();
|
||||
$han_login->changeEmail( trim( strtolower( $member['email'] ) ), trim( strtolower( $email ) ), $member );
|
||||
|
||||
//-----------------------------------------
|
||||
// We don't want to die just from a Converge error
|
||||
//-----------------------------------------
|
||||
|
||||
/*if ( $han_login->return_code AND ( $han_login->return_code != 'METHOD_NOT_DEFINED' AND $han_login->return_code != 'SUCCESS' ) )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['m_emailalready'] );
|
||||
exit();
|
||||
}*/
|
||||
|
||||
//-----------------------------------------
|
||||
// Update member
|
||||
//-----------------------------------------
|
||||
|
||||
IPSLib::runMemberSync( 'onEmailChange', $member_id, strtolower( $email ), $member['email'] );
|
||||
|
||||
IPSMember::save( $member_id, array( 'core' => array( 'email' => strtolower( $email ) ) ) );
|
||||
|
||||
ipsRegistry::getClass('adminFunctions')->saveAdminLog( sprintf( $this->lang->words['m_emailchangelog'], $member['email'], $email, $member_id ) );
|
||||
|
||||
$this->registry->output->global_message = $this->lang->words['email_updated_success'];
|
||||
$this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . 'module=members&do=viewmember&member_id=' . $member_id );
|
||||
}
|
||||
|
||||
/**
|
||||
* Change a member's password
|
||||
*
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
protected function save_password()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$member_id = intval( $this->request['member_id'] );
|
||||
$password = IPSText::parseCleanValue( $_POST['password'] );
|
||||
$password2 = IPSText::parseCleanValue( $_POST['password2'] );
|
||||
$new_key = intval( $this->request['new_key'] );
|
||||
$new_salt = intval( $this->request['new_salt'] );
|
||||
$salt = str_replace( '\\', "\\\\", IPSMember::generatePasswordSalt(5) );
|
||||
$key = IPSMember::generateAutoLoginKey();
|
||||
$md5_once = md5( trim($password) );
|
||||
|
||||
//-----------------------------------------
|
||||
// AJAX debug
|
||||
//-----------------------------------------
|
||||
|
||||
IPSDebug::fireBug( 'info', array( 'Password: ' . $password ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// Check
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $password OR ! $password2 )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['password_nogood'] );
|
||||
}
|
||||
|
||||
if ( $password != $password2 )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['m_passmatch'] );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Get member
|
||||
//-----------------------------------------
|
||||
|
||||
$member = IPSMember::load( $member_id );
|
||||
|
||||
//-----------------------------------------
|
||||
// Allowed to edit administrators?
|
||||
//-----------------------------------------
|
||||
|
||||
if( $member['g_access_cp'] AND !$this->registry->getClass('class_permissions')->checkPermission( 'member_edit_admin', 'members', 'members' ) )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['m_editadmin'] );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Check Converge: Password
|
||||
//-----------------------------------------
|
||||
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/handlers/han_login.php', 'han_login' );
|
||||
$han_login = new $classToLoad( $this->registry );
|
||||
$han_login->init();
|
||||
$han_login->changePass( $member['email'], $md5_once, $password, $member );
|
||||
|
||||
/*if ( $han_login->return_code != 'METHOD_NOT_DEFINED' AND $han_login->return_code != 'SUCCESS' )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['m_passchange']);
|
||||
exit();
|
||||
}*/
|
||||
|
||||
//-----------------------------------------
|
||||
// Local DB
|
||||
//-----------------------------------------
|
||||
|
||||
$update = array();
|
||||
|
||||
if( $new_salt )
|
||||
{
|
||||
$update['members_pass_salt'] = $salt;
|
||||
}
|
||||
|
||||
if( $new_key )
|
||||
{
|
||||
$update['member_login_key'] = $key;
|
||||
}
|
||||
|
||||
if( count($update) )
|
||||
{
|
||||
IPSMember::save( $member_id, array( 'core' => $update ) );
|
||||
}
|
||||
|
||||
IPSMember::updatePassword( $member_id, $md5_once );
|
||||
IPSLib::runMemberSync( 'onPassChange', $member_id, $password );
|
||||
|
||||
ipsRegistry::getClass('adminFunctions')->saveAdminLog( sprintf( $this->lang->words['m_passlog'], $member_id ) );
|
||||
|
||||
$this->registry->output->global_message = $this->lang->words['pw_updated_success'];
|
||||
$this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . 'module=members&do=viewmember&member_id=' . $member_id );
|
||||
}
|
||||
|
||||
/**
|
||||
* Update a user's login or display name
|
||||
*
|
||||
* @param string Field to update
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
protected function save_member_name( $field='members_display_name' )
|
||||
{
|
||||
$member_id = intval( $this->request['member_id'] );
|
||||
|
||||
$member = IPSMember::load( $member_id );
|
||||
|
||||
//-----------------------------------------
|
||||
// Allowed to edit administrators?
|
||||
//-----------------------------------------
|
||||
|
||||
if( $member['g_access_cp'] AND !$this->registry->getClass('class_permissions')->checkPermission( 'member_edit_admin', 'members', 'members' ) )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['m_editadmin'] );
|
||||
}
|
||||
|
||||
if ( $field == 'members_display_name' )
|
||||
{
|
||||
$display_name = $this->request['display_name'];
|
||||
$display_name = str_replace("+", "+", $display_name );
|
||||
}
|
||||
else
|
||||
{
|
||||
$display_name = $this->request['name'];
|
||||
$display_name = str_replace("+", "+", $display_name );
|
||||
|
||||
$display_name = str_replace( '|', '|' , $display_name );
|
||||
$display_name = trim( preg_replace( "/\s{2,}/", " ", $display_name ) );
|
||||
}
|
||||
|
||||
if ( $this->settings['strip_space_chr'] )
|
||||
{
|
||||
// use hexdec to convert between '0xAD' and chr
|
||||
$display_name = IPSText::removeControlCharacters( $display_name );
|
||||
}
|
||||
|
||||
if ( $field == 'members_display_name' AND preg_match( "#[\[\];,\|]#", str_replace( ''', "'", str_replace( '&', '&', str_replace( '"', '"', str_replace( '!', '!', $display_name ) ) ) ) ) )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['m_displaynames'] );
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
if ( IPSMember::getFunction()->updateName( $member_id, $display_name, $field ) === TRUE )
|
||||
{
|
||||
if ( $field == 'members_display_name' )
|
||||
{
|
||||
ipsRegistry::getClass('adminFunctions')->saveAdminLog(sprintf( $this->lang->words['m_dnamelog'], $member['members_display_name'], $display_name ));
|
||||
}
|
||||
else
|
||||
{
|
||||
ipsRegistry::getClass('adminFunctions')->saveAdminLog(sprintf( $this->lang->words['m_namelog'], $member['name'], $display_name ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// If updating a name, and display names
|
||||
// disabled, update display name too
|
||||
//-----------------------------------------
|
||||
|
||||
if( !ipsRegistry::$settings['auth_allow_dnames'] )
|
||||
{
|
||||
IPSMember::getFunction()->updateName( $member_id, $display_name, 'members_display_name' );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// I say, did we choose to email 'dis member?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $this->request['send_email'] == 1 )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// By golly, we did!
|
||||
//-----------------------------------------
|
||||
|
||||
$msg = trim( IPSText::stripslashes( nl2br( $_POST['email_contents'] ) ) );
|
||||
|
||||
$msg = str_replace( "{old_name}", $member['name'], $msg );
|
||||
$msg = str_replace( "{new_name}", $display_name , $msg );
|
||||
$msg = str_replace( "<#BOARD_NAME#>", $this->settings['board_name'], $msg );
|
||||
$msg = str_replace( "<#BOARD_ADDRESS#>", $this->settings['board_url'] . '/index.' . $this->settings['php_ext'], $msg );
|
||||
|
||||
IPSText::getTextClass('email')->message = stripslashes( IPSText::getTextClass('email')->cleanMessage($msg) );
|
||||
IPSText::getTextClass('email')->subject = $this->lang->words['m_changesubj'];
|
||||
IPSText::getTextClass('email')->to = $member['email'];
|
||||
IPSText::getTextClass('email')->sendMail();
|
||||
}
|
||||
}
|
||||
|
||||
$this->cache->rebuildCache( 'stats', 'global' );
|
||||
}
|
||||
else
|
||||
{
|
||||
# We should absolutely never get here. So this is a fail-safe, really to
|
||||
# prevent a "false" positive outcome for the end-user
|
||||
$this->registry->output->showError( $this->lang->words['m_namealready'] );
|
||||
}
|
||||
}
|
||||
catch( Exception $error )
|
||||
{
|
||||
// $this->returnJsonError( $error->getMessage() );
|
||||
|
||||
switch( $error->getMessage() )
|
||||
{
|
||||
case 'NO_USER':
|
||||
$this->registry->output->showError( $this->lang->words['m_noid'] );
|
||||
break;
|
||||
case 'NO_PERMISSION':
|
||||
case 'NO_NAME':
|
||||
$this->registry->output->showError( sprintf($this->lang->words['m_morethan3'], $this->settings['max_user_name_length'] ) );
|
||||
break;
|
||||
case 'ILLEGAL_CHARS':
|
||||
$this->registry->output->showError( $this->lang->words['m_illegal'] );
|
||||
break;
|
||||
case 'USER_NAME_EXISTS':
|
||||
$this->registry->output->showError( $this->lang->words['m_namealready'] );
|
||||
break;
|
||||
default:
|
||||
$this->registry->output->showError( $error->getMessage() );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Load handler...
|
||||
//-----------------------------------------
|
||||
|
||||
if( $field == 'name' )
|
||||
{
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/handlers/han_login.php', 'han_login' );
|
||||
$han_login = new $classToLoad( $this->registry );
|
||||
$han_login->init();
|
||||
$han_login->changeName( $member['name'], $display_name, $member['email'], $member );
|
||||
}
|
||||
else
|
||||
{
|
||||
IPSLib::runMemberSync( 'onNameChange', $member_id, $display_name );
|
||||
}
|
||||
|
||||
$this->registry->output->global_message = $this->lang->words[ $field . '_updated_success'];
|
||||
$this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . 'module=members&do=viewmember&member_id=' . $member_id );
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,6 @@
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
File diff suppressed because it is too large.
Load diff
@@ -3,18 +3,18 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Configure default notification options
|
||||
* Last Updated: $Date: 2010-06-17 21:29:47 -0400 (Thu, 17 Jun 2010) $
|
||||
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 6553 $
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 8644 $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -29,31 +29,27 @@ class admin_members_members_notifications extends ipsCommand
|
||||
/**
|
||||
* Skin object
|
||||
*
|
||||
* @access private
|
||||
* @var object Skin templates
|
||||
*/
|
||||
private $html;
|
||||
protected $html;
|
||||
|
||||
/**
|
||||
* Shortcut for url
|
||||
*
|
||||
* @access private
|
||||
* @var string URL shortcut
|
||||
*/
|
||||
private $form_code;
|
||||
protected $form_code;
|
||||
|
||||
/**
|
||||
* Shortcut for url (javascript)
|
||||
*
|
||||
* @access private
|
||||
* @var string JS URL shortcut
|
||||
*/
|
||||
private $form_code_js;
|
||||
protected $form_code_js;
|
||||
|
||||
/**
|
||||
* Notifications library
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
*/
|
||||
protected $notifyLibrary;
|
||||
@@ -61,9 +57,8 @@ class admin_members_members_notifications extends ipsCommand
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @access public
|
||||
* @param object ipsRegistry reference
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
@@ -126,8 +121,7 @@ class admin_members_members_notifications extends ipsCommand
|
||||
/**
|
||||
* Show form to configure notification default options
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function showDefaults()
|
||||
{
|
||||
@@ -140,14 +134,12 @@ class admin_members_members_notifications extends ipsCommand
|
||||
/**
|
||||
* Save default notification configuration
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function saveDefaults()
|
||||
{
|
||||
$_configOptions = $this->notifyLibrary->getNotificationData();
|
||||
$_notifyConfig = $this->notifyLibrary->getDefaultNotificationConfig();
|
||||
$_noPrivateMessage = array( 'new_private_message', 'reply_private_message' );
|
||||
|
||||
foreach( $_configOptions as $option )
|
||||
{
|
||||
@@ -155,24 +147,6 @@ class admin_members_members_notifications extends ipsCommand
|
||||
$_notifyConfig[ $option['key'] ]['selected'] = ( is_array($this->request['default_' . $option['key'] ]) AND count($this->request['default_' . $option['key'] ]) ) ? $this->request['default_' . $option['key'] ] : array();
|
||||
$_notifyConfig[ $option['key'] ]['disabled'] = ( is_array($this->request['disabled_' . $option['key'] ]) AND count($this->request['disabled_' . $option['key'] ]) ) ? $this->request['disabled_' . $option['key'] ] : array();
|
||||
$_notifyConfig[ $option['key'] ]['disable_override'] = intval($this->request['disable_override_' . $option['key'] ]);
|
||||
|
||||
/**
|
||||
* @link http://community.invisionpower.com/tracker/issue-23453-notification-defaults/
|
||||
*/
|
||||
if( in_array( $option['key'], $_noPrivateMessage ) AND in_array( 'pm', $_notifyConfig[ $option['key'] ]['selected'] ) )
|
||||
{
|
||||
$_newSelected = array();
|
||||
|
||||
foreach( $_notifyConfig[ $option['key'] ]['selected'] as $_v )
|
||||
{
|
||||
if( $_v != 'pm' )
|
||||
{
|
||||
$_newSelected[] = $_v;
|
||||
}
|
||||
}
|
||||
|
||||
$_notifyConfig[ $option['key'] ]['selected'] = $_newSelected;
|
||||
}
|
||||
}
|
||||
|
||||
$this->notifyLibrary->saveNotificationConfig( $_notifyConfig );
|
||||
|
||||
@@ -3,18 +3,18 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Member management
|
||||
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Revision: 5713 $
|
||||
* @link http://hatynka.in
|
||||
* @version $Revision: 8644 $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -30,49 +30,29 @@ class admin_members_members_ranks extends ipsCommand
|
||||
/**
|
||||
* Skin object
|
||||
*
|
||||
* @access private
|
||||
* @var object Skin templates
|
||||
*/
|
||||
private $html;
|
||||
protected $html;
|
||||
|
||||
/**
|
||||
* Shortcut for url
|
||||
*
|
||||
* @access private
|
||||
* @var string URL shortcut
|
||||
*/
|
||||
private $form_code;
|
||||
protected $form_code;
|
||||
|
||||
/**
|
||||
* Shortcut for url (javascript)
|
||||
*
|
||||
* @access private
|
||||
* @var string JS URL shortcut
|
||||
*/
|
||||
private $form_code_js;
|
||||
|
||||
/**
|
||||
* Editor object
|
||||
*
|
||||
* @access private
|
||||
* @var object Editor library
|
||||
*/
|
||||
private $han_editor;
|
||||
|
||||
/**
|
||||
* Trash can forum id
|
||||
*
|
||||
* @access private
|
||||
* @var integer Trash can forum
|
||||
*/
|
||||
private $trash_forum = 0;
|
||||
protected $form_code_js;
|
||||
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @access public
|
||||
* @param object ipsRegistry reference
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
@@ -144,8 +124,7 @@ class admin_members_members_ranks extends ipsCommand
|
||||
/**
|
||||
* Recache ranks
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function titlesRecache()
|
||||
{
|
||||
@@ -173,8 +152,7 @@ class admin_members_members_ranks extends ipsCommand
|
||||
/**
|
||||
* Overview page
|
||||
*
|
||||
* @access protected
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
protected function _titlesStart()
|
||||
{
|
||||
@@ -209,9 +187,8 @@ class admin_members_members_ranks extends ipsCommand
|
||||
/**
|
||||
* Save rank [add/edit]
|
||||
*
|
||||
* @access protected
|
||||
* @param string 'add' or 'edit'
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
protected function _titlesSave( $type = 'add' )
|
||||
{
|
||||
@@ -261,19 +238,20 @@ class admin_members_members_ranks extends ipsCommand
|
||||
|
||||
if( $type == 'add' )
|
||||
{
|
||||
$this->registry->output->doneScreen($this->lang->words['rnk_added2'], $this->lang->words['rnk_rankcontrol'], "{$this->form_code}&do=title", 'redirect' );
|
||||
$this->registry->output->global_message = $this->lang->words['rnk_added2'];
|
||||
$this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code . '&do=title' );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->registry->output->doneScreen($this->lang->words['rnk_edited'], $this->lang->words['rnk_rankcontrol'], "{$this->form_code}&do=title", 'redirect' );
|
||||
$this->registry->output->global_message = $this->lang->words['rnk_edited'];
|
||||
$this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code . '&do=title' );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a rank
|
||||
*
|
||||
* @access protected
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
protected function _titlesDelete()
|
||||
{
|
||||
@@ -291,17 +269,17 @@ class admin_members_members_ranks extends ipsCommand
|
||||
$this->titlesRecache();
|
||||
|
||||
ipsRegistry::getClass('adminFunctions')->saveAdminLog( $this->lang->words['rnk_removed'] );
|
||||
|
||||
$this->registry->output->doneScreen($this->lang->words['rnk_removed2'], $this->lang->words['rnk_rankcontrol'], "{$this->form_code}&do=title", 'redirect' );
|
||||
|
||||
$this->registry->output->global_message = $this->lang->words['rnk_removed2'];
|
||||
$this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code . '&do=title' );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Show the form to add/edit a rank
|
||||
*
|
||||
* @access protected
|
||||
* @param string Type of form (add|edit)
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
protected function _titlesForm( $mode='edit' )
|
||||
{
|
||||
|
||||
@@ -3,18 +3,18 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Reputation System
|
||||
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 5713 $
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 8644 $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -30,33 +30,29 @@ class admin_members_members_reputation extends ipsCommand
|
||||
/**
|
||||
* Skin object
|
||||
*
|
||||
* @access private
|
||||
* @var object Skin templates
|
||||
*/
|
||||
private $html;
|
||||
protected $html;
|
||||
|
||||
/**
|
||||
* Shortcut for url
|
||||
*
|
||||
* @access private
|
||||
* @var string URL shortcut
|
||||
*/
|
||||
private $form_code;
|
||||
protected $form_code;
|
||||
|
||||
/**
|
||||
* Shortcut for url (javascript)
|
||||
*
|
||||
* @access private
|
||||
* @var string JS URL shortcut
|
||||
*/
|
||||
private $form_code_js;
|
||||
protected $form_code_js;
|
||||
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @access public
|
||||
* @param object ipsRegistry reference
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
@@ -111,8 +107,7 @@ class admin_members_members_reputation extends ipsCommand
|
||||
/**
|
||||
* Rebuilds the reputation level cache
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function rebuildReputationLevelCache()
|
||||
{
|
||||
@@ -135,8 +130,7 @@ class admin_members_members_reputation extends ipsCommand
|
||||
/**
|
||||
* Removes the selected reputation level
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function deleteLevel()
|
||||
{
|
||||
@@ -153,15 +147,15 @@ class admin_members_members_reputation extends ipsCommand
|
||||
$this->rebuildReputationLevelCache();
|
||||
|
||||
/* Redirect */
|
||||
$this->registry->output->doneScreen( $this->lang->words['rep_level_removed'], $this->lang->words['rep_management'], $this->form_code, 'redirect' );
|
||||
$this->registry->output->global_message = $this->lang->words['rep_level_removed'];
|
||||
$this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code );
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles the add/edit reputation level form
|
||||
*
|
||||
* @access public
|
||||
* @param string $mode Either add or edit
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function doLevelForm( $mode='add' )
|
||||
{
|
||||
@@ -194,7 +188,8 @@ class admin_members_members_reputation extends ipsCommand
|
||||
$this->rebuildReputationLevelCache();
|
||||
|
||||
/* Redirect */
|
||||
$this->registry->output->doneScreen( $this->lang->words['rep_level_added'], $this->lang->words['rep_management'], $this->form_code, 'redirect' );
|
||||
$this->registry->output->global_message = $this->lang->words['rep_level_added'];
|
||||
$this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -211,17 +206,17 @@ class admin_members_members_reputation extends ipsCommand
|
||||
$this->rebuildReputationLevelCache();
|
||||
|
||||
/* Redirect */
|
||||
$this->registry->output->doneScreen( $this->lang->words['rep_level_edited'], $this->lang->words['rep_management'], $this->form_code, 'redirect' );
|
||||
$this->registry->output->global_message = $this->lang->words['rep_level_edited'];
|
||||
$this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Form for adding/exiting reputation levels
|
||||
*
|
||||
* @access public
|
||||
* @param string $mode Either add or edit
|
||||
* @param array $errors Array of error messages to display
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function levelForm( $mode='add', $errors=array() )
|
||||
{
|
||||
@@ -276,8 +271,7 @@ class admin_members_members_reputation extends ipsCommand
|
||||
/**
|
||||
* Reputation overview
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function reputationOverview()
|
||||
{
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -5,6 +5,6 @@
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -6,46 +6,12 @@
|
||||
<subitems>
|
||||
<subitem>
|
||||
<subitemtitle>Управление пользователями</subitemtitle>
|
||||
<subitemlang>manage_members</subitemlang>
|
||||
<subsection>members</subsection>
|
||||
<subitemurl>do=members_overview</subitemurl>
|
||||
<subitemrolekey></subitemrolekey>
|
||||
<subisredirect>0</subisredirect>
|
||||
</subitem>
|
||||
<subitem>
|
||||
<subitemtitle>Список неактивированных</subitemtitle>
|
||||
<subsection>tools</subsection>
|
||||
<subitemurl>section=tools&do=validating</subitemurl>
|
||||
<subitemrolekey></subitemrolekey>
|
||||
<subisredirect>0</subisredirect>
|
||||
</subitem>
|
||||
<subitem>
|
||||
<subitemtitle>Список заблокированных</subitemtitle>
|
||||
<subsection>tools</subsection>
|
||||
<subitemurl>section=tools&do=locked</subitemurl>
|
||||
<subitemrolekey></subitemrolekey>
|
||||
<subisredirect>0</subisredirect>
|
||||
</subitem>
|
||||
<subitem>
|
||||
<subitemtitle>Список забаненных</subitemtitle>
|
||||
<subsection>tools</subsection>
|
||||
<subitemurl>section=tools&do=banned</subitemurl>
|
||||
<subitemrolekey></subitemrolekey>
|
||||
<subisredirect>0</subisredirect>
|
||||
</subitem>
|
||||
<subitem>
|
||||
<subitemtitle>Список спамеров</subitemtitle>
|
||||
<subsection>tools</subsection>
|
||||
<subitemurl>section=tools&do=spam</subitemurl>
|
||||
<subitemrolekey></subitemrolekey>
|
||||
<subisredirect>0</subisredirect>
|
||||
</subitem>
|
||||
<subitem>
|
||||
<subitemtitle>Список не завершивших регистрацию</subitemtitle>
|
||||
<subsection>members</subsection>
|
||||
<subitemurl>section=tools&do=incomplete</subitemurl>
|
||||
<subitemrolekey></subitemrolekey>
|
||||
<subisredirect>0</subisredirect>
|
||||
</subitem>
|
||||
</subitems>
|
||||
</item>
|
||||
|
||||
@@ -54,9 +20,10 @@
|
||||
<subitems>
|
||||
<subitem>
|
||||
<subitemtitle>Управление званиями пользователей</subitemtitle>
|
||||
<subitemlang>mem_ranks</subitemlang>
|
||||
<subsection>ranks</subsection>
|
||||
<subitemurl>do=ranks_overview</subitemurl>
|
||||
<subitemrolekey></subitemrolekey>
|
||||
<subitemrolekey>ranks_add</subitemrolekey>
|
||||
<subisredirect>0</subisredirect>
|
||||
</subitem>
|
||||
</subitems>
|
||||
@@ -67,9 +34,10 @@
|
||||
<subitems>
|
||||
<subitem>
|
||||
<subitemtitle>Управление репутацией пользователей</subitemtitle>
|
||||
<subitemlang>mem_rep</subitemlang>
|
||||
<subsection>reputation</subsection>
|
||||
<subitemurl>do=overview</subitemurl>
|
||||
<subitemrolekey></subitemrolekey>
|
||||
<subitemrolekey>reps_manage</subitemrolekey>
|
||||
<subisredirect>0</subisredirect>
|
||||
</subitem>
|
||||
</subitems>
|
||||
@@ -80,35 +48,10 @@
|
||||
<subitems>
|
||||
<subitem>
|
||||
<subitemtitle>Управление дополнительными полями профиля</subitemtitle>
|
||||
<subsection>customfields</subsection>
|
||||
<subitemurl></subitemurl>
|
||||
<subitemrolekey></subitemrolekey>
|
||||
<subisredirect>0</subisredirect>
|
||||
</subitem>
|
||||
</subitems>
|
||||
</item>
|
||||
|
||||
<item>
|
||||
<title>Группы дополнительных полей</title>
|
||||
<subitems>
|
||||
<subitem>
|
||||
<subitemtitle>Управление группами дополнительных полей профиля</subitemtitle>
|
||||
<subsection>customfields</subsection>
|
||||
<subitemurl>do=group_overview</subitemurl>
|
||||
<subitemrolekey></subitemrolekey>
|
||||
<subisredirect>0</subisredirect>
|
||||
</subitem>
|
||||
</subitems>
|
||||
</item>
|
||||
|
||||
<item>
|
||||
<title>Определение IP</title>
|
||||
<subitems>
|
||||
<subitem>
|
||||
<subitemtitle>Инструменты</subitemtitle>
|
||||
<subitemlang>mem_tools</subitemlang>
|
||||
<subsection>tools</subsection>
|
||||
<subitemurl></subitemurl>
|
||||
<subitemrolekey></subitemrolekey>
|
||||
<subitemrolekey>membertools_ip</subitemrolekey>
|
||||
<subisredirect>0</subisredirect>
|
||||
</subitem>
|
||||
</subitems>
|
||||
@@ -119,9 +62,10 @@
|
||||
<subitems>
|
||||
<subitem>
|
||||
<subitemtitle>Добавление пользователя</subitemtitle>
|
||||
<subitemlang>mem_add</subitemlang>
|
||||
<subsection>members</subsection>
|
||||
<subitemurl>do=add</subitemurl>
|
||||
<subitemrolekey></subitemrolekey>
|
||||
<subitemrolekey>member_add</subitemrolekey>
|
||||
<subisredirect>0</subisredirect>
|
||||
</subitem>
|
||||
</subitems>
|
||||
@@ -132,9 +76,10 @@
|
||||
<subitems>
|
||||
<subitem>
|
||||
<subitemtitle>Управление бан фильтрами</subitemtitle>
|
||||
<subitemlang>banfilters</subitemlang>
|
||||
<subsection>banfilters</subsection>
|
||||
<subitemurl>do=add</subitemurl>
|
||||
<subitemrolekey></subitemrolekey>
|
||||
<subitemurl></subitemurl>
|
||||
<subitemrolekey>ban_manage</subitemrolekey>
|
||||
<subisredirect>0</subisredirect>
|
||||
</subitem>
|
||||
</subitems>
|
||||
@@ -145,9 +90,10 @@
|
||||
<subitems>
|
||||
<subitem>
|
||||
<subitemtitle>Настройки уведомлений</subitemtitle>
|
||||
<subitemlang>notifications</subitemlang>
|
||||
<subsection>notifications</subsection>
|
||||
<subitemurl></subitemurl>
|
||||
<subitemrolekey></subitemrolekey>
|
||||
<subitemrolekey>configure_notifications</subitemrolekey>
|
||||
<subisredirect>0</subisredirect>
|
||||
</subitem>
|
||||
</subitems>
|
||||
|
||||
@@ -2,112 +2,127 @@
|
||||
<permissions>
|
||||
<group>
|
||||
<grouptitle>Управление пользователями</grouptitle>
|
||||
<grouplang>members_members</grouplang>
|
||||
<items>
|
||||
<item>
|
||||
<key>member_add</key>
|
||||
<string>Может добавлять пользователей?</string>
|
||||
<string>Может добавлять?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>member_add_admin</key>
|
||||
<string>Может добавлять АДМИНОВ?</string>
|
||||
<string>Может добавлять администраторов?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>member_edit</key>
|
||||
<string>Может редактировать пользователей?</string>
|
||||
<string>Может изменять?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>member_edit_admin</key>
|
||||
<string>Может редактировать АДМИНОВ?</string>
|
||||
<string>Может изменять администраторов?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>member_delete</key>
|
||||
<string>Может удалять пользователей?</string>
|
||||
<string>Может удалять?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>member_delete_admin</key>
|
||||
<string>Может удалять АДМИНОВ?</string>
|
||||
<string>Может удалять администраторов?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>members_merge</key>
|
||||
<string>Может соединять пользовательские учетки?</string>
|
||||
<string>Может объединять?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>member_suspend</key>
|
||||
<string>Может блокировать и разблокировать пользователей?</string>
|
||||
<string>Может блокировать?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>member_suspend_admin</key>
|
||||
<string>Может блокировать и разблокировать АДМИНОВ?</string>
|
||||
<string>Может блокировать администраторов?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>member_prune</key>
|
||||
<string>Может массово удалять пользователей?</string>
|
||||
<string>Может удалять?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>member_prune_admin</key>
|
||||
<string>Может массово удалять АДМИНОВ?</string>
|
||||
<string>Может удалять администраторов?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>member_move</key>
|
||||
<string>Может перемещать пользователей в другие группы?</string>
|
||||
<string>Может переносить из группы в группу?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>member_move_admin1</key>
|
||||
<string>Может перемещать АДМИНОВ в другие группы?</string>
|
||||
<string>Может переносить администраторов в другие группы?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>member_move_admin2</key>
|
||||
<string>Может настроить продвижение группы в АДМИНА?</string>
|
||||
<string>Может переносить в группу администраторов?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>member_ban</key>
|
||||
<string>Может банить пользователей?</string>
|
||||
<string>Может банить?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>member_ban_admin</key>
|
||||
<string>Может банить АДМИНОВ?</string>
|
||||
<string>Может банить администраторов?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>member_photo</key>
|
||||
<string>Может изменять пользователские фотографии и аватары?</string>
|
||||
<string>Может изменять фотографии пользователям?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>member_photo_admin</key>
|
||||
<string>Может изменять фотографии и аватары у АДМИНОВ?</string>
|
||||
<string>Может изменять фотографии администраторам?</string>
|
||||
</item>
|
||||
</items>
|
||||
</group>
|
||||
<group>
|
||||
<grouptitle>Инструменты по работе с пользователями</grouptitle>
|
||||
<items>
|
||||
<item>
|
||||
<key>membertools_validating</key>
|
||||
<string>Может управлять неактивированными пользователями?</string>
|
||||
<string>Может управлять ожидающими активации?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>membertools_locked</key>
|
||||
<string>Может управлять заблокированными пользователями?</string>
|
||||
<string>Может управлять заблокированными?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>membertools_banned</key>
|
||||
<string>Может управлять забаненными пользователями?</string>
|
||||
<string>Может управлять забаненными?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>membertools_ip</key>
|
||||
<string>Может использовать инструмент для работы с IP адресами?</string>
|
||||
<key>membertools_spam</key>
|
||||
<string>Может управлять спам-пользователями?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>membertools_incomplete</key>
|
||||
<string>Может управлять не завершившими регистрацию?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>membertools_delete_pms</key>
|
||||
<string>Может удалять личные сообщения?</string>
|
||||
</item>
|
||||
</items>
|
||||
</group>
|
||||
<group>
|
||||
<grouptitle>Звания пользователей</grouptitle>
|
||||
<grouptitle>Инструменты</grouptitle>
|
||||
<grouplang>members_tools</grouplang>
|
||||
<items>
|
||||
<item>
|
||||
<key>membertools_ip</key>
|
||||
<string>Может использовать инструменты работы с IP-адресами?</string>
|
||||
</item>
|
||||
</items>
|
||||
</group>
|
||||
<group>
|
||||
<grouptitle>Звания</grouptitle>
|
||||
<grouplang>members_ranks</grouplang>
|
||||
<items>
|
||||
<item>
|
||||
<key>ranks_add</key>
|
||||
<string>Может добавлять новые?</string>
|
||||
<string>Может просматривать и добавлять?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>ranks_edit</key>
|
||||
<string>Может изменять существующие?</string>
|
||||
<string>Может изменять?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>ranks_delete</key>
|
||||
@@ -116,58 +131,40 @@
|
||||
</items>
|
||||
</group>
|
||||
<group>
|
||||
<grouptitle>Дополнительные поля</grouptitle>
|
||||
<items>
|
||||
<item>
|
||||
<key>profilefields_global</key>
|
||||
<string>Can access custom profile fields management?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>profilefields_add</key>
|
||||
<string>Может добавлять новые?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>profilefields_edit</key>
|
||||
<string>Может изменять существующие?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>profilefields_delete</key>
|
||||
<string>Может удалять?</string>
|
||||
</item>
|
||||
</items>
|
||||
</group>
|
||||
<group>
|
||||
<grouptitle>Бан фильтры</grouptitle>
|
||||
<grouptitle>Бан-фильтр</grouptitle>
|
||||
<grouplang>members_banfilters</grouplang>
|
||||
<items>
|
||||
<item>
|
||||
<key>ban_manage</key>
|
||||
<string>Может добавлять/изменять?</string>
|
||||
<string>Может управлять фильтром?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>ban_remove</key>
|
||||
<string>Может удалять?</string>
|
||||
<string>Может удалять правила?</string>
|
||||
</item>
|
||||
</items>
|
||||
</group>
|
||||
<group>
|
||||
<grouptitle>Репутация пользователей</grouptitle>
|
||||
<grouptitle>Репутация</grouptitle>
|
||||
<grouplang>members_reputation</grouplang>
|
||||
<items>
|
||||
<item>
|
||||
<key>reps_manage</key>
|
||||
<string>Может добавлять/изменять уровни репутации?</string>
|
||||
<string>Может управлять?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>reps_delete</key>
|
||||
<string>Может удалять уровни?</string>
|
||||
<string>Может удалять уровни репутации?</string>
|
||||
</item>
|
||||
</items>
|
||||
</group>
|
||||
<group>
|
||||
<grouptitle>Уведомления</grouptitle>
|
||||
<grouplang>members_notifications</grouplang>
|
||||
<items>
|
||||
<item>
|
||||
<key>configure_notifications</key>
|
||||
<string>Может настраивать уведомления?</string>
|
||||
<string>Может настраивать значения по-умолчанию для уведомлений?</string>
|
||||
</item>
|
||||
</items>
|
||||
</group>
|
||||
|
||||
@@ -1,32 +1,14 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Define the default restrictions section
|
||||
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://www.invisionpower.com
|
||||
* @file defaultSection.php Define the default section for the 'restrictions' module
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $Author: ips_terabyte $
|
||||
* @since 20th February 2002
|
||||
* @version $Rev: 5713 $
|
||||
*
|
||||
* $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 8655 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
* Very simply returns the default section if one is not
|
||||
* passed in the URL
|
||||
*/
|
||||
|
||||
$DEFAULT_SECTION = 'restrictions';
|
||||
$DEFAULT_SECTION = 'restrictions';
|
||||
@@ -5,6 +5,6 @@
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -3,19 +3,20 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* ACP Restrictions
|
||||
* Last Updated: $Date: 2010-06-02 18:28:28 -0400 (Wed, 02 Jun 2010) $
|
||||
* Last Updated: $Date: 2011-06-14 12:04:59 -0400 (Tue, 14 Jun 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since 1st march 2002
|
||||
* @version $Revision: 6445 $
|
||||
* @version $Revision: 9039 $
|
||||
* @todo Update class_xml references to classXml
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -30,41 +31,36 @@ class admin_members_restrictions_restrictions extends ipsCommand
|
||||
/**
|
||||
* Skin object
|
||||
*
|
||||
* @access private
|
||||
* @var object Skin templates
|
||||
*/
|
||||
private $html;
|
||||
protected $html;
|
||||
|
||||
/**
|
||||
* Shortcut for url
|
||||
*
|
||||
* @access private
|
||||
* @var string URL shortcut
|
||||
*/
|
||||
private $form_code;
|
||||
protected $form_code;
|
||||
|
||||
/**
|
||||
* Shortcut for url (javascript)
|
||||
*
|
||||
* @access private
|
||||
* @var string JS URL shortcut
|
||||
*/
|
||||
private $form_code_js;
|
||||
protected $form_code_js;
|
||||
|
||||
/**
|
||||
* Member information
|
||||
*
|
||||
* @access private
|
||||
* @var array Member information
|
||||
*/
|
||||
private $member_info = array();
|
||||
protected $member_info = array();
|
||||
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @access public
|
||||
* @param object ipsRegistry reference
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
@@ -165,11 +161,10 @@ class admin_members_restrictions_restrictions extends ipsCommand
|
||||
/**
|
||||
* Saving the ACP restrictions - here's where it gets really dirty
|
||||
*
|
||||
* @access private
|
||||
* @return void
|
||||
* @return @e void
|
||||
* @since 2.1.0.2005-7-11
|
||||
*/
|
||||
private function _restrictionsSave()
|
||||
protected function _restrictionsSave()
|
||||
{
|
||||
$role_id = intval($this->request['id']);
|
||||
$role_type = $this->request['type'];
|
||||
@@ -206,6 +201,99 @@ class admin_members_restrictions_restrictions extends ipsCommand
|
||||
return;
|
||||
}
|
||||
|
||||
//-------------------------------
|
||||
// Grab XML library
|
||||
//-------------------------------
|
||||
|
||||
require_once( IPS_KERNEL_PATH . 'class_xml.php' );/*noLibHook*/
|
||||
|
||||
$xml = new class_xml();
|
||||
$xml->doc_type = IPS_DOC_CHAR_SET;
|
||||
|
||||
//-------------------------------
|
||||
// Start the madness...err parsing
|
||||
//-------------------------------
|
||||
|
||||
foreach( ipsRegistry::$applications as $app_dir => $app_data )
|
||||
{
|
||||
if( !is_array(ipsRegistry::$modules[ $app_dir ]) OR !count(ipsRegistry::$modules[ $app_dir ]) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$this->lang->loadLanguageFile( array( 'admin_menulang' ), $app_dir );
|
||||
|
||||
foreach( ipsRegistry::$modules[ $app_dir ] as $module )
|
||||
{
|
||||
$_file = IPSLib::getAppDir( $app_dir ) . '/modules_admin/' . $module['sys_module_key'] . '/xml/permissions.xml';
|
||||
|
||||
if( ! $module['sys_module_admin'] )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if( ! is_file( $_file ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$content = file_get_contents( $_file );
|
||||
|
||||
$xml->xml_parse_document( $content );
|
||||
|
||||
if ( ! is_array( $xml->xml_array['permissions']['group'][0] ) )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Ensure [0] is populated
|
||||
//-----------------------------------------
|
||||
|
||||
$xml->xml_array['permissions']['group'] = array( 0 => $xml->xml_array['permissions']['group'] );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Loop through and sort out permissions and groups...
|
||||
//-----------------------------------------
|
||||
|
||||
$group = 0;
|
||||
|
||||
foreach( $xml->xml_array['permissions']['group'] as $entry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Do we have a row matching this already?
|
||||
//-----------------------------------------
|
||||
|
||||
$_title = ( $entry['grouplang']['VALUE'] AND $this->lang->words[ 'r__' . $entry['grouplang']['VALUE'] ] ) ? $this->lang->words[ 'r__' . $entry['grouplang']['VALUE'] ] : $entry['grouptitle']['VALUE'];
|
||||
$items = array();
|
||||
$group++;
|
||||
|
||||
if( is_array($entry['items']) AND count($entry['items']) )
|
||||
{
|
||||
foreach( $entry['items'] as $item )
|
||||
{
|
||||
if( is_array($item) AND count($item) )
|
||||
{
|
||||
if( isset($item['key']) )
|
||||
{
|
||||
$items[ $item['key']['VALUE'] ] = ( $item['key']['VALUE'] AND $this->lang->words[ 'r__' . $item['key']['VALUE'] ] ) ? $this->lang->words[ 'r__' . $item['key']['VALUE'] ] : $item['string']['VALUE'];
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach( $item as $sub_item )
|
||||
{
|
||||
$items[ $sub_item['key']['VALUE'] ] = ( $sub_item['key']['VALUE'] AND $this->lang->words[ 'r__' . $sub_item['key']['VALUE'] ] ) ? $this->lang->words[ 'r__' . $sub_item['key']['VALUE'] ] : $sub_item['string']['VALUE'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$perms[ $app_data['app_id'] ][ $module['sys_module_id'] ][ $group ]['title'] = $_title;
|
||||
$perms[ $app_data['app_id'] ][ $module['sys_module_id'] ][ $group ]['items'] = $items;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//echo '<PRE>';print_r( $perms );exit();
|
||||
|
||||
$updated_permissions = array(
|
||||
'applications' => array(),
|
||||
'modules' => array(),
|
||||
@@ -214,6 +302,9 @@ class admin_members_restrictions_restrictions extends ipsCommand
|
||||
|
||||
foreach( $_POST as $key => $value )
|
||||
{
|
||||
|
||||
|
||||
|
||||
if( preg_match( "/^app_(\d+)$/", $key, $matches ) )
|
||||
{
|
||||
if( $value )
|
||||
@@ -246,13 +337,11 @@ class admin_members_restrictions_restrictions extends ipsCommand
|
||||
/**
|
||||
* Manage ACP restrictions - The meat and potatoes, so to speak
|
||||
*
|
||||
* @access private
|
||||
* @param string [member|group]
|
||||
* @return void
|
||||
* @return @e void
|
||||
* @since 2.1.0.2005-7-11
|
||||
* @todo One of the only areas that still uses the old XML parser
|
||||
*/
|
||||
private function _restrictionsForm( $type='member' )
|
||||
protected function _restrictionsForm( $type='member' )
|
||||
{
|
||||
//-------------------------------
|
||||
// INIT
|
||||
@@ -293,7 +382,7 @@ class admin_members_restrictions_restrictions extends ipsCommand
|
||||
// Grab XML library
|
||||
//-------------------------------
|
||||
|
||||
require_once( IPS_KERNEL_PATH . 'class_xml.php' );
|
||||
require_once( IPS_KERNEL_PATH . 'class_xml.php' );/*noLibHook*/
|
||||
|
||||
$xml = new class_xml();
|
||||
$xml->doc_type = IPS_DOC_CHAR_SET;
|
||||
@@ -308,6 +397,8 @@ class admin_members_restrictions_restrictions extends ipsCommand
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$this->lang->loadLanguageFile( array( 'admin_menulang' ), $app_dir );
|
||||
|
||||
foreach( ipsRegistry::$modules[ $app_dir ] as $module )
|
||||
{
|
||||
@@ -318,7 +409,7 @@ class admin_members_restrictions_restrictions extends ipsCommand
|
||||
continue;
|
||||
}
|
||||
|
||||
if( ! file_exists( $_file ) )
|
||||
if( ! is_file( $_file ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -348,7 +439,7 @@ class admin_members_restrictions_restrictions extends ipsCommand
|
||||
// Do we have a row matching this already?
|
||||
//-----------------------------------------
|
||||
|
||||
$_title = $entry['grouptitle']['VALUE'];
|
||||
$_title = ( $entry['grouplang']['VALUE'] AND $this->lang->words[ 'r__' . $entry['grouplang']['VALUE'] ] ) ? $this->lang->words[ 'r__' . $entry['grouplang']['VALUE'] ] : $entry['grouptitle']['VALUE'];
|
||||
$items = array();
|
||||
$group++;
|
||||
|
||||
@@ -360,13 +451,13 @@ class admin_members_restrictions_restrictions extends ipsCommand
|
||||
{
|
||||
if( isset($item['key']) )
|
||||
{
|
||||
$items[ $item['key']['VALUE'] ] = $item['string']['VALUE'];
|
||||
$items[ $item['key']['VALUE'] ] = ( $item['key']['VALUE'] AND $this->lang->words[ 'r__' . $item['key']['VALUE'] ] ) ? $this->lang->words[ 'r__' . $item['key']['VALUE'] ] : $item['string']['VALUE'];
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach( $item as $sub_item )
|
||||
{
|
||||
$items[ $sub_item['key']['VALUE'] ] = $sub_item['string']['VALUE'];
|
||||
$items[ $sub_item['key']['VALUE'] ] = ( $sub_item['key']['VALUE'] AND $this->lang->words[ 'r__' . $sub_item['key']['VALUE'] ] ) ? $this->lang->words[ 'r__' . $sub_item['key']['VALUE'] ] : $sub_item['string']['VALUE'];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -389,11 +480,10 @@ class admin_members_restrictions_restrictions extends ipsCommand
|
||||
/**
|
||||
* List members and groups with restrictions
|
||||
*
|
||||
* @access private
|
||||
* @return void Outputs to screen
|
||||
* @return @e void Outputs to screen
|
||||
* @since 2.1.0.2005-7-7
|
||||
*/
|
||||
private function _acppermsList()
|
||||
protected function _acppermsList()
|
||||
{
|
||||
//-------------------------------
|
||||
// INIT
|
||||
@@ -475,12 +565,11 @@ class admin_members_restrictions_restrictions extends ipsCommand
|
||||
/**
|
||||
* Remove ACP restrictions - this will make a restricted member or group have full permissions
|
||||
*
|
||||
* @access private
|
||||
* @param string [member|group]
|
||||
* @return void
|
||||
* @return @e void
|
||||
* @since 2.1.0.2005-7-11
|
||||
*/
|
||||
private function _removePermissions( $type='member' )
|
||||
protected function _removePermissions( $type='member' )
|
||||
{
|
||||
//-------------------------------
|
||||
// INIT
|
||||
@@ -516,12 +605,11 @@ class admin_members_restrictions_restrictions extends ipsCommand
|
||||
/**
|
||||
* ACP Perms: Add member form
|
||||
*
|
||||
* @access private
|
||||
* @param string [member|group]
|
||||
* @return void
|
||||
* @return @e void
|
||||
* @since 2.1.0.2005-7-7
|
||||
*/
|
||||
private function _addRole( $type='member' )
|
||||
protected function _addRole( $type='member' )
|
||||
{
|
||||
$this->registry->output->extra_nav[] = array( '', $this->lang->words['r_nav'] );
|
||||
|
||||
@@ -540,11 +628,10 @@ class admin_members_restrictions_restrictions extends ipsCommand
|
||||
* Checks input, adds row to DB if OK
|
||||
* This bud's for you
|
||||
*
|
||||
* @access private
|
||||
* @return void
|
||||
* @return @e void
|
||||
* @since 2.1.0.2005-7-8
|
||||
*/
|
||||
private function _addMemberDo()
|
||||
protected function _addMemberDo()
|
||||
{
|
||||
//-------------------------------
|
||||
// INIT
|
||||
@@ -672,7 +759,7 @@ class admin_members_restrictions_restrictions extends ipsCommand
|
||||
|
||||
$message = count($restrict) ? $this->lang->words['r_restrictbase'] : $this->lang->words['r_noacpaccessuntil'];
|
||||
|
||||
$this->registry->output->global_message = sprintf( $this->lang->words['r_addedmember'], $member['members_display_name'], $message );
|
||||
$this->registry->output->setMessage( sprintf( $this->lang->words['r_addedmember'], $member['members_display_name'], $message ), 1 );
|
||||
|
||||
$this->request[ 'mid'] = $member['member_id'] ;
|
||||
$this->_restrictionsForm( 'member' );
|
||||
@@ -681,11 +768,10 @@ class admin_members_restrictions_restrictions extends ipsCommand
|
||||
/**
|
||||
* ACP Perms: Finish adding the group
|
||||
*
|
||||
* @access private
|
||||
* @return void
|
||||
* @return @e void
|
||||
* @since 2.1.0.2005-7-8
|
||||
*/
|
||||
private function _addGroupDo()
|
||||
protected function _addGroupDo()
|
||||
{
|
||||
//-------------------------------
|
||||
// INIT
|
||||
@@ -772,7 +858,7 @@ class admin_members_restrictions_restrictions extends ipsCommand
|
||||
'row_perm_cache' => serialize( array() ),
|
||||
'row_updated' => time() ) );
|
||||
|
||||
$this->registry->output->global_message = sprintf( $this->lang->words['r_addedgroup'], $group['g_title'] );
|
||||
$this->registry->output->setMessage( sprintf( $this->lang->words['r_addedgroup'], $group['g_title'] ), 1 );
|
||||
$this->_acppermsList();
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,6 @@
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -6,6 +6,7 @@
|
||||
<subitems>
|
||||
<subitem>
|
||||
<subitemtitle>Администраторские ограничения</subitemtitle>
|
||||
<subitemlang>restrictions</subitemlang>
|
||||
<subsection>restrictions</subsection>
|
||||
<subitemurl>do=overview</subitemurl>
|
||||
<subitemrolekey></subitemrolekey>
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
<permissions>
|
||||
<group>
|
||||
<grouptitle>Управление ограничениями доступа</grouptitle>
|
||||
<grouplang>members_restrictions</grouplang>
|
||||
<items>
|
||||
<item>
|
||||
<key>restrictions_add_member</key>
|
||||
|
||||
@@ -3,19 +3,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Profile AJAX hCard
|
||||
* Last Updated: $Date: 2010-09-08 12:09:02 -0400 (Wed, 08 Sep 2010) $
|
||||
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: matt $
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since Tuesday 1st March 2005 (11:52)
|
||||
* @version $Revision: 6840 $
|
||||
* @version $Revision: 8644 $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -30,9 +30,8 @@ class public_members_ajax_card extends ipsAjaxCommand
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry reference
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
@@ -98,7 +97,7 @@ class public_members_ajax_card extends ipsAjaxCommand
|
||||
/* Reputation */
|
||||
if ( $this->settings['reputation_protected_groups'] )
|
||||
{
|
||||
if ( in_array( $this->memberData['member_group_id'], explode( ",", $this->settings['reputation_protected_groups'] ) ) )
|
||||
if ( in_array( $member['member_group_id'], explode( ",", $this->settings['reputation_protected_groups'] ) ) )
|
||||
{
|
||||
$this->settings['reputation_show_profile'] = false;
|
||||
}
|
||||
|
||||
@@ -1,234 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Profile AJAX Comment Handler
|
||||
* Last Updated: $Date: 2010-09-07 14:10:16 -0400 (Tue, 07 Sep 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: matt $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://www.invisionpower.com
|
||||
* @since Tuesday 1st March 2005 (11:52)
|
||||
* @version $Revision: 6834 $
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class public_members_ajax_comments extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Comments library
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
*/
|
||||
protected $comments;
|
||||
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry reference
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'members' ) . '/sources/comments.php', 'profileCommentsLib', 'members' );
|
||||
$this->comments = new $classToLoad( $this->registry );
|
||||
|
||||
switch( $this->request[ 'do' ] )
|
||||
{
|
||||
case 'view':
|
||||
default:
|
||||
$this->returnHtml( $this->comments->buildComments( IPSMember::load( intval( $this->request['member_id'] ) ) ) );
|
||||
break;
|
||||
|
||||
case 'add':
|
||||
$this->_addComment();
|
||||
break;
|
||||
|
||||
case 'delete':
|
||||
$this->_deleteComment();
|
||||
break;
|
||||
|
||||
case 'approve':
|
||||
$this->_approveComment();
|
||||
break;
|
||||
|
||||
case 'reload':
|
||||
$this->_reloadComment();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Approve a comment on member's profile
|
||||
*
|
||||
* @access protected
|
||||
* @return void [Prints to screen]
|
||||
* @since IPB 2.2.0.2006-08-02
|
||||
*/
|
||||
protected function _approveComment()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$member_id = intval( $this->request['member_id'] );
|
||||
$md5check = IPSText::md5Clean( $this->request['md5check'] );
|
||||
$comment_id = intval( $this->request['comment_id'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// MD5 check
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $md5check != $this->member->form_hash )
|
||||
{
|
||||
$this->returnString( 'error' );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Delete
|
||||
//-----------------------------------------
|
||||
|
||||
$result = $this->comments->approveComment( $member_id, $comment_id );
|
||||
|
||||
/* Check for error */
|
||||
if( $result )
|
||||
{
|
||||
$this->returnString( $result );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->returnHtml( $this->comments->buildComments( IPSMember::load( $member_id ) ) );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reload comments
|
||||
*
|
||||
* @access protected
|
||||
* @return void [Prints to screen]
|
||||
* @since IPB 2.2.0.2006-08-15
|
||||
*/
|
||||
protected function _reloadComment()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$member_id = intval( $this->request['member_id'] );
|
||||
$md5check = IPSText::md5Clean( $this->request['md5check'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// MD5 check
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $md5check != $this->member->form_hash )
|
||||
{
|
||||
$this->returnString( 'error' );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Load member
|
||||
//-----------------------------------------
|
||||
|
||||
$member = IPSMember::load( $member_id );
|
||||
|
||||
//-----------------------------------------
|
||||
// Check
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $member['member_id'] )
|
||||
{
|
||||
$this->returnString( 'error' );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Regenerate comments...
|
||||
//-----------------------------------------
|
||||
|
||||
$this->returnHtml( $this->comments->buildComments( $member ) );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Deletes a comment on member's profile
|
||||
*
|
||||
* @access protected
|
||||
* @return void [Prints to screen]
|
||||
* @since IPB 2.2.0.2006-08-02
|
||||
*/
|
||||
protected function _deleteComment()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$member_id = intval( $this->request['member_id'] );
|
||||
$md5check = IPSText::md5Clean( $this->request['md5check'] );
|
||||
$comment_id = intval( $this->request['comment_id'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// MD5 check
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $md5check != $this->member->form_hash )
|
||||
{
|
||||
$this->returnString( 'error' );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Delete
|
||||
//-----------------------------------------
|
||||
|
||||
$result = $this->comments->deleteComment( $member_id, $comment_id );
|
||||
|
||||
/* Check for error */
|
||||
if( $result )
|
||||
{
|
||||
$this->returnString( $result );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->returnHtml( $this->comments->buildComments( IPSMember::load( $member_id ) ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Saves a comment on member's profile
|
||||
*
|
||||
* @access protected
|
||||
* @return void [Prints to screen]
|
||||
* @since IPB 2.2.0.2006-08-02
|
||||
*/
|
||||
protected function _addComment()
|
||||
{
|
||||
/* INIT */
|
||||
$member_id = intval( $this->request['member_id'] );
|
||||
|
||||
$result = $this->comments->addCommentToDB( $member_id, IPSText::parseCleanValue( $_POST['comment'] ) );
|
||||
|
||||
/* Check for error */
|
||||
if( $result AND $result != 'pp_comment_added_mod' )
|
||||
{
|
||||
$this->returnString( $result );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->returnHtml( $this->comments->buildComments( IPSMember::load( $member_id ), 0, '' ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,19 +3,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Profile display name history
|
||||
* Last Updated: $Date: 2010-04-15 15:46:26 -0400 (Thu, 15 Apr 2010) $
|
||||
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since Tuesday 1st March 2005 (11:52)
|
||||
* @version $Revision: 6133 $
|
||||
* @version $Revision: 8644 $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -30,9 +30,8 @@ class public_members_ajax_dname extends ipsAjaxCommand
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry reference
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
|
||||
@@ -3,19 +3,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Member AJAX DST switcher
|
||||
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since Tuesday 1st March 2005 (11:52)
|
||||
* @version $Revision: 5713 $
|
||||
* @version $Revision: 8644 $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -30,9 +30,8 @@ class public_members_ajax_dst extends ipsAjaxCommand
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry reference
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
|
||||
@@ -3,19 +3,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Profile AJAX Comment Handler
|
||||
* Last Updated: $Date: 2010-07-14 17:57:17 -0400 (Wed, 14 Jul 2010) $
|
||||
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since Tuesday 1st March 2005 (11:52)
|
||||
* @version $Revision: 6651 $
|
||||
* @version $Revision: 8644 $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -30,17 +30,15 @@ class public_members_ajax_friends extends ipsAjaxCommand
|
||||
/**
|
||||
* Friends library
|
||||
*
|
||||
* @access private
|
||||
* @var object
|
||||
*/
|
||||
private $friends;
|
||||
protected $friends;
|
||||
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry reference
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
@@ -62,94 +60,16 @@ class public_members_ajax_friends extends ipsAjaxCommand
|
||||
|
||||
case 'remove':
|
||||
$this->_removeFriend();
|
||||
break;
|
||||
|
||||
case 'view':
|
||||
$this->_iframeList();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads the content for the friends tab
|
||||
*
|
||||
* @access private
|
||||
* @return void [Prints to screen]
|
||||
* @since IPB 2.2.0.2006-08-15
|
||||
*/
|
||||
private function _iframeList()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$member_id = intval( $this->request['member_id'] );
|
||||
$content = '';
|
||||
$friends = array();
|
||||
|
||||
//-----------------------------------------
|
||||
// Load member
|
||||
//-----------------------------------------
|
||||
|
||||
$member = IPSMember::load( $member_id );
|
||||
|
||||
//-----------------------------------------
|
||||
// Check
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $member['member_id'] )
|
||||
{
|
||||
$this->returnString( $this->lang->words['nofriendid'] );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Grab the friends
|
||||
//-----------------------------------------
|
||||
|
||||
$this->DB->build( array( 'select' => 'f.*',
|
||||
'from' => array( 'profile_friends' => 'f' ),
|
||||
'where' => 'f.friends_member_id=' . $member_id . ' AND f.friends_approved=1',
|
||||
'order' => 'm.members_display_name ASC',
|
||||
'add_join' => array(
|
||||
1 => array( 'select' => 'pp.*',
|
||||
'from' => array( 'profile_portal' => 'pp' ),
|
||||
'where' => 'pp.pp_member_id=f.friends_friend_id',
|
||||
'type' => 'left' ),
|
||||
2 => array( 'select' => 'm.*',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => 'm.member_id=f.friends_friend_id',
|
||||
'type' => 'left' )
|
||||
)
|
||||
) );
|
||||
$outer = $this->DB->execute();
|
||||
|
||||
//-----------------------------------------
|
||||
// Get and store...
|
||||
//-----------------------------------------
|
||||
|
||||
while( $row = $this->DB->fetch($outer) )
|
||||
{
|
||||
$row['members_display_name_short'] = IPSText::truncate( $row['members_display_name'], 13 );
|
||||
|
||||
$friends[] = IPSMember::buildDisplayData( $row, 0 );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Ok.. show the friends
|
||||
//-----------------------------------------
|
||||
|
||||
$content = $this->registry->getClass('output')->getTemplate('profile')->friendsIframe( $member, $friends );
|
||||
|
||||
$this->returnHtml( $content );
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a friend
|
||||
*
|
||||
* @access private
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
private function _addFriend()
|
||||
protected function _addFriend()
|
||||
{
|
||||
/* INIT */
|
||||
$member_id = intval( $this->request['member_id'] );
|
||||
@@ -177,10 +97,9 @@ class public_members_ajax_friends extends ipsAjaxCommand
|
||||
/**
|
||||
* Removes a friend
|
||||
*
|
||||
* @access private
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
private function _removeFriend()
|
||||
protected function _removeFriend()
|
||||
{
|
||||
/* INIT */
|
||||
$member_id = intval( $this->request['member_id'] );
|
||||
|
||||
@@ -2,19 +2,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Profile AJAX Ignore User
|
||||
* Last Updated: $Date: 2010-10-21 07:08:38 -0400 (Thu, 21 Oct 2010) $
|
||||
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since Tuesday 1st March 2005 (11:52)
|
||||
* @version $Revision: 7007 $
|
||||
* @version $Revision: 8644 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
@@ -29,7 +29,7 @@ class public_members_ajax_ignore extends ipsAjaxCommand
|
||||
* Class entry point
|
||||
*
|
||||
* @param object Registry reference
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
|
||||
@@ -5,6 +5,6 @@
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -2,19 +2,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Profile AJAX Tab Loader
|
||||
* Last Updated: $Date: 2010-10-21 07:08:38 -0400 (Thu, 21 Oct 2010) $
|
||||
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since Tuesday 1st March 2005 (11:52)
|
||||
* @version $Revision: 7007 $
|
||||
* @version $Revision: 8644 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
@@ -29,7 +29,7 @@ class public_members_ajax_load extends ipsAjaxCommand
|
||||
* Class entry point
|
||||
*
|
||||
* @param object Registry reference
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
@@ -75,12 +75,12 @@ class public_members_ajax_load extends ipsAjaxCommand
|
||||
// Load config
|
||||
//-----------------------------------------
|
||||
|
||||
if( !file_exists( IPSLib::getAppDir( $app ) . '/extensions/profileTabs/' . $tab . '.conf.php' ) )
|
||||
if( !is_file( IPSLib::getAppDir( $app ) . '/extensions/profileTabs/' . $tab . '.conf.php' ) )
|
||||
{
|
||||
$this->returnString( 'error' );
|
||||
}
|
||||
|
||||
require( IPSLib::getAppDir( $app ) . '/extensions/profileTabs/' . $tab . '.conf.php' );
|
||||
require( IPSLib::getAppDir( $app ) . '/extensions/profileTabs/' . $tab . '.conf.php' );/*noLibHook*/
|
||||
|
||||
//-----------------------------------------
|
||||
// Active?
|
||||
@@ -95,12 +95,12 @@ class public_members_ajax_load extends ipsAjaxCommand
|
||||
// Load main class...
|
||||
//-----------------------------------------
|
||||
|
||||
if( !file_exists( IPSLib::getAppDir( $app ) . '/extensions/profileTabs/' . $tab . '.php' ) )
|
||||
if( !is_file( IPSLib::getAppDir( $app ) . '/extensions/profileTabs/' . $tab . '.php' ) )
|
||||
{
|
||||
$this->returnString( 'error' );
|
||||
}
|
||||
|
||||
require( IPSLib::getAppDir( 'members' ) . '/sources/tabs/pluginParentClass.php' );
|
||||
require( IPSLib::getAppDir( 'members' ) . '/sources/tabs/pluginParentClass.php' );/*noLibHook*/
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( $app ) . '/extensions/profileTabs/' . $tab . '.php', 'profile_' . $tab, $app );
|
||||
$plugin = new $classToLoad( $this->registry );
|
||||
|
||||
|
||||
@@ -3,19 +3,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Profile AJAX Ignored User methods
|
||||
* Last Updated: $Date: 2010-10-05 21:26:08 -0400 (Tue, 05 Oct 2010) $
|
||||
* Last Updated: $Date: 2011-09-13 21:55:41 -0400 (Tue, 13 Sep 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since Thursday 26th June 2008
|
||||
* @version $Revision: 6945 $
|
||||
* @version $Revision: 9487 $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -30,7 +30,6 @@ class public_members_ajax_messenger extends ipsAjaxCommand
|
||||
/**
|
||||
* Messenger library
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
*/
|
||||
protected $messengerFunctions;
|
||||
@@ -38,9 +37,8 @@ class public_members_ajax_messenger extends ipsAjaxCommand
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry reference
|
||||
* @return void [Outputs to screen]
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
@@ -76,15 +74,68 @@ class public_members_ajax_messenger extends ipsAjaxCommand
|
||||
break;
|
||||
case 'archiveConversation':
|
||||
$this->_archiveConversation();
|
||||
break;
|
||||
case 'getInboxDropDown':
|
||||
$this->_getInboxDropDown();
|
||||
break;
|
||||
case 'sigCloseMenu':
|
||||
$this->_sigCloseMenu();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected function _sigCloseMenu()
|
||||
{
|
||||
$this->lang->loadLanguageFile( array( 'public_topic', 'public_mod' ), 'forums' );
|
||||
|
||||
$msgid = intval( $this->request['msgid'] );
|
||||
|
||||
/* Fetch post */
|
||||
$msg = $this->messengerFunctions->fetchMessageDataById( $msgid, true );
|
||||
|
||||
if ( $this->messengerFunctions->canAccessTopic( $this->memberData['member_id'], $msg['msg_topic_id'] ) )
|
||||
{
|
||||
return $this->returnHtml( $this->registry->output->getTemplate('topic')->ajaxSigCloseMenu( $msg ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->returnJsonError( 'nopermission' );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Shows the last 10 Pms or whatever.
|
||||
*
|
||||
* @return string HTML to be returned via ajax
|
||||
* @since IPB 3.1.0.2011-03-24
|
||||
*/
|
||||
protected function _getInboxDropDown()
|
||||
{
|
||||
if ( ! $this->messengerFunctions->canUsePMSystem( $this->memberData ) )
|
||||
{
|
||||
$this->returnJsonError( 'cannotUsePMSystem' );
|
||||
}
|
||||
|
||||
$this->lang->loadLanguageFile( array( 'public_messaging' ), 'members' );
|
||||
|
||||
/* Alright. Fetch the last 10 */
|
||||
//$this->messengerFunctions->addFolderFilter('myconvo');
|
||||
|
||||
$topics = $this->messengerFunctions->getPersonalTopicsList( $this->memberData['member_id'], 'myconvo', array( 'sort' => 'date', 'offsetStart' => 0, 'offsetEnd' => 10 ) );
|
||||
$topics = ( ! is_array( $topics ) ) ? array() : $topics;
|
||||
|
||||
/* reset */
|
||||
$this->messengerFunctions->resetMembersAlertCounts( $this->memberData );
|
||||
|
||||
$this->returnJsonArray( array( 'html' => $this->cleanOutput( $this->registry->output->getTemplate('global_other')->inboxList( $topics ) ) ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Archives the conversation
|
||||
*
|
||||
* @access protected
|
||||
* @return string HTML to be returned via ajax
|
||||
* @since IPB 3.1.2.2010-07-07
|
||||
*/
|
||||
@@ -157,7 +208,6 @@ class public_members_ajax_messenger extends ipsAjaxCommand
|
||||
/**
|
||||
* Sends the PM
|
||||
*
|
||||
* @access protected
|
||||
* @return string HTML to be returned via ajax
|
||||
* @since IPB 3.0.0.2008-06-25
|
||||
*/
|
||||
@@ -176,8 +226,6 @@ class public_members_ajax_messenger extends ipsAjaxCommand
|
||||
$msgContent = $this->convertHtmlEntities( $this->convertUnicode( $_POST['Post'] ) );
|
||||
$msgTitle = IPSText::parseCleanValue( $this->convertHtmlEntities( $this->convertUnicode( $_POST['subject'] ) ) );
|
||||
$this->request['Post'] = IPSText::parseCleanValue( $_POST['Post'] );
|
||||
$_trackMsg = intval( $this->request['trackMsg'] );
|
||||
$_addToSent = intval( $this->request['addToSent'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Check viewing permissions, etc
|
||||
@@ -198,12 +246,6 @@ class public_members_ajax_messenger extends ipsAjaxCommand
|
||||
$this->returnJsonError( 'cannotUsePMSystem' );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Reset Classes
|
||||
//-----------------------------------------
|
||||
|
||||
IPSText::resetTextClass('editor');
|
||||
|
||||
//-----------------------------------------
|
||||
// Load lang file
|
||||
//-----------------------------------------
|
||||
@@ -227,12 +269,7 @@ class public_members_ajax_messenger extends ipsAjaxCommand
|
||||
|
||||
try
|
||||
{
|
||||
$this->messengerFunctions->sendNewPersonalTopic( $toMemberID, $this->memberData['member_id'], array(), $msgTitle, $msgContent, array( 'origMsgID' => 0,
|
||||
'fromMsgID' => 0,
|
||||
'postKey' => md5(microtime()),
|
||||
'trackMsg' => $_trackMsg,
|
||||
'addToSentFolder' => $_addToSent,
|
||||
'hideCCUser' => 0 ) );
|
||||
$this->messengerFunctions->sendNewPersonalTopic( $toMemberID, $this->memberData['member_id'], array(), $msgTitle, $msgContent );
|
||||
|
||||
return $this->returnJsonArray( array( 'status' => 'sent' ) );
|
||||
}
|
||||
@@ -267,7 +304,6 @@ class public_members_ajax_messenger extends ipsAjaxCommand
|
||||
/**
|
||||
* Shows the quick PM form
|
||||
*
|
||||
* @access protected
|
||||
* @return string HTML to be returned via ajax
|
||||
* @since IPB 3.0.0.2008-06-25
|
||||
*/
|
||||
@@ -326,7 +362,6 @@ class public_members_ajax_messenger extends ipsAjaxCommand
|
||||
/**
|
||||
* Returns PM notification
|
||||
*
|
||||
* @access protected
|
||||
* @return string JSON either error or status
|
||||
* @since IPB 3.0.0.2008-06-25
|
||||
*/
|
||||
@@ -397,7 +432,7 @@ class public_members_ajax_messenger extends ipsAjaxCommand
|
||||
IPSText::getTextClass( 'bbcode' )->parsing_mgroup_others = $msg['mgroup_others'];
|
||||
|
||||
$msg['msg_post'] = IPSText::getTextClass('bbcode')->stripAllTags( strip_tags( str_replace( '<br />', "\n", $msg['msg_post'] ) ) );
|
||||
$msg['msg_post'] = IPSText::getTextClass('bbcode')->wordWrap( $msg['msg_post'], 50, "\n" );
|
||||
$msg['msg_post'] = wordwrap( $msg['msg_post'], 50, "\n" );
|
||||
|
||||
if ( IPSText::mbstrlen( $msg['msg_post'] ) > 300 )
|
||||
{
|
||||
@@ -438,7 +473,6 @@ class public_members_ajax_messenger extends ipsAjaxCommand
|
||||
/**
|
||||
* Empties a folder
|
||||
*
|
||||
* @access protected
|
||||
* @return string JSON either error or status
|
||||
* @since IPB 3.0.0.2008-06-25
|
||||
*/
|
||||
@@ -529,7 +563,6 @@ class public_members_ajax_messenger extends ipsAjaxCommand
|
||||
/**
|
||||
* Renames a folder
|
||||
*
|
||||
* @access protected
|
||||
* @return string JSON either error or status
|
||||
* @since IPB 3.0.0.2008-06-25
|
||||
*/
|
||||
@@ -611,7 +644,6 @@ class public_members_ajax_messenger extends ipsAjaxCommand
|
||||
/**
|
||||
* Removes a folder
|
||||
*
|
||||
* @access protected
|
||||
* @return string JSON either error or status
|
||||
* @since IPB 3.0.0.2008-06-25
|
||||
*/
|
||||
@@ -669,11 +701,31 @@ class public_members_ajax_messenger extends ipsAjaxCommand
|
||||
|
||||
//-----------------------------------------
|
||||
// .. and it has no messages
|
||||
// Change May 9 2011 - JS alert already warns that
|
||||
// all messages in folder will be deleted, so just empty and delete
|
||||
// @link http://community.invisionpower.com/tracker/issue-29857-cannot-delete-pm-folder
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $folders[ $folderID ]['count'] > 0 )
|
||||
//if ( $folders[ $folderID ]['count'] > 0 )
|
||||
//{
|
||||
// $this->returnJsonError( 'cannotDeleteHasMessages' );
|
||||
//}
|
||||
|
||||
$messages = $this->messengerFunctions->getPersonalTopicsList( $memberID, $folderID, array( 'offsetStart' => 0, 'offsetEnd' => 100000 ) );
|
||||
|
||||
/* Just grab IDs */
|
||||
$mtids = array_keys( $messages );
|
||||
|
||||
try
|
||||
{
|
||||
$this->returnJsonError( 'cannotDeleteHasMessages' );
|
||||
$this->messengerFunctions->deleteTopics( $memberData['member_id'], $mtids );
|
||||
}
|
||||
catch( Exception $error )
|
||||
{
|
||||
if( $error->getMessage() != 'NO_IDS_TO_DELETE' )
|
||||
{
|
||||
$this->returnJsonError( $error->getMessage() );
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
@@ -704,7 +756,6 @@ class public_members_ajax_messenger extends ipsAjaxCommand
|
||||
/**
|
||||
* Adds a folder
|
||||
*
|
||||
* @access protected
|
||||
* @return string JSON either error or status
|
||||
* @since IPB 3.0.0.2008-06-25
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,194 @@
|
||||
<?php
|
||||
/**
|
||||
* @file photo.php Returns a cropped photo for an ajax request
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $Author: mmecham $
|
||||
* @since 7th Feb 2011
|
||||
* $LastChangedDate: 2011-09-08 11:58:29 -0400 (Thu, 08 Sep 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 9467 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @class public_members_ajax_photo
|
||||
* @brief Returns a cropped photo for an ajax request
|
||||
*
|
||||
*/
|
||||
class public_members_ajax_photo extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Main function executed automatically by the controller
|
||||
*
|
||||
* @param object $registry Registry object
|
||||
* @return @e void
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'public_profile' ), 'members' );
|
||||
|
||||
/* Load library */
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/member/photo.php', 'classes_member_photo' );
|
||||
$this->photo = new $classToLoad( $registry );
|
||||
|
||||
switch( $this->request[ 'do' ] )
|
||||
{
|
||||
case 'cropPhoto':
|
||||
$this->_cropPhoto();
|
||||
break;
|
||||
case 'show':
|
||||
$this->_show();
|
||||
break;
|
||||
case 'remove':
|
||||
$this->_remove();
|
||||
break;
|
||||
case 'save':
|
||||
$this->_save();
|
||||
break;
|
||||
case 'importUrl':
|
||||
$this->_importUrl();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Import a photo or image from URL
|
||||
*
|
||||
*/
|
||||
protected function _importUrl()
|
||||
{
|
||||
$url = trim( $this->request['url'] );
|
||||
|
||||
/* Do it */
|
||||
try
|
||||
{
|
||||
/* Check for valid URL */
|
||||
$photo = $this->photo->save( $this->memberData, 'url', '', $url );
|
||||
|
||||
if ( is_array( $photo ) )
|
||||
{
|
||||
$photo = IPSMember::buildDisplayData( IPSMember::load( $this->memberData['member_id'], 'all' ) );
|
||||
$photo['oldThumb'] = $this->memberData['pp_small_photo'];
|
||||
$photo['status'] = 'ok';
|
||||
$photo['thumb'] = $photo['pp_thumb_photo'];
|
||||
$this->returnJsonArray( $photo );
|
||||
}
|
||||
}
|
||||
catch( Exception $error )
|
||||
{
|
||||
$msg = $error->getMessage();
|
||||
|
||||
switch ( $msg )
|
||||
{
|
||||
default:
|
||||
$this->returnJsonError( $this->lang->words[ $msg ] );
|
||||
break;
|
||||
case 'PROFILE_DISABLED':
|
||||
$this->returnJsonError( 'member_profile_disabled' );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves data
|
||||
*
|
||||
* @return @e void [HTML]
|
||||
*/
|
||||
protected function _save()
|
||||
{
|
||||
$photoType = $this->request['photoType'];
|
||||
$gravatar = $this->request['gravatar'];
|
||||
|
||||
/* Do it */
|
||||
try
|
||||
{
|
||||
$photo = $this->photo->save( $this->memberData, $photoType, $gravatar );
|
||||
|
||||
if ( is_array( $photo ) )
|
||||
{
|
||||
$photo = IPSMember::buildDisplayData( IPSMember::load( $this->memberData['member_id'], 'all' ) );
|
||||
$photo['oldThumb'] = $this->memberData['pp_small_photo'];
|
||||
$photo['status'] = 'ok';
|
||||
$photo['thumb'] = $photo['pp_thumb_photo'];
|
||||
$this->returnJsonArray( $photo );
|
||||
}
|
||||
}
|
||||
catch( Exception $error )
|
||||
{
|
||||
$msg = $error->getMessage();
|
||||
|
||||
switch ( $msg )
|
||||
{
|
||||
default:
|
||||
$this->returnJsonError( $this->lang->words[ 'pp_' . $msg ] );
|
||||
break;
|
||||
case 'PROFILE_DISABLED':
|
||||
$this->returnJsonError( 'member_profile_disabled' );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the photo
|
||||
*
|
||||
* @return @e void [HTML]
|
||||
*/
|
||||
protected function _remove()
|
||||
{
|
||||
$this->photo->remove( $this->memberData['member_id'] );
|
||||
|
||||
$return = IPSMember::buildDisplayData( IPSMember::load( $this->memberData['member_id'], 'all' ) );
|
||||
$return['oldThumb'] = $this->memberData['pp_small_photo'];
|
||||
$return['status'] = 'deleted';
|
||||
$return['thumb'] = $return['pp_thumb_photo'];
|
||||
|
||||
$this->returnJsonArray( $return );
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the photo editor
|
||||
*
|
||||
* @return @e void [HTML]
|
||||
*/
|
||||
protected function _show()
|
||||
{
|
||||
$this->returnHtml( $this->photo->getEditorHtml( $this->memberData ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Crop the chosen photo
|
||||
*
|
||||
* @return @e void [JSON array]
|
||||
*/
|
||||
protected function _cropPhoto()
|
||||
{
|
||||
$x1 = intval( $this->request['x1'] );
|
||||
$x2 = intval( $this->request['x2'] );
|
||||
$y1 = intval( $this->request['y1'] );
|
||||
$y2 = intval( $this->request['y2'] );
|
||||
$dims = array( 'x1' => $x1, 'y1' => $y1, 'x2' => $x2, 'y2' => $y2 );
|
||||
|
||||
/* Crop and fetch return data */
|
||||
$return = $this->photo->cropPhoto( $this->memberData['member_id'], $dims );
|
||||
$member = IPSMember::buildDisplayData( IPSMember::load( $this->memberData['member_id'], 'all' ) );
|
||||
|
||||
if ( $return['status'] == 'ok' )
|
||||
{
|
||||
$this->returnJsonArray( array_merge( $member, $return ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->returnJsonError('fail');
|
||||
}
|
||||
}
|
||||
}
|
||||
Loaded 100 of 2641 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user