From 6603a14177fb6cab1fb9d517af820130d80fc970 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sat, 23 Aug 2008 13:13:48 -0400 Subject: [PATCH] Changing $bugsys->permissions[] to bugdar::$permissions[] --- admin/permission.php | 4 ++-- admin/usergroup.php | 6 +++--- includes/functions.php | 14 +++++++------- includes/functions_datastore.php | 2 +- includes/permissions.php | 2 +- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/admin/permission.php b/admin/permission.php index aab83df..fcd40dd 100755 --- a/admin/permission.php +++ b/admin/permission.php @@ -132,7 +132,7 @@ if ($_REQUEST['do'] == 'edit') $admin->row_span($group, 'thead', 'center'); foreach ($settings AS $setting => $name) { - $admin->row_yesno($name, "perm[$setting]", ($mask & $bugsys->permissions["$setting"])); + $admin->row_yesno($name, "perm[$setting]", ($mask & bugdar::$permissions["$setting"])); } } @@ -153,7 +153,7 @@ if ($_POST['do'] == 'update') )); foreach ($input->in['perm'] AS $permtitle => $binaryswitch) { - $permissionvalue += $bugsys->permissions["$permtitle"] * $binaryswitch; + $permissionvalue += bugdar::$permissions["$permtitle"] * $binaryswitch; } $db->query(" diff --git a/admin/usergroup.php b/admin/usergroup.php index e0b7cfe..868dc17 100755 --- a/admin/usergroup.php +++ b/admin/usergroup.php @@ -168,7 +168,7 @@ if ($_REQUEST['do'] == 'add' OR $_REQUEST['do'] == 'edit' OR $_REQUEST['do'] == $admin->row_span($group, 'thead', 'center'); foreach ($settings AS $setting => $name) { - $admin->row_yesno($name, "perm[$setting]", ($usergroup->record['permissions'] & $bugsys->permissions["$setting"])); + $admin->row_yesno($name, "perm[$setting]", ($usergroup->record['permissions'] & bugdar::$permissions["$setting"])); } } @@ -216,7 +216,7 @@ if ($_POST['do'] == 'insert') $input->inputClean('perm', TYPE_UINT); foreach ($input->in['perm'] AS $permtitle => $binaryswitch) { - $permissionvalue += $bugsys->permissions["$permtitle"] * $binaryswitch; + $permissionvalue += bugdar::$permissions["$permtitle"] * $binaryswitch; } $usergroup = new UsergroupAPI(); @@ -271,7 +271,7 @@ if ($_POST['do'] == 'update') $input->inputClean('perm', TYPE_UINT); foreach ($input->in['perm'] AS $permtitle => $binaryswitch) { - $permissionvalue += $bugsys->permissions["$permtitle"] * $binaryswitch; + $permissionvalue += bugdar::$permissions["$permtitle"] * $binaryswitch; } $usergroup = new UsergroupAPI(); diff --git a/includes/functions.php b/includes/functions.php index 39e419a..1d9f870 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -121,7 +121,7 @@ function can_perform($bitmask, $productid = 0, $userinfo = null) $permissions =& bugdar::$datastore['permission']; - if (!isset($bugsys->permissions["$bitmask"])) + if (!isset(bugdar::$permissions["$bitmask"])) { trigger_error('Invalid bitmask "' . $bitmask . '" specified for can_perform() [includes/functions.php]', E_USER_WARNING); } @@ -133,21 +133,21 @@ function can_perform($bitmask, $productid = 0, $userinfo = null) if ($productid AND !in_array($bitmask, $inspecific)) { - $verdict = (isset($permissions["$userinfo[usergroupid]"]["$productid"]) ? ($permissions["$userinfo[usergroupid]"]["$productid"] & $bugsys->permissions["$bitmask"]) : ($userinfo['permissions'] & $bugsys->permissions["$bitmask"])); + $verdict = (isset($permissions["$userinfo[usergroupid]"]["$productid"]) ? ($permissions["$userinfo[usergroupid]"]["$productid"] & bugdar::$permissions["$bitmask"]) : ($userinfo['permissions'] & bugdar::$permissions["$bitmask"])); foreach ($userinfo['groupids'] AS $group) { if (isset($permissions["$group"]["$productid"])) { - $verdict |= ($permissions["$group"]["$productid"] & $bugsys->permissions["$bitmask"]); + $verdict |= ($permissions["$group"]["$productid"] & bugdar::$permissions["$bitmask"]); } } BSApp::debug("verdict* on can_perform($bitmask, $productid, $userinfo[userid]) = $verdict"); return $verdict; } - BSApp::debug("verdict on can_perform($bitmask, $productid, $userinfo[userid]) = " . ($userinfo['permissions'] & $bugsys->permissions["$bitmask"])); - return ($userinfo['permissions'] & $bugsys->permissions["$bitmask"]); + BSApp::debug("verdict on can_perform($bitmask, $productid, $userinfo[userid]) = " . ($userinfo['permissions'] & bugdar::$permissions["$bitmask"])); + return ($userinfo['permissions'] & bugdar::$permissions["$bitmask"]); } /** @@ -503,7 +503,7 @@ function fetch_on_bits($mask, $userinfo = null) foreach ($groups AS $groupid) { // we only need to do this so long as there's no onbits array because this isn't product specific - if (sizeof($onbits) == 0 AND bugdar::$datastore['usergroup']["$groupid"]['permissions'] & $bugsys->permissions["$mask"]) + if (sizeof($onbits) == 0 AND bugdar::$datastore['usergroup']["$groupid"]['permissions'] & bugdar::$permissions["$mask"]) { foreach (bugdar::$datastore['product'] AS $id => $product) { @@ -523,7 +523,7 @@ function fetch_on_bits($mask, $userinfo = null) { foreach (bugdar::$datastore['permission']["$groupid"] AS $productid => $bit) { - if ($bit & $bugsys->permissions["$mask"]) + if ($bit & bugdar::$permissions["$mask"]) { $explicit["$productid"] = $productid; $onbits["$productid"] = $productid; diff --git a/includes/functions_datastore.php b/includes/functions_datastore.php index ca9f379..113c21a 100755 --- a/includes/functions_datastore.php +++ b/includes/functions_datastore.php @@ -148,7 +148,7 @@ function build_assignedto() $ids = $exprs = array(); foreach (bugdar::$datastore['usergroup'] AS $id => $group) { - if ($group['permissions'] & $bugsys->permissions['canbeassignedto']) + if ($group['permissions'] & bugdar::$permissions['canbeassignedto']) { $ids[] = $id; $exprs[] = "FIND_IN_SET($id, groupids)"; diff --git a/includes/permissions.php b/includes/permissions.php index dae3b09..dc8f46d 100644 --- a/includes/permissions.php +++ b/includes/permissions.php @@ -19,7 +19,7 @@ || ################################################################### \*=====================================================================*/ -$bugsys->permissions = array( +bugdar::$permissions = array( 'canviewbugs' => 1, // can view bugs 'cansearch' => 2, // can use the search 'cansubscribe' => 4, // can email subscribe -- 2.43.5