miniorange 2FA extension Topic is solved

This forum is for general questions about extensions for Joomla! 4.x.

Moderators: pe7er, General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Post Reply
gchamp
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Tue Dec 06, 2022 1:22 am

miniorange 2FA extension

Post by gchamp » Tue Dec 06, 2022 2:11 am

For some reason, after I installed Two-Factor Authentication for Joomla, It gives me an error Undefined constant "php".
shot2.png
shot1.png
This is a screenshot of the Debug. I don't know what's going on, this is my first and only extension and I am using a new site I created on Joomla 4.2.5
You do not have the required permissions to view the files attached to this post.

User avatar
toivo
Joomla! Master
Joomla! Master
Posts: 15491
Joined: Thu Feb 15, 2007 5:48 am
Location: Sydney, Australia

Re: miniorange 2FA extension

Post by toivo » Tue Dec 06, 2022 3:05 am

Welcome to the Joomla support forum!

Did you install the latest version, Two Factor Authentication 2FA for Joomla v3.0.0, updated in August 2022?

In version 3.0.0 of the component com_miniorange_2fa line 3221 of the file default.php has been commented out, as shown below, and therefore that line cannot trigger the error shown in the screenshot, Undefined constant "php"

Code: Select all

<!-- <input type="checkbox" <?php//echo $featureDisable ?> <?php// echo $inlineDisabled;?> name="login_with_second_factor_only" <?php //echo $login_with_second_factor_only;?> /> -->
Just installed this extension and accessed 'Advance Settings' of the component using Joomla 4.2.6-dev and PHP 8.1.10 without any issues.
Toivo Talikka, Global Moderator

gchamp
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Tue Dec 06, 2022 1:22 am

Re: miniorange 2FA extension

Post by gchamp » Wed Dec 07, 2022 2:51 am

Hello sorry for the late response was not expecting something that quickly. I have version 3.0.0 installed but I keep getting that error. I do not have the dev version of Joomla so what can I do to comment that line out and fix this error

User avatar
toivo
Joomla! Master
Joomla! Master
Posts: 15491
Joined: Thu Feb 15, 2007 5:48 am
Location: Sydney, Australia

Re: miniorange 2FA extension

Post by toivo » Wed Dec 07, 2022 3:39 am

I do not think that Joomla 4.2.6-dev would be any different from Joomla 4.2.5 in terms of PHP code, as long as PHP has been configured all right.

Please copy and paste the contents of the line 3221 from the file administrator/components/com_miniorange_twofa/views/account_setup/tmpl/default.php.
Toivo Talikka, Global Moderator

gchamp
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Tue Dec 06, 2022 1:22 am

Re: miniorange 2FA extension

Post by gchamp » Wed Dec 07, 2022 4:31 pm

I am sorry I have little idea what you are talking about. I do not know how to access that file and I know only a little bit of PHP. I tried putting that file path in my browser and the only thing I got was a blank page

User avatar
toivo
Joomla! Master
Joomla! Master
Posts: 15491
Joined: Thu Feb 15, 2007 5:48 am
Location: Sydney, Australia

Re: miniorange 2FA extension

Post by toivo » Wed Dec 07, 2022 7:42 pm

Go to the cPanel or a similar page provided by your host and use the File Manager to locate the file and download it to your workstation. Then use an editor, for example Notepad++ to locate line 3221.
Toivo Talikka, Global Moderator

gchamp
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Tue Dec 06, 2022 1:22 am

Re: miniorange 2FA extension

Post by gchamp » Wed Dec 07, 2022 9:47 pm

I finally got access to it and found the line. It was exactly the same as line you showed me.

Code: Select all

<!-- <input type="checkbox" <?php//echo $featureDisable ?> <?php// echo $inlineDisabled;?> name="login_with_second_factor_only" <?php //echo $login_with_second_factor_only;?> /> -->
I don't know why the site was reading a comment line but I ended up deleting it and all of sudden the plugin works now. Thank you for your help.

User avatar
toivo
Joomla! Master
Joomla! Master
Posts: 15491
Joined: Thu Feb 15, 2007 5:48 am
Location: Sydney, Australia

Re: miniorange 2FA extension

Post by toivo » Wed Dec 07, 2022 9:58 pm

Good that you managed to sort it out. What a weird error indeed. Possibly the comment // was not recognised by the PHP interpreter because there was no space between '<?php' and '//'. My test in PHP 8.1.10 did not report an error from that string.
Toivo Talikka, Global Moderator


Post Reply

Return to “Extensions for Joomla! 4.x”