egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

prohibit some commands to users

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
MasterEgg
Voice


Joined: 04 Apr 2011
Posts: 3

PostPosted: Tue Apr 05, 2011 8:53 am    Post subject: prohibit some commands to users Reply with quote

Hello is in the title, I want to prohibit some commands all users except me of course, such as binds, modules, simul, die, loadmod unloadmod thank you for your help
Back to top
View user's profile Send private message
willyw
Revered One


Joined: 15 Jan 2009
Posts: 1175

PostPosted: Tue Apr 05, 2011 9:28 am    Post subject: Re: prohibit some commands to users Reply with quote

MasterEgg wrote:
Hello is in the title, I want to prohibit some commands all users except me of course, such as binds, modules, simul, die, loadmod unloadmod thank you for your help


Log into your bot.
Issue these commands, and examine each result:
.binds *binds* all
.binds *modules* all
.binds *simul* all
.binds *die* all
.binds *loadmod* all
.binds *unloadmod* all

With a quick check on one of my bots, I find that all the above, execpt the
.binds
command, are already limited to only those users with +n.

If you wish to change the flags, at the end of your eggdrop.conf you could do something like this:
Code:

unbind dcc  m|- binds *dcc:binds
bind dcc n|- binds *dcc:binds


I suppose that if you truly wanted to limit a command's use to ONLY you, and no other owner that has +n, then you could change the flag to a custom flag, and then give yourself that flag.


I hope this helps.
Back to top
View user's profile Send private message
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3741
Location: Mint Factory

PostPosted: Tue Apr 05, 2011 10:05 am    Post subject: Reply with quote

You got 3 options:

1. don't give partyline access to people you don't trust;
2. use 'bind filt' to filter out the commands you wish;
3. rebind the commands you wish to prohibit to another flag of your choice;

Here's an example on using the filt to permit the command only if it's set as owner in the configuration file.
Code:

bind filt - ".binds *" dcc:allow

proc dcc:allow {idx args} {
  set handle [idx2hand $idx]
  if {[lsearch -nocase $::owner $handle] == -1} {
    putdcc $idx "Permission denied."
    } else {
    return $args
  }
}

Haven't tested this but as far as I see this may have a major flaw (I haven't tested anything) as I seem to trigger '.binds' just by issuing '.bin' from party line.

@willyw : Apart the '.binds' ALL are already bound for global owner only:
Quote:

TYPE FLAGS COMMAND HITS BINDING (TCL)
dcc n|- unloadmod 0 *dcc:unloadmod
dcc n|- loadmod 0 *dcc:loadmod
dcc m|- binds 9 *dcc:binds
dcc n|- modules 0 *dcc:modules
dcc n|- simul 0 *dcc:simul
dcc n|- die 0 *dcc:die

_________________
Once the game is over, the king and the pawn go back in the same box.
Back to top
View user's profile Send private message
MasterEgg
Voice


Joined: 04 Apr 2011
Posts: 3

PostPosted: Tue Apr 05, 2011 8:53 pm    Post subject: Reply with quote

Thanks Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber