Version 3.0.5
This commit is contained in:
1 parent
19b38c7c74
commit
1d4720f3e2
3755 files changed
+508378
-664541
No files matched your search
@@ -0,0 +1,83 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* Profile AJAX hCard
|
||||
* Last Updated: $Date: 2009-09-30 06:58:35 -0400 (Wed, 30 Sep 2009) $
|
||||
*
|
||||
* @author $Author: matt $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @subpackage Members
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @since Tuesday 1st March 2005 (11:52)
|
||||
* @version $Revision: 5180 $
|
||||
*
|
||||
*/
|
||||
|
||||
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_card extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry reference
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'public_profile') );
|
||||
|
||||
/* INIT */
|
||||
$member_id = intval( $this->request['mid'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Can we access?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( !$this->memberData['g_mem_info'] )
|
||||
{
|
||||
$this->returnString( 'error' );
|
||||
}
|
||||
|
||||
if( !$member_id )
|
||||
{
|
||||
$this->returnString( 'error' );
|
||||
}
|
||||
|
||||
$member = IPSMember::load( $member_id, 'profile_portal,pfields_content,sessions,groups,basic', 'id' );
|
||||
|
||||
if( !$member['member_id'] )
|
||||
{
|
||||
$this->returnString( 'error' );
|
||||
}
|
||||
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'public_online' ), 'members' );
|
||||
|
||||
$member = IPSMember::buildDisplayData( $member, array( 'customFields' => 1, 'cfSkinGroup' => 'profile', 'spamStatus' => 1 ) );
|
||||
$member = IPSMember::getLocation( $member );
|
||||
|
||||
$board_posts = $this->caches['stats']['total_topics'] + $this->caches['stats']['total_replies'];
|
||||
|
||||
if( $member['posts'] and $board_posts )
|
||||
{
|
||||
$member['_posts_day'] = round( $member['posts'] / ( ( time() - $member['joined']) / 86400 ), 2 );
|
||||
|
||||
# Fix the issue when there is less than one day
|
||||
$member['_posts_day'] = ( $member['_posts_day'] > $member['posts'] ) ? $member['posts'] : $member['_posts_day'];
|
||||
$member['_total_pct'] = sprintf( '%.2f', ( $member['posts'] / $board_posts * 100 ) );
|
||||
}
|
||||
|
||||
$member['_posts_day'] = floatval( $member['_posts_day'] );
|
||||
|
||||
$this->returnHtml( $this->registry->getClass('output')->getTemplate('profile')->showCard( $member ) );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,232 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* Profile AJAX Comment Handler
|
||||
* Last Updated: $Date: 2009-07-28 20:26:37 -0400 (Tue, 28 Jul 2009) $
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @subpackage Members
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @since Tuesday 1st March 2005 (11:52)
|
||||
* @version $Revision: 4948 $
|
||||
*
|
||||
*/
|
||||
|
||||
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 private
|
||||
* @var object
|
||||
*/
|
||||
private $comments;
|
||||
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry reference
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
require_once( IPSLib::getAppDir( 'members' ) . '/sources/comments.php' );
|
||||
$this->comments = new profileCommentsLib( $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 private
|
||||
* @return void [Prints to screen]
|
||||
* @since IPB 2.2.0.2006-08-02
|
||||
*/
|
||||
private 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 private
|
||||
* @return void [Prints to screen]
|
||||
* @since IPB 2.2.0.2006-08-15
|
||||
*/
|
||||
private 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 private
|
||||
* @return void [Prints to screen]
|
||||
* @since IPB 2.2.0.2006-08-02
|
||||
*/
|
||||
private 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 private
|
||||
* @return void [Prints to screen]
|
||||
* @since IPB 2.2.0.2006-08-02
|
||||
*/
|
||||
private 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 ), $new_id, $return_msg ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* Profile display name history
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @subpackage Members
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @since Tuesday 1st March 2005 (11:52)
|
||||
* @version $Revision: 4948 $
|
||||
*
|
||||
*/
|
||||
|
||||
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_dname extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry reference
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$info = array();
|
||||
$id = intval( $this->request['id'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Get HTML and skin
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'public_profile' ), 'members' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Can we access?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( !$this->memberData['g_mem_info'] )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['dname_profiles_off'] );
|
||||
}
|
||||
|
||||
if ( ! $this->settings['auth_allow_dnames'] )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['dnames_off'] );
|
||||
}
|
||||
|
||||
if( !$id )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['dnames_no_id'] );
|
||||
}
|
||||
|
||||
$member = IPSMember::load( $id );
|
||||
|
||||
//-----------------------------------------
|
||||
// Get Dname history
|
||||
//-----------------------------------------
|
||||
|
||||
$this->DB->build( array( 'select' => 'd.*',
|
||||
'from' => array( 'dnames_change' => 'd' ),
|
||||
'where' => 'dname_member_id='.$id,
|
||||
'add_join' => array( 0 => array( 'select' => 'm.members_display_name',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => 'm.member_id=d.dname_member_id',
|
||||
'type' => 'inner' ) ),
|
||||
'order' => 'dname_date DESC'
|
||||
) );
|
||||
$this->DB->execute();
|
||||
|
||||
while( $row = $this->DB->fetch() )
|
||||
{
|
||||
$records[] = $row;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Print the pop-up window
|
||||
//-----------------------------------------
|
||||
|
||||
$html = $this->registry->getClass('output')->getTemplate('profile')->dnameWrapper( $member['members_display_name'], $records );
|
||||
|
||||
//-----------------------------------------
|
||||
// Push to print handler
|
||||
//-----------------------------------------
|
||||
|
||||
$this->returnHtml( $html );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* Member AJAX DST switcher
|
||||
* Last Updated: $Date: 2009-09-29 17:59:02 -0400 (Tue, 29 Sep 2009) $
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @subpackage Members
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @since Tuesday 1st March 2005 (11:52)
|
||||
* @version $Revision: 5178 $
|
||||
*
|
||||
*/
|
||||
|
||||
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_dst extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry reference
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
if( !$this->memberData['member_id'] )
|
||||
{
|
||||
$this->returnNull();
|
||||
}
|
||||
|
||||
if( $this->memberData['members_auto_dst'] == 1 AND $this->settings['time_dst_auto_correction'] )
|
||||
{
|
||||
$newValue = $this->memberData['dst_in_use'] ? 0 : 1;
|
||||
|
||||
IPSMember::save( $this->memberData['member_id'], array( 'members' => array( 'dst_in_use' => $newValue ) ) );
|
||||
}
|
||||
|
||||
$this->returnNull();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,202 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* Profile AJAX Comment Handler
|
||||
* Last Updated: $Date: 2009-07-28 20:26:37 -0400 (Tue, 28 Jul 2009) $
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @subpackage Members
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @since Tuesday 1st March 2005 (11:52)
|
||||
* @version $Revision: 4948 $
|
||||
*
|
||||
*/
|
||||
|
||||
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_friends extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Friends library
|
||||
*
|
||||
* @access private
|
||||
* @var object
|
||||
*/
|
||||
private $friends;
|
||||
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry reference
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
/* Friends Enabled */
|
||||
if( ! $this->settings['friends_enabled'] )
|
||||
{
|
||||
$this->registry->getClass('output')->showError( 'friends_not_enabled', 10220 );
|
||||
}
|
||||
|
||||
/* Friends Library */
|
||||
require_once( IPSLib::getAppDir( 'members' ) . '/sources/friends.php' );
|
||||
$this->friends = new profileFriendsLib( $registry );
|
||||
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'add':
|
||||
$this->_addFriend();
|
||||
break;
|
||||
|
||||
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
|
||||
*/
|
||||
private function _addFriend()
|
||||
{
|
||||
/* INIT */
|
||||
$member_id = intval( $this->request['member_id'] );
|
||||
|
||||
/* Add friend */
|
||||
$result = $this->friends->addFriend( $member_id );
|
||||
|
||||
/* Add to other user as well, but only if not pending */
|
||||
if( !$this->friends->pendingApproval )
|
||||
{
|
||||
$result2 = $this->friends->addFriend( $this->memberData['member_id'], $member_id, true );
|
||||
}
|
||||
|
||||
/* Check for error */
|
||||
if( $result )
|
||||
{
|
||||
$this->returnString( $result );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->returnString( 'success' );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes a friend
|
||||
*
|
||||
* @access private
|
||||
* @return void
|
||||
*/
|
||||
private function _removeFriend()
|
||||
{
|
||||
/* INIT */
|
||||
$member_id = intval( $this->request['member_id'] );
|
||||
|
||||
/* Remove friend */
|
||||
$result = $this->friends->removeFriend( $member_id );
|
||||
|
||||
/* Remove from other user as well */
|
||||
$result2 = $this->friends->removeFriend( $this->memberData['member_id'], $member_id );
|
||||
|
||||
/* Check for error */
|
||||
if( $result )
|
||||
{
|
||||
$this->returnString( $result );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->returnString( 'success' );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* Profile AJAX Ignore User
|
||||
* Last Updated: $Date: 2009-07-28 20:26:37 -0400 (Tue, 28 Jul 2009) $
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @subpackage Members
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @since Tuesday 1st March 2005 (11:52)
|
||||
* @version $Revision: 4948 $
|
||||
*
|
||||
*/
|
||||
|
||||
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_ignore extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry reference
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
/* Get ignore user quick call file */
|
||||
require_once( IPSLib::getAppDir( 'members' ) . '/modules_public/profile/ignore.php' );
|
||||
$library = new public_members_profile_ignore( $registry );
|
||||
$library->makeRegistryShortcuts( $registry );
|
||||
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
default:
|
||||
case 'add':
|
||||
$result = $library->ignoreMember( $this->request['memberID'], 'topics' );
|
||||
break;
|
||||
|
||||
case 'remove':
|
||||
$result = $library->stopIgnoringMember( $this->request['memberID'], 'topics' );
|
||||
break;
|
||||
|
||||
case 'addPM':
|
||||
$result = $library->ignoreMember( $this->request['memberID'], 'messages' );
|
||||
break;
|
||||
|
||||
case 'removePM':
|
||||
$result = $library->stopIgnoringMember( $this->request['memberID'], 'messages' );
|
||||
break;
|
||||
}
|
||||
|
||||
$this->returnJsonArray( $result );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
<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.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
|
||||
@@ -0,0 +1,113 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* Profile AJAX Tab Loader
|
||||
* Last Updated: $Date: 2009-07-28 20:26:37 -0400 (Tue, 28 Jul 2009) $
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @subpackage Members
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @since Tuesday 1st March 2005 (11:52)
|
||||
* @version $Revision: 4948 $
|
||||
*
|
||||
*/
|
||||
|
||||
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_load extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry reference
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$member_id = intval( ipsRegistry::$request['member_id'] );
|
||||
$tab = substr( IPSText::alphanumericalClean( str_replace( '..', '', trim( ipsRegistry::$request['tab'] ) ) ), 0, 20 );
|
||||
$md5check = IPSText::md5Clean( $this->request['md5check'] );
|
||||
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'public_profile' ), 'members' );
|
||||
|
||||
//-----------------------------------------
|
||||
// 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' );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Load config
|
||||
//-----------------------------------------
|
||||
|
||||
if( !file_exists( IPSLib::getAppDir( 'members' ) . '/sources/tabs/' . $tab . '.conf.php' ) )
|
||||
{
|
||||
$this->returnString( 'error' );
|
||||
}
|
||||
|
||||
require( IPSLib::getAppDir( 'members' ) . '/sources/tabs/' . $tab . '.conf.php' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Active?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $CONFIG['plugin_enabled'] )
|
||||
{
|
||||
$this->returnString( 'error' );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Load main class...
|
||||
//-----------------------------------------
|
||||
|
||||
if( !file_exists( IPSLib::getAppDir( 'members' ) . '/sources/tabs/' . $tab . '.php' ) )
|
||||
{
|
||||
$this->returnString( 'error' );
|
||||
}
|
||||
|
||||
require( IPSLib::getAppDir( 'members' ) . '/sources/tabs/pluginParentClass.php' );
|
||||
require( IPSLib::getAppDir( 'members' ) . '/sources/tabs/' . $tab . '.php' );
|
||||
$_func_name = 'profile_' . $tab;
|
||||
$plugin = new $_func_name( $this->registry );
|
||||
|
||||
$html = $plugin->return_html_block( $member );
|
||||
|
||||
//-----------------------------------------
|
||||
// Return it...
|
||||
//-----------------------------------------
|
||||
|
||||
$this->returnHtml( $html );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,699 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* Profile AJAX Ignored User methods
|
||||
* Last Updated: $Date: 2009-07-28 20:26:37 -0400 (Tue, 28 Jul 2009) $
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @subpackage Members
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @since Thursday 26th June 2008
|
||||
* @version $Revision: 4948 $
|
||||
*
|
||||
*/
|
||||
|
||||
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_messenger extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Messenger library
|
||||
*
|
||||
* @access private
|
||||
* @var object
|
||||
*/
|
||||
private $messengerFunctions;
|
||||
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry reference
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Grab class
|
||||
//-----------------------------------------
|
||||
|
||||
require_once( IPSLib::getAppDir( 'members' ) . '/sources/classes/messaging/messengerFunctions.php' );
|
||||
$this->messengerFunctions = new messengerFunctions( $registry );
|
||||
|
||||
switch( $this->request[ 'do' ] )
|
||||
{
|
||||
case 'addFolder':
|
||||
$this->_addFolder();
|
||||
break;
|
||||
case 'removeFolder':
|
||||
$this->_removeFolder();
|
||||
break;
|
||||
case 'renameFolder':
|
||||
$this->_renameFolder();
|
||||
break;
|
||||
case 'emptyFolder':
|
||||
$this->_emptyFolder();
|
||||
break;
|
||||
case 'getPMNotification':
|
||||
$this->_getPMNotification();
|
||||
break;
|
||||
case 'showQuickForm':
|
||||
$this->_showQuickForm();
|
||||
break;
|
||||
case 'PMSend':
|
||||
$this->_PMSend();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends the PM
|
||||
*
|
||||
* @access private
|
||||
* @return string HTML to be returned via ajax
|
||||
* @since IPB 3.0.0.2008-06-25
|
||||
*/
|
||||
private function _PMSend()
|
||||
{
|
||||
if( $this->messengerFunctions->checkHasHitMax() )
|
||||
{
|
||||
$this->returnJsonError( 'cannotUsePMSystem' );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$toMemberID = intval( $this->request['toMemberID'] );
|
||||
$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
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $this->memberData['g_use_pm'] )
|
||||
{
|
||||
$this->returnJsonError( 'cannotUsePMSystem' );
|
||||
}
|
||||
|
||||
if ( $this->memberData['members_disable_pm'] )
|
||||
{
|
||||
$this->returnJsonError( 'cannotUsePMSystem' );
|
||||
}
|
||||
|
||||
if ( ! $this->memberData['member_id'] )
|
||||
{
|
||||
$this->returnJsonError( 'cannotUsePMSystem' );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Reset Classes
|
||||
//-----------------------------------------
|
||||
|
||||
IPSText::resetTextClass('editor');
|
||||
|
||||
//-----------------------------------------
|
||||
// Load lang file
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->getClass( 'class_localization')->loadLanguageFile( array( "public_error" ), 'core' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Language
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'public_messaging' ), 'members' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Send .. or.. save...
|
||||
//-----------------------------------------
|
||||
|
||||
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 ) );
|
||||
|
||||
return $this->returnJsonArray( array( 'status' => 'sent' ) );
|
||||
}
|
||||
catch( Exception $error )
|
||||
{
|
||||
$msg = $error->getMessage();
|
||||
$toMember = IPSMember::load( $toMemberID, 'core', 'displayname' );
|
||||
|
||||
if ( strstr( $msg, 'BBCODE_' ) )
|
||||
{
|
||||
$msg = str_replace( 'BBCODE_', '', $msg );
|
||||
|
||||
return $this->returnJsonArray( array( 'inlineError' => $this->lang->words[ $msg ] ) );
|
||||
}
|
||||
else if ( isset($this->lang->words[ 'err_' . $msg ]) )
|
||||
{
|
||||
$_msgString = $this->lang->words[ 'err_' . $msg ];
|
||||
$_msgString = str_replace( '#NAMES#' , implode( ",", $this->messengerFunctions->exceptionData ), $_msgString );
|
||||
$_msgString = str_replace( '#TONAME#' , $toMember['members_display_name'] , $_msgString );
|
||||
$_msgString = str_replace( '#FROMNAME#', $this->memberData['members_display_name'], $_msgString );
|
||||
}
|
||||
else
|
||||
{
|
||||
$_msgString = $this->lang->words['err_UNKNOWN'] . ' ' . $msg;
|
||||
}
|
||||
|
||||
return $this->returnJsonArray( array( 'inlineError' => $_msgString ) );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Shows the quick PM form
|
||||
*
|
||||
* @access private
|
||||
* @return string HTML to be returned via ajax
|
||||
* @since IPB 3.0.0.2008-06-25
|
||||
*/
|
||||
private function _showQuickForm()
|
||||
{
|
||||
if( $this->messengerFunctions->checkHasHitMax() )
|
||||
{
|
||||
$this->returnJsonError( 'cannotUsePMSystem' );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$toMemberID = intval( $this->request['toMemberID'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Load...
|
||||
//-----------------------------------------
|
||||
|
||||
$toMemberData = IPSMember::load( $toMemberID, 'all' );
|
||||
|
||||
if ( ! $toMemberData['member_id'] )
|
||||
{
|
||||
$this->returnJsonError( 'noSuchToMember' );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Check viewing permissions, etc
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $this->memberData['g_use_pm'] )
|
||||
{
|
||||
$this->returnJsonError( 'cannotUsePMSystem' );
|
||||
}
|
||||
|
||||
if ( $this->memberData['members_disable_pm'] )
|
||||
{
|
||||
$this->returnJsonError( 'cannotUsePMSystem' );
|
||||
}
|
||||
|
||||
if ( ! $this->memberData['member_id'] )
|
||||
{
|
||||
$this->returnJsonError( 'cannotUsePMSystem' );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Stil here?
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->getClass( 'class_localization')->loadLanguageFile( array( 'public_editors' ), 'core' );
|
||||
|
||||
return $this->returnJsonArray( array( 'success' => $this->registry->getClass('output')->getTemplate('messaging')->PMQuickForm( $toMemberData ) ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns PM notification
|
||||
*
|
||||
* @access private
|
||||
* @return string JSON either error or status
|
||||
* @since IPB 3.0.0.2008-06-25
|
||||
*/
|
||||
private function _getPMNotification()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$limit = intval( $this->request['limit'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// INIT the parser
|
||||
//-----------------------------------------
|
||||
|
||||
IPSText::resetTextClass('bbcode');
|
||||
IPSText::getTextClass('bbcode')->allow_update_caches = 0;
|
||||
IPSText::getTextClass('bbcode')->parse_bbcode = 1;
|
||||
IPSText::getTextClass('bbcode')->parse_smilies = 1;
|
||||
IPSText::getTextClass('bbcode')->parse_html = 0;
|
||||
IPSText::getTextClass('bbcode')->parsing_section = 'pms';
|
||||
|
||||
//-----------------------------------------
|
||||
// Get last PM details
|
||||
//-----------------------------------------
|
||||
|
||||
$msg = $this->DB->buildAndFetch( array( 'select' => 'mt.*',
|
||||
'from' => array( 'message_topics' => 'mt' ),
|
||||
'where' => "mt.mt_owner_id=" . $this->memberData['member_id'] . " AND mt.mt_vid_folder='in'",
|
||||
'order' => 'mt.mt_date DESC',
|
||||
'limit' => array( intval($limit), 1 ),
|
||||
'add_join' => array(
|
||||
array( 'select' => 'msg.*',
|
||||
'from' => array( 'message_text' => 'msg' ),
|
||||
'where' => 'msg.msg_id=mt.mt_msg_id',
|
||||
'type' => 'left'
|
||||
),
|
||||
array( 'select' => 'm.member_id,m.name,m.member_group_id,m.mgroup_others,m.email,m.joined,m.posts, m.last_visit, m.last_activity, m.warn_level, m.warn_lastwarn, m.members_display_name',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => 'm.member_id=mt.mt_from_id',
|
||||
'type' => 'left'
|
||||
),
|
||||
array( 'select' => 'pp.*',
|
||||
'from' => array( 'profile_portal' => 'pp' ),
|
||||
'where' => 'pp.pp_member_id=mt.mt_from_id',
|
||||
'type' => 'left'
|
||||
),
|
||||
array( 'select' => 'g.g_id, g.g_title, g.g_icon, g.g_dohtml',
|
||||
'from' => array( 'groups' => 'g' ),
|
||||
'where' => 'g.g_id=m.member_group_id',
|
||||
'type' => 'left'
|
||||
) ) ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// Check...
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $msg['msg_id'] and ! $msg['mt_id'] and ! $msg['id'] )
|
||||
{
|
||||
$this->returnJsonError( 'noMsg' );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Strip and wrap
|
||||
//-----------------------------------------
|
||||
|
||||
IPSText::getTextClass( 'bbcode' )->parsing_mgroup = $msg['member_group_id'];
|
||||
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" );
|
||||
|
||||
if ( IPSText::mbstrlen( $msg['msg_post'] ) > 300 )
|
||||
{
|
||||
$msg['msg_post'] = IPSText::truncate( $msg['msg_post'], 350 ) ;
|
||||
}
|
||||
|
||||
$msg['msg_post'] = nl2br($msg['msg_post']);
|
||||
|
||||
//-----------------------------------------
|
||||
// Add attach icon
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $msg['mt_hasattach'] )
|
||||
{
|
||||
$msg['attach_img'] = '<{ATTACH_ICON}> ';
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Date
|
||||
//-----------------------------------------
|
||||
|
||||
$msg['msg_date'] = $this->registry->getClass('class_localization')->getDate( $msg['msg_date'], 'TINY' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Next / Total links
|
||||
//-----------------------------------------
|
||||
|
||||
$msg['_cur_num'] = intval($limit) + 1;
|
||||
$msg['_msg_count_total'] = intval($this->memberData['msg_count_new']) ? intval($this->memberData['msg_count_new']) : 1;
|
||||
|
||||
//-----------------------------------------
|
||||
// Return loverly HTML
|
||||
//-----------------------------------------
|
||||
|
||||
return $this->returnHtml( $this->registry->getClass('output')->getTemplate('messaging')->PMNotificationBox( $msg ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Empties a folder
|
||||
*
|
||||
* @access private
|
||||
* @return string JSON either error or status
|
||||
* @since IPB 3.0.0.2008-06-25
|
||||
*/
|
||||
private function _emptyFolder()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$folderID = IPSText::alphanumericalClean( $this->request['folderID'] );
|
||||
$memberID = intval( $this->request['memberID'] );
|
||||
$memberData = IPSMember::load( $memberID, 'extendedProfile' );
|
||||
$status = 'ok';
|
||||
$mtids = array();
|
||||
|
||||
//-----------------------------------------
|
||||
// Check
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $memberData['member_id'] OR ! $folderID )
|
||||
{
|
||||
$this->returnJsonError( 'noSuchFolder' );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// First off, get dir data
|
||||
//-----------------------------------------
|
||||
|
||||
$folders = $this->messengerFunctions->explodeFolderData( $memberData['pconversation_filters'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// "New" folder?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $folderID == 'new' )
|
||||
{
|
||||
/* Just mark them as read */
|
||||
$this->DB->update( 'message_topic_user_map', array( 'map_has_unread' => 0 ), 'map_user_id=' . $memberID . " AND map_user_banned=0 AND map_user_active=1" );
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Delete all PMs -you- sent regardless of which folder they're in */
|
||||
$messages = $this->messengerFunctions->getPersonalTopicsList( $memberID, $folderID, array( 'offsetStart' => 0, 'offsetEnd' => 100000 ) );
|
||||
|
||||
/* Just grab IDs */
|
||||
$mtids = array_keys( $messages );
|
||||
|
||||
//-----------------------------------------
|
||||
// Got anything?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! count( $mtids ) )
|
||||
{
|
||||
$this->returnJsonError( 'nothingToRemove' );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Delete the messages
|
||||
//-----------------------------------------
|
||||
|
||||
try
|
||||
{
|
||||
$this->messengerFunctions->deleteTopics( $memberData['member_id'], $mtids );
|
||||
}
|
||||
catch( Exception $error )
|
||||
{
|
||||
$this->returnJsonError( $error->getMessage() );
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Reset total message count
|
||||
//-----------------------------------------
|
||||
|
||||
$totalMsgs = $this->messengerFunctions->resetMembersTotalTopicCount( $memberData['member_id'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Update directory counts
|
||||
//-----------------------------------------
|
||||
|
||||
$newDirs = $this->messengerFunctions->resetMembersFolderCounts( $memberData['member_id'] );
|
||||
$folders = $this->messengerFunctions->explodeFolderData( $newDirs );
|
||||
|
||||
$this->returnJsonArray( array( 'status' => $status, 'totalMsgs' => $totalMsgs, 'newDirs' => $newDirs, 'affectedDirCount' => $folders[ $folderID ]['count'] ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Renames a folder
|
||||
*
|
||||
* @access private
|
||||
* @return string JSON either error or status
|
||||
* @since IPB 3.0.0.2008-06-25
|
||||
*/
|
||||
private function _renameFolder()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$folderID = IPSText::alphanumericalClean( $this->request['folderID'] );
|
||||
$memberID = intval( $this->request['memberID'] );
|
||||
$memberData = IPSMember::load( $memberID, 'extendedProfile' );
|
||||
|
||||
// If we run through alpha clean, chars in other langs don't work properly of course
|
||||
$name = IPSText::truncate( $this->convertAndMakeSafe($_POST['name']), 50 ); //IPSText::alphanumericalClean( $this->request['name'], ' ' );
|
||||
$status = 'ok';
|
||||
|
||||
//-----------------------------------------
|
||||
// First off, get dir data
|
||||
//-----------------------------------------
|
||||
|
||||
$folders = $this->messengerFunctions->explodeFolderData( $memberData['pconversation_filters'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Check
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $memberData['member_id'] OR ! $folderID )
|
||||
{
|
||||
$this->returnJsonError( 'noSuchFolder' );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Now ensure we actually have that folder
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $folders[ $folderID ] )
|
||||
{
|
||||
$this->returnJsonError( 'noSuchFolder' );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// ..and it is not a 'set' folder..
|
||||
// 8.25.2008 - We should be able to rename these
|
||||
// 10.10.2008 - No, we shouldn't now they are "magic"
|
||||
//-----------------------------------------
|
||||
|
||||
/* Protected? */
|
||||
if ( $folders[ $folderID ]['protected'] )
|
||||
{
|
||||
$this->returnJsonError( 'cannotDeleteUndeletable' );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// OK, rename it.
|
||||
//-----------------------------------------
|
||||
|
||||
$folders[ $folderID ]['real'] = $name;
|
||||
|
||||
//-----------------------------------------
|
||||
// Collapse
|
||||
//-----------------------------------------
|
||||
|
||||
$newDirs = $this->messengerFunctions->implodeFolderData( $folders );
|
||||
|
||||
//-----------------------------------------
|
||||
// Save...
|
||||
//-----------------------------------------
|
||||
|
||||
IPSMember::save( $memberID, array( 'extendedProfile' => array( 'pconversation_filters' => $newDirs ) ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// Return...
|
||||
//-----------------------------------------
|
||||
|
||||
$this->returnJsonArray( array( 'status' => $status, 'newDirs' => $newDirs, 'name' => $name ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes a folder
|
||||
*
|
||||
* @access private
|
||||
* @return string JSON either error or status
|
||||
* @since IPB 3.0.0.2008-06-25
|
||||
*/
|
||||
private function _removeFolder()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$folderID = IPSText::alphanumericalClean( $this->request['folderID'] );
|
||||
$memberID = intval( $this->request['memberID'] );
|
||||
$memberData = IPSMember::load( $memberID, 'extendedProfile' );
|
||||
$status = 'ok';
|
||||
|
||||
IPSDebug::fireBug( 'info', array( 'Received folder id:' . $folderID ) );
|
||||
IPSDebug::fireBug( 'info', array( 'Received member id:' . $memberID ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// First off, get dir data
|
||||
//-----------------------------------------
|
||||
|
||||
$folders = $this->messengerFunctions->explodeFolderData( $memberData['pconversation_filters'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Check
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $memberData['member_id'] OR ! $folderID )
|
||||
{
|
||||
IPSDebug::fireBug( 'error', array( 'Missing member id or folder id' ) );
|
||||
|
||||
$this->returnJsonError( 'noSuchFolder' );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Now ensure we actually have that folder
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $folders[ $folderID ] )
|
||||
{
|
||||
IPSDebug::fireBug( 'error', array( 'Specified folder does not exist' ) );
|
||||
|
||||
$this->returnJsonError( 'noSuchFolder' );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Protected folder?
|
||||
//-----------------------------------------
|
||||
|
||||
/* Protected? */
|
||||
if ( $folders[ $folderID ]['protected'] )
|
||||
{
|
||||
$this->returnJsonError( 'cannotDeleteUndeletable' );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// .. and it has no messages
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $folders[ $folderID ]['count'] > 0 )
|
||||
{
|
||||
$this->returnJsonError( 'cannotDeleteHasMessages' );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// OK, remove it.
|
||||
//-----------------------------------------
|
||||
|
||||
unset( $folders[ $folderID ] );
|
||||
|
||||
///-----------------------------------------
|
||||
// Collapse
|
||||
//-----------------------------------------
|
||||
|
||||
$newDirs = $this->messengerFunctions->implodeFolderData( $folders );
|
||||
|
||||
//-----------------------------------------
|
||||
// Save...
|
||||
//-----------------------------------------
|
||||
|
||||
IPSMember::save( $memberID, array( 'extendedProfile' => array( 'pconversation_filters' => $newDirs ) ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// Return...
|
||||
//-----------------------------------------
|
||||
|
||||
$this->returnJsonArray( array( 'status' => $status, 'newDirs' => $newDirs ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a folder
|
||||
*
|
||||
* @access private
|
||||
* @return string JSON either error or status
|
||||
* @since IPB 3.0.0.2008-06-25
|
||||
*/
|
||||
private function _addFolder()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$name = IPSText::truncate( $this->convertAndMakeSafe($_POST['name']), 50 );
|
||||
$memberID = intval( $this->request['memberID'] );
|
||||
$memberData = IPSMember::load( $memberID, 'extendedProfile' );
|
||||
$status = 'ok';
|
||||
$maxID = 0;
|
||||
|
||||
//-----------------------------------------
|
||||
// Check
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $memberData['member_id'] OR ! $name )
|
||||
{
|
||||
$this->returnJsonError( 'invalidName' );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Get vdir information
|
||||
//-----------------------------------------
|
||||
|
||||
$folders = $this->messengerFunctions->explodeFolderData( $memberData['pconversation_filters'] );
|
||||
|
||||
foreach( $folders as $id => $folder )
|
||||
{
|
||||
if ( stristr( $folder['id'], 'dir_' ) )
|
||||
{
|
||||
$maxID = intval( str_replace( 'dir_', "", $folder['id'] ) ) + 1;
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Add a folder
|
||||
//-----------------------------------------
|
||||
|
||||
$folders[ 'dir_' . $maxID ] = array( 'id' => 'dir_' . $maxID,
|
||||
'real' => $name,
|
||||
'protected' => 0,
|
||||
'count' => 0 );
|
||||
|
||||
//-----------------------------------------
|
||||
// If we have more than 50 folders, error
|
||||
//-----------------------------------------
|
||||
|
||||
if ( count( $folders ) > 50 )
|
||||
{
|
||||
$this->returnJsonError( 'tooManyFolders' );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Collapse
|
||||
//-----------------------------------------
|
||||
|
||||
$newDirs = $this->messengerFunctions->implodeFolderData( $folders );
|
||||
|
||||
//-----------------------------------------
|
||||
// Save...
|
||||
//-----------------------------------------
|
||||
|
||||
IPSMember::save( $memberID, array( 'extendedProfile' => array( 'pconversation_filters' => $newDirs ) ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// Return...
|
||||
//-----------------------------------------
|
||||
|
||||
$this->returnJsonArray( array( 'status' => $status, 'newDirs' => $newDirs, 'newID' => 'dir_' . $maxID ) );
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,149 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* Profile AJAX Tab Loader
|
||||
* Last Updated: $Date: 2009-09-22 17:31:43 -0400 (Tue, 22 Sep 2009) $
|
||||
*
|
||||
* @author $Author: josh $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @subpackage Members
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @since Tuesday 1st March 2005 (11:52)
|
||||
* @version $Revision: 5141 $
|
||||
*
|
||||
*/
|
||||
|
||||
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_rate extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry reference
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$rating_id = intval($this->request['rating']);
|
||||
$rating_id = $rating_id > 5 ? 5 : $rating_id;
|
||||
$rating_id = $rating_id < 0 ? 0 : $rating_id;
|
||||
$member_id = intval($this->request['member_id']);
|
||||
$member = array();
|
||||
$type = 'new';
|
||||
$md5_check = IPSText::md5Clean( $this->request['md5check'] );
|
||||
$error = array();
|
||||
|
||||
//-----------------------------------------
|
||||
// Check
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $this->settings['pp_allow_member_rate'] )
|
||||
{
|
||||
$error['error_key'] = 'user_rate_no_perm';
|
||||
$this->returnJsonArray( $error );
|
||||
}
|
||||
|
||||
if ( ! $member_id OR ! $this->memberData['member_id'] OR $member_id == $this->memberData['member_id'] )
|
||||
{
|
||||
$error['error_key'] = 'user_rate_no_perm';
|
||||
$this->returnJsonArray( $error );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// MD5 check
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $md5_check != $this->member->form_hash )
|
||||
{
|
||||
$error['error_key'] = 'user_rate_no_perm3';
|
||||
$this->returnJsonArray( $error );
|
||||
}
|
||||
|
||||
$member = IPSMember::load( $member_id, 'extendedProfile,groups' );
|
||||
|
||||
if ( ! $member['member_id'] )
|
||||
{
|
||||
$error['error_key'] = 'user_rate_no_perm4';
|
||||
$this->returnJsonArray( $error );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Have we already rated?
|
||||
//-----------------------------------------
|
||||
|
||||
$rating = $this->DB->buildAndFetch( array( 'select' => '*',
|
||||
'from' => 'profile_ratings',
|
||||
'where' => "rating_for_member_id={$member_id} AND rating_by_member_id=" . $this->memberData['member_id'] ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// Already rated?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $rating['rating_id'] )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Do we allow re-ratings?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $rating_id != $rating['rating_value'] )
|
||||
{
|
||||
$member['pp_rating_value'] = intval( $member['pp_rating_value'] );
|
||||
$member['pp_rating_value'] = ( $member['pp_rating_value'] + $rating_id ) - $rating['rating_value'];
|
||||
|
||||
$this->DB->update( 'profile_ratings', array( 'rating_value' => $rating_id ), 'rating_id=' . $rating['rating_id'] );
|
||||
|
||||
$this->DB->update( 'profile_portal', array( 'pp_rating_value' => $member['pp_rating_value'],
|
||||
'pp_rating_real' => round( $member['pp_rating_value'] / $member['pp_rating_hits'] ) ), 'pp_member_id=' . $member_id );
|
||||
|
||||
$type = 'update';
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// NEW RATING!
|
||||
//-----------------------------------------
|
||||
|
||||
else
|
||||
{
|
||||
$member['pp_rating_value'] = intval($member['pp_rating_value']) + $rating_id;
|
||||
$member['pp_rating_hits'] = intval($member['pp_rating_hits']) + 1;
|
||||
|
||||
$this->DB->insert( 'profile_ratings', array( 'rating_for_member_id' => $member_id,
|
||||
'rating_by_member_id' => $this->memberData['member_id'],
|
||||
'rating_value' => $rating_id,
|
||||
'rating_ip_address' => $this->member->ip_address ) );
|
||||
|
||||
$this->DB->update( 'profile_portal', array( 'pp_rating_hits' => intval($member['pp_rating_hits']),
|
||||
'pp_rating_value' => intval($member['pp_rating_value']),
|
||||
'pp_rating_real' => round( $member['pp_rating_value'] / $member['pp_rating_hits'] ) ), 'pp_member_id=' . $member_id );
|
||||
|
||||
|
||||
}
|
||||
|
||||
$member['pp_rating_real'] = round( $member['pp_rating_value'] / $member['pp_rating_hits'] );
|
||||
|
||||
$return = array(
|
||||
'rating' => $member['pp_rating_value'],
|
||||
'total' => $member['pp_rating_real'],
|
||||
'average' => $member['pp_rating_real'],
|
||||
'rated' => $type
|
||||
);
|
||||
|
||||
$this->returnJsonArray( $return );
|
||||
//$this->returnString( $member['pp_rating_value'] . ',' . $member['pp_rating_hits'] . ',' . $member['pp_rating_real'] . ',' . $type );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,153 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* Profile AJAX Tab Loader
|
||||
* Last Updated: $Date: 2009-07-28 20:26:37 -0400 (Tue, 28 Jul 2009) $
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @subpackage Members
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @since Tuesday 1st March 2005 (11:52)
|
||||
* @version $Revision: 4948 $
|
||||
* @deprecated We no longer have AJAX setting changes in profile
|
||||
*
|
||||
*/
|
||||
|
||||
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_settings extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry reference
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$member_id = intval($this->request['member_id']);
|
||||
$member = array();
|
||||
$command = trim( $this->request['cmd'] );
|
||||
$value = $this->convertAndMakeSafe( $this->request['value'], 0 );
|
||||
$md5_check = IPSText::md5Clean( $this->request['md5check'] );
|
||||
$return_string = '';
|
||||
$pp_b_day = intval( $this->request['pp_b_day'] );
|
||||
$pp_b_month = intval( $this->request['pp_b_month'] );
|
||||
$pp_b_year = intval( $this->request['pp_b_year'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// MD5 check
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $md5_check != $this->member->form_hash )
|
||||
{
|
||||
$this->returnString( 'error' );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Check
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $member_id OR ! $this->memberData['member_id'] )
|
||||
{
|
||||
$this->returnString( 'error' );
|
||||
}
|
||||
|
||||
if ( ! $this->memberData['g_edit_profile'] )
|
||||
{
|
||||
$this->returnString( 'error' );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Load member
|
||||
//-----------------------------------------
|
||||
|
||||
$member = IPSMember::load( $member_id, 'extendedProfile,groups' );
|
||||
|
||||
if ( ! $member['member_id'] )
|
||||
{
|
||||
$this->returnString( 'error' );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Not the same member?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( !$this->memberData['g_is_supmod'] AND $member_id != $this->memberData['member_id'] )
|
||||
{
|
||||
$this->returnString( 'error' );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Alright.. what are we doing?
|
||||
//-----------------------------------------
|
||||
|
||||
switch( $command )
|
||||
{
|
||||
case 'birthdate':
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'public_profile' ) );
|
||||
|
||||
if( $pp_b_month OR $pp_b_day OR $pp_b_year )
|
||||
{
|
||||
if ( ! $pp_b_month or ! $pp_b_day )
|
||||
{
|
||||
$return_string = 'dateerror';
|
||||
}
|
||||
}
|
||||
|
||||
if ( ( $pp_b_month AND $pp_b_day AND $pp_b_year ) AND ! @checkdate( $pp_b_month, $pp_b_day, $pp_b_year ) )
|
||||
{
|
||||
$return_string = 'dateerror';
|
||||
}
|
||||
|
||||
if( $return_string != 'dateerror' )
|
||||
{
|
||||
IPSMember::save( $member_id, array( 'core' => array( 'bday_month' => intval( $pp_b_month ), 'bday_day' => intval( $pp_b_day ), 'bday_year' => intval( $pp_b_year ) ) ) );
|
||||
|
||||
$_pp_b_month = '';
|
||||
|
||||
if( $pp_b_month > 0 AND $pp_b_month < 13 )
|
||||
{
|
||||
$_pp_b_month = $this->lang->words['M_' . $pp_b_month ];
|
||||
}
|
||||
|
||||
$date_vars = array();
|
||||
|
||||
# Adding this to support birthdays that don't specify all 3 params
|
||||
|
||||
if( $_pp_b_month )
|
||||
{
|
||||
$date_vars[] = $_pp_b_month;
|
||||
}
|
||||
|
||||
if( $pp_b_day )
|
||||
{
|
||||
$date_vars[] = $pp_b_day;
|
||||
}
|
||||
|
||||
if( $pp_b_year )
|
||||
{
|
||||
$date_vars[] = $pp_b_year;
|
||||
}
|
||||
|
||||
$return_string = ( count($date_vars) ) ? implode( '-', $date_vars ) : $this->lang->words['m_bday_unknown'];
|
||||
}
|
||||
}
|
||||
|
||||
$this->returnString( $return_string );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* Allow user to change their status
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @subpackage Members
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @since Tuesday 1st March 2005 (11:52)
|
||||
* @version $Revision: 4948 $
|
||||
*
|
||||
*/
|
||||
|
||||
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_status extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry reference
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$info = array();
|
||||
$id = intval( $this->memberData['member_id'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Get HTML and skin
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'public_profile' ), 'members' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Can we access?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( !$this->memberData['g_mem_info'] OR $this->memberData['gbw_no_status_update'] )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['status_off'] );
|
||||
}
|
||||
|
||||
if( !$id )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['status_off'] );
|
||||
}
|
||||
|
||||
$newStatus = trim( IPSText::getTextClass('bbcode')->stripBadWords( IPSText::parseCleanValue( $_POST['new_status'] ) ) );
|
||||
|
||||
IPSMember::save( $id, array( 'extendedProfile' => array( 'pp_status' => $newStatus, 'pp_status_update' => time() ) ) );
|
||||
|
||||
$this->returnJsonArray( array( 'status' => 'success', 'new_status' => $newStatus ) );
|
||||
|
||||
exit;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* Retrieve member warn log
|
||||
* Last Updated: $Date: 2009-07-28 20:26:37 -0400 (Tue, 28 Jul 2009) $
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @subpackage Members
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @since Tuesday 1st March 2005 (11:52)
|
||||
* @version $Revision: 4948 $
|
||||
*
|
||||
*/
|
||||
|
||||
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_warn extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Class entry point
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry reference
|
||||
* @return void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
ipsRegistry::getClass( 'class_localization')->loadLanguageFile( array( 'public_mod' ), 'forums' );
|
||||
|
||||
if ( ! $this->settings['warn_on'] )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['ajax_no_warn'] );
|
||||
}
|
||||
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'view':
|
||||
$this->_viewWarnLogs();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Retieve warn logs and return them
|
||||
*
|
||||
* @access private
|
||||
* @return void
|
||||
*/
|
||||
private function _viewWarnLogs()
|
||||
{
|
||||
require_once( IPSLib::getAppDir('members') . '/modules_public/warn/warn.php' );
|
||||
$warn = new public_members_warn_warn( $this->registry );
|
||||
$warn->makeRegistryShortcuts( $this->registry );
|
||||
$warn->loadData();
|
||||
|
||||
$warnHTML = $warn->viewLog();
|
||||
|
||||
if ( !$warnHTML )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['ajax_bad_html'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->returnHtml( $this->registry->getClass('output')->getTemplate('mod')->warnLogsAjaxWrapper( $warnHTML ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user