[OzzModz] Country Flags by IP Address

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

No permission to download
Possibly, but it is not something I have looked into as doing so would defeat the intention of the addon.
 
Correct. It is also in their best interest to work this way.

Say a user is from the USA, and they have some posts show up as them being from Bulgaria. Now that use sees that, and they know they were not there, then they know their account has been compromised.
 
Well yes, but that would not show the flags at all. Once they turn them back on, it would still show the flags from different countries.
 
But I thought it grabs the flags from the last login.
So, let's say I go on vacation to Sweden. Before I go I turn it off.
Then I go to Sweden, just write my posts like usually and then I return.
Now since I returned, I login to my account and turn it on again. So it should show now again my home's place, because I am logged in at home, so it should grab my IP at home.
 
I see. Well, that sucks then :D.
Well then I suggest having a feature "turn vacation mode on". If that is enabled by the user, then it no longer logs the location and displays a dummy flag chosen by the user, so it looks like one is still at home.
 
Okay, it does grab the flag at login, not post. But it is still recorded even if the user has it off.

Well then I suggest having a feature "turn vacation mode on". If that is enabled by the user, then it no longer logs the location and displays a dummy flag chosen by the user, so it looks like one is still at home.

I will add this to the wish list. Due note though, items on the wish list may or may not be added.
 
If it does grab it at login, then no need for the wish.
As I said, let the user turn it off before vacation and done.
 
If it does grab it at login, then no need for the wish.
As I said, let the user turn it off before vacation and done.

No, it still records their location at the time of login, even if the user has it off, it just don't display their flags.
 
I am not sure what you mean.
That the ip is recorded, that doesn't matter.
It is just about if one can not display the flag for a brief of time and later turn it on again, without showcasing the place one was.
 
When a user logs in, their location and flag are recorded even if they have it off in their privacy settings. Turning it back on displays the flags.
 
  • Like
Reactions: sbj
I thought when you said "Okay, it does grab the flag at login, ", it means the location and flag are recorded, but the records come from the last login date and not from the post date.

So If I were in Sweden for the last 30 days, and turn it off, yes, it records me being in Sweden but since the flag is not displayed, it is not shown.
And once I come back, now I login, now all the last 30 days will show my current location of Tunisia, because it grabs from my last login place, which is now at home in Tunisia for example. So it wipes all the records from previous dates as it only grabs it from the place from last login.
 
I thought when you said "Okay, it does grab the flag at login, ", it means the location and flag are recorded, but the records come from the last login date and not from the post date.

So If I were in Sweden for the last 30 days, and turn it off, yes, it records me being in Sweden but since the flag is not displayed, it is not shown.
And once I come back, now I login, now all the last 30 days will show my current location of Tunisia, because it grabs from my last login place, which is now at home in Tunisia for example. So it wipes all the records from previous dates as it only grabs it from the place from last login.

Okay, it seems that this would work. I never thought of it that way.

Nice catch. :)
 
  • Like
Reactions: sbj
Just be sure you make it an option for the admins to allow members to use "vacation mode". There are many admins that don't allow their members to change countries at all without triggering an investigation on their system. And it would defeat that purpose.
 
Hey @ozzy47 or @Snog --

Some weeks ago I had changed the ownership (chown) on some of my Xenforo directories, and once a month (at update time) I am getting the following error when the Flags add-on tries to update:

[*]ErrorException: [E_WARNING] file_put_contents(/var/www/html/500eboard.co/public_html/forums/data/countryflags/cloudflare_cookie.txt): failed to open stream: Permission denied [*]src/vendor/guzzlehttp/guzzle/src/Cookie/FileCookieJar.php:59 [*]Generated by: Unknown account [*]Oct 15, 2019 at 12:00 AM [SIZE=5][B]Stack trace[/B][/SIZE] #0 [internal function]: XF::handlePhpError(2, '[E_WARNING] fil...', '/var/www/html/5...', 59, Array) #1 src/vendor/guzzlehttp/guzzle/src/Cookie/FileCookieJar.php(59): file_put_contents('/var/www/html/5...', '[{"Name":"__cfd...') #2 src/vendor/guzzlehttp/guzzle/src/Cookie/FileCookieJar.php(39): GuzzleHttp\Cookie\FileCookieJar->save('/var/www/html/5...') #3 src/addons/Snog/Flags/Cron/Maxmind.php(63): GuzzleHttp\Cookie\FileCookieJar->__destruct() #4 [internal function]: Snog\Flags\Cron\Maxmind::Update(Object(XF\Entity\CronEntry)) #5 src/XF/Job/Cron.php(34): call_user_func(Array, Object(XF\Entity\CronEntry)) #6 src/XF/Job/Manager.php(253): XF\Job\Cron->run(G) #7 src/XF/Job/Manager.php(195): XF\Job\Manager->runJobInternal(Array, G) #8 src/XF/Job/Manager.php(79): XF\Job\Manager->runJobEntry(Array, G) #9 job.php(42): XF\Job\Manager->runQueue(false, 8) #10 {main}

What does the ownership of the file need to be? Or what user should I change it to (as compared to other XenForo directories)? Any thoughts?

Cheers,
Gerry
 
SBJ is correct. The data directory and all of it's subdirectories should be world writable.

The owner of the folders and files should be whatever user your PHP installation runs as.

The ONLY time you can get away with permissions other than 777 is when your PHP installation for your site runs as a unique user on your server (note that www-data or some such user is not usually a unique user/group). Such as, on one of my sites the owner is WEB2 and the group is CLIENT0. So I can get away with 755 on the directories and 644 for files.

myperms.png
 
Last edited:
Top Bottom