News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Elarkte Password support for SMF 2.0

Started by vbgamer45, April 01, 2019, 10:11:59 PM

Previous topic - Next topic

vbgamer45

Here is a script to use Elkarte 1.1x passwords in SMF 2.0.x

Open Sources/LogInOut.php

Find

elseif (strlen($user_settings['passwd']) == 40)
{
// Maybe they are using a hash from before the password fix.
$other_passwords[] = sha1(strtolower($user_settings['member_name']) . un_htmlspecialchars($_POST['passwrd']));

// BurningBoard3 style of hashing.
$other_passwords[] = sha1($user_settings['password_salt'] . sha1($user_settings['password_salt'] . sha1($_POST['passwrd'])));

// Perhaps we converted to UTF-8 and have a valid password being hashed differently.
if ($context['character_set'] == 'UTF-8' && !empty($modSettings['previousCharacterSet']) && $modSettings['previousCharacterSet'] != 'utf8')
{
// Try iconv first, for no particular reason.
if (function_exists('iconv'))
$other_passwords['iconv'] = sha1(strtolower(iconv('UTF-8', $modSettings['previousCharacterSet'], $user_settings['member_name'])) . un_htmlspecialchars(iconv('UTF-8', $modSettings['previousCharacterSet'], $_POST['passwrd'])));

// Say it aint so, iconv failed!
if (empty($other_passwords['iconv']) && function_exists('mb_convert_encoding'))
$other_passwords[] = sha1(strtolower(mb_convert_encoding($user_settings['member_name'], 'UTF-8', $modSettings['previousCharacterSet'])) . un_htmlspecialchars(mb_convert_encoding($_POST['passwrd'], 'UTF-8', $modSettings['previousCharacterSet'])));
}
}

Add after

elseif (strlen($user_settings['passwd']) == 60)
{
$other_passwords[] = validateLoginPasswordElkarte($_POST['passwrd'], $user_settings['passwd'],$user_settings['member_name']);

}


Find at the end of the and add before ?>

function validateLoginPasswordElkarte(&$password, $hash, $user = '', $returnhash = false)
{
    global $smcFunc, $sourcedir;

// Our hashing controller
require_once($sourcedir . '/PasswordHash.php');

// Base-2 logarithm of the iteration count used for password stretching, the
// higher the number the more secure and CPU time consuming
$hash_cost_log2 = 10;

// Do we require the hashes to be portable to older systems (less secure)?
$hash_portable = false;

// Get an instance of the hasher
$hasher = new PasswordHash($hash_cost_log2, $hash_portable);

// If the password is not 64 characters, lets make it a (SHA-256)
if (strlen($password) !== 64)
$password = hash('sha256', $smcFunc['strtolower']($user) . un_htmlspecialchars($password));

// They need a password hash, something to save in the db?
if ($returnhash)
{
$passhash = $hasher->HashPassword($password);

// Something is not right, we can not generate a valid hash that's <20 characters
if (strlen($passhash) < 20)
$passhash = false;
}
// Or doing a password check?
else
$passhash = (bool) $hasher->CheckPassword($password, $hash);

unset($hasher);

return $passhash;
}




Then Copy attached PasswordHash.php to the Sources folder
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

gevv

Hello,

Is there a converter from elkarte 1.1.6 to smf?
ElkArte is a modern, powerful community building forum software. https://www.elkarte.net/

vbgamer45

Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

gevv

Thanks  @vbgamer45

I tried it gave an error in the member groups.

Importing settings... ✔
Importing members... ✔
Importing categories... ✔
Importing boards... ✔
Importing topics... ✔
Importing messages... ✔
Importing polls... ✔
Importing poll choices... ✔
Importing poll votes... ✔
Importing personal messages... ✔
Importing pm recipients... ✔
Importing pm rules... ✔
Importing board moderators... ✔
Importing mark read data (boards)... ✔
Importing mark read data (topics)... ✔
Importing mark read data... ✔
Importing notifications... ✔
Importing membergroups...
Unsuccessful!
This query:

    REPLACE INTO `smf`.smf_membergroups
    (id_group, group_name, description, online_color, min_posts, max_messages, stars, group_type, hidden, id_parent)
    VALUES ('1', 'Yönetici', '', '#E1332D', '-1', '0', '5#iconadmin.png', '0', '0', '-2'),
    ('2', 'Genel Moderatör', '', '#0000FF', '-1', '0', '5#icongmod.png', '0', '0', '-2'),
    ('3', 'Moderatör', '', '', '-1', '0', '5#iconmod.png', '0', '0', '-2'),
    ('4', 'Yeni Üye', '', '', '0', '0', '1#icon.png', '0', '0', '-2'),
    ('5', 'Üye', '', '', '6', '0', '2#icon.png', '0', '0', '-2'),
    ('6', 'Tam Üye', '', '', '100', '0', '3#icon.png', '0', '0', '-2'),
    ('7', 'Kıdemli Üye', '', '', '250', '0', '4#icon.png', '0', '0', '-2'),
    ('8', 'Kahraman Üye', '', '', '500', '0', '5#icon.png', '0', '0', '-2');

