reading files all the time is a little slow, I also have a thing about ini files but in this case its probably just small scale,
I would store the channel names in this format. say the max level is 500 and min 1
500:#chan1 100:#chan2 50:#chan3
then you can use $wildtok to see if they have access on that channel. like:
$wildtok(500:#chan1 100:#chan2 50:#chan3,*:#chan3,1,32)
will return 50:#chan3 if you $gettok(50:#chan3,1,58) it will return the level.
Since you have a login system, and you only are connected as a client, so you can only see when people quit when you have common channels with them.
So you need to log them out some time. you would need to do that when they part the last common channel. or you see them quit.
Well mirc just has the very thing to let you do that.
/ialmark nick <text>
that will allow you to put text in the ial cache, it will stay even when they change nicks and it will be lost when they part the last common channel, which is good if you ask me, because that will be them logged out.
When they login i would mark the ial with either the username or all the channels and access levels they have.
you can get that info back with $ial(<nick>).mark
will probably be better if you keep that info in the ial cache because it's much faster than reading it from a file everytime.
You will also need to only allow them to login when they have a common channel with the bot, you can check if $comchan($nick,1) exists for that, $comchan($nick,0) would return the total common channels.