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 01, 2008, 12:29:01 PM

Login with username, password and session length
Search



Advanced search
Support GoPHP5.org
BeBot - An Anarchy Online/Age Of Conan chat automaton > Forum > Development > Coding and development discussion > Topic: new Admin.php function
Pages: [1]   Go Down
« previous next »
Print
Author Topic: new Admin.php function  (Read 441 times)
0 Members and 1 Guest are viewing this topic.
Wanuarmi
BeBot Contributor
Apprentice
*******
Offline Offline

Posts: 121


new Admin.php function
« on: January 24, 2006, 02:43:40 PM »

Id like to suggest this function added to Admin.php

Code:
function upto_group($name, $group)
{
$name = ucfirst(strtolower($name));
$group = strtolower($group);
$in_group = 0;
$result = $this -> bot -> db -> select("SELECT * FROM admin_members WHERE name = $name");
foreach($result AS $entry) // same user can be in multiple groups
{
if (empty($in_group) || $in_group > $entry[1])
$in_group = $entry[1];
}
$result = $this -> bot -> db -> select("SELECT * FROM admin_groups WHERE name = $group");
if (empty($result))
return false;
if (!empty($in_group) && $in_group <= $result[0][0])
return true;
return false;
}

so you dont have to check multiple groups for commands, and so admins have all permissions raidleaders have. this would only work if the groups hierarchy was kept in the id column though...
Logged
Pages: [1]   Go Up
Print
BeBot - An Anarchy Online/Age Of Conan chat automaton > Forum > Development > Coding and development discussion > Topic: new Admin.php function
« previous next »
 
Jump to:  

Recent
[request] Raid timers
by Alreadythere
[Today at 11:42:32 AM]

Shared DB online list
by Temar
[Today at 01:55:47 AM]

relay colors
by Temar
[Today at 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]

Bot not see Guild Chat
by Delvar
[November 28, 2008, 08:30:34 AM]

Starting Bot
by Allisande
[November 28, 2008, 07:08:21 AM]
Stats
Members
Total Members: 1243
Latest: Whackoeng
Stats
Total Posts: 11143
Total Topics: 1505
Online Today: 21
Online Ever: 168
(July 01, 2007, 09:30:02 PM)
Users Online
Users: 4
Guests: 15
Total: 19
egrath
Temar
gerborg

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.277 seconds with 28 queries. (Pretty URLs adds 0.03s, 4q)
Loading...