diff --git a/globals/Dependencies/Users/User.php b/globals/Dependencies/Users/User.php index c716858..bede781 100644 --- a/globals/Dependencies/Users/User.php +++ b/globals/Dependencies/Users/User.php @@ -12,7 +12,7 @@ namespace Alphaland\Users use Alphaland\Web\WebContextManager; use PDO; - class user + class User { public $id = -1; public $name = ""; @@ -24,27 +24,27 @@ namespace Alphaland\Users private const SecondsInDays = 86400; - function __construct() { + public function __construct() { if(isset($_COOKIE['token'])) { $this->ValidateSession($_COOKIE['token']); } } - function isOwner() { + public function IsOwner() { if ($this->rank == 3) { return true; } return false; } - function isAdmin() { + public function IsAdmin() { if($this->rank == 2 || $this->rank == 3) { return true; } return false; } - function isStaff() { + public function IsStaff() { if($this->rank == 1 || $this->rank == 2 || $this->rank == 3) { return true; } @@ -119,7 +119,7 @@ namespace Alphaland\Users return false; } - function logout() + public function Logout() { if($this->logged_in) { $logout = $GLOBALS['pdo']->prepare("DELETE FROM sessions WHERE id = :id"); diff --git a/globals/Dependencies/Web/WebContextManager.php b/globals/Dependencies/Web/WebContextManager.php index 53e9a4d..1d23d5a 100644 --- a/globals/Dependencies/Web/WebContextManager.php +++ b/globals/Dependencies/Web/WebContextManager.php @@ -21,7 +21,7 @@ namespace Alphaland\Web { public static function CanBypassMaintenance() { - return $GLOBALS['user']->isStaff() || WebContextManager::IsCurrentIpAddressWhitelisted(); + return $GLOBALS['user']->IsStaff() || WebContextManager::IsCurrentIpAddressWhitelisted(); } public static function IsUnderMaintenance(bool $status = false) diff --git a/globals/functions.php b/globals/functions.php index 7f9ce48..14cd267 100644 --- a/globals/functions.php +++ b/globals/functions.php @@ -978,7 +978,7 @@ function userGroupsCount() function createGroup($name, $description, $approval, $base64emblem) { - if (userGroupsCount() == 6 && !$GLOBALS['user']->isAdmin()) + if (userGroupsCount() == 6 && !$GLOBALS['user']->IsAdmin()) { return "Limited to 6 groups per player"; } @@ -1728,7 +1728,7 @@ function isGroupOwner($groupid) $owner->bindParam(":gid", $groupid, PDO::PARAM_INT); $owner->bindParam(":cid", $localplayer, PDO::PARAM_INT); $owner->execute(); - if ($owner->rowCount() > 0 || $GLOBALS['user']->isAdmin()) + if ($owner->rowCount() > 0 || $GLOBALS['user']->IsAdmin()) { return true; } @@ -1815,7 +1815,7 @@ function wallViewPermission($groupid) { $role = groupRoleInfo($groupid, groupMemberInfo($groupid, $localplayer)->rank); - if ($role->AccessGroupWall == 1 || $GLOBALS['user']->isAdmin()) + if ($role->AccessGroupWall == 1 || $GLOBALS['user']->IsAdmin()) { return true; } @@ -1831,7 +1831,7 @@ function wallPostPermission($groupid) { $role = groupRoleInfo($groupid, groupMemberInfo($groupid, $localplayer)->rank); - if ($role->PostGroupWall == 1 || $GLOBALS['user']->isAdmin()) + if ($role->PostGroupWall == 1 || $GLOBALS['user']->IsAdmin()) { return true; } @@ -1847,7 +1847,7 @@ function wallDeletePermission($groupid) { $role = groupRoleInfo($groupid, groupMemberInfo($groupid, $localplayer)->rank); - if ($role->DeleteGroupWallPosts == 1 || $GLOBALS['user']->isAdmin()) + if ($role->DeleteGroupWallPosts == 1 || $GLOBALS['user']->IsAdmin()) { return true; } @@ -1863,7 +1863,7 @@ function postShoutPermission($groupid) { $role = groupRoleInfo($groupid, groupMemberInfo($groupid, $localplayer)->rank); - if ($role->PostGroupShout == 1 || $GLOBALS['user']->isAdmin()) + if ($role->PostGroupShout == 1 || $GLOBALS['user']->IsAdmin()) { return true; } @@ -1879,7 +1879,7 @@ function manageLowerRankPermission($groupid) { $role = groupRoleInfo($groupid, groupMemberInfo($groupid, $localplayer)->rank); - if ($role->ManageLowerRanks == 1 || $GLOBALS['user']->isAdmin()) + if ($role->ManageLowerRanks == 1 || $GLOBALS['user']->IsAdmin()) { return true; } @@ -1895,7 +1895,7 @@ function kickLowerRankPermission($groupid) { $role = groupRoleInfo($groupid, groupMemberInfo($groupid, $localplayer)->rank); - if ($role->KickLowerRanks == 1 || $GLOBALS['user']->isAdmin()) + if ($role->KickLowerRanks == 1 || $GLOBALS['user']->IsAdmin()) { return true; } @@ -1911,7 +1911,7 @@ function acceptJoinRequestPermission($groupid) { $role = groupRoleInfo($groupid, groupMemberInfo($groupid, $localplayer)->rank); - if ($role->AcceptJoinRequests == 1 || $GLOBALS['user']->isAdmin()) + if ($role->AcceptJoinRequests == 1 || $GLOBALS['user']->IsAdmin()) { return true; } @@ -1927,7 +1927,7 @@ function viewAuditLogPermission($groupid) { $role = groupRoleInfo($groupid, groupMemberInfo($groupid, $localplayer)->rank); - if ($role->ViewAuditLog == 1 || $GLOBALS['user']->isAdmin()) + if ($role->ViewAuditLog == 1 || $GLOBALS['user']->IsAdmin()) { return true; } @@ -1939,9 +1939,9 @@ function configPermission($groupid) { $localplayer = $GLOBALS['user']->id; - if (isGroupMember($localplayer, $groupid) || $GLOBALS['user']->isAdmin()) + if (isGroupMember($localplayer, $groupid) || $GLOBALS['user']->IsAdmin()) { - if (manageLowerRankPermission($groupid) || kickLowerRankPermission($groupid) || acceptJoinRequestPermission($groupid) || viewAuditLogPermission($groupid) || $GLOBALS['user']->isAdmin()) + if (manageLowerRankPermission($groupid) || kickLowerRankPermission($groupid) || acceptJoinRequestPermission($groupid) || viewAuditLogPermission($groupid) || $GLOBALS['user']->IsAdmin()) { return true; } @@ -1961,7 +1961,7 @@ function userAccessToGame($placeid, $userid) $whitelist->bindParam(":pid", $placeid, PDO::PARAM_INT); $whitelist->bindParam(":uid", $userid, PDO::PARAM_INT); $whitelist->execute(); - if ($whitelist->rowCount() > 0 || $userid == getAssetInfo($placeid)->CreatorId || $GLOBALS['user']->isAdmin()) + if ($whitelist->rowCount() > 0 || $userid == getAssetInfo($placeid)->CreatorId || $GLOBALS['user']->IsAdmin()) { return true; } @@ -2842,7 +2842,7 @@ function userPlaying($userid) function isUserInventoryPrivate($userid) { - if(userInfo($userid)->privateInventory && !$GLOBALS['user']->isAdmin()) + if(userInfo($userid)->privateInventory && !$GLOBALS['user']->IsAdmin()) { return true; } @@ -4254,14 +4254,14 @@ function isOwner($id, $userid=NULL) //handle game assets if ($assettypeid == 9) { - if ($creatorid == $userid || $GLOBALS['user']->isOwner()) { + if ($creatorid == $userid || $GLOBALS['user']->IsOwner()) { return true; } return false; } //others - if ($creatorid == $userid || $GLOBALS['user']->isStaff()) { + if ($creatorid == $userid || $GLOBALS['user']->IsStaff()) { return true; } } @@ -5233,7 +5233,7 @@ function getNav() $modbutton = ""; $pendingassetscount = 0; - if ($GLOBALS['user']->isStaff()) + if ($GLOBALS['user']->IsStaff()) { $pendingassetscount = fetchPendingAssets()->rowCount(); @@ -5315,7 +5315,7 @@ function getNav() Create '.$modbutton.' - '.(($user->isAdmin())? ' + '.(($user->IsAdmin())? ' ':'').' diff --git a/html/2fa.php b/html/2fa.php index 3f45cc2..44f4cef 100644 --- a/html/2fa.php +++ b/html/2fa.php @@ -14,7 +14,7 @@ if(isset($_POST['submit_2fa'])) { } if(isset($_POST['logout'])) { - $user->logout(); + $user->Logout(); WebContextManager::Redirect("/"); } diff --git a/html/MCP/approveasset.php b/html/MCP/approveasset.php index 31c5d3b..ce426de 100644 --- a/html/MCP/approveasset.php +++ b/html/MCP/approveasset.php @@ -14,7 +14,7 @@ header("Access-Control-Allow-Origin: https://www.alphaland.cc"); header("access-control-allow-credentials: true"); -if(!$user->isStaff()) +if(!$user->IsStaff()) { WebContextManager::Redirect("/"); } diff --git a/html/MCP/asset-management.php b/html/MCP/asset-management.php index 970b147..1bd93b4 100644 --- a/html/MCP/asset-management.php +++ b/html/MCP/asset-management.php @@ -2,7 +2,7 @@ use Alphaland\Web\WebContextManager; -if(!$user->isStaff()) +if(!$user->IsStaff()) { WebContextManager::Redirect("/"); } diff --git a/html/MCP/chat-logs/index.php b/html/MCP/chat-logs/index.php index eb166e9..5839e8a 100644 --- a/html/MCP/chat-logs/index.php +++ b/html/MCP/chat-logs/index.php @@ -2,7 +2,7 @@ use Alphaland\Web\WebContextManager; -if(!$user->isStaff()) +if(!$user->IsStaff()) { WebContextManager::Redirect("/"); } diff --git a/html/MCP/chat-logs/loggedChats.php b/html/MCP/chat-logs/loggedChats.php index 23acc19..f21a1ca 100644 --- a/html/MCP/chat-logs/loggedChats.php +++ b/html/MCP/chat-logs/loggedChats.php @@ -12,7 +12,7 @@ header("Access-Control-Allow-Origin: https://www.alphaland.cc"); header("access-control-allow-credentials: true"); header('Content-Type: application/json'); -if(!$user->isStaff()) +if(!$user->IsStaff()) { WebContextManager::Redirect("/"); } diff --git a/html/MCP/index.php b/html/MCP/index.php index d2b051a..1d39bdd 100644 --- a/html/MCP/index.php +++ b/html/MCP/index.php @@ -2,7 +2,7 @@ use Alphaland\Web\WebContextManager; -if(!($user->isStaff())) +if(!($user->IsStaff())) { WebContextManager::Redirect("/"); } diff --git a/html/MCP/invite-logs/index.php b/html/MCP/invite-logs/index.php index 2e80a54..fdbdb9d 100644 --- a/html/MCP/invite-logs/index.php +++ b/html/MCP/invite-logs/index.php @@ -2,7 +2,7 @@ use Alphaland\Web\WebContextManager; -if(!$user->isStaff()) +if(!$user->IsStaff()) { WebContextManager::Redirect("/"); } diff --git a/html/MCP/invite-logs/inviteLogs.php b/html/MCP/invite-logs/inviteLogs.php index 6e928b7..6e30972 100644 --- a/html/MCP/invite-logs/inviteLogs.php +++ b/html/MCP/invite-logs/inviteLogs.php @@ -2,7 +2,7 @@ use Alphaland\Web\WebContextManager; -if(!$user->isStaff()) +if(!$user->IsStaff()) { WebContextManager::Redirect("/"); } diff --git a/html/MCP/moderateasset.php b/html/MCP/moderateasset.php index 053b7f4..e13e82c 100644 --- a/html/MCP/moderateasset.php +++ b/html/MCP/moderateasset.php @@ -14,7 +14,7 @@ header("Access-Control-Allow-Origin: https://www.alphaland.cc"); header("access-control-allow-credentials: true"); -if(!$user->isStaff()) +if(!$user->IsStaff()) { WebContextManager::Redirect("/"); } diff --git a/html/MCP/pendingassets.php b/html/MCP/pendingassets.php index a9d1350..22e32b3 100644 --- a/html/MCP/pendingassets.php +++ b/html/MCP/pendingassets.php @@ -6,7 +6,7 @@ Alphaland 2021 use Alphaland\Web\WebContextManager; -if(!$user->isStaff()) +if(!$user->IsStaff()) { WebContextManager::Redirect("/"); } diff --git a/html/MCP/reports/data/close.php b/html/MCP/reports/data/close.php index e014b5d..e568a15 100644 --- a/html/MCP/reports/data/close.php +++ b/html/MCP/reports/data/close.php @@ -13,7 +13,7 @@ header('Content-Type: application/json'); $id = (int)$_GET['id']; -if(!$user->isStaff() || !$id) { +if(!$user->IsStaff() || !$id) { WebContextManager::Redirect("/"); } diff --git a/html/MCP/reports/data/index.php b/html/MCP/reports/data/index.php index dadeaa8..cbc3a46 100644 --- a/html/MCP/reports/data/index.php +++ b/html/MCP/reports/data/index.php @@ -13,7 +13,7 @@ header('Content-Type: application/json'); $id = (int)$_GET['id']; -if(!$user->isStaff() || !$id) { +if(!$user->IsStaff() || !$id) { WebContextManager::Redirect("/"); } diff --git a/html/MCP/reports/data/reports.php b/html/MCP/reports/data/reports.php index d773491..af01aeb 100644 --- a/html/MCP/reports/data/reports.php +++ b/html/MCP/reports/data/reports.php @@ -10,7 +10,7 @@ header("Access-Control-Allow-Origin: https://www.alphaland.cc"); header("access-control-allow-credentials: true"); header('Content-Type: application/json'); -if(!$user->isStaff()) { +if(!$user->IsStaff()) { WebContextManager::Redirect("/"); } diff --git a/html/MCP/reports/index.php b/html/MCP/reports/index.php index a373d0b..6804e31 100644 --- a/html/MCP/reports/index.php +++ b/html/MCP/reports/index.php @@ -7,7 +7,7 @@ use Alphaland\Web\WebContextManager; -if(!$user->isStaff()) { +if(!$user->IsStaff()) { WebContextManager::Redirect("/"); } diff --git a/html/MCP/reports/view.php b/html/MCP/reports/view.php index 66e1ad8..7bc796d 100644 --- a/html/MCP/reports/view.php +++ b/html/MCP/reports/view.php @@ -7,7 +7,7 @@ use Alphaland\Web\WebContextManager; -if(!$user->isStaff()) { +if(!$user->IsStaff()) { WebContextManager::Redirect("/"); } diff --git a/html/MCP/user-management/ban.php b/html/MCP/user-management/ban.php index 06093d3..abf9468 100644 --- a/html/MCP/user-management/ban.php +++ b/html/MCP/user-management/ban.php @@ -7,7 +7,7 @@ Alphaland 2021 use Alphaland\Moderation\UserModerationManager; use Alphaland\Web\WebContextManager; -if(!$user->isStaff()) { +if(!$user->IsStaff()) { WebContextManager::Redirect("/"); } diff --git a/html/MCP/user-management/banlist.php b/html/MCP/user-management/banlist.php index 46ca0f2..32d9db0 100644 --- a/html/MCP/user-management/banlist.php +++ b/html/MCP/user-management/banlist.php @@ -10,7 +10,7 @@ header("Access-Control-Allow-Origin: https://www.alphaland.cc"); header("access-control-allow-credentials: true"); header('Content-Type: application/json'); -if(!$user->isStaff()) { +if(!$user->IsStaff()) { WebContextManager::Redirect("/"); } diff --git a/html/MCP/user-management/index.php b/html/MCP/user-management/index.php index 7e381e1..bf068b9 100644 --- a/html/MCP/user-management/index.php +++ b/html/MCP/user-management/index.php @@ -3,7 +3,7 @@ use Alphaland\Web\WebContextManager; $body = ''; -if(!($user->isStaff())) { +if(!($user->IsStaff())) { WebContextManager::Redirect("/"); } diff --git a/html/MCP/user-management/unban.php b/html/MCP/user-management/unban.php index 5369eed..4db6278 100644 --- a/html/MCP/user-management/unban.php +++ b/html/MCP/user-management/unban.php @@ -7,7 +7,7 @@ Alphaland 2021 use Alphaland\Moderation\UserModerationManager; use Alphaland\Web\WebContextManager; -if(!$user->isStaff()) { +if(!$user->IsStaff()) { WebContextManager::Redirect("/"); } diff --git a/html/asset/index.php b/html/asset/index.php index d345be6..30faa95 100644 --- a/html/asset/index.php +++ b/html/asset/index.php @@ -52,7 +52,7 @@ if ($id) { if(isLoggedIn()) { - if ($iteminfo->IsPublicDomain == true or $iteminfo->CreatorId == $user->id or $user->isOwner()) + if ($iteminfo->IsPublicDomain == true or $iteminfo->CreatorId == $user->id or $user->IsOwner()) { ReturnAsset($iteminfo->Hash, $iteminfo->AssetTypeId); } diff --git a/html/ban.php b/html/ban.php index d730874..f1eb84c 100644 --- a/html/ban.php +++ b/html/ban.php @@ -17,7 +17,7 @@ if (UserModerationManager::IsBanned($user->id)) if(isset($_POST['logout'])) { - $user->logout(); + $user->Logout(); WebContextManager::Redirect("/"); } diff --git a/html/catalog/config.php b/html/catalog/config.php index 1436cb6..b3ccce5 100644 --- a/html/catalog/config.php +++ b/html/catalog/config.php @@ -105,7 +105,7 @@ if(isset($_GET['id'])) } else { - if ($user->isStaff()) + if ($user->IsStaff()) { UserModerationManager::LogAction("Configure Item ".$id); } @@ -133,7 +133,7 @@ if(isset($_GET['id'])) if (isset($_POST['onsale_checkbox'])) { - if ($user->isStaff()) + if ($user->IsStaff()) { UserModerationManager::LogAction("Configure Item Onsale ".$id); } @@ -164,7 +164,7 @@ if(isset($_GET['id'])) } elseif (isset($_POST['RegenItem'])) //for admin regen stuff { - if ($user->isStaff()) + if ($user->IsStaff()) { $script = ""; $scripttype = ""; @@ -298,7 +298,7 @@ if(isset($_GET['id'])) } elseif (isset($_POST['ModerateItem'])) //for mods { - if ($user->isStaff()) + if ($user->IsStaff()) { $moderation = moderateAsset($id); @@ -333,7 +333,7 @@ else $moderatebutton = ''; $regenbutton = ''; -if ($user->isStaff()) +if ($user->IsStaff()) { $regenbutton = ''; $moderatebutton = ''; diff --git a/html/catalog/view.php b/html/catalog/view.php index 2c51f5a..cb88755 100644 --- a/html/catalog/view.php +++ b/html/catalog/view.php @@ -121,7 +121,7 @@ if(isset($_GET['id'])) //only allow shirts, pants and t shirts to be modified by the end user (admins can regardless) $configbutton_html = ""; - if ($itemtypeint == 2 or $itemtypeint == 11 or $itemtypeint == 12 or $user->isAdmin()) + if ($itemtypeint == 2 or $itemtypeint == 11 or $itemtypeint == 12 or $user->IsAdmin()) { if (isOwner($id) && !isAssetModerated($id)) //owner of the item or admin { diff --git a/html/create/index.php b/html/create/index.php index 585639a..2558005 100644 --- a/html/create/index.php +++ b/html/create/index.php @@ -238,7 +238,7 @@ function newPlace() $description = $_POST['place_desc']; //how many games the user has - if (getAllGames($GLOBALS['user']->id)->rowCount() >= 6 && !$GLOBALS['user']->isAdmin()) + if (getAllGames($GLOBALS['user']->id)->rowCount() >= 6 && !$GLOBALS['user']->IsAdmin()) { return "Games limit reached"; } @@ -275,7 +275,7 @@ function newPBSPlace($placetype) $description = $_POST['place_desc']; //how many games the user has - if (getAllGames($GLOBALS['user']->id)->rowCount() > 6 && !$GLOBALS['user']->isAdmin()) + if (getAllGames($GLOBALS['user']->id)->rowCount() > 6 && !$GLOBALS['user']->IsAdmin()) { return "Games limit reached"; } diff --git a/html/games/config.php b/html/games/config.php index 022ad51..a8faf42 100644 --- a/html/games/config.php +++ b/html/games/config.php @@ -99,7 +99,7 @@ if(isset($_GET['id'])) if($q->rowCount() > 0) { - if (isOwner($id) or $user->isAdmin()) //if the user is the owner of the game, or staff + if (isOwner($id) or $user->IsAdmin()) //if the user is the owner of the game, or staff { //item parameters $gameinfo = getAssetInfo($id); diff --git a/html/logout.php b/html/logout.php index 69e570b..1e2ec1f 100644 --- a/html/logout.php +++ b/html/logout.php @@ -2,5 +2,5 @@ use Alphaland\Web\WebContextManager; -$user->logout(); +$user->Logout(); WebContextManager::Redirect("/"); \ No newline at end of file diff --git a/html_admin/announcements.php b/html_admin/announcements.php index 0da67e4..859ae23 100644 --- a/html_admin/announcements.php +++ b/html_admin/announcements.php @@ -4,7 +4,7 @@ use Alphaland\Web\WebContextManager; WebContextManager::ForceHttpsCloudflare(); -if(!($user->isOwner())) { +if(!($user->IsOwner())) { die('bababooey'); } diff --git a/html_admin/client-deployer-upload.php b/html_admin/client-deployer-upload.php index c7c968f..0bd3d48 100644 --- a/html_admin/client-deployer-upload.php +++ b/html_admin/client-deployer-upload.php @@ -5,8 +5,8 @@ use Alphaland\Web\WebContextManager; WebContextManager::ForceHttpsCloudflare(); //permissions -if(!($user->isOwner())) { - if ($user->isAdmin()) { +if(!($user->IsOwner())) { + if ($user->IsAdmin()) { WebContextManager::Redirect("/"); } die('bababooey'); diff --git a/html_admin/client-deployer.php b/html_admin/client-deployer.php index 44dc4ab..9e3a6c6 100644 --- a/html_admin/client-deployer.php +++ b/html_admin/client-deployer.php @@ -4,8 +4,8 @@ use Alphaland\Web\WebContextManager; WebContextManager::ForceHttpsCloudflare(); -if(!($user->isOwner())) { - if ($user->isAdmin()) { +if(!($user->IsOwner())) { + if ($user->IsAdmin()) { WebContextManager::Redirect("/"); } die('bababooey'); diff --git a/html_admin/configuration.php b/html_admin/configuration.php index b22d5f2..5f83bad 100644 --- a/html_admin/configuration.php +++ b/html_admin/configuration.php @@ -4,8 +4,8 @@ use Alphaland\Web\WebContextManager; WebContextManager::ForceHttpsCloudflare(); -if(!($user->isOwner())) { - if ($user->isAdmin()) { +if(!($user->IsOwner())) { + if ($user->IsAdmin()) { WebContextManager::Redirect("/"); } die('bababooey'); diff --git a/html_admin/create-asset.php b/html_admin/create-asset.php index e9da000..26e2ea7 100644 --- a/html_admin/create-asset.php +++ b/html_admin/create-asset.php @@ -5,7 +5,7 @@ use Alphaland\Web\WebContextManager; WebContextManager::ForceHttpsCloudflare(); -if(!($user->isAdmin())) { +if(!($user->IsAdmin())) { die('bababooey'); } diff --git a/html_admin/create-signupkey.php b/html_admin/create-signupkey.php index 23962a4..4ad8f93 100644 --- a/html_admin/create-signupkey.php +++ b/html_admin/create-signupkey.php @@ -4,7 +4,7 @@ use Alphaland\Web\WebContextManager; WebContextManager::ForceHttpsCloudflare(); -if(!($user->isAdmin())) { +if(!($user->IsAdmin())) { die('bababooey'); } diff --git a/html_admin/generateSecurityKey.php b/html_admin/generateSecurityKey.php index f8b2307..ec0e0f4 100644 --- a/html_admin/generateSecurityKey.php +++ b/html_admin/generateSecurityKey.php @@ -7,7 +7,7 @@ WebContextManager::ForceHttpsCloudflare(); header("Access-Control-Allow-Origin: https://crackpot.alphaland.cc"); header("access-control-allow-credentials: true"); -if(!($user->isAdmin())) { +if(!($user->IsAdmin())) { die('bababooey'); } diff --git a/html_admin/give-asset.php b/html_admin/give-asset.php index 5a7ba6a..7de6967 100644 --- a/html_admin/give-asset.php +++ b/html_admin/give-asset.php @@ -4,8 +4,8 @@ use Alphaland\Web\WebContextManager; WebContextManager::ForceHttpsCloudflare(); -if(!($user->isOwner())) { - if ($user->isAdmin()) { +if(!($user->IsOwner())) { + if ($user->IsAdmin()) { WebContextManager::Redirect("/"); } die('bababooey'); diff --git a/html_admin/index.php b/html_admin/index.php index 08c0cf5..98e7d2f 100644 --- a/html_admin/index.php +++ b/html_admin/index.php @@ -4,7 +4,7 @@ use Alphaland\Web\WebContextManager; WebContextManager::ForceHttpsCloudflare(); -if(!($user->isAdmin())) { +if(!($user->IsAdmin())) { die('bababooey'); } diff --git a/html_admin/lua-executer/activeJobs.php b/html_admin/lua-executer/activeJobs.php index 1d324fc..ab89f04 100644 --- a/html_admin/lua-executer/activeJobs.php +++ b/html_admin/lua-executer/activeJobs.php @@ -4,7 +4,7 @@ use Alphaland\Web\WebContextManager; WebContextManager::ForceHttpsCloudflare(); -if(!($user->isAdmin())) { +if(!($user->IsAdmin())) { die('bababooey'); } diff --git a/html_admin/lua-executer/executeScript.php b/html_admin/lua-executer/executeScript.php index cb7ba06..1eca055 100644 --- a/html_admin/lua-executer/executeScript.php +++ b/html_admin/lua-executer/executeScript.php @@ -5,7 +5,7 @@ use Alphaland\Web\WebContextManager; WebContextManager::ForceHttpsCloudflare(); -if(!($user->isAdmin())) { +if(!($user->IsAdmin())) { die('bababooey'); } diff --git a/html_admin/lua-executer/index.php b/html_admin/lua-executer/index.php index be80f32..a52053c 100644 --- a/html_admin/lua-executer/index.php +++ b/html_admin/lua-executer/index.php @@ -4,7 +4,7 @@ use Alphaland\Web\WebContextManager; WebContextManager::ForceHttpsCloudflare(); -if(!($user->isAdmin())) { +if(!($user->IsAdmin())) { die('bababooey'); } diff --git a/html_admin/rank-management.php b/html_admin/rank-management.php index 544d914..3089336 100644 --- a/html_admin/rank-management.php +++ b/html_admin/rank-management.php @@ -4,8 +4,8 @@ use Alphaland\Web\WebContextManager; WebContextManager::ForceHttpsCloudflare(); -if(!($user->isOwner())) { - if ($user->isAdmin()) { +if(!($user->IsOwner())) { + if ($user->IsAdmin()) { WebContextManager::Redirect("/"); } die('bababooey'); diff --git a/html_admin/rendermanagement.php b/html_admin/rendermanagement.php index 0afbab9..4a2275b 100644 --- a/html_admin/rendermanagement.php +++ b/html_admin/rendermanagement.php @@ -5,7 +5,7 @@ use Alphaland\Web\WebContextManager; WebContextManager::ForceHttpsCloudflare(); -if(!($user->isAdmin())) { +if(!($user->IsAdmin())) { die('bababooey'); } diff --git a/html_api/game/info.php b/html_api/game/info.php index abda97a..249c192 100644 --- a/html_api/game/info.php +++ b/html_api/game/info.php @@ -31,7 +31,7 @@ $userInfo = array( "CreatorId" => $assetinfo->CreatorId, "isPersonalServer" => boolval($assetinfo->isPersonalServer), "playPermission" => userAccessToGame($assetinfo->id, $user->id), - "canManage" => boolval($assetinfo->CreatorId == $user->id || $user->isAdmin()), + "canManage" => boolval($assetinfo->CreatorId == $user->id || $user->IsAdmin()), "CommentsEnabled" => boolval($assetinfo->IsCommentsEnabled), "PersonalServerWhitelist" => boolval($assetinfo->isGameWhitelisted), "MaxPlayers" => $assetinfo->MaxPlayers,