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

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

Author Topic: new Admin.php function  (Read 3994 times)

0 Members and 1 Guest are viewing this topic.

Offline Wanuarmi

  • Contributor
  • *******
  • Posts: 121
  • Karma: +0/-0
new Admin.php function
« on: January 24, 2006, 08:43:40 pm »
Id like to suggest this function added to Admin.php

Code: [Select]
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...

 

* Recent Posts
0.8.x updates for AO by bitnykk
[June 23, 2024, 03:19:47 pm]


0.8.x updates for AoC by bitnykk
[June 23, 2024, 03:19:44 pm]


[AoC] special char for items module by bitnykk
[February 09, 2024, 09:41:18 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: 723
  • 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