[OzzModz] Country Flags by IP Address

[OzzModz] Country Flags by IP Address 2.2.1 Patch Level 3

No permission to download
1684947642656.png


Xenforo needs you to have those two directories data and internal_data (and everything inside) to be fully accessible, which means 777 or 0777. Not just for this addon, for everything.

An easy way to do is to open FileZilla (or any other SFTP software you can install on your Windows/Apple/Linux machines. Then you connect to your server with your admin password and ip. Then you navigate to that directory and do a right click on that directory and you can enter the permissions as numbers or just tick the boxes. In my screenshot below you can see it. I forgot to check the "recurse into subdirectories" checkbox which you should do so all sub-folders below it also gets the 777 permission.

1684947978018.png
 
Last edited:
Isn't that a security vulnerability then?
That is a requirement so you can run XenForo. I literally linked the section from the official XF manual. No, it is not a security vulnerability. Who installed your XF for you? This should have been the case from the begin when you installed XF.
 
View attachment 286397


Xenforo needs you to have those two directories data and internal_data (and everything inside) to be fully accessible, which means 777 or 0777. Not just for this addon, for everything.

An easy way to do is to open FileZilla (or any other SFTP software you can install on your Windows/Apple/Linux machines. Then you connect to your server with your admin password and ip. Then you navigate to that directory and do a right click on that directory and you can enter the permissions as numbers or just tick the boxes. In my screenshot below you can see it. I forgot to check the "recurse into subdirectories" checkbox which you should do so all sub-folders below it also gets the 777 permission.

View attachment 286398
Yes I know. That's not the problem ;)
 
Some files in this directory do not have 755.
If I now set everything to 777, do I get problems?

eg.:
internal_data/image_cache/0/blabla.data have 644
or
Auswahl_002.png
 
I already provided a link from the official XF manual.

If you want to be 100% sure, create a ticket and ask XF what the official policy is. Or maybe we get a public answer from @Brogan. But again, this is on you, this has nothing to do with the addon.

In any case, the .data stuff are your attachments. Not sure what kind of attachments you allow your forum to upload, but generally speaking jpeg, png, pdf, mp3, mp4 attachments should not be able to run executables. And if you don't trust addon devs, don't install the addons.
 
"And if you don't trust addon devs, don't install the addons." >> This has nothing to do with the trust in the addons!
I just don't want to make my forum unsafe.
The XF installer has assigned these rights itself.
I trusted the installer.

And this discussion here will surely help other users with the same problem as well.
 
Last edited:
Could I make a suggestion please?
For people using Cloudflare, use the Country code header instead of calling the Maxmind api to improve performance?
Check
$_SERVER["HTTP_CF_IPCOUNTRY"]
and if it exists, use it and bypass your existing code for getting the IP?
We do this for our location check in our competitions addon.
Thanks for considering.
 
@Ozzy47 Could you add the option to show the flag in a few additional places? For example, seeing a flag in Approval queue would be very helpful.

Also, being able to view flags in Member List and to search members by country, similar to how threads can be searched by country right now. This would be useful both in the frontend and in the admin panel.
 
Last edited:
I lost all users' flag history after upgrading from XenForo 1.5 to 2.2. Is that expected behavior? Can any steps be taken manually to get that history back? For example, importing certain MySQL field values from the old database into the new one.
 
Could I make a suggestion please?
For people using Cloudflare, use the Country code header instead of calling the Maxmind api to improve performance?
Check
$_SERVER["HTTP_CF_IPCOUNTRY"]
and if it exists, use it and bypass your existing code for getting the IP?
We do this for our location check in our competitions addon.
Thanks for considering.
Any chance of implementing this please?
Also for solutions where there is a small avatar, the flag is displaced in to the message
1.webp

Should flags in solution type posts use .userflag-s rather than userflag-m ?
This would fix it
CSS:
.message.message--simple .userflag-m {
    top: calc(56px - 17px);
    left: calc(56px - 27px);
}

Look forward to an update.
Many thanks.
 
Thanks much for this Add-On, I've been running it without errors for a long time until today.

I recently updated XF to 2.2.13 and [OzzModz] Country Flags by IP Address to 2.2.0 Patch Level 4 and have a new error appearing in the ACP:

  • ErrorException: Template error: [E_WARNING] Attempt to read property "snog_flag" on null
  • internal_data/code_cache/templates/l1/s7/public/xfrm_resource_wrapper_macros.php:34
Looks like it might have something to do with the Resource Manager?
 
Top Bottom