Caused the error:

    Unknown column 'stars' in 'field list'

Line: 117
File: C:\wamp64\www\op\OpenImporter\Database.php

Unsuccessful!
This query:

    REPLACE INTO `smf`.smf_membergroups
    (id_group, group_name, description, online_color, min_posts, max_messages, stars, group_type, hidden, id_parent)
    VALUES ('1', 'Yönetici', '', '#E1332D', '-1', '0', '5#iconadmin.png', '0', '0', '-2'),
    ('2', 'Genel Moderatör', '', '#0000FF', '-1', '0', '5#icongmod.png', '0', '0', '-2'),
    ('3', 'Moderatör', '', '', '-1', '0', '5#iconmod.png', '0', '0', '-2'),
    ('4', 'Yeni Üye', '', '', '0', '0', '1#icon.png', '0', '0', '-2'),
    ('5', 'Üye', '', '', '6', '0', '2#icon.png', '0', '0', '-2'),
    ('6', 'Tam Üye', '', '', '100', '0', '3#icon.png', '0', '0', '-2'),
    ('7', 'Kıdemli Üye', '', '', '250', '0', '4#icon.png', '0', '0', '-2'),
    ('8', 'Kahraman Üye', '', '', '500', '0', '5#icon.png', '0', '0', '-2');

Caused the error:

    Unknown column 'stars' in 'field list'
ElkArte is a modern, powerful community building forum software. https://www.elkarte.net/

vbgamer45

Your smf membergroups table is missing the stars column for some reason... Add it to the table
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

gevv

my fault i installed smf 2.1 but there was smf 2.0 support

I'm trying to install smf 2.0

thanks
ElkArte is a modern, powerful community building forum software. https://www.elkarte.net/

gevv

#6
error occurred during the conversion of attachments  (in the last moments)


Message: Trying to get property of non-object
Trace: Trying to get property of non-object
Line: 499
File: /op/OpenImporter/Importer.php
Message: Invalid argument supplied for foreach()
Trace: Invalid argument supplied for foreach()
Line: 499
File: //op/OpenImporter/Importer.php

Fatal error: Class '_step1' not found in /op/OpenImporter/Importer.php on line 533



+ Completed files return error 404 - Attachment Not Found


smf 2.0 admin Attachment Settings   "Attachments directory"   recorded as below. How should I arrange?

Path;

