L* R*
HOME FORUM DOWNLOADS
Content
  Links
     Browse SVN
     SVN Commit log
     Documentation (Wiki)
  Developers
     Taskmanager
User
Welcome, Guest. Please login or register.
Did you miss your activation email?
December 02, 2008, 11:51:16 PM

Login with username, password and session length
Search



Advanced search
Support GoPHP5.org
BeBot - An Anarchy Online/Age Of Conan chat automaton > Forum > Support > BeBot 0.5 support > Topic: Bug in Subcommand check
Pages: [1]   Go Down
« previous next »
Print
Author Topic: Bug in Subcommand check  (Read 207 times)
0 Members and 1 Guest are viewing this topic.
Temar
BeBot Developer
Grandmaster
********
Offline Offline

Gender: Male
Posts: 877



WWW
Bug in Subcommand check
« on: February 12, 2008, 09:45:41 PM »

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

Logged

MSN messenger: chris_smith96 at hotmain dot com
Xfire: chriss96
Alreadythere
BeBot Maintainer
Administrator
Grandmaster
********
Offline Offline

Posts: 1085


Re: Bug in Subcommand check
« Reply #1 on: February 13, 2008, 06:08:46 AM »

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.
Logged
Blueeagle
Omnipotent
BeBot Developer
Expert
********
Offline Offline

Gender: Male
Posts: 313



Re: Bug in Subcommand check
« Reply #2 on: February 13, 2008, 10:46:51 AM »

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?
Logged

The only problem that can't be solved by adding another wrapper is having too many wrappers.
Temar
BeBot Developer
Grandmaster
********
Offline Offline

Gender: Male
Posts: 877



WWW
Re: Bug in Subcommand check
« Reply #3 on: February 13, 2008, 10:51:40 AM »

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
Logged

MSN messenger: chris_smith96 at hotmain dot com
Xfire: chriss96
Alreadythere
BeBot Maintainer
Administrator
Grandmaster
********
Offline Offline

Posts: 1085


Re: Bug in Subcommand check
« Reply #4 on: February 13, 2008, 12: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 $.
Logged
Temar
BeBot Developer
Grandmaster
********
Offline Offline

Gender: Male
Posts: 877



WWW
Re: Bug in Subcommand check
« Reply #5 on: February 13, 2008, 12:28:28 PM »

ah so u mean like
$ = !member
* = !member anything
Logged

MSN messenger: chris_smith96 at hotmain dot com
Xfire: chriss96
Alreadythere
BeBot Maintainer
Administrator
Grandmaster
********
Offline Offline

Posts: 1085


Re: Bug in Subcommand check
« Reply #6 on: February 14, 2008, 04:29:23 AM »

Exactly. If no $ entry exists * will handle !member too.
Logged
Pages: [1]   Go Up
Print
BeBot - An Anarchy Online/Age Of Conan chat automaton > Forum > Support > BeBot 0.5 support > Topic: Bug in Subcommand check
« previous next »
 
Jump to:  

Recent
!items database
by Zeephonz
[Today at 08:05:21 PM]

Log playtime from buddys ...
by IKShadow
[Today at 06:48:12 AM]

[request] Raid timers
by Elesar1
[December 01, 2008, 04:41:09 PM]

Shared DB online list
by Temar
[December 01, 2008, 01:55:47 AM]

relay colors
by Temar
[December 01, 2008, 01:54:56 AM]

BeBot v0.6.0 released
by Alreadythere
[November 30, 2008, 05:32:00 PM]

Change to Bid.php
by Temar
[November 30, 2008, 11:41:44 AM]

OnlineOrg
by Jiheld
[November 29, 2008, 12:44:27 PM]

Silly Newbie Question.
by Temar
[November 29, 2008, 12:00:02 PM]

massive_pvp_time_table 1
by gerborg
[November 29, 2008, 06:55:35 AM]
Stats
Members
Total Members: 1244
Latest: Armonkens
Stats
Total Posts: 11146
Total Topics: 1505
Online Today: 25
Online Ever: 168
(July 01, 2007, 09:30:02 PM)
Users Online
Users: 2
Guests: 18
Total: 20
FLGuru
Elesar1

Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC
TinyPortal v0.9.8 © Bloc | NewDef design by Bloc
Page created in 0.31 seconds with 28 queries. (Pretty URLs adds 0.026s, 4q)
Loading...