News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Add Two-Factor Authenticationusing TOTP protocol

Started by johnice32, April 05, 2020, 01:24:02 PM

Previous topic - Next topic

johnice32

Hi,

I am aware that SMF 2.1 has two-factor authentication using TOTP but I want to implement the same option in SMF 2.0.1 because I prefer not to use in production a version that has not an official stable candidate. For that I have been checking the files related to that function in SMF 2.1: github [DOT] com/SimpleMachines/SMF2.1/pull/2547/files and include them in SMF 2.0.1 After doing all the modifcations to the code and database I went to my profile to setup 2fa but then I got the following error: [error] 26834#0: *504 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Cannot redeclare loadCustomFields() (previously declared in /usr/share/nginx/html/smf/Sources/Profile.php:670) in /usr/share/nginx/html/smf/Sources/Class-TOTP.php on line 660" while reading response header from upstream Although I installed some mods and did really smalls modifications in the past to SMF, this is the first time that I do a "big" modification to SMFs code. If someone can help me to achieve it, I would be grateful :)

Thanks

Shambles

So, that error message is hinting that function loadCustomFields() is being declared in two scripts, yet Class-TOTP.php doesn't declare it or even have 660 lines.

So, what does your version of Class-TOTP.php actually contain?

johnice32

Thanks for your reply, I really do not know how I have the wrong content in Class-TOTP.php I must be really tired when I did it... I put the right content now and all is working. Thanks! If I face any other issue I will post it

Advertisement: