Version 4.3.0
This commit is contained in:
1 parent
96997ddd8e
commit
fe1acf984a
1349 files changed
+116159
-67711
No files matched your search
@@ -132,6 +132,32 @@ class _UBBthreads extends \IPS\convert\Software
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows software to add additional menu row options
|
||||
*
|
||||
* @param array $rows Existing rows
|
||||
* @return array
|
||||
*/
|
||||
public function extraMenuRows( $rows )
|
||||
{
|
||||
$count = $this->countRows( static::canConvert()['convertMembersFollowers']['table'], static::canConvert()['convertMembersFollowers']['where'] );
|
||||
|
||||
if( $count )
|
||||
{
|
||||
$rows['convertMembersFollowers'] = array(
|
||||
'step_method' => 'convertMembersFollowers',
|
||||
'step_title' => 'convert_follows',
|
||||
'ips_rows' => \IPS\Db::i()->select( 'COUNT(*)', 'core_follow', array( 'follow_app=? and follow_area=?', 'core', 'member' ) )->first(),
|
||||
'source_rows' => $count,
|
||||
'per_cycle' => 500,
|
||||
'dependencies' => array( 'convertMembers' ),
|
||||
'link_type' => 'core_follow',
|
||||
);
|
||||
}
|
||||
|
||||
return $rows;
|
||||
}
|
||||
|
||||
/**
|
||||
* Can we convert passwords from this software.
|
||||
@@ -265,6 +291,15 @@ class _UBBthreads extends \IPS\convert\Software
|
||||
'field_hint' => \IPS\Member::loggedIn()->language()->addToStack( 'username_hint' ),
|
||||
);
|
||||
|
||||
$return['convertMembers']['photo_location'] = array(
|
||||
'field_class' => 'IPS\\Helpers\\Form\\Text',
|
||||
'field_default' => NULL,
|
||||
'field_required' => TRUE,
|
||||
'field_extra' => array(),
|
||||
'field_hint' => \IPS\Member::loggedIn()->language()->addToStack('convert_ubbthreads_photo_path'),
|
||||
'field_validation' => function( $value ) { if ( !@is_dir( $value ) ) { throw new \DomainException( 'path_invalid' ); } },
|
||||
);
|
||||
|
||||
foreach( array( 'homepage', 'occupation', 'hobbies', 'location', 'icq', 'yahoo', 'aim', 'msn' ) AS $field )
|
||||
{
|
||||
\IPS\Member::loggedIn()->language()->words["field_{$field}"] = \IPS\Member::loggedIn()->language()->addToStack( 'pseudo_field', FALSE, array( 'sprintf' => $field ) );
|
||||
@@ -315,7 +350,7 @@ class _UBBthreads extends \IPS\convert\Software
|
||||
\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_rebuild_attachments" );
|
||||
}
|
||||
@@ -584,8 +619,16 @@ class _UBBthreads extends \IPS\convert\Software
|
||||
/* Profile photo */
|
||||
$profilePhotoName = NULL;
|
||||
$profilePhotoData = NULL;
|
||||
$profilePhotoPath = NULL;
|
||||
|
||||
if ( !empty( $row['USER_AVATAR'] ) AND ( $row['USER_AVATAR'] != 'http://' ) )
|
||||
/* Is it a file? */
|
||||
if( !empty( $row['USER_AVATAR'] ) AND mb_substr( $row['USER_AVATAR'], 0, 1 ) == '/' )
|
||||
{
|
||||
$profilePhotoPath = pathinfo( rtrim( $this->app->_session['more_info']['convertMembers']['photo_location'], '/' ) . $row['USER_AVATAR'], PATHINFO_DIRNAME );
|
||||
$profilePhotoName = pathinfo( rtrim( $this->app->_session['more_info']['convertMembers']['photo_location'], '/' ) . $row['USER_AVATAR'], PATHINFO_BASENAME );
|
||||
}
|
||||
/* Or an URL? */
|
||||
elseif ( !empty( $row['USER_AVATAR'] ) AND ( $row['USER_AVATAR'] != 'http://' ) AND mb_substr( $row['USER_AVATAR'], 0, 4 ) )
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -595,7 +638,7 @@ class _UBBthreads extends \IPS\convert\Software
|
||||
catch( \IPS\Http\Request\Exception $e ) { }
|
||||
}
|
||||
|
||||
$libraryClass->convertMember( $info, $pfields, $profilePhotoName, NULL, $profilePhotoData );
|
||||
$libraryClass->convertMember( $info, $pfields, $profilePhotoName, $profilePhotoPath, $profilePhotoData );
|
||||
$libraryClass->setLastKeyValue( $row['USER_ID'] );
|
||||
}
|
||||
}
|
||||
@@ -609,7 +652,7 @@ class _UBBthreads extends \IPS\convert\Software
|
||||
{
|
||||
$libraryClass = $this->getLibrary();
|
||||
|
||||
foreach ( $this->fetch( 'WATCH_LISTS', 'WATCH_ID', array( 'WATCH_TYPE=?', 'u' ), 'USER_ID ASC, WATCH_ID ASC' ) as $row )
|
||||
foreach ( $this->fetch( 'WATCH_LISTS', 'WATCH_ID', array( 'WATCH_TYPE=?', 'u' ) ) as $row )
|
||||
{
|
||||
$libraryClass->convertFollow( array(
|
||||
'follow_app' => 'core',
|
||||
@@ -769,7 +812,7 @@ class _UBBthreads extends \IPS\convert\Software
|
||||
$data = $this->app->getLink( (int) $matches[1], array( 'members', 'core_members' ) );
|
||||
$item = \IPS\Member::load( $data );
|
||||
|
||||
if( $item->canView() )
|
||||
if( \IPS\Member::loggedIn()->canAccessModule( \IPS\Application\Module::get( 'core', 'members' ) ) )
|
||||
{
|
||||
return $item->url();
|
||||
}
|
||||
@@ -782,4 +825,37 @@ class _UBBthreads extends \IPS\convert\Software
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Process a login
|
||||
*
|
||||
* @param \IPS\Member $member The member
|
||||
* @param string $password Password from form
|
||||
* @return bool
|
||||
*/
|
||||
public function login( $member, $password )
|
||||
{
|
||||
$hash = $member->members_pass_hash;
|
||||
$salt = $member->members_pass_salt;
|
||||
|
||||
if ( \IPS\Login::compareHashes( $hash, md5( $password ) ) )
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// Not using md5, UBB salts the password with the password
|
||||
// IPB already md5'd it though, *sigh*
|
||||
if ( \IPS\Login::compareHashes( $hash, md5( md5( $salt ) . crypt( $password, $password ) ) ) )
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// Now standard IPB check.
|
||||
if ( \IPS\Login::compareHashes( $hash, md5( md5( $salt ) . md5( $password ) ) ) )
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user