This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

channel list

Old posts that have not been replied to for several years.
Locked
s
simonbell
Halfop
Posts: 68
Joined: Mon Aug 05, 2002 8:07 pm
Location: Washington, England
Contact:

channel list

Post by simonbell »

Hi

is there any way to retrieve a list of channels a user has access in from the userfile in the same way that information can be retrieved using the getuser command. Ive looked through tcl-commands.doc and it appears i can only check whether a user is on the access list of each channel individually.

thanks
Simon
t
tainted
Master
Posts: 239
Joined: Sun May 12, 2002 8:00 pm
Location: chicago
Contact:

Post by tainted »

Try a foreach statement with that. Might not be exactly what you are looking for, but should do the trick none the less.
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

You would have to do them individualy.

However, the foreach can be used to loop through them like this.

somthing like

Code: Select all

proc chanaccess {hand} {
  set a [list]
  foreach ch [channels] {
    switch -- [chattr $hand {} $ch] {
      "*" { return -1 }
      default { lappend a $ch }
    }
  }
  return $a
}
That will return a list of channels that a user has flags on. If the user does not exist, it returns -1.

It can be quicly addapted to check for certain flags.

It all depends what you constitute as access.
s
simonbell
Halfop
Posts: 68
Joined: Mon Aug 05, 2002 8:07 pm
Location: Washington, England
Contact:

Post by simonbell »

Hi, thanks, access to the channel in this case would mean having either of following flags for the specific channel.

n m o l v

how would the script be modified to accomodate this?

thanks
Simon
s
simonbell
Halfop
Posts: 68
Joined: Mon Aug 05, 2002 8:07 pm
Location: Washington, England
Contact:

Post by simonbell »

Actually, i just implemented that script which im guessing would work with any channel or global flags at all, so i added a user with no global or channel flags, and tried the script on that person. However, the script appears to add a channel to the user and then tells me that the user has access in it.

ie. Before the command

<H4> bob yes 0 - never (nowhere )
<H4> EMAIL: a@b.com

after the command:

<H4> bob yes 0 - never (nowhere )
<H4> #VoiceNET - never
<H4> EMAIL: a@b.com

Simon.
s
simonbell
Halfop
Posts: 68
Joined: Mon Aug 05, 2002 8:07 pm
Location: Washington, England
Contact:

Post by simonbell »

ok ive actually modified it to do what i want myself:
set a
  • foreach ch [channels] {
    if { [matchattr $handle_requested -|nmovl $ch] == 1 } {
    putnotc $nick "$ch"
    }
    }
Thanks for the pointers :)

Simon
Locked