a:51:{i:1;s:54:"/SITE/public_html/smf/attachments/attachments";i:2;s:50:"/SITE/public_html/smf/attachments/2016/11";i:3;s:50:"/SITE/public_html/smf/attachments/2016/12";i:4;s:50:"/SITE/public_html/smf/attachments/2017/01";i:5;s:50:"/SITE/public_html/smf/attachments/2017/02";i:6;s:50:"/SITE/public_html/smf/attachments/2017/03";i:7;s:50:"/SITE/public_html/smf/attachments/2017/04";i:8;s:50:"/SITE/public_html/smf/attachments/2017/05";i:9;s:50:"/SITE/public_html/smf/attachments/2017/06";i:10;s:50:"/SITE/public_html/smf/attachments/2017/07";i:11;s:50:"/SITE/public_html/smf/attachments/2017/08";i:12;s:50:"/SITE/public_html/smf/attachments/2017/09";i:13;s:50:"/SITE/public_html/smf/attachments/2017/10";i:14;s:50:"/SITE/public_html/smf/attachments/2017/11";i:15;s:50:"/SITE/public_html/smf/attachments/2017/12";i:16;s:50:"/SITE/public_html/smf/attachments/2018/01";i:17;s:50:"/SITE/public_html/smf/attachments/2018/02";i:18;s:50:"/SITE/public_html/smf/attachments/2018/03";i:19;s:50:"/SITE/public_html/smf/attachments/2018/04";i:20;s:50:"/SITE/public_html/smf/attachments/2018/05";i:21;s:50:"/SITE/public_html/smf/attachments/2018/06";i:22;s:50:"/SITE/public_html/smf/attachments/2018/07";i:23;s:50:"/SITE/public_html/smf/attachments/2018/08";i:24;s:50:"/SITE/public_html/smf/attachments/2018/09";i:25;s:50:"/SITE/public_html/smf/attachments/2018/10";i:26;s:50:"/SITE/public_html/smf/attachments/2018/11";i:27;s:50:"/SITE/public_html/smf/attachments/2018/12";i:28;s:50:"/SITE/public_html/smf/attachments/2019/01";i:29;s:50:"/SITE/public_html/smf/attachments/2019/02";i:30;s:50:"/SITE/public_html/smf/attachments/2019/03";i:31;s:50:"/SITE/public_html/smf/attachments/2019/04";i:32;s:50:"/SITE/public_html/smf/attachments/2019/05";i:33;s:50:"/SITE/public_html/smf/attachments/2019/06";i:34;s:50:"/SITE/public_html/smf/attachments/2019/07";i:35;s:50:"/SITE/public_html/smf/attachments/2019/08";i:36;s:50:"/SITE/public_html/smf/attachments/2019/09";i:37;s:50:"/SITE/public_html/smf/attachments/2019/10";i:38;s:50:"/SITE/public_html/smf/attachments/2019/11";i:39;s:50:"/SITE/public_html/smf/attachments/2019/12";i:40;s:50:"/SITE/public_html/smf/attachments/2020/01";i:41;s:50:"/SITE/public_html/smf/attachments/2020/02";i:42;s:50:"/SITE/public_html/smf/attachments/2020/03";i:43;s:50:"/SITE/public_html/smf/attachments/2020/04";i:44;s:50:"/SITE/public_html/smf/attachments/2020/05";i:45;s:50:"/SITE/public_html/smf/attachments/2020/06";i:46;s:50:"/SITE/public_html/smf/attachments/2020/07";i:47;s:50:"/SITE/public_html/smf/attachments/2020/08";i:48;s:50:"/SITE/public_html/smf/attachments/2020/09";i:49;s:50:"/SITE/public_html/smf/attachments/2020/10";i:50;s:50:"/SITE/public_html/smf/attachments/2020/11";i:51;s:50:"/SITE/public_html/smf/attachments/2020/12";}


My elkarte Attachment Settings; Choose the mode of management of the add-on folders   "(automatic) separate by year and month"
ElkArte is a modern, powerful community building forum software. https://www.elkarte.net/

vbgamer45

Hmm give this a shot

Copy to
openimporter\importer\Importers\smf2.0
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

gevv

I tried again with the new file gave an error


Fatal error: Cannot redeclare moveAttachment() (previously declared in //op/Importers/smf2.0/elkarte1-1_importer.php:106) in //op/Importers/smf2.0/smf2.0_importer.php on line 201
ElkArte is a modern, powerful community building forum software. https://www.elkarte.net/

vbgamer45

Skip the file post. Your attachments directory serialzations are corrupt... Which is why it failed.
For instance this part
s:50:"/SITE/public_html/smf/attachments/2016/11";
Is supposed to 50 characters in quotes it is 41 instead.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

gevv

Hello,

I started again. I moved the attachments  from the elk. admin panel to the attachment folder, I run the import 

failed in attachments transfer


https://site.com/import.php?step=1&substep=33&start=1500


Importing...

Message: Trying to get property of non-object
Trace: Trying to get property of non-object
Line: 499
File: //OpenImporter/Importer.php
Message: Invalid argument supplied for foreach()
Trace: Invalid argument supplied for foreach()
Line: 499
File: //OpenImporter/Importer.php

Fatal error: Class '_step1' not found in //OpenImporter/Importer.php on line 533
ElkArte is a modern, powerful community building forum software. https://www.elkarte.net/

vbgamer45

Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

gevv

ElkArte is a modern, powerful community building forum software. https://www.elkarte.net/

gevv

I can change the php version
php version should I use?   7, 7.4
ElkArte is a modern, powerful community building forum software. https://www.elkarte.net/

vbgamer45

I would have to do some testing. Can you provide a sample db/attachments.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

gevv

Hello @vbgamer45 ,

I wonder if there is any improvement

Thanks
ElkArte is a modern, powerful community building forum software. https://www.elkarte.net/

gevv

Hello @vbgamer45 ,

I tried localhost, it was successful.

All attachments data loaded did not fail, but does not convert attacments.

I manually deleted the file extensions name attachments (bat file; rename *.elk *.)   and re upload server

Convert  completed Thanks.
ElkArte is a modern, powerful community building forum software. https://www.elkarte.net/

vbgamer45

Glad you got it working! Strange worked on localhost.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

gevv

@vbgamer45


Valid for elarkte password support for SMF 2.1 RC3?

I'm getting a token error
ElkArte is a modern, powerful community building forum software. https://www.elkarte.net/

vbgamer45

Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Advertisement: