Version 4.3.0

This commit is contained in:
Neo committed 2025-12-19 05:47:12 -08:00
1 parent 96997ddd8e
commit fe1acf984a
1349 files changed
+116159 -67711

No files matched your search

@@ -166,6 +166,43 @@ class _Vbulletin extends \IPS\convert\Software
)
);
}
/**
* Count Source Rows for a specific step
*
* @param string $table The table containing the rows to count.
* @param array|NULL $where WHERE clause to only count specific rows, or NULL to count all.
* @param bool $recache Skip cache and pull directly (updating cache)
* @return integer
* @throws \IPS\convert\Exception
*/
public function countRows( $table, $where=NULL, $recache=FALSE )
{
switch( $table )
{
case 'userchangelog':
return $this->db->select( 'count(changeid)', 'userchangelog', array( $this->db->in( 'fieldname', array_keys( static::$changeLogTypes ) ) ) )->first();
break;
case 'pm':
/* vB doesn't put an index on a column that makes this converison much quicker, so we'll do it. */
if( !$this->db->checkForIndex( 'pm', 'parent_id' ) )
{
$this->db->addIndex( 'pm', array(
'type' => 'key',
'name' => 'parent_id',
'columns' => array( 'parentpmid', 'folderid' )
) );
}
return parent::countRows( $table, $where, $recache );
break;
default:
return parent::countRows( $table, $where, $recache );
break;
}
}
/**
* Can we convert passwords from this software.
@@ -479,12 +516,15 @@ class _Vbulletin extends \IPS\convert\Software
/* Content Counts */
\IPS\Task::queue( 'core', 'RecountMemberContent', array( 'app' => $this->app->app_id ), 4, array( 'app' ) );
/* Clubs */
\IPS\Task::queue( 'convert', 'RecountClubMembers', array( 'app' => $this->app->app_id ), 2, array( 'app' ) );
/* First Post Data */
\IPS\Task::queue( 'convert', 'RebuildConversationFirstIds', array( 'app' => $this->app->app_id ), 2, array( 'app' ) );
/* Attachments */
\IPS\Task::queue( 'core', 'RebuildAttachmentThumbnails', array( 'app' => $this->app->app_id ), 4, array( 'app' ) );
\IPS\Task::queue( 'core', 'RebuildAttachmentThumbnails', array( 'app' => $this->app->app_id ), 1, array( 'app' ) );
return array( "f_search_index_rebuild", "f_clear_caches", "f_rebuild_pms", "f_signatures_rebuild", "f_announce_rebuild" );
}
@@ -882,7 +922,7 @@ class _Vbulletin extends \IPS\convert\Software
/**
* @brief Member history type map
*/
protected $changeLogTypes = array( 'username' => 'display_name', 'email' => 'email_change', 'usergroupid' => 'member_group_id', 'membergroupids' => 'mgroup_others' );
protected static $changeLogTypes = array( 'username' => 'display_name', 'email' => 'email_change', 'usergroupid' => 'member_group_id', 'membergroupids' => 'mgroup_others' );
/**
* Convert member history
@@ -892,50 +932,15 @@ class _Vbulletin extends \IPS\convert\Software
public function convertMemberHistory()
{
$libraryClass = $this->getLibrary();
$libraryClass::setKey( 'changeid' );
$fixGroups = function( $string )
foreach( $this->fetch( 'userchangelog', 'changeid', array( $this->db->in( 'fieldname', array_keys( static::$changeLogTypes ) ) ) ) AS $change )
{
$groups = explode( ',', $string );
$newGroups = array();
array_walk( $groups, function( &$item, $key ) use ( &$newGroups )
{
try
{
$item = $this->app->getLink( $item, 'core_groups' );
$newGroups[] = $item;
}
catch( \OutOfRangeException $e ){}
});
return implode( ',', $newGroups );
};
foreach( $this->fetch( 'userchangelog', 'changeid' ) AS $change )
{
if( !in_array( $change['fieldname'], array_keys( $this->changeLogTypes ) ) )
{
$libraryClass->setLastKeyValue( $change['changeid'] );
continue;
}
/* Any processing we need to do */
switch( $this->changeLogTypes[ $change['fieldname'] ] )
{
case 'member_group_id':
case 'mgroup_others':
$change['oldvalue'] = $fixGroups( $change['oldvalue'] );
$change['newvalue'] = $fixGroups( $change['newvalue'] );
break;
}
$libraryClass->convertMemberHistory( array(
'log_id' => $change['changeid'],
'log_member' => $change['userid'],
'log_by' => $change['adminid'],
'log_type' => $this->changeLogTypes[ $change['fieldname'] ],
'log_type' => static::$changeLogTypes[ $change['fieldname'] ],
'log_data' => array( 'old' => $change['oldvalue'], 'new' => $change['newvalue'] ),
'log_date' => $change['change_time']
)
@@ -1241,7 +1246,7 @@ class _Vbulletin extends \IPS\convert\Software
}
}
$libraryClass->convertMember( $info, $profileFields, $filename, $filepath, $filedata );
$libraryClass->convertMember( $info, $profileFields, $filename, $filepath );
/* Any friends need converting to followers? */
foreach( $this->db->select( '*', 'userlist', array( "type=? AND friend=? AND userid=?", 'buddy', 'yes', $user['userid'] ) ) AS $follower )
@@ -1933,10 +1938,11 @@ class _Vbulletin extends \IPS\convert\Software
}
/* Profile URLs can be in one of 3 formats really...
* /member.php/1-name
* /members/1-name
* /member.php?u=1
*/
* /member.php/1-name
* /members/1-name
* /member.php?u=1
* /member.php?1-name
*/
$path = $url->data[ \IPS\Http\Url::COMPONENT_PATH ];
if( mb_strpos( $path, 'member.php' ) !== FALSE )
{
@@ -1944,6 +1950,10 @@ class _Vbulletin extends \IPS\convert\Software
{
$oldId = \IPS\Request::i()->u;
}
elseif( preg_match( '#^(\d+)-[^/]+#i', $url->data[ \IPS\Http\Url::COMPONENT_QUERY ], $matches ) )
{
$oldId = $matches[1];
}
else
{
$queryStringPieces = explode( '-', mb_substr( $path, mb_strpos( $path, 'member.php/' ) + mb_strlen( 'member.php/' ) ) );
@@ -1971,4 +1981,23 @@ class _Vbulletin extends \IPS\convert\Software
return NULL;
}
/**
* Process a login
*
* @param \IPS\Member $member The member
* @param string $password Password from form
* @return bool
*/
public static function login( $member, $password )
{
if ( \IPS\Login::compareHashes( $member->conv_password, md5( md5( str_replace( ''', "'", html_entity_decode( $password ) ) ) . $member->conv_password_extra ) ) )
{
return TRUE;
}
else
{
return FALSE;
}
}
}