News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Need a serious help

Started by crashedanon, July 14, 2022, 02:40:26 AM

Previous topic - Next topic

crashedanon

I want to let users who register to my specific SMF should be able to do so only with a specific email [ eg of an organization/college ending with their own specific domain; eg: [email protected]] all others trying to register using another email should be prohibited, where can I change the specific settings for the same?


Dzonny

Hello there and welcome to SMF! :)

Which SMF version are you using?

Maybe this would do the trick (if you're using 1.1.x or 2.0.x versions):
https://custom.simplemachines.org/index.php?mod=1493

crashedanon

Quote from: Dzonny on July 14, 2022, 03:10:36 AMHello there and welcome to SMF! :)

Which SMF version are you using?

Maybe this would do the trick (if you're using 1.1.x or 2.0.x versions):
https://custom.simplemachines.org/index.php?mod=1493

Using Version 2.0

Dzonny

In that case feel free to check the linked mod, and let us know if that helped :)

crashedanon

I do not understand how it works, the zip file is going outta my head, please guide on how to get started. Thanks

crashedanon

Quote from: Dzonny on July 14, 2022, 04:38:24 AMIn that case feel free to check the linked mod, and let us know if that helped :)

Got it, But it says it is highly risky and recommended that I should not proceed



What should I do?

Kindred

Do you mean that, when you attempt to install the mod, using the package manager, you get a warning that the mod can not fully install because the system was unable to complete some of the automated changes?

If so, see the faq on "errors during mod installation"
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

crashedanon

Quote from: Kindred on July 14, 2022, 06:37:10 AMIf so, see the faq on "errors during mod installation"

Read, cannot find relevant help. Although I tried this process on localhost and to my surprise, it is installed without any problem but the function of the mod is not at all working. Any other possible solutions to this problem

Kindred

Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

crashedanon

Quote from: Kindred on July 14, 2022, 08:19:16 AMhttps://wiki.simplemachines.org/smf/Error_in_mod_installation

Thank you, it works, I went through the lines to be added and replaced and it's done. however, Now i need to change the custom error message displayed. Any suggestions on where to start finding it?

Doug Heffernan

Quote from: crashedanon on July 14, 2022, 08:57:19 AMhowever, Now i need to change the custom error message displayed. Any suggestions on where to start finding it?

You can change that at the mod 's language file.

crashedanon

Quote from: Doug Heffernan on July 14, 2022, 09:09:21 AM
Quote from: crashedanon on July 14, 2022, 08:57:19 AMhowever, Now i need to change the custom error message displayed. Any suggestions on where to start finding it?

You can change that at the mod 's language file.


Done, works smooth, However new challenge arises when the user tries to change it's email it doesn't restrict there, when I changed the code there too:

        return 'bad_email';

        // Lets restrict some email providers
        if (!empty($modSettings['enable_restrict_EmailProvider']))
        {
                if (!empty($modSettings['restricted_provider']))
                {
                        $restricted_provider = explode(",", preg_replace("/(\@[^a-zA-Z0-9,])/", "", $modSettings['restricted_provider']));

                        foreach ($restricted_provider as $key => $value)
                                if (empty($value))
                                        unset($restricted_provider[$key]);
                }
                else
                        $restricted_provider = array();

                foreach($restricted_provider as $provider)
                {
                        preg_match('/' . $provider . '+/i', $email, $matches);

                        if(count($matches) > 0)
                        {
                                fatal_error(sprintf($txt['restricted']), false);
                        }
                }
        }


It says says $txt is not defined: you can find $txt on the last few lines

Doug Heffernan

Quote from: crashedanon on July 14, 2022, 09:31:29 AM
Quote from: Doug Heffernan on July 14, 2022, 09:09:21 AM
Quote from: crashedanon on July 14, 2022, 08:57:19 AMhowever, Now i need to change the custom error message displayed. Any suggestions on where to start finding it?

You can change that at the mod 's language file.


Done, works smooth, However new challenge arises when the user tries to change it's email it doesn't restrict there, when I changed the code there too:

        return 'bad_email';

        // Lets restrict some email providers
        if (!empty($modSettings['enable_restrict_EmailProvider']))
        {
                if (!empty($modSettings['restricted_provider']))
                {
                        $restricted_provider = explode(",", preg_replace("/(\@[^a-zA-Z0-9,])/", "", $modSettings['restricted_provider']));

                        foreach ($restricted_provider as $key => $value)
                                if (empty($value))
                                        unset($restricted_provider[$key]);
                }
                else
                        $restricted_provider = array();

                foreach($restricted_provider as $provider)
                {
                        preg_match('/' . $provider . '+/i', $email, $matches);

                        if(count($matches) > 0)
                        {
                                fatal_error(sprintf($txt['restricted']), false);
                        }
                }
        }


It says says $txt is not defined: you can find $txt on the last few lines

I am not familiar with the mod in question. Anyways, all questions about third party mods and themes should be posted in their support topics. In this case it would be here:

https://www.simplemachines.org/community/index.php?topic=274317.0

crashedanon

QuoteI am not familiar with the mod in question. Anyways, all questions about third party mods and themes should be posted in their support topics. In this case it would be here:

https://www.simplemachines.org/community/index.php?topic=274317.0

The support is too old to be noticed and the author no longer updates the product, particularly I am willing to find some clues and I think it would be more reachable here. I am close enough to fix the last few errors and make it compatible.

Advertisement: