Global functions doesnt work in Hotspot - user Profile - on login script

Hello All!

Few days ago i've update from 7.21.3 to 7.24.1 stable on hap ac2.

i have on-login script in hotspot - user profiles:

{ 

    :global pHSUserOnLogin

    $pHSUserOnLogin $user $"mac-address"

}

After update I've noticed that my on-login script dont work properly.
I make diagnostic and find out that now on-login script dont see global functions a variables(my on-login script call global function).
It worked good few days before, but now dont.

Also i noticed that script/environment doesnt consists user for any environment.

I find very old topic with similar issues

What is this? which behavior is normal: old one or new?

Thanks in advance!

(moved on next post)

since you not put pHSUserOnLogin on forum,
and you can read the other post you linked,
it's nothing more to add, the solution is already defined in the other topic.


BUT...


Use your brain:
If when you launch a script the couter of "Run Count" increase...
`/system script run scriptForRunCount'

Just count on this way how many times users login... NO?
:laughing:

Hello @rextended,

do you have further information about to handle global vars, created by a user owned script and read them while triggered through ppp/dhcp/hotspot as this seems to be the user sys.

Because i have also some trouble with reading global vars. Strangly some work and some don't.

Some kind of hint would be appreciated, your posts helped me a lot the last years.

Thank you

the user actually is unnamed/"undefined" on 7.24.1 and is impossible to handle (no *sys) [BUG?]

you must use a ramdisk and store var inside file, for not write on disk
or use layer7 useless filters, etc. as posted on other topics.

I did several tests today in the 7.24.1 hotspot, but I didn't solve anything.

Yeah i understand the file based workaround, that would be a mass of work but i think i could get something done.

I've seen this problem since 7.24, did only a short test with 7.24.1 today and then a downgrade to 7.23.3 where everything works as expected.

Thank you

Thanks guys for your reply!

Yeah! It's something wrong with this firmware. I will try to do the same(downgrade to version you're mentioned):+1:

I just need to find confirmation of the same issue as mine.

Thanks!!!!

Hello!

pHSUserOnLogin is just global function nothing more. It should save params in {"Mac":{"username"=$user;hostname="..."}}. It's worked 2 months since I did it. But now something is going wrong.

I'm not sure, that update causes this issue. If not the case, then what difference between old behavior and current. It's really strange.

Solution in the topic I found, it's too complicated (I can make it, but it is wrong: onlogin->file->run script which read file). I dont want to make deal with this.

The Question is if this worked well just one week ago, maybe it's better to understand what real difference is and how to run onLogin l(or defining global functions) correctly, as it was running before.

Can you give ideas what might be the cause of running before?

.....

In case of any "worked in version x and now broken in y" and nothing obvious in changelog or release topics, then I would rather contact MikroTik support. They break it, they either need to fix it or provide proper changelog. RouterOS is a commercial project and no open source hobbyist side-project. Focus should be stability and reliability. Not breaking peoples existing scripts without announcement. But sometimes the developers at MikroTik make slight changes which impact a dozen of other areas. But they are not aware, because they don't have tests. And that's why customers need to report these bugs, so MikroTik can fix them. But sometimes these bugs return, because Mikrotik does not add tests to avoid regressions. It is a loop.

not?
https://forum.mikrotik.com
:sweat_smile:

I'm newbe on this forum. I thought that support also read this. Do I need to send it somewhere else this (seems to be) bug?

The info is part of every RouterOS release notes:

finnaly i downgrade to 7.23.3 and this issue gone! I've sent bug report to support for this issue. Hope they fix it soon

Thanks guys! :confetti_ball::partying_face::tada: