Version 3.4.5

This commit is contained in:
Neo committed 2025-12-19 00:38:12 -08:00
1 parent fb6b5baabc
commit e4478369d8
1360 files changed
+228921 -179445

No files matched your search

@@ -1,332 +0,0 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* Editor Library: Gateway
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board
* @link http://www.invisionpower.com
* @since 9th March 2005 11:03
* @version $Revision: 10914 $
*/
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 hanEditor
{
/**
* Editor reference
*
* @var object
*/
public $class_editor;
/**
* Editing method (rte|std)
*
* @var string
*/
public $method = '';
/**
* RTE enabled?
*
* @var boolean
*/
public $rte_on = false;
/**
* Images directory (for acp)
*
* @var string
*/
public $image_dir = '';
/**
* Emoticons directory (for acp)
*
* @var string
*/
public $emo_dir = '';
/**
* Current editor id
*
* @var string
*/
public $editor_id = 'ed-0';
/**
* Remove emoticons from editor
*
* @var boolean
*/
public $remove_emoticons = false;
/**
* ACP editor id
*
* @var integer
*/
public $acp_editor_id = 0;
/**#@+
* Registry objects
*
* @var object
*/
protected $registry;
protected $DB;
protected $settings;
protected $request;
protected $lang;
protected $member;
protected $memberData;
protected $cache;
protected $caches;
/**#@-*/
/**
* Constructor
*
* @param object $registry Registry object
* @return @e void
*/
public function __construct( ipsRegistry $registry )
{
/* Make object */
$this->registry = $registry;
$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();
}
/**
* Init method
*
* @param object Registry object
* @return @e void
*/
public function init()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$class = "";
if ( ! $this->method )
{
$this->method = 'rte';
}
//-----------------------------------------
// Make sure we haven't had any messin'
//-----------------------------------------
if ( isset( $_POST['editor_ids'] ) AND is_array( $_POST['editor_ids'] ) )
{
foreach( $_POST['editor_ids'] as $k => $v )
{
if ( isset($_POST[ $v . '_wysiwyg_used']) AND intval($_POST[ $v . '_wysiwyg_used']) == 1)
{
$this->method = 'rte';
}
else
{
$this->method = 'std';
}
}
}
if ( isset($_POST['ed-0_wysiwyg_used']) AND intval($_POST['ed-0_wysiwyg_used']) == 1 )
{
$this->method = 'rte';
}
//-----------------------------------------
// Force STD editor.. if needed
//-----------------------------------------
if ( ( isset($_POST['std_used']) AND intval($_POST['std_used']) ) )
{
$this->method = 'std';
}
//-----------------------------------------
// Which class
//-----------------------------------------
switch( $this->method )
{
case 'rte':
$class = 'class_editor_rte.php';
$this->rte_on = 1;
break;
case 'std':
$class = 'class_editor_std.php';
$this->rte_on = 0;
break;
default:
$class = 'class_editor_std.php';
$this->rte_on = 0;
}
//-----------------------------------------
// Load classes
//-----------------------------------------
require_once( IPS_ROOT_PATH . 'sources/classes/editor/class_editor.php' );/*noLibHook*/
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/editor/' . $class, 'class_editor_module' );
$this->class_editor = new $classToLoad( $this->registry );
$this->class_editor->allow_unicode = IPS_ALLOW_UNICODE;
$this->class_editor->get_magic_quotes = IPS_MAGIC_QUOTES;
//-----------------------------------------
// Load lang file
//-----------------------------------------
ipsRegistry::getClass( 'class_localization')->loadLanguageFile( array( 'public_editors' ), 'core' );
//-----------------------------------------
// Init class
//-----------------------------------------
$this->class_editor->editorInit();
//-----------------------------------------
// Load skin and language
//-----------------------------------------
if ( IN_ACP )
{
$image_set = $this->DB->buildAndFetch( array( 'select' => 'set_image_dir, set_emo_dir', 'from' => 'skin_collections', 'where' => 'set_is_default=1' ) );
$this->image_dir = $image_set['set_image_dir'];
$this->emo_dir = $image_set['set_emo_dir'];
//-----------------------------------------
// Remove side panel
//-----------------------------------------
$this->remove_emoticons = true;
}
else
{
$this->emo_dir = ipsRegistry::getClass('output')->skin['set_emo_dir'];
}
}
/**
* Show the editor
*
* @param string Raw text with bbcode
* @param string Form field name
* @return string Editor HTML
*/
public function showEditor( $text, $form_field='post_content' )
{
//-----------------------------------------
// INIT
//-----------------------------------------
$smilies = IPSLib::fetchEmoticonsAsJson( $this->emo_dir );
$total = 0;
$count = 0;
$smilie_id = 0;
//-----------------------------------------
// Load skin and language
//-----------------------------------------
//if ( IN_ACP )
//{
//-----------------------------------------
// Sort out editor id
//-----------------------------------------
$this->editor_id = 'ed-'.$this->acp_editor_id;
$this->acp_editor_id++;
//}
//-----------------------------------------
// Emoticons
//-----------------------------------------
$this->settings['_remove_emoticons'] = $this->remove_emoticons;
//-----------------------------------------
// Pre parse...
//-----------------------------------------
$text = $this->class_editor->processBeforeForm( $text );
//-----------------------------------------
// Weird script tag stuff...
//-----------------------------------------
if( $this->method == 'rte' )
{
$text = preg_replace( '#(<|&lt;|&amp;lt;|&\#60;)script#si', "&amp;lt;script", $text );
}
//-----------------------------------------
// Comment
//-----------------------------------------
if ( IN_ACP )
{
$return_html = $this->registry->getClass('output')->global_template->ips_editor( $form_field, $text, $this->settings['img_url'].'/folder_editor_images/', $this->rte_on, $this->editor_id, $smilies );
$return_html = preg_replace( '#([^/\.])js/#is', "\\1".$this->settings['board_url'] . '/' . PUBLIC_DIRECTORY . "/js/" , $return_html );
$return_html = str_replace( "<#IMG_DIR#>" , $this->settings['board_url'] . '/' . PUBLIC_DIRECTORY . "/style_images/{$this->image_dir}", $return_html );
}
else
{
$return_html = $this->registry->getClass('output')->getTemplate('editors')->ips_editor( $form_field, $text, $this->settings['img_url'].'/folder_editor_images/', $this->rte_on, $this->editor_id, $smilies );
}
return $return_html;
}
/**
* Retrieve the posted contents from the editor
*
* @param string Form field name OR raw text
* @param boolean Is definitely full text and not a field name
* @return string Editor HTML
*/
public function processRawPost( $form_field, $isDefinitelyFullText=false )
{
return $this->class_editor->processAfterForm( $form_field, $isDefinitelyFullText );
}
/**
* Runs through processBeforeForm
*
* @param string Raw text
* @return string Processed text
*/
public function unProcessRawPost( $text )
{
return $this->class_editor->processBeforeForm( $text );
}
}
File diff suppressed because it is too large. Load diff
+105 -39
View File
@@ -2,9 +2,9 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* IP.Board v3.4.5
* Login handler abstraction
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* Last Updated: $Date: 2013-05-03 23:09:37 -0400 (Fri, 03 May 2013) $
* </pre>
*
* @author $Author: bfarber $
@@ -13,7 +13,7 @@
* @package IP.Board
* @link http://www.invisionpower.com
* @since Tuesday 1st March 2005 (11:52)
* @version $Revision: 10914 $
* @version $Revision: 12226 $
*/
if ( ! defined( 'IN_IPB' ) )
@@ -125,7 +125,7 @@ class han_login
// Load member
//-----------------------------------------
$member = IPSMember::load( $memberID, 'all' );
$member = IPSMember::load( $memberID, 'all,members_partial' );
if ( ! $member['member_id'] )
{
@@ -137,20 +137,28 @@ class han_login
// Not completed their sign in?
//-----------------------------------------
if ( $member['members_created_remote'] AND isset($member['full']) AND !$member['full'] )
if ( $member['members_created_remote'] )
{
//-----------------------------------------
// If this is a resume, i.e. from Facebook,
// timenow won't be set
//-----------------------------------------
if( !$member['timenow'] )
if ( isset($member['full']) AND !$member['full'] )
{
$partial = $this->DB->buildAndFetch( array( 'select' => 'partial_date', 'from' => 'members_partial', 'where' => 'partial_member_id=' . $member['member_id'] ) );
$member['timenow'] = $partial['partial_date'];
}
return array( $this->registry->getClass('class_localization')->words['partial_login'], $this->settings['base_url'] . 'app=core&amp;module=global&amp;section=register&amp;do=complete_login&amp;mid='.$member['member_id'].'&amp;key='.$member['timenow'] );
//-----------------------------------------
// If this is a resume, i.e. from Facebook,
// timenow won't be set
//-----------------------------------------
if( !$member['timenow'] )
{
$partial = $this->DB->buildAndFetch( array( 'select' => 'partial_date', 'from' => 'members_partial', 'where' => 'partial_member_id=' . $member['member_id'] ) );
$member['timenow'] = $partial['partial_date'];
}
return array( $this->registry->getClass('class_localization')->words['partial_login'], $this->settings['base_url'] . 'app=core&amp;module=global&amp;section=register&amp;do=complete_login&amp;mid='.$member['member_id'].'&amp;key='.$member['timenow'] );
}
elseif ( $member['partial_member_id'] )
{
$this->DB->delete( 'members_partial', "partial_member_id={$member['partial_member_id']}" );
}
}
//-----------------------------------------
@@ -173,16 +181,18 @@ class han_login
//-----------------------------------------
// Cookie me softly?
//-----------------------------------------
if ( $setCookies )
{
IPSCookie::set( "member_id" , $member['member_id'] , 1 );
IPSCookie::set( "pass_hash" , $member['member_login_key'], $_sticky, $_days );
IPSCookie::set( "member_id" , $member['member_id'] , 1, 0, FALSE, TRUE );
IPSCookie::set( "pass_hash" , $member['member_login_key'], $_sticky, $_days, FALSE, TRUE );
IPSCookie::set( "ipsconnect_" . md5( $this->settings['board_url'] . '/interface/ipsconnect/ipsconnect.php' ), '1', $_sticky, $_days, FALSE, FALSE );
}
else
{
IPSCookie::set( "member_id" , $member['member_id'], 0 );
IPSCookie::set( "pass_hash" , $member['member_login_key'], 0 );
IPSCookie::set( "member_id" , $member['member_id'], 0, 0, FALSE, TRUE );
IPSCookie::set( "pass_hash" , $member['member_login_key'], 0, 0, FALSE, TRUE );
IPSCookie::set( "ipsconnect_" . md5( $this->settings['board_url'] . '/interface/ipsconnect/ipsconnect.php' ), '1', 0, 0, FALSE, FALSE );
}
//-----------------------------------------
@@ -209,8 +219,7 @@ class han_login
$session_id = $this->registry->member()->sessionClass()->convertGuestToMember( array( 'member_name' => $member['members_display_name'],
'member_id' => $member['member_id'],
'member_group' => $member['member_group_id'],
'login_type' => $privacy
) );
'login_type' => $privacy ) );
if ( !empty( $this->request['referer'] ) AND $this->request['section'] != 'register' )
{
@@ -276,7 +285,8 @@ class han_login
// Still here?
//-----------------------------------------
return array( $this->registry->getClass('class_localization')->words['partial_login'], str_replace( '?&', '?', $url . '&s=' . $session_id ) );
//return array( $this->registry->getClass('class_localization')->words['partial_login'], str_replace( '?&', '?', $url . '&s=' . $session_id ) );
return array( $this->registry->getClass('class_localization')->words['partial_login'], str_replace( '?&', '?', $url ) );
}
/**
@@ -294,15 +304,16 @@ class han_login
$errors = '';
$core = array();
$mobileSSO = false;
$memberData = $this->registry->member()->fetchMemberData();
/* Mobile app + sso */
if ( $this->memberData['userAgentType'] == 'mobileApp' )
if ( $memberData['userAgentType'] == 'mobileApp' )
{
$file = IPS_ROOT_PATH . 'sources/classes/session/ssoMobileAppLogIn.php';
if ( is_file( $file ) )
{
require_once( $file );/*noLibHook*/ #NoTeraThisDoesNotNeedAHookButIForgotYourLittleCodeSorryX
require_once( $file );
if ( class_exists( 'ssoMobileAppLogIn' ) )
{
@@ -345,7 +356,7 @@ class han_login
//-----------------------------------------
// Check return code...
//-----------------------------------------
if ( $this->return_code != 'SUCCESS' )
{
if( $this->return_code == 'MISSING_DATA' )
@@ -376,6 +387,17 @@ class han_login
{
return array( null, null, 'flagged_remote' );
}
else if( $this->return_code == 'VALIDATING' )
{
if( $this->revalidate_url == 'ADMIN_VALIDATION' )
{
return array( null, null, 'validating_remote', ipsRegistry::getClass('class_localization')->words['admin_validation_msg'] );
}
else
{
return array( null, null, 'validating_remote', "<a href='{$this->revalidate_url}' target='_blank'>".ipsRegistry::getClass('class_localization')->words['resend_val']."</a>" );
}
}
else
{
return array( null, null, 'wrong_auth' );
@@ -412,18 +434,22 @@ class han_login
//-----------------------------------------
// Cookie me softly?
//-----------------------------------------
if ( $this->request['rememberMe'] )
{
IPSCookie::set( "member_id" , $member['member_id'] , 1 );
IPSCookie::set( "pass_hash" , $member['member_login_key'], $_sticky, $_days );
IPSCookie::set( "member_id" , $member['member_id'] , 1, 0, FALSE, TRUE );
IPSCookie::set( "pass_hash" , $member['member_login_key'], $_sticky, $_days, FALSE, TRUE );
IPSCookie::set( "ipsconnect_" . md5( $this->settings['board_url'] . '/interface/ipsconnect/ipsconnect.php' ), '1', $_sticky, $_days, FALSE, FALSE );
}
else
{
IPSCookie::set( "member_id" , $member['member_id'], 0 );
IPSCookie::set( "pass_hash" , $member['member_login_key'], 0 );
// Ticket 824266
// IPSCookie::set( "member_id" , $member['member_id'], 0 );
// IPSCookie::set( "pass_hash" , $member['member_login_key'], 0 );
IPSCookie::set( "ipsconnect_" . md5( $this->settings['board_url'] . '/interface/ipsconnect/ipsconnect.php' ), '1', 0, 0, FALSE, FALSE );
}
//-----------------------------------------
// Remove any COPPA cookies previously set
//-----------------------------------------
@@ -448,8 +474,7 @@ class han_login
$session_id = $this->registry->member()->sessionClass()->convertGuestToMember( array( 'member_name' => $member['members_display_name'],
'member_id' => $member['member_id'],
'member_group' => $member['member_group_id'],
'login_type' => $privacy
) );
'login_type' => $privacy ) );
if ( !empty($this->request['referer']) AND $this->request['section'] != 'register' )
{
@@ -656,6 +681,7 @@ class han_login
{
foreach( $this->modules as $k => $obj_reference )
{
$obj_reference->is_password_check = TRUE;
$obj_reference->authenticate( $username, $email_address, $password );
$this->return_code = ( $obj_reference->return_code == 'SUCCESS' ? 'SUCCESS' : 'FAIL' );
$this->member_data = $obj_reference->member_data;
@@ -685,6 +711,7 @@ class han_login
$this->return_code = $obj_reference->return_code;
$this->member_data = $obj_reference->member_data;
$this->account_unlock = ( $obj_reference->account_unlock ) ? $obj_reference->account_unlock : $this->account_unlock;
$this->revalidate_url = ( $obj_reference->revalidate_url ) ? $obj_reference->revalidate_url : $this->revalidate_url;
/* Locked */
if( $this->return_code == 'ACCOUNT_LOCKED' )
@@ -725,9 +752,10 @@ class han_login
/**
* Logout callback - called when a user logs out
*
* @param array Member Data
* @return mixed Possible redirection based on login method config, else array of messages
*/
public function logoutCallback()
public function logoutCallback( $memberData )
{
$returns = array();
$redirect = '';
@@ -736,7 +764,7 @@ class han_login
{
if( method_exists( $obj_reference, 'logoutCallback' ) )
{
$returns[] = $obj_reference->logoutCallback();
$returns[] = $obj_reference->logoutCallback( $memberData );
}
//-----------------------------------------
@@ -964,15 +992,15 @@ class han_login
* @param array Arra of Member Data
* @return boolean Request was successful
*/
public function changeName( $old_name, $new_name, $email_address, $memberData )
public function changeName( $old_name, $new_name, $email_address, $memberData, $type='name' )
{
$this->return_code = 'METHOD_NOT_DEFINED';
foreach( $this->modules as $k => $obj_reference )
{
if( method_exists( $obj_reference, 'changeName' ) )
{
$obj_reference->changeName( $old_name, $new_name, $email_address, $memberData );
$obj_reference->changeName( $old_name, $new_name, $email_address, $memberData, $type );
$this->return_code = $obj_reference->return_code;
}
}
@@ -980,6 +1008,44 @@ class han_login
return ( $this->return_code == 'SUCCESS' ) ? true : false;
}
/**
* Validate Account
*
* @param array Member data
*/
public function validateAccount( $member )
{
$this->return_code = 'METHOD_NOT_DEFINED';
foreach( $this->modules as $k => $obj_reference )
{
if( method_exists( $obj_reference, 'validateAccount' ) )
{
$obj_reference->validateAccount( $member );
$this->return_code = $obj_reference->return_code;
}
}
}
/**
* Delete Account
*
* @param int|array ID(s)
*/
public function deleteAccount( $ids )
{
$this->return_code = 'METHOD_NOT_DEFINED';
foreach( $this->modules as $k => $obj_reference )
{
if( method_exists( $obj_reference, 'deleteAccount' ) )
{
$obj_reference->deleteAccount( $ids );
$this->return_code = $obj_reference->return_code;
}
}
}
/**
* Create a user's account
*
@@ -2,18 +2,19 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* IP.Board v3.4.5
* BBCode parsing gateway.
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* Last Updated: $Date: 2012-07-12 05:25:08 -0400 (Thu, 12 Jul 2012) $
* </pre>
*
* @author $Author: bfarber $
* @author $Author: mmecham $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board
* @link http://www.invisionpower.com
* @since 9th March 2005 11:03
* @version $Revision: 10914 $
* @version $Revision: 11067 $
* @depricated Since 3.4
*/
if ( ! defined( 'IN_IPB' ) )