From 2bdc9c6d0ebd1592575d2879b2dfb6382c1cc6fd Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sun, 16 Oct 2005 06:32:48 +0000 Subject: [PATCH] r560: Moving permissions into their separate file so we can use it in the installer --- includes/init.php | 35 +++------------------------ includes/permissions.php | 51 ++++++++++++++++++++++++++++++++++++++++ install/install.php | 2 ++ 3 files changed, 56 insertions(+), 32 deletions(-) create mode 100644 includes/permissions.php diff --git a/includes/init.php b/includes/init.php index 2a02d45..a1b9b89 100755 --- a/includes/init.php +++ b/includes/init.php @@ -133,38 +133,9 @@ $mail->from = $bugsys->options['webmasteremail']; $mail->fromname = $lang->string('BugStrike Notification'); // ################################################################### -// Initialize usergroup system -$_PERMISSION = array( - 'canviewbugs' => 1, // can view bugs - 'cansearch' => 2, // can use the search - 'cansubscribe' => 4, // can email subscribe - 'canvote' => 8, // can vote on bugs - 'cansubmitbugs' => 16, // can submit new bugs - 'canpostcomments' => 32, // can post new comments - 'cangetattach' => 64, // can dl attachments - 'canputattach' => 128, // can ul attachments - 'caneditown' => 256, // can edit own bugs - 'caneditother' => 512, // can edit others' bugs - 'caneditownreply' => 1024, // can edit own comments - 'canassign' => 2048, // can assign bug - 'canchangestatus' => 4096, // can change bug status - 'canadminpanel' => 8192, // can view admin panel - 'canadminbugs' => 16384, // can administrate bug functions - 'canadminversions' => 32768, // can admin version info - 'canadminusers' => 65536, // can admin users - 'canadmingroups' => 131072, // can admin permission masks - 'canadmintools' => 262144, // can use admin tools - 'canadminfields' => 524288, // can admin custom bug fields - 'canbeassignedto' => 1048576, // can be assigned bugs, - 'caneditattach' => 2097152, // can edit attachments - 'canviewhidden' => 4194304, // can see hidden bugs - 'caneditotherreply' => 8388608 // can edit other peoples' comments -); - -foreach ($_PERMISSION AS $name => $maskvalue) -{ - define(strtoupper($name), $maskvalue); -} +// load permissions + +require_once('./includes/permissions.php'); /*=====================================================================*\ || ################################################################### diff --git a/includes/permissions.php b/includes/permissions.php new file mode 100644 index 0000000..9accb48 --- /dev/null +++ b/includes/permissions.php @@ -0,0 +1,51 @@ + 1, // can view bugs + 'cansearch' => 2, // can use the search + 'cansubscribe' => 4, // can email subscribe + 'canvote' => 8, // can vote on bugs + 'cansubmitbugs' => 16, // can submit new bugs + 'canpostcomments' => 32, // can post new comments + 'cangetattach' => 64, // can dl attachments + 'canputattach' => 128, // can ul attachments + 'caneditown' => 256, // can edit own bugs + 'caneditother' => 512, // can edit others' bugs + 'caneditownreply' => 1024, // can edit own comments + 'canassign' => 2048, // can assign bug + 'canchangestatus' => 4096, // can change bug status + 'canadminpanel' => 8192, // can view admin panel + 'canadminbugs' => 16384, // can administrate bug functions + 'canadminversions' => 32768, // can admin version info + 'canadminusers' => 65536, // can admin users + 'canadmingroups' => 131072, // can admin permission masks + 'canadmintools' => 262144, // can use admin tools + 'canadminfields' => 524288, // can admin custom bug fields + 'canbeassignedto' => 1048576, // can be assigned bugs, + 'caneditattach' => 2097152, // can edit attachments + 'canviewhidden' => 4194304, // can see hidden bugs + 'caneditotherreply' => 8388608 // can edit other peoples' comments +); + +foreach ($_PERMISSION AS $name => $maskvalue) +{ + define(strtoupper($name), $maskvalue); +} + +/*=====================================================================*\ +|| ################################################################### +|| # $HeadURL$ +|| # $Id$ +|| ################################################################### +\*=====================================================================*/ +?> \ No newline at end of file diff --git a/install/install.php b/install/install.php index 0096e0c..8988cbf 100644 --- a/install/install.php +++ b/install/install.php @@ -200,6 +200,8 @@ if ($bugsys->in['mark'] == 7)

In order to make BugStrike the most efficient possible, the system caches the maximum amount of data it can. This reduces the load of your server without compromising usability. Currently the caches are being built.

\n"; -- 2.22.5