collapse collapse
* User Info
 
 
Welcome, Guest. Please login or register.
* Search

* Board Stats
  • stats Total Members: 989
  • stats Total Posts: 18363
  • stats Total Topics: 2500
  • stats Total Categories: 7
  • stats Total Boards: 35
  • stats Most Online: 1144

Author Topic: Bug in Subcommand check  (Read 2136 times)

0 Members and 1 Guest are viewing this topic.

Offline Temar

  • Contributor
  • *******
  • Posts: 1140
  • Karma: +0/-0
    • AoFiles
Bug in Subcommand check
« on: February 13, 2008, 03:45:41 am »
im guessing that $ = NO subcommands allowed

in AccessControl.php function check_rights
it does a Check
   if (isset($this -> access_cache[strtolower($command)]['$'][strtolower($channel)]))
IF
      if ($subcommand === false)
wat if it isnt false? (which is when it NEEDS it most
i dont see a check

this is all asuming im guessing right about what $ means


Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: Bug in Subcommand check
« Reply #1 on: February 13, 2008, 12:08:46 pm »
subcommand = "$" in the table means that no parameter or subcommand is allowed for this access right entry. Only !command without any further text is valid. This case only can happen if no subcommand exists, that's why it's in the $subcommand === false branch.

If $subcommand !== false we got a subcommand, so the $ entry cannot be valid anyways. That means we don't need to check for it, as the default behaviour of check_rights() is to return false. Which will happen if no valid subcommand entry for access rights is found.

So no, I think there is no bug here.

Offline Blueeagle

  • Omnipotent
  • BeBot Hero
  • ******
  • Posts: 323
  • Karma: +0/-0
Re: Bug in Subcommand check
« Reply #2 on: February 13, 2008, 04:46:51 pm »
Speaking of sub-commands when you look at any commandline program they use a dash or a slash to mark options. Is this something we should concider?

The syntax would then become something like !member -add Someuser

I am pretty sure that it will make a uniform options handler much easier to implement.

Alternately each module might make an array $subcom[]='add'; $subcom[]='del'; and one could loop trough it. Any thoughts on such an alternate implementation?
The only problem that can't be solved by adding another wrapper is having too many wrappers.

Offline Temar

  • Contributor
  • *******
  • Posts: 1140
  • Karma: +0/-0
    • AoFiles
Re: Bug in Subcommand check
« Reply #3 on: February 13, 2008, 04:51:40 pm »
so if some one does more than just command it will get denied because it can't find access level

I don't see any use for it tho as a module that uses command only could just ignor the rest

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: Bug in Subcommand check
« Reply #4 on: February 13, 2008, 06:10:28 pm »
Check the !member command. Without any parameter it shows the memberlist, with add/del as parameter is changes it. Some bot admins may want to allow all members to check the memberlist, but in most cases they don't want non-admins to change it. This case can only be handled with something like $.

Offline Temar

  • Contributor
  • *******
  • Posts: 1140
  • Karma: +0/-0
    • AoFiles
Re: Bug in Subcommand check
« Reply #5 on: February 13, 2008, 06:28:28 pm »
ah so u mean like
$ = !member
* = !member anything

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: Bug in Subcommand check
« Reply #6 on: February 14, 2008, 10:29:23 am »
Exactly. If no $ entry exists * will handle !member too.

 

* Recent Posts
[AoC] special char for items module by bitnykk
[February 09, 2024, 09:41:18 pm]


0.8.x updates for AoC by bitnykk
[January 30, 2024, 11:16:08 pm]


0.8.x updates for AO by bitnykk
[January 30, 2024, 11:15:37 pm]


BeBot still alive & kicking ! by bitnykk
[December 17, 2023, 12:58:44 am]


Bebot and Rasberry by bitnykk
[November 29, 2023, 11:04:14 pm]

* Who's Online
  • Dot Guests: 750
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.
* Forum Staff
bitnykk admin bitnykk
Administrator
Khalem admin Khalem
Administrator
WeZoN gmod WeZoN
Global Moderator
SimplePortal 2.3.7 © 2008-2024, SimplePortal