Skip to content

Commit

Permalink
Fixed minor bug with level 2 authorization.
Browse files Browse the repository at this point in the history
  • Loading branch information
Bren2010 committed Oct 1, 2010
1 parent 7ad56cc commit 658ee37
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 15 deletions.
4 changes: 2 additions & 2 deletions config.ini
Expand Up @@ -7,8 +7,8 @@ password = "d|g!74ldrp3pper2012"
Bren2010[level] = 2
Bren2010[hostmask] = "Bren2010!Bren2010@bren2010.com"

Thetan[level] = 2
Thetan[hostmask] = "Thetan!Thetan@HTS-EEB48195.dsl.mindspring.com"
;Thetan[level] = 2
;Thetan[hostmask] = "Thetan!Thetan@HTS-EEB48195.dsl.mindspring.com"

[lecture]
lector = "Romnous"
Expand Down
8 changes: 6 additions & 2 deletions modules/privmsg/rehash.php
Expand Up @@ -10,14 +10,18 @@
if ($where != $nick) return;

$hostmask = $message->getNick() . "!" . $message->getName() . "@" . $message->getHost();
if (!searchAccess($hostmask, $accessArray)) return;
$search = searchAccess($hostmask, $accessArray);

if (!$search) return;

if ($level = $accessArray[$search]['level'] != 2) return;

list($msg) = explode(" ", $parameters[1]);
$msg = trim($parameters[1]);

if ($msg != 'rehash') return;

global $modules;

$modules->reload();
say("All modules have been rehashed.");
};
Expand Down
11 changes: 6 additions & 5 deletions modules/privmsg/reload_access.php
Expand Up @@ -10,16 +10,17 @@
if ($where != $nick) return;

$hostmask = $message->getNick() . "!" . $message->getName() . "@" . $message->getHost();
if (!searchAccess($hostmask, $accessArray)) return;

$search = searchAccess($hostmask, $accessArray);
if (!$search) return;

if ($level = $accessArray[$search]['level'] != 2) return;

list($msg) = explode(" ", $parameters[1]);
if ($msg != 'reload_access') return;
$msg = trim($parameters[1]);

if ($msg != 'reload access') return;

$config = parse_ini_file("config.ini", true);

global $accessArray;

$accessArray = $config['access'];

Expand Down
9 changes: 6 additions & 3 deletions modules/privmsg/reload_intro.php
Expand Up @@ -10,12 +10,15 @@
if ($where != $nick) return;

$hostmask = $message->getNick() . "!" . $message->getName() . "@" . $message->getHost();
if (!searchAccess($hostmask, $accessArray)) return;
$search = searchAccess($hostmask, $accessArray);

if (!$search) return;

if ($level = $accessArray[$search]['level'] != 2) return;

list($msg) = explode(" ", $parameters[1]);
if ($msg != 'reload_intro') return;
$msg = trim($parameters[1]);

if ($msg != 'reload intro') return;

$config = parse_ini_file("config.ini", true);

Expand Down
9 changes: 6 additions & 3 deletions modules/privmsg/reload_lecture.php
Expand Up @@ -10,12 +10,15 @@
if ($where != $nick) return;

$hostmask = $message->getNick() . "!" . $message->getName() . "@" . $message->getHost();
if (!searchAccess($hostmask, $accessArray)) return;
$search = searchAccess($hostmask, $accessArray);

if (!$search) return;

if ($level = $accessArray[$search]['level'] != 2) return;

list($msg) = explode(" ", $parameters[1]);
if ($msg != 'reload_lecture') return;
$msg = trim($parameters[1]);

if ($msg != 'reload lecture') return;

global $lecture;
global $position;
Expand Down

0 comments on commit 658ee37

Please sign in to comment.