diff --git a/online.php b/online.php index a1c0e4b9..6a402803 100644 --- a/online.php +++ b/online.php @@ -37,19 +37,7 @@ if ($u->info['online'] < time() - 60) { $filter->setOnline($u->info['online'], $u->info['id']); } -function isModerOrAdmin($uinfo): bool -{ - return $uinfo['admin'] > 0 || - ( - $uinfo['align'] > 1 && - $uinfo['align'] < 2) || - ( - $uinfo['align'] > 3 && - $uinfo['align'] < 4 - ); -} - -if (isset($_POST['delMsg']) && isModerOrAdmin($u->info)) { +if (isset($_POST['delMsg']) && $u->isModerator()) { $delmsgid = (int)$_POST['delMsg']; if ($delmsgid > 0) { Db::sql('update chat set `delete` = ? where id = ?', [$u->info['id'], $delmsgid]); @@ -687,7 +675,7 @@ while ($pl = mysql_fetch_array($sp)) { $see = 1; - if ($pl['type'] == 8 && isModerOrAdmin($u->info)) { + if ($pl['type'] == 8 && $u->isModerator()) { $see = 0; } @@ -713,7 +701,7 @@ while ($pl = mysql_fetch_array($sp)) { $pl['type'] == 5 || $pl['type'] == 6 || ( - $pl['type'] == 8 && isModerOrAdmin($u->info) + $pl['type'] == 8 && $u->isModerator() ) ) && ( @@ -820,7 +808,7 @@ while ($pl = mysql_fetch_array($sp)) { $modr = 0; - if (isModerOrAdmin($u->info)) { + if ($u->isModerator()) { $modr = 1; }