You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(34) |
Aug
(215) |
Sep
(180) |
Oct
(135) |
Nov
(105) |
Dec
(81) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(76) |
Feb
(22) |
Mar
(154) |
Apr
(149) |
May
(128) |
Jun
(94) |
Jul
(14) |
Aug
(24) |
Sep
(77) |
Oct
(52) |
Nov
(22) |
Dec
(6) |
2003 |
Jan
(4) |
Feb
(10) |
Mar
(6) |
Apr
(29) |
May
(10) |
Jun
(37) |
Jul
(39) |
Aug
(13) |
Sep
(23) |
Oct
(3) |
Nov
(7) |
Dec
(2) |
2004 |
Jan
|
Feb
(10) |
Mar
(4) |
Apr
|
May
(35) |
Jun
(4) |
Jul
(17) |
Aug
(6) |
Sep
(14) |
Oct
(18) |
Nov
(2) |
Dec
(14) |
2005 |
Jan
(9) |
Feb
(30) |
Mar
(6) |
Apr
|
May
(38) |
Jun
(23) |
Jul
(21) |
Aug
(76) |
Sep
(50) |
Oct
(51) |
Nov
(13) |
Dec
|
From: Benjamin C. <php...@be...> - 2005-11-24 21:20:57
|
Drat! Now we need to %s/quote/quoteSmart/g ! On Nov 24, 2005, at 11:07 AM, Marco Kuhn wrote: > hi all, > > you use often db->quote() to quote a string in your code. > > I take a look to pear documentation, > http://pear.php.net/manual/en/html/package.database.db.db- > common.quote.html > > and found, that this method is deprecated in release 1.6.0. > > The current pear version is 1.4.5. > > What do you think about that? > > Best > --marco > > > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep through > log files > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. DOWNLOAD > SPLUNK! > http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click > _______________________________________________ > phpbt-dev mailing list > php...@li... > https://lists.sourceforge.net/lists/listinfo/phpbt-dev |
From: Benjamin C. <php...@be...> - 2005-11-24 21:19:40
|
I got tired of my crummy attempt at web design, so I redid the site with a design from http://www.oswd.org/. I think it's at least 200% better. :) http://phpbt.sourceforge.net/ |
From: Marco K. <kuh...@we...> - 2005-11-24 18:08:30
|
hi all, you use often db->quote() to quote a string in your code. I take a look to pear documentation, http://pear.php.net/manual/en/html/package.database.db.db-common.quote.html and found, that this method is deprecated in release 1.6.0. The current pear version is 1.4.5. What do you think about that? Best --marco |
From: Marco K. <kuh...@we...> - 2005-11-24 14:52:37
|
hi all, i tried to download the cvs version, but i got no access to download it. Tried: phpbt_CVS # cvs -d:pserver:ano...@cv...:/cvsroot/phpbt login Logging in to :pserver:ano...@cv...:2401/cvsroot/phpbt CVS password: cvs [login aborted]: connect to cvs.sourceforge.net(66.35.250.207):2401 failed: Connection timed out does anyone have the same experience? by marco Am Dienstag, 22. November 2005 16:36 schrieb Ulf Erikson: > Hi All! > > Enough features and fixes have been added to phpBugTracker since the 1.0 > release. It is time to prepare for a v1.1 release. Hopefully this can be > done quickly. > > First step will be a rough functionality test. Download the CVS HEAD > version and start with a fresh, empty, database. Add some users, add > some bugs, try out the new features. > > I would like to hear from as many testers as possible what system you > are using (OS+version, web server+version, database+version and php > version) and what your results are. If you would be able to check > whether upgrades from 1.0.1 work too that would be great. > > Note: Upgrades are currently disabled. Unless you know what you do (and > are working with a copy of your backed-up data) don't enable it ;-) > > As soon as it looks like the code is stable enough to benefit from more > serious testing there will be a beta available for download and an > announcement to the phpbt-users mailing list. > > Below is the CHANGELOG since 1.0.1 > > Thanks > /Ulf > > > -- 1.x -- > > : Moved priority levels into a table > : Changed the 'Assignable' bit to a group permission > : Added sort-order to components and versions > : Added support to bookmark/monitor a set of bugs > : Added a simple UI to edit group permissions > : Added support to (re)edit a query > : Added support for sending smtp mail > : Made the group "User" less special > : Fixed some permissions related issues for project admins > : Added "priority" and "dependency" to the bug history > : Added the ability to update several bugs at once > : Allow admins and project admins to delete bugs > : Allow admins and project admins to change reporter > : Added support to mark bugs as duplicates of each other > : Added several new permissions and a set of "user roles" > > On Mon, 21 Nov 2005 20:44:04 -0800, Benjamin Curtis wrote: > > That sounds good to me. > > > > On Nov 9, 2005, at 12:49 PM, Ulf Erikson wrote: > >> Sorry that it toke a while. The upgrade scripts should be ready > >> now. They are all disabled until I hear from someone that they work > >> safely.. Please be careful with your data while testing. > >> > >> Benjamin, what is the plan now? I would suggest: > >> 1) Ask people at phpbt-dev to test the CVS version > >> a) first by a fresh install into an empty database and add some > >> dummy users and bugs. > >> b) by upgrading a dummy v1.0.1 database (or a copy! of an > >> existing v1.0.1 database) > >> 2) Fix some bugs found > >> 3) Make a tar-ball and ask people at phpbt-users to test it > >> 4) Fix some bugs found > >> 5) release? or iterate steps 3+4 a few times? > >> > >> Benjamin Curtis wrote: > >>> Yeah, I've been thinking for the last week or so that we should > >>> just do 1.1. Branching around the 1st sounds good to me. > >>> > >>> On Oct 18, 2005, at 12:13 PM, Ulf Erikson wrote: > >>>> Benjamin, > >>>> > >>>> Is the plan still to have a v1.0.2 update? Should I keep > >>>> flagging bugs as interesting for that release? or is it time to > >>>> focus on 1.1? > >>>> > >>>> What do you think of branching over two weeks? (november 1st?) > > ------------------------------------------------------- > This SF.Net email is sponsored by the JBoss Inc. Get Certified Today > Register for a JBoss Training Course. Free Certification Exam > for All Training Attendees Through End of 2005. For more info visit: > http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click > _______________________________________________ > phpbt-dev mailing list > php...@li... > https://lists.sourceforge.net/lists/listinfo/phpbt-dev |
From: Ulf E. <ulf...@fa...> - 2005-11-22 15:36:40
|
Hi All! Enough features and fixes have been added to phpBugTracker since the 1.0 release. It is time to prepare for a v1.1 release. Hopefully this can be done quickly. First step will be a rough functionality test. Download the CVS HEAD version and start with a fresh, empty, database. Add some users, add some bugs, try out the new features. I would like to hear from as many testers as possible what system you are using (OS+version, web server+version, database+version and php version) and what your results are. If you would be able to check whether upgrades from 1.0.1 work too that would be great. Note: Upgrades are currently disabled. Unless you know what you do (and are working with a copy of your backed-up data) don't enable it ;-) As soon as it looks like the code is stable enough to benefit from more serious testing there will be a beta available for download and an announcement to the phpbt-users mailing list. Below is the CHANGELOG since 1.0.1 Thanks /Ulf -- 1.x -- : Moved priority levels into a table : Changed the 'Assignable' bit to a group permission : Added sort-order to components and versions : Added support to bookmark/monitor a set of bugs : Added a simple UI to edit group permissions : Added support to (re)edit a query : Added support for sending smtp mail : Made the group "User" less special : Fixed some permissions related issues for project admins : Added "priority" and "dependency" to the bug history : Added the ability to update several bugs at once : Allow admins and project admins to delete bugs : Allow admins and project admins to change reporter : Added support to mark bugs as duplicates of each other : Added several new permissions and a set of "user roles" On Mon, 21 Nov 2005 20:44:04 -0800, Benjamin Curtis wrote: > That sounds good to me. > > On Nov 9, 2005, at 12:49 PM, Ulf Erikson wrote: > >> Sorry that it toke a while. The upgrade scripts should be ready >> now. They are all disabled until I hear from someone that they work >> safely.. Please be careful with your data while testing. >> >> Benjamin, what is the plan now? I would suggest: >> 1) Ask people at phpbt-dev to test the CVS version >> a) first by a fresh install into an empty database and add some >> dummy users and bugs. >> b) by upgrading a dummy v1.0.1 database (or a copy! of an >> existing v1.0.1 database) >> 2) Fix some bugs found >> 3) Make a tar-ball and ask people at phpbt-users to test it >> 4) Fix some bugs found >> 5) release? or iterate steps 3+4 a few times? >> >> >> Benjamin Curtis wrote: >>> Yeah, I've been thinking for the last week or so that we should >>> just do 1.1. Branching around the 1st sounds good to me. >>> On Oct 18, 2005, at 12:13 PM, Ulf Erikson wrote: >>>> Benjamin, >>>> >>>> Is the plan still to have a v1.0.2 update? Should I keep >>>> flagging bugs as interesting for that release? or is it time to >>>> focus on 1.1? >>>> >>>> What do you think of branching over two weeks? (november 1st?) |
From: Benjamin C. <php...@be...> - 2005-11-22 04:51:20
|
It looks interesting to me. On Nov 18, 2005, at 6:16 AM, Marco Kuhn wrote: > hi all, > > i included in my version of phpbt some features, which are perhaps > interesting > for you. > > The features are > - global filter (only admin can create this filters, the users can > choose it) > - global highlightning of status, type, and severity. > > In our bugtracking workflow the global filters are really helpful > to get fast > access to the bugs and the highlightning make the buglist clearly > laid out. > > In the attachment you can find a screenshoot. > > Are this features interesting for general phpbt? > > best > --marco > > <features.jpg> |
From: Benjamin C. <php...@be...> - 2005-11-22 04:50:36
|
i took a slightly different approach in tackling this vulnerability report, but it looks like vote_view() got missed. There should be a $db->quote() around the bug_id in the query. On Nov 18, 2005, at 5:45 AM, Marco Kuhn wrote: > hi all, > > i read about some security vulnerability in phpbt version 0.9.1. > I know,that this reports are 1 year ago, but the current CVS version > contain not the patch described below. > > reports: > http://networksecurityarchive.org/html/Vuln-Dev/2004-11/msg00197.html > http://networksecurityarchive.org/html/Vuln-Dev/2004-11/msg00208.html > > patch: > http://www.phpsecure.info/v2/.php?zone=pDl&id=169 > > e.g. the patch for vote_view($bug_id) in bug.php: > the patch check the variable $bug_id witch > $bug_id = intval($bug_id); > > Did you fix the security gap differently? > > Best reagards > > -- marco > > > ------------------------------------------------------- > This SF.Net email is sponsored by the JBoss Inc. Get Certified Today > Register for a JBoss Training Course. Free Certification Exam > for All Training Attendees Through End of 2005. For more info visit: > http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click > _______________________________________________ > phpbt-dev mailing list > php...@li... > https://lists.sourceforge.net/lists/listinfo/phpbt-dev |
From: Benjamin C. <php...@be...> - 2005-11-22 04:44:36
|
That sounds good to me. On Nov 9, 2005, at 12:49 PM, Ulf Erikson wrote: > Sorry that it toke a while. The upgrade scripts should be ready > now. They are all disabled until I hear from someone that they work > safely.. Please be careful with your data while testing. > > Benjamin, what is the plan now? I would suggest: > 1) Ask people at phpbt-dev to test the CVS version > a) first by a fresh install into an empty database and add some > dummy users and bugs. > b) by upgrading a dummy v1.0.1 database (or a copy! of an > existing v1.0.1 database) > 2) Fix some bugs found > 3) Make a tar-ball and ask people at phpbt-users to test it > 4) Fix some bugs found > 5) release? or iterate steps 3+4 a few times? > > > Benjamin Curtis wrote: >> Yeah, I've been thinking for the last week or so that we should >> just do 1.1. Branching around the 1st sounds good to me. >> On Oct 18, 2005, at 12:13 PM, Ulf Erikson wrote: >>> Benjamin, >>> >>> Is the plan still to have a v1.0.2 update? Should I keep >>> flagging bugs as interesting for that release? or is it time to >>> focus on 1.1? >>> >>> What do you think of branching over two weeks? (november 1st?) > > > ------------------------------------------------------- > SF.Net email is sponsored by: > Tame your development challenges with Apache's Geronimo App Server. > Download > it for free - -and be entered to win a 42" plasma tv or your very own > Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php > _______________________________________________ > phpbt-dev mailing list > php...@li... > https://lists.sourceforge.net/lists/listinfo/phpbt-dev |
From: Marco K. <kuh...@we...> - 2005-11-18 13:16:29
|
hi all, i included in my version of phpbt some features, which are perhaps interesting for you. The features are - global filter (only admin can create this filters, the users can choose it) - global highlightning of status, type, and severity. In our bugtracking workflow the global filters are really helpful to get fast access to the bugs and the highlightning make the buglist clearly laid out. In the attachment you can find a screenshoot. Are this features interesting for general phpbt? best --marco |
From: Marco K. <kuh...@we...> - 2005-11-18 12:45:51
|
hi all, i read about some security vulnerability in phpbt version 0.9.1. I know,that this reports are 1 year ago, but the current CVS version contain not the patch described below. reports: http://networksecurityarchive.org/html/Vuln-Dev/2004-11/msg00197.html http://networksecurityarchive.org/html/Vuln-Dev/2004-11/msg00208.html patch: http://www.phpsecure.info/v2/.php?zone=pDl&id=169 e.g. the patch for vote_view($bug_id) in bug.php: the patch check the variable $bug_id witch $bug_id = intval($bug_id); Did you fix the security gap differently? Best reagards -- marco |
From: Ulf E. <ulf...@fa...> - 2005-11-09 20:49:21
|
Sorry that it toke a while. The upgrade scripts should be ready now. They are all disabled until I hear from someone that they work safely.. Please be careful with your data while testing. Benjamin, what is the plan now? I would suggest: 1) Ask people at phpbt-dev to test the CVS version a) first by a fresh install into an empty database and add some dummy users and bugs. b) by upgrading a dummy v1.0.1 database (or a copy! of an existing v1.0.1 database) 2) Fix some bugs found 3) Make a tar-ball and ask people at phpbt-users to test it 4) Fix some bugs found 5) release? or iterate steps 3+4 a few times? Benjamin Curtis wrote: > Yeah, I've been thinking for the last week or so that we should just do > 1.1. Branching around the 1st sounds good to me. > > On Oct 18, 2005, at 12:13 PM, Ulf Erikson wrote: >> Benjamin, >> >> Is the plan still to have a v1.0.2 update? Should I keep flagging >> bugs as interesting for that release? or is it time to focus on 1.1? >> >> What do you think of branching over two weeks? (november 1st?) |
From: Ulf E. <ulf...@us...> - 2005-11-09 20:41:28
|
Update of /cvsroot/phpbt/phpbt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5089 Modified Files: install.php Log Message: Adding mssql to installer Index: install.php =================================================================== RCS file: /cvsroot/phpbt/phpbt/install.php,v retrieving revision 1.55 retrieving revision 1.56 diff -u -r1.55 -r1.56 --- install.php 30 Sep 2005 21:56:53 -0000 1.55 +++ install.php 9 Nov 2005 20:41:20 -0000 1.56 @@ -84,7 +84,9 @@ 'mysql' => 'MySQL < 4.1', 'mysqli' => 'MySQL >= 4.1', 'oci8' => 'Oracle 8.1.x', - 'pgsql' => 'PostgreSQL'); + 'pgsql' => 'PostgreSQL', + 'mssql' => 'Microsoft SQL Server', + ); @ini_set("magic_quotes_runtime", 0); // runtime quotes will kill the included sql @ini_set("magic_quotes_sybase", 0); |
From: Ulf E. <ulf...@us...> - 2005-11-09 20:40:28
|
Update of /cvsroot/phpbt/phpbt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4826 Modified Files: upgrade.php Log Message: Updated upgrade scripts Index: upgrade.php =================================================================== RCS file: /cvsroot/phpbt/phpbt/upgrade.php,v retrieving revision 1.44 retrieving revision 1.45 diff -u -r1.44 -r1.45 --- upgrade.php 3 Sep 2005 16:41:48 -0000 1.44 +++ upgrade.php 9 Nov 2005 20:40:20 -0000 1.45 @@ -101,6 +101,15 @@ if (!$upgraded) { switch(DB_TYPE) { case 'pgsql' : + if (true) { + $comment_text .= "<div class=\"error\">Upgrading of old installs is still unsupported</div>"; + + $comment_text .= "<p>An upgrade script has been written, but it is completely UNTESTED! Proceed At Your Own Risk...</p>"; + $comment_text .= "<p>Don't forget to report your success (or failure) story to <a href=\"mailto:php...@li...\">php...@li...</a> if you do proceed. We have interest in detailed error reports and patches from people who use PostgreSQL.</p>"; + include 'templates/default/upgrade-finished.html'; + exit; + } + log_query("create table ".TBL_PROJECT_PERM." ( project_id INT4 NOT NULL DEFAULT '0', user_id INT4 NOT NULL DEFAULT '0' )"); if ($thisvers < 2) { log_query("alter table ".TBL_AUTH_GROUP." ADD assignable INT2"); @@ -124,17 +133,31 @@ log_query("create table ".TBL_PRIORITY."( priority_id INT4 NOT NULL DEFAULT '0', priority_name varchar(30) NOT NULL DEFAULT '', priority_desc TEXT DEFAULT '' NOT NULL, sort_order INT2 NOT NULL DEFAULT '0', priority_color varchar(10) NOT NULL DEFAULT '#FFFFFF', PRIMARY KEY (priority_id) )"); log_query("create table ".TBL_BOOKMARK."( user_id INT4 NOT NULL DEFAULT '0', bug_id INT4 NOT NULL DEFAULT '0' )"); - log_query('ALTER TABLE '.TBL_COMPONENT.' ADD sort_order INT2'); + log_query("ALTER TABLE ".TBL_COMPONENT." ADD sort_order INT2"); log_query("ALTER TABLE ".TBL_COMPONENT." alter sort_order set DEFAULT 0"); log_query("ALTER TABLE ".TBL_COMPONENT." alter sort_order set NOT NULL"); - log_query('ALTER TABLE '.TBL_VERSION.' ADD sort_order INT2'); + log_query("ALTER TABLE ".TBL_VERSION." ADD sort_order INT2"); log_query("ALTER TABLE ".TBL_VERSION." alter sort_order set DEFAULT 0"); log_query("ALTER TABLE ".TBL_VERSION." alter sort_order set NOT NULL"); log_query("CREATE SEQUENCE ".TBL_PRIORITY."_seq START 6"); + log_query("ALTER TABLE ".TBL_AUTH_GROUP." ADD is_role INT2"); + log_query("ALTER TABLE ".TBL_AUTH_GROUP." alter is_role set DEFAULT 0"); + log_query("ALTER TABLE ".TBL_AUTH_GROUP." alter is_role set NOT NULL"); + log_query("DROP SEQUENCE ".TBL_AUTH_GROUP."_seq"); + log_query("CREATE SEQUENCE ".TBL_AUTH_GROUP."_seq START 10"); } break; case 'mysqli' : case 'mysql' : + if (true) { + $comment_text .= "<div class=\"error\">Upgrading of old installs is still unsupported</div>"; + + $comment_text .= "<p>An upgrade script has been written, but it is completely UNTESTED! Proceed At Your Own Risk...</p>"; + $comment_text .= "<p>Don't forget to report your success (or failure) story to <a href=\"mailto:php...@li...\">php...@li...</a> if you do proceed. We have interest in detailed error reports and patches from people who use MySQL.</p>"; + include 'templates/default/upgrade-finished.html'; + exit; + } + log_query("create table if not exists ".TBL_PROJECT_PERM." ( project_id int(11) NOT NULL default '0', user_id int(11) NOT NULL default '0' )"); if ($thisvers < 2) { log_query("alter table ".TBL_AUTH_GROUP." ADD assignable TINYINT DEFAULT 0 NOT NULL AFTER locked"); @@ -152,13 +175,17 @@ log_query("alter table ".TBL_VERSION." ADD sort_order tinyint(3) unsigned NOT NULL default '0' AFTER active"); log_query("CREATE TABLE IF NOT EXISTS ".TBL_PRIORITY."_seq (id int unsigned auto_increment not null primary key)"); log_query("INSERT INTO ".TBL_PRIORITY."_seq values (5)"); + log_query("alter table ".TBL_AUTH_GROUP." ADD is_role tinyint(1) unsigned NOT NULL default '0'"); + log_query("DROP TABLE ".TBL_AUTH_GROUP."_seq"); + log_query("CREATE TABLE IF NOT EXISTS ".TBL_AUTH_GROUP."_seq (id int unsigned auto_increment not null primary key)"); + log_query("INSERT INTO ".TBL_AUTH_GROUP."_seq values (9)"); } break; case 'oci8' : if (true) { - $comment_text .= "<div class=\"error\">Oracle is not supported in version 1.0</div>"; + $comment_text .= "<div class=\"error\">Upgrading of old installs is still unsupported</div>"; - $comment_text .= "<p>An attempt to restore Oracle support has been made (by copy-paste-and-edit), but it is completely UNTESTED! Proceed At Your Own Risk...</p>"; + $comment_text .= "<p>An upgrade script has been written, but it is completely UNTESTED! Proceed At Your Own Risk...</p>"; $comment_text .= "<p>Don't forget to report your success (or failure) story to <a href=\"mailto:php...@li...\">php...@li...</a> if you do proceed. We have interest in detailed error reports and patches from people who use Oracle.</p>"; include 'templates/default/upgrade-finished.html'; exit; @@ -180,6 +207,9 @@ log_query("ALTER TABLE ".TBL_COMPONENT." ADD ( sort_order number(3) default '0' NOT NULL )"); log_query("ALTER TABLE ".TBL_VERSION." ADD ( sort_order number(3) default '0' NOT NULL )"); log_query("CREATE SEQUENCE ".TBL_PRIORITY."_seq START WITH 6 NOCACHE"); + log_query("ALTER TABLE ".TBL_AUTH_GROUP." ADD ( is_role number(1) default '0' NOT NULL )"); + log_query("DROP SEQUENCE ".TBL_AUTH_GROUP."_seq"); + log_query("CREATE SEQUENCE ".TBL_AUTH_GROUP."_seq START WITH 10 NOCACHE"); } break; } @@ -200,8 +230,54 @@ } if ($thisvers < 5) { + log_query("DELETE FROM ".TBL_AUTH_GROUP." WHERE 1"); + log_query("DELETE FROM ".TBL_AUTH_PERM." WHERE 1"); + log_query("DELETE FROM ".TBL_GROUP_PERM." WHERE 1"); + log_query("INSERT INTO ".TBL_AUTH_GROUP." (group_id, group_name, locked) VALUES (1, 'Admin', 1)"); + log_query("INSERT INTO ".TBL_AUTH_GROUP." (group_id, group_name, locked) VALUES (2, 'User', 1)"); + log_query("INSERT INTO ".TBL_AUTH_GROUP." (group_id, group_name, locked) VALUES (3, 'Developer', 1)"); + log_query("INSERT INTO ".TBL_AUTH_GROUP." (group_id, group_name, locked) VALUES (4, 'Manager', 1)"); + log_query("INSERT INTO ".TBL_AUTH_GROUP." (group_id, group_name, is_role, locked) VALUES (5, 'Guest', 1, 1)"); + log_query("INSERT INTO ".TBL_AUTH_GROUP." (group_id, group_name, is_role, locked) VALUES (6, 'User', 1, 1)"); + log_query("INSERT INTO ".TBL_AUTH_GROUP." (group_id, group_name, is_role, locked) VALUES (7, 'Reporter', 1, 1)"); + log_query("INSERT INTO ".TBL_AUTH_GROUP." (group_id, group_name, is_role, locked) VALUES (8, 'Assignee', 1, 1)"); + log_query("INSERT INTO ".TBL_AUTH_GROUP." (group_id, group_name, is_role, locked) VALUES (9, 'Owner', 1, 1)"); + log_query("INSERT INTO ".TBL_AUTH_PERM." (perm_id, perm_name) VALUES (1, 'Admin')"); + log_query("INSERT INTO ".TBL_AUTH_PERM." (perm_id, perm_name) VALUES (2, 'AddBug')"); + log_query("INSERT INTO ".TBL_AUTH_PERM." (perm_id, perm_name) VALUES (3, 'EditAssignment')"); log_query("INSERT INTO ".TBL_AUTH_PERM." (perm_id, perm_name) VALUES (4, 'Assignable')"); - $comment_text .= "You must set your developer group(s) to be Assignable by visiting the \"Groups\" page within the Administration Pages.<br><br>\n"; + log_query("INSERT INTO ".TBL_AUTH_PERM." (perm_id, perm_name) VALUES (5, 'EditBug')"); + log_query("INSERT INTO ".TBL_AUTH_PERM." (perm_id, perm_name) VALUES (6, 'CloseBug')"); + log_query("INSERT INTO ".TBL_AUTH_PERM." (perm_id, perm_name) VALUES (7, 'CommentBug')"); + log_query("INSERT INTO ".TBL_AUTH_PERM." (perm_id, perm_name) VALUES (8, 'EditPriority')"); + log_query("INSERT INTO ".TBL_AUTH_PERM." (perm_id, perm_name) VALUES (9, 'EditStatus')"); + log_query("INSERT INTO ".TBL_AUTH_PERM." (perm_id, perm_name) VALUES (10, 'EditSeverity')"); + log_query("INSERT INTO ".TBL_AUTH_PERM." (perm_id, perm_name) VALUES (11, 'EditResolution')"); + log_query("INSERT INTO ".TBL_AUTH_PERM." (perm_id, perm_name) VALUES (12, 'EditProject')"); + log_query("INSERT INTO ".TBL_AUTH_PERM." (perm_id, perm_name) VALUES (13, 'EditComponent')"); + log_query("INSERT INTO ".TBL_AUTH_PERM." (perm_id, perm_name) VALUES (14, 'ManageBug')"); + log_query("INSERT INTO ".TBL_GROUP_PERM." (group_id, perm_id) VALUES (1, 1)"); + log_query("INSERT INTO ".TBL_GROUP_PERM." (group_id, perm_id) VALUES (5, 7)"); + log_query("INSERT INTO ".TBL_GROUP_PERM." (group_id, perm_id) VALUES (6, 2)"); + log_query("INSERT INTO ".TBL_GROUP_PERM." (group_id, perm_id) VALUES (7, 5)"); + log_query("INSERT INTO ".TBL_GROUP_PERM." (group_id, perm_id) VALUES (7, 10)"); + log_query("INSERT INTO ".TBL_GROUP_PERM." (group_id, perm_id) VALUES (3, 4)"); + log_query("INSERT INTO ".TBL_GROUP_PERM." (group_id, perm_id) VALUES (3, 5)"); + log_query("INSERT INTO ".TBL_GROUP_PERM." (group_id, perm_id) VALUES (8, 8)"); + log_query("INSERT INTO ".TBL_GROUP_PERM." (group_id, perm_id) VALUES (8, 9)"); + log_query("INSERT INTO ".TBL_GROUP_PERM." (group_id, perm_id) VALUES (8, 11)"); + log_query("INSERT INTO ".TBL_GROUP_PERM." (group_id, perm_id) VALUES (4, 3)"); + log_query("INSERT INTO ".TBL_GROUP_PERM." (group_id, perm_id) VALUES (4, 6)"); + log_query("INSERT INTO ".TBL_GROUP_PERM." (group_id, perm_id) VALUES (4, 12)"); + log_query("INSERT INTO ".TBL_GROUP_PERM." (group_id, perm_id) VALUES (4, 13)"); + log_query("INSERT INTO ".TBL_GROUP_PERM." (group_id, perm_id) VALUES (4, 14)"); + log_query("INSERT INTO ".TBL_GROUP_PERM." (group_id, perm_id) VALUES (9, 6)"); + log_query("INSERT INTO ".TBL_GROUP_PERM." (group_id, perm_id) VALUES (9, 7)"); + log_query("INSERT INTO ".TBL_GROUP_PERM." (group_id, perm_id) VALUES (9, 8)"); + log_query("INSERT INTO ".TBL_GROUP_PERM." (group_id, perm_id) VALUES (9, 9)"); + log_query("INSERT INTO ".TBL_GROUP_PERM." (group_id, perm_id) VALUES (9, 10)"); + log_query("INSERT INTO ".TBL_GROUP_PERM." (group_id, perm_id) VALUES (9, 11)"); + log_query("INSERT INTO ".TBL_GROUP_PERM." (group_id, perm_id) VALUES (9, 13)"); log_query("INSERT INTO ".TBL_CONFIGURATION." VALUES ('USE_PRIORITY_COLOR','0','Should the query list use the priority colors as the row background color','bool')"); log_query("INSERT INTO ".TBL_PRIORITY." VALUES (1,'Low','Fix if possible',1,'#dadada')"); log_query("INSERT INTO ".TBL_PRIORITY." VALUES (2,'Medium Low','Must fix before final',2,'#dad0d0')"); @@ -209,6 +285,7 @@ log_query("INSERT INTO ".TBL_PRIORITY." VALUES (4,'Medium High','Fix as soon as possible',4,'#dab0b0')"); log_query("INSERT INTO ".TBL_PRIORITY." VALUES (5,'High','Fix immediately',5,'#daaaaa')"); log_query("INSERT INTO ".TBL_CONFIGURATION." VALUES ('NEW_ACCOUNTS_GROUP', 'User', 'The group assigned to new user accounts', 'string')"); + log_query("INSERT INTO ".TBL_AUTH_USER." (user_id, login, first_name, last_name, email, password, active) values (0, 'Anonymous User', 'Anonymous', 'User', '', '', 0)"); } /* update to current DB_VERSION */ |
From: Ulf E. <ulf...@us...> - 2005-10-31 21:34:48
|
Update of /cvsroot/phpbt/phpbt/templates/default In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1698/templates/default Modified Files: bugdisplay.html Log Message: Adding a role-based permission system Index: bugdisplay.html =================================================================== RCS file: /cvsroot/phpbt/phpbt/templates/default/bugdisplay.html,v retrieving revision 1.57 retrieving revision 1.58 diff -u -r1.57 -r1.58 --- bugdisplay.html 5 Oct 2005 20:36:02 -0000 1.57 +++ bugdisplay.html 31 Oct 2005 21:34:35 -0000 1.58 @@ -49,8 +49,19 @@ //--> </script> <?php + $is_user = (isset($_SESSION['uid']) && !empty($_SESSION['uid'])); + $is_admin = ($is_user && isset($perm) && $perm->have_perm_proj($project_id)); $may_edit = (isset($perm) && $perm->have_perm('EditBug', $project_id)); - $may_close = (isset($perm) && $perm->have_perm('CloseBug', $project_id)); + $may_manage = ($may_edit && $perm->have_perm('ManageBug', $project_id)); + $may_change_project = ($may_edit && $perm->have_perm('EditProject', $project_id)); + $may_change_component = ($may_edit && $perm->have_perm('EditComponent', $project_id)); + $may_change_assignment = ($may_edit && $perm->have_perm('EditAssignment', $project_id)); + $may_change_status = ($may_edit && $perm->have_perm('EditStatus', $project_id)); + $may_close = ($may_edit && $perm->have_perm('CloseBug', $project_id)); + $may_change_resolution = ($may_edit && $perm->have_perm('EditResolution', $project_id)); + $may_change_priority = ($may_edit && $perm->have_perm('EditPriority', $project_id)); + $may_change_severity = ($may_edit && $perm->have_perm('EditSeverity', $project_id)); + $may_add_comment = (isset($perm) && $perm->have_perm('CommentBug', $project_id)); ?> <form action="bug.php" method="post"> <input type="hidden" name="op" value="update"> @@ -78,7 +89,7 @@ <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td><?php echo translate("Reporter"); ?>:</td> - <?php if (isset($perm) and $perm->have_perm_proj($project_id)) { ?> + <?php if ($is_admin) { ?> <td><select name="created_by"><?php build_select('reporter', $created_by) ?></select></td> <?php } else { ?> <td><b><?php echo maskemail($reporter); ?></b></td> @@ -87,26 +98,26 @@ <td><b><?php echo date(DATE_FORMAT, $created_date) ?></b></td> </tr><tr> <td><?php echo translate("Project"); ?>:</td> - <?php if ($may_edit) { ?> + <?php if ($may_change_project) { ?> <td><select name="project_id" onChange="updateMenus(this.form)"><?php build_select('project', $project_id) ?></select></td> <?php } else { ?> <td><?php echo lookup('project', $project_id); ?></td> <?php } ?> <td><?php echo translate("Priority"); ?>:</td> - <?php if ($may_edit) { ?> + <?php if ($may_change_priority or $may_manage) { ?> <td><select name="priority"><?php build_select('priority', $priority) ?></select></td> <?php } else { ?> <td><?php echo lookup('priority', $priority); ?></td> <?php } ?> </tr><tr> <td><?php echo translate("Component"); ?>:</td> - <?php if ($may_edit) { ?> + <?php if ($may_change_component) { ?> <td><select name="component_id"><?php build_select('component', $component_id, $project_id) ?></select></td> <?php } else { ?> <td><?php echo lookup('component', $component_id); ?></td> <?php } ?> <td><?php echo translate("Severity"); ?>:</td> - <?php if ($may_edit) { ?> + <?php if ($may_change_severity or $may_manage) { ?> <td><select name="severity_id"><?php build_select('severity', $severity_id) ?></select></td> <?php } else { ?> <td><?php echo lookup('severity', $severity_id); ?></td> @@ -126,7 +137,7 @@ <?php } ?> </tr><tr> <td><?php echo translate("To be closed in version"); ?></td> - <?php if ($may_close) { ?> + <?php if ($may_close or $may_manage) { ?> <td><select name="to_be_closed_in_version_id"> <option value="0"><?php echo translate("Choose one"); ?></option> <?php build_select('version', $to_be_closed_in_version_id, $project_id) ?> @@ -142,7 +153,7 @@ <?php } ?> </tr><tr> <td><?php echo translate("Closed in version"); ?></td> - <?php if ($may_close) { ?> + <?php if ($may_close or $may_manage) { ?> <td><select name="closed_in_version_id"> <option value="0"><?php echo translate("Choose one"); ?></option> <?php build_select('version', $closed_in_version_id, $project_id) ?> @@ -164,7 +175,7 @@ <td><?php echo stripslashes(htmlspecialchars($title)); ?></td> <?php } ?> <td><?php echo translate("Status"); ?>:</td> - <?php if ($may_edit) { ?> + <?php if ($may_change_status or $may_manage) { ?> <td><select name="status_id"><?php build_select('status', $status_id, $project_id, true); ?></select></td> <?php } else { ?> <td><?php echo lookup('status', $status_id); ?></td> @@ -177,22 +188,22 @@ <td><?php echo $url; ?></td> <?php } ?> <td><?php echo translate("Resolution"); ?>:</td> - <?php if ($may_close) { ?> + <?php if ($may_close or $may_change_resolution or $may_manage) { ?> <td><select name="resolution_id"><option value="0"><?php echo translate("None"); ?></option><?php build_select('resolution', $resolution_id) ?></select></td> <?php } else { ?> <td><?php echo lookup('resolution', $resolution_id); ?></td> <?php } ?> </tr><tr> <td><?php echo translate("Assigned to"); ?>:</td> - <?php if (isset($perm) && ($perm->have_perm('EditAssignment') or $perm->have_perm_proj($project_id))) { ?> + <?php if ($may_change_assignment or $may_manage) { ?> <td><select name="assigned_to"><option value="0"><?php echo translate("None"); ?></option><?php build_select('owner', $assigned_to) ?></select></td> <?php } else { ?> <td> - <?php echo lookup('assigned_to', $assigned_to); ?> + <?php echo $assigned_to ? lookup('assigned_to', $assigned_to) : ""; ?> <input type="hidden" name="assigned_to" value="<?php echo $assigned_to ?>"> </td> <?php } ?> - <?php if (isset($perm)) { ?> + <?php if ($is_user) { ?> <td><?php echo translate("Add CC"); ?>:</td> <td><input type="text" name="add_cc"></td> <?php } ?> @@ -200,6 +211,7 @@ <td colspan="2" valign="top"> <br> <?php if (!empty($error['add_dep'])) echo "<div class=\"error\">{$error['add_dep']}</div>"; ?> + <?php if (!empty($bug_dependencies)) { ?> <?php echo translate("Depends on bugs"); ?>: <?php for ($i = 0, $count = count($bug_dependencies); $i < $count; $i++) { printf('<a href="bug.php?op=show&bugid=%d" class="%s">#%d</a>%s', @@ -209,6 +221,8 @@ ($i < $count - 1 ? ', ' : '')); } ?> <br> + <?php } ?> + <?php if (!empty($bug_blocks)) { ?> <?php echo translate("Blocks bugs"); ?>: <?php for ($i = 0, $count = count($bug_blocks); $i < $count; $i++) { printf('<a href="bug.php?op=show&bugid=%d" class="%s">#%d</a>%s', @@ -218,6 +232,8 @@ ($i < $count - 1 ? ', ' : '')); } ?> <br> + <?php } ?> + <?php if (!empty($bug_duplicates)) { ?> <?php echo translate("Duplicates"); ?>: <?php for ($i = 0, $count = count($bug_duplicates); $i < $count; $i++) { if (isset($bug_duplicates[$i])) { @@ -229,7 +245,8 @@ } } ?> <br> - <?php if ($may_edit) { ?> + <?php } ?> + <?php if ($may_manage or $is_owner or $is_assignee) { ?> <br> <?php echo translate("Add dependency"); ?>: <input type="text" name="add_dependency" size="5"><br> <?php echo translate("Remove dependency"); ?>: <input type="text" name="del_dependency" size="5"><br> @@ -241,7 +258,7 @@ <?php } ?> </td> <td colspan="2" valign="top"> - <?php if (isset($perm)) { ?> + <?php if ($is_user) { ?> <?php echo translate("Remove selected CCs"); ?>:<br> <select name="remove_cc[]" size="5" style="width: 15em" multiple><?php build_select('bug_cc', $bug_id, $project_id) ?></select> <?php } ?> @@ -249,13 +266,13 @@ </tr> </table> <table border="0" cellpadding="2" cellspacing="0" width="100%"> - <?php if (isset($perm)) { ?> + <?php if ($may_add_comment) { ?> <tr class="noprint"> <td valign="top"><br><?php echo translate("Additional comments"); ?>:<br> <textarea name="comments" rows="6" cols="55" wrap="virtual"><?php echo isset($_POST['comments']) ? $_POST['comments'] : ''; ?></textarea> <br><br> <div align="right"> - <?php if (!empty($_SESSION['uid'])) { ?> + <?php if ($may_edit or $may_add_comment) { ?> <?php echo translate("Supress notification email"); ?> <input type="checkbox" name="suppress_email" value="1"> <input type="submit" value="Submit"> <?php } else echo translate("You must login to modify this bug"); ?> @@ -299,7 +316,7 @@ <td align="center"><?php echo $attachments[$i]['mime_type']; ?></td> <td align="center"><?php echo date(DATE_FORMAT, $attachments[$i]['created_date']); ?></td> <td align="center"><a href='attachment.php?attachid=<?php echo $attachments[$i]['attachment_id']; ?>'>View</a> - <?php if (isset($perm) and $perm->have_perm_proj($project_id)) { ?> + <?php if ($is_admin or $may_manage) { ?> | <a href='attachment.php?del=<?php echo $attachments[$i]['attachment_id']; ?>' onClick="return confirm('<?php echo translate("Are you sure you want to delete this attachment?"); ?>');"><?php echo translate("Delete"); ?></a> <?php } ?> </td> @@ -357,7 +374,7 @@ <td><?php echo format_comments($comments[$i]['comment_text']); ?> <br><br></td> </tr> <?php } ?> - <?php if (isset($perm) && $perm->have_perm_proj($project_id)) { ?> + <?php if ($is_admin) { ?> <tr class="noprint"> <td> <div align="right"> |
From: Ulf E. <ulf...@us...> - 2005-10-31 21:34:48
|
Update of /cvsroot/phpbt/phpbt/templates/default/admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1698/templates/default/admin Modified Files: grouplist.html wrap.html Log Message: Adding a role-based permission system Index: grouplist.html =================================================================== RCS file: /cvsroot/phpbt/phpbt/templates/default/admin/grouplist.html,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- grouplist.html 22 Aug 2005 20:04:05 -0000 1.10 +++ grouplist.html 31 Oct 2005 21:34:35 -0000 1.11 @@ -3,14 +3,17 @@ var me = '<?php echo $_SERVER['SCRIPT_NAME']; ?>'; function popupGroup(id) { - window.open(me + '?op=edit&use_js=1&group_id='+id, 'ewin', 'dependent=yes,width=250,height=250,scrollbars=1'); + window.open(me + '?op=edit<?php echo $do_group ? '' : '-role'?>&use_js=1&group_id='+id, 'ewin', 'dependent=yes,width=250,height=250,scrollbars=1'); } // --> </script> <table border="0" width="100%"> <tr> <td valign="top"> - <b><?php echo $page_title; ?></b> - <a href="<?php echo $_SERVER['SCRIPT_NAME']; ?>?op=edit&group_id=0" onClick="popupGroup(0); return false;"><?php echo translate("Add new group"); ?></a> + <b><?php echo $page_title; ?></b> + <?php if ($do_group) { ?> + - <a href="<?php echo $_SERVER['SCRIPT_NAME']; ?>?op=edit<?php echo $do_group ? '' : '-role'?>&group_id=0" onClick="popupGroup(0); return false;"><?php echo translate("Add new group"); ?></a> + <?php } ?> <hr size="1"> <table class="bordertable" align="center"> <tr> @@ -20,14 +23,14 @@ </tr> <?php for ($i = 0, $count = count($groups); $i < $count; $i++) { ?> <tr> - <td><a href="<?php echo $_SERVER['SCRIPT_NAME']; ?>?op=edit&group_id=<?php echo $groups[$i]['group_id']; ?>" onClick="popupGroup(<?php echo $groups[$i]['group_id']; ?>); return false;"><?php echo stripslashes($groups[$i]['group_name']); ?></a></td> + <td><a href="<?php echo $_SERVER['SCRIPT_NAME']; ?>?op=edit<?php echo $do_group ? '' : '-role'?>&group_id=<?php echo $groups[$i]['group_id']; ?>" onClick="popupGroup(<?php echo $groups[$i]['group_id']; ?>); return false;"><?php echo stripslashes($groups[$i]['group_name']); ?></a></td> <td align="center"><?php echo $groups[$i]['count']; ?></td> <td align="center"> <?php if($groups[$i]['locked']) { echo translate("Locked"); } else { ?> - <a href="<?php echo $_SERVER['SCRIPT_NAME']; ?>?op=del&group_id=<?php echo $groups[$i]['group_id']; ?>" onClick="return confirm('<?php echo translate("This will remove all user assignments to this group and the group itself. Continue?"); ?>')"><?php echo translate("Delete"); ?></a> | - <a href="<?php echo $_SERVER['SCRIPT_NAME']; ?>?op=purge&group_id=<?php echo $groups[$i]['group_id']; ?>" onClick="return confirm('<?php echo translate("This will remove all user assignments to this group. Continue?"); ?>')"><?php echo translate("Purge"); ?></a> + <a href="<?php echo $_SERVER['SCRIPT_NAME']; ?>?op=del<?php echo $do_group ? '' : '-role'?>&group_id=<?php echo $groups[$i]['group_id']; ?>" onClick="return confirm('<?php echo translate("This will remove all user assignments to this group and the group itself. Continue?"); ?>')"><?php echo translate("Delete"); ?></a> | + <a href="<?php echo $_SERVER['SCRIPT_NAME']; ?>?op=purge<?php echo $do_group ? '' : '-role'?>&group_id=<?php echo $groups[$i]['group_id']; ?>" onClick="return confirm('<?php echo translate("This will remove all user assignments to this group. Continue?"); ?>')"><?php echo translate("Purge"); ?></a> <?php } ?> </td> </tr> Index: wrap.html =================================================================== RCS file: /cvsroot/phpbt/phpbt/templates/default/admin/wrap.html,v retrieving revision 1.25 retrieving revision 1.26 diff -u -r1.25 -r1.26 --- wrap.html 22 Aug 2005 19:44:47 -0000 1.25 +++ wrap.html 31 Oct 2005 21:34:35 -0000 1.26 @@ -24,6 +24,7 @@ <li><a href="project.php" class="navlink"><?php echo translate("Projects"); ?></a></li> <li><a href="user.php" class="navlink"><?php echo translate("Users"); ?></a></li> <li><a href="group.php" class="navlink"><?php echo translate("Groups"); ?></a></li> + <li><a href="group.php?op=list-roles" class="navlink"><?php echo translate("Roles"); ?></a></li> <li><a href="../docs/html/userguide.html" class="navlink"><?php echo translate("Documentation"); ?></a></li> <li><a href="../index.php" class="navlink"><?php echo translate("User Tools"); ?></a></li> </ul> |
From: Ulf E. <ulf...@us...> - 2005-10-31 21:34:45
|
Update of /cvsroot/phpbt/phpbt/schemas In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1698/schemas Modified Files: mssql.in mysql.in mysqli.in oci8.in pgsql.in Log Message: Adding a role-based permission system Index: mssql.in =================================================================== RCS file: /cvsroot/phpbt/phpbt/schemas/mssql.in,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- mssql.in 2 Oct 2005 20:57:40 -0000 1.5 +++ mssql.in 31 Oct 2005 21:34:35 -0000 1.6 @@ -30,6 +30,7 @@ created_date int NOT NULL default '0', last_modified_by smallint NOT NULL default '0', last_modified_date int NOT NULL default '0', + is_role bit NOT NULL default '0', PRIMARY KEY (group_id) ); @@ -384,6 +385,10 @@ INSERT INTO TBL_AUTH_USER + (user_id, login, first_name, last_name, email, password, active) + values (0, 'Anonymous User', 'Anonymous', 'User', '', '', 0); + +INSERT INTO TBL_AUTH_USER (user_id, login, first_name, last_name, email, password) values (1, 'OPTION_ADMIN_EMAIL', 'System', 'Admin', 'OPTION_ADMIN_EMAIL', 'OPTION_ADMIN_PASS'); @@ -391,37 +396,71 @@ CREATE TABLE TBL_AUTH_USER_seq ([id] [int] IDENTITY (1, 1) NOT NULL, [vapor] [int] NULL) -# Start off with three user levels... +# Start off with four user levels... INSERT INTO TBL_AUTH_GROUP (group_id, group_name, locked) VALUES (1, 'Admin', 1); INSERT INTO TBL_AUTH_GROUP (group_id, group_name, locked) VALUES (2, 'User', 1); INSERT INTO TBL_AUTH_GROUP (group_id, group_name, locked) VALUES (3, 'Developer', 1); INSERT INTO TBL_AUTH_GROUP (group_id, group_name, locked) VALUES (4, 'Manager', 1); -CREATE TABLE TBL_AUTH_GROUP_seq ([id] [int] IDENTITY (3, 1) NOT NULL, [vapor] [int] NULL) +# ... six user roles ... +INSERT INTO TBL_AUTH_GROUP (group_id, group_name, is_role, locked) VALUES (5, 'Guest', 1, 1); +INSERT INTO TBL_AUTH_GROUP (group_id, group_name, is_role, locked) VALUES (6, 'User', 1, 1); +INSERT INTO TBL_AUTH_GROUP (group_id, group_name, is_role, locked) VALUES (7, 'Reporter', 1, 1); +INSERT INTO TBL_AUTH_GROUP (group_id, group_name, is_role, locked) VALUES (8, 'Assignee', 1, 1); +INSERT INTO TBL_AUTH_GROUP (group_id, group_name, is_role, locked) VALUES (9, 'Owner', 1, 1); + +CREATE TABLE TBL_AUTH_GROUP_seq ([id] [int] IDENTITY (9, 1) NOT NULL, [vapor] [int] NULL) -# ... and four permissions +# ... and fourteen permissions INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (1, 'Admin'); INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (2, 'AddBug'); INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (3, 'EditAssignment'); INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (4, 'Assignable'); INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (5, 'EditBug'); INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (6, 'CloseBug'); +INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (7, 'CommentBug'); +INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (8, 'EditPriority'); +INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (9, 'EditStatus'); +INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (10, 'EditSeverity'); +INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (11, 'EditResolution'); +INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (12, 'EditProject'); +INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (13, 'EditComponent'); +INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (14, 'ManageBug'); # Admins can do all the admin stuff, INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (1, 1); # users can add and edit bugs, -INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (2, 2); -INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (2, 5); +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (5, 7); +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (6, 2); + +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (7, 5); +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (7, 10); # developers can own bugs, and INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (3, 4); +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (3, 5); + +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (8, 8); +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (8, 9); +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (8, 11); # managers can assign and close bugs INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (4, 3); INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (4, 6); +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (4, 12); +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (4, 13); +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (4, 14); + +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (9, 6); +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (9, 7); +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (9, 8); +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (9, 9); +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (9, 10); +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (9, 11); +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (9, 13); # Insert user_id 1 into the admin group Index: mysql.in =================================================================== RCS file: /cvsroot/phpbt/phpbt/schemas/mysql.in,v retrieving revision 1.53 retrieving revision 1.54 diff -u -r1.53 -r1.54 --- mysql.in 2 Oct 2005 20:57:40 -0000 1.53 +++ mysql.in 31 Oct 2005 21:34:35 -0000 1.54 @@ -30,6 +30,7 @@ created_date bigint(20) unsigned NOT NULL default '0', last_modified_by int(10) unsigned NOT NULL default '0', last_modified_date bigint(20) unsigned NOT NULL default '0', + is_role tinyint(1) unsigned NOT NULL default '0', PRIMARY KEY (group_id) ) TYPE=MyISAM; @@ -390,6 +391,10 @@ INSERT INTO TBL_AUTH_USER + (user_id, login, first_name, last_name, email, password, active) + values (0, 'Anonymous User', 'Anonymous', 'User', '', '', 0); + +INSERT INTO TBL_AUTH_USER (user_id, login, first_name, last_name, email, password) values (1, 'OPTION_ADMIN_EMAIL', 'System', 'Admin', 'OPTION_ADMIN_EMAIL', 'OPTION_ADMIN_PASS'); @@ -399,39 +404,73 @@ INSERT INTO TBL_AUTH_USER_seq values (1); -# Start off with three user levels... +# Start off with four user levels... INSERT INTO TBL_AUTH_GROUP (group_id, group_name, locked) VALUES (1, 'Admin', 1); INSERT INTO TBL_AUTH_GROUP (group_id, group_name, locked) VALUES (2, 'User', 1); INSERT INTO TBL_AUTH_GROUP (group_id, group_name, locked) VALUES (3, 'Developer', 1); INSERT INTO TBL_AUTH_GROUP (group_id, group_name, locked) VALUES (4, 'Manager', 1); +# ... six user roles ... +INSERT INTO TBL_AUTH_GROUP (group_id, group_name, is_role, locked) VALUES (5, 'Guest', 1, 1); +INSERT INTO TBL_AUTH_GROUP (group_id, group_name, is_role, locked) VALUES (6, 'User', 1, 1); +INSERT INTO TBL_AUTH_GROUP (group_id, group_name, is_role, locked) VALUES (7, 'Reporter', 1, 1); +INSERT INTO TBL_AUTH_GROUP (group_id, group_name, is_role, locked) VALUES (8, 'Assignee', 1, 1); +INSERT INTO TBL_AUTH_GROUP (group_id, group_name, is_role, locked) VALUES (9, 'Owner', 1, 1); + CREATE TABLE TBL_AUTH_GROUP_seq ( id int unsigned auto_increment not null primary key); -INSERT INTO TBL_AUTH_GROUP_seq values (3); +INSERT INTO TBL_AUTH_GROUP_seq values (9); -# ... and four permissions +# ... and fourteen permissions INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (1, 'Admin'); INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (2, 'AddBug'); INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (3, 'EditAssignment'); INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (4, 'Assignable'); INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (5, 'EditBug'); INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (6, 'CloseBug'); +INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (7, 'CommentBug'); +INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (8, 'EditPriority'); +INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (9, 'EditStatus'); +INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (10, 'EditSeverity'); +INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (11, 'EditResolution'); +INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (12, 'EditProject'); +INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (13, 'EditComponent'); +INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (14, 'ManageBug'); # Admins can do all the admin stuff, INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (1, 1); # users can add and edit bugs, -INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (2, 2); -INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (2, 5); +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (5, 7); +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (6, 2); + +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (7, 5); +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (7, 10); # developers can own bugs, and INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (3, 4); +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (3, 5); + +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (8, 8); +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (8, 9); +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (8, 11); # managers can assign and close bugs INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (4, 3); INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (4, 6); +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (4, 12); +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (4, 13); +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (4, 14); + +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (9, 6); +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (9, 7); +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (9, 8); +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (9, 9); +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (9, 10); +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (9, 11); +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (9, 13); # Insert user_id 1 into the admin group Index: mysqli.in =================================================================== RCS file: /cvsroot/phpbt/phpbt/schemas/mysqli.in,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- mysqli.in 2 Oct 2005 20:57:40 -0000 1.3 +++ mysqli.in 31 Oct 2005 21:34:35 -0000 1.4 @@ -30,6 +30,7 @@ created_date bigint(20) unsigned NOT NULL default '0', last_modified_by int(10) unsigned NOT NULL default '0', last_modified_date bigint(20) unsigned NOT NULL default '0', + is_role tinyint(1) unsigned NOT NULL default '0', PRIMARY KEY (group_id) ) TYPE=MyISAM; @@ -390,6 +391,10 @@ INSERT INTO TBL_AUTH_USER + (user_id, login, first_name, last_name, email, password, active) + values (0, 'Anonymous User', 'Anonymous', 'User', '', '', 0); + +INSERT INTO TBL_AUTH_USER (user_id, login, first_name, last_name, email, password) values (1, 'OPTION_ADMIN_EMAIL', 'System', 'Admin', 'OPTION_ADMIN_EMAIL', 'OPTION_ADMIN_PASS'); @@ -399,39 +404,73 @@ INSERT INTO TBL_AUTH_USER_seq values (1); -# Start off with three user levels... +# Start off with four user levels... INSERT INTO TBL_AUTH_GROUP (group_id, group_name, locked) VALUES (1, 'Admin', 1); INSERT INTO TBL_AUTH_GROUP (group_id, group_name, locked) VALUES (2, 'User', 1); INSERT INTO TBL_AUTH_GROUP (group_id, group_name, locked) VALUES (3, 'Developer', 1); INSERT INTO TBL_AUTH_GROUP (group_id, group_name, locked) VALUES (4, 'Manager', 1); +# ... six user roles ... +INSERT INTO TBL_AUTH_GROUP (group_id, group_name, is_role, locked) VALUES (5, 'Guest', 1, 1); +INSERT INTO TBL_AUTH_GROUP (group_id, group_name, is_role, locked) VALUES (6, 'User', 1, 1); +INSERT INTO TBL_AUTH_GROUP (group_id, group_name, is_role, locked) VALUES (7, 'Reporter', 1, 1); +INSERT INTO TBL_AUTH_GROUP (group_id, group_name, is_role, locked) VALUES (8, 'Assignee', 1, 1); +INSERT INTO TBL_AUTH_GROUP (group_id, group_name, is_role, locked) VALUES (9, 'Owner', 1, 1); + CREATE TABLE TBL_AUTH_GROUP_seq ( id int unsigned auto_increment not null primary key); -INSERT INTO TBL_AUTH_GROUP_seq values (3); +INSERT INTO TBL_AUTH_GROUP_seq values (9); -# ... and four permissions +# ... and fourteen permissions INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (1, 'Admin'); INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (2, 'AddBug'); INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (3, 'EditAssignment'); INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (4, 'Assignable'); INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (5, 'EditBug'); INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (6, 'CloseBug'); +INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (7, 'CommentBug'); +INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (8, 'EditPriority'); +INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (9, 'EditStatus'); +INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (10, 'EditSeverity'); +INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (11, 'EditResolution'); +INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (12, 'EditProject'); +INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (13, 'EditComponent'); +INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (14, 'ManageBug'); # Admins can do all the admin stuff, INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (1, 1); # users can add and edit bugs, -INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (2, 2); -INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (2, 5); +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (5, 7); +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (6, 2); + +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (7, 5); +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (7, 10); # developers can own bugs, and INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (3, 4); +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (3, 5); + +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (8, 8); +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (8, 9); +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (8, 11); # managers can assign and close bugs INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (4, 3); INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (4, 6); +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (4, 12); +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (4, 13); +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (4, 14); + +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (9, 6); +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (9, 7); +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (9, 8); +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (9, 9); +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (9, 10); +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (9, 11); +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (9, 13); # Insert user_id 1 into the admin group Index: oci8.in =================================================================== RCS file: /cvsroot/phpbt/phpbt/schemas/oci8.in,v retrieving revision 1.33 retrieving revision 1.34 diff -u -r1.33 -r1.34 --- oci8.in 2 Oct 2005 20:57:40 -0000 1.33 +++ oci8.in 31 Oct 2005 21:34:35 -0000 1.34 @@ -30,6 +30,7 @@ created_date number(20) default '0' NOT NULL, last_modified_by number(10) default '0' NOT NULL, last_modified_date number(20) default '0' NOT NULL, + is_role number(1) default '0' NOT NULL, PRIMARY KEY (group_id) ) ; @@ -395,6 +396,10 @@ INSERT INTO TBL_AUTH_USER + (user_id, login, first_name, last_name, email, password, active) + values (0, 'Anonymous User', 'Anonymous', 'User', '', '', 0); + +INSERT INTO TBL_AUTH_USER (user_id, login, first_name, last_name, email, password) values (1, 'OPTION_ADMIN_EMAIL', 'System', 'Admin', 'OPTION_ADMIN_EMAIL', 'OPTION_ADMIN_PASS'); @@ -402,37 +407,71 @@ CREATE SEQUENCE TBL_AUTH_USER_seq START WITH 2 NOCACHE; -# Start off with three user levels... +# Start off with four user levels... INSERT INTO TBL_AUTH_GROUP (group_id, group_name, locked) VALUES (1, 'Admin', 1); INSERT INTO TBL_AUTH_GROUP (group_id, group_name, locked) VALUES (2, 'User', 1); INSERT INTO TBL_AUTH_GROUP (group_id, group_name, locked) VALUES (3, 'Developer', 1); INSERT INTO TBL_AUTH_GROUP (group_id, group_name, locked) VALUES (4, 'Manager', 1); -CREATE SEQUENCE TBL_AUTH_GROUP_seq START WITH 4 NOCACHE; +# ... six user roles ... +INSERT INTO TBL_AUTH_GROUP (group_id, group_name, is_role, locked) VALUES (5, 'Guest', 1, 1); +INSERT INTO TBL_AUTH_GROUP (group_id, group_name, is_role, locked) VALUES (6, 'User', 1, 1); +INSERT INTO TBL_AUTH_GROUP (group_id, group_name, is_role, locked) VALUES (7, 'Reporter', 1, 1); +INSERT INTO TBL_AUTH_GROUP (group_id, group_name, is_role, locked) VALUES (8, 'Assignee', 1, 1); +INSERT INTO TBL_AUTH_GROUP (group_id, group_name, is_role, locked) VALUES (9, 'Owner', 1, 1); + +CREATE SEQUENCE TBL_AUTH_GROUP_seq START WITH 10 NOCACHE; -# ... and four permissions +# ... and fourteen permissions INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (1, 'Admin'); INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (2, 'AddBug'); INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (3, 'EditAssignment'); INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (4, 'Assignable'); INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (5, 'EditBug'); INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (6, 'CloseBug'); +INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (7, 'CommentBug'); +INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (8, 'EditPriority'); +INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (9, 'EditStatus'); +INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (10, 'EditSeverity'); +INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (11, 'EditResolution'); +INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (12, 'EditProject'); +INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (13, 'EditComponent'); +INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (14, 'ManageBug'); # Admins can do all the admin stuff, INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (1, 1); # users can add and edit bugs, -INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (2, 2); -INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (2, 5); +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (5, 7); +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (6, 2); + +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (7, 5); +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (7, 10); # developers can own bugs, and INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (3, 4); +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (3, 5); + +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (8, 8); +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (8, 9); +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (8, 11); # managers can assign and close bugs INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (4, 3); INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (4, 6); +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (4, 12); +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (4, 13); +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (4, 14); + +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (9, 6); +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (9, 7); +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (9, 8); +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (9, 9); +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (9, 10); +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (9, 11); +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (9, 13); # Insert user_id 1 into the admin group Index: pgsql.in =================================================================== RCS file: /cvsroot/phpbt/phpbt/schemas/pgsql.in,v retrieving revision 1.52 retrieving revision 1.53 diff -u -r1.52 -r1.53 --- pgsql.in 2 Oct 2005 20:57:40 -0000 1.52 +++ pgsql.in 31 Oct 2005 21:34:35 -0000 1.53 @@ -30,6 +30,7 @@ created_date INT8 NOT NULL DEFAULT '0', last_modified_by INT4 NOT NULL DEFAULT '0', last_modified_date INT8 NOT NULL DEFAULT '0', + is_role INT2 NOT NULL DEFAULT 0, PRIMARY KEY (group_id) ); @@ -383,6 +384,10 @@ INSERT INTO TBL_AUTH_USER + (user_id, login, first_name, last_name, email, password, active) + values (0, 'Anonymous User', 'Anonymous', 'User', '', '', 0); + +INSERT INTO TBL_AUTH_USER (user_id, login, first_name, last_name, email, password) values (1, 'OPTION_ADMIN_EMAIL', 'System', 'Admin', 'OPTION_ADMIN_EMAIL', 'OPTION_ADMIN_PASS'); @@ -390,37 +395,70 @@ CREATE SEQUENCE TBL_AUTH_USER_seq START 2; -# Start off with three user levels... +# Start off with four user levels... INSERT INTO TBL_AUTH_GROUP (group_id, group_name, locked) VALUES (1, 'Admin', 1); INSERT INTO TBL_AUTH_GROUP (group_id, group_name, locked) VALUES (2, 'User', 1); INSERT INTO TBL_AUTH_GROUP (group_id, group_name, locked) VALUES (3, 'Developer', 1); INSERT INTO TBL_AUTH_GROUP (group_id, group_name, locked) VALUES (4, 'Manager', 1); -CREATE SEQUENCE TBL_AUTH_GROUP_seq START 4; +# ... six user roles ... +INSERT INTO TBL_AUTH_GROUP (group_id, group_name, is_role, locked) VALUES (5, 'Guest', 1, 1); +INSERT INTO TBL_AUTH_GROUP (group_id, group_name, is_role, locked) VALUES (6, 'User', 1, 1); +INSERT INTO TBL_AUTH_GROUP (group_id, group_name, is_role, locked) VALUES (7, 'Reporter', 1, 1); +INSERT INTO TBL_AUTH_GROUP (group_id, group_name, is_role, locked) VALUES (8, 'Assignee', 1, 1); +INSERT INTO TBL_AUTH_GROUP (group_id, group_name, is_role, locked) VALUES (9, 'Owner', 1, 1); +CREATE SEQUENCE TBL_AUTH_GROUP_seq START 10; -# ... and four permissions +# ... and fourteen permissions INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (1, 'Admin'); INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (2, 'AddBug'); INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (3, 'EditAssignment'); INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (4, 'Assignable'); INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (5, 'EditBug'); INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (6, 'CloseBug'); +INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (7, 'CommentBug'); +INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (8, 'EditPriority'); +INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (9, 'EditStatus'); +INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (10, 'EditSeverity'); +INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (11, 'EditResolution'); +INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (12, 'EditProject'); +INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (13, 'EditComponent'); +INSERT INTO TBL_AUTH_PERM (perm_id, perm_name) VALUES (14, 'ManageBug'); # Admins can do all the admin stuff, INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (1, 1); # users can add and edit bugs, -INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (2, 2); -INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (2, 5); +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (5, 7); +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (6, 2); + +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (7, 5); +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (7, 10); # developers can own bugs, and INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (3, 4); +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (3, 5); + +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (8, 8); +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (8, 9); +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (8, 11); # managers can assign and close bugs INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (4, 3); INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (4, 6); +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (4, 12); +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (4, 13); +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (4, 14); + +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (9, 6); +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (9, 7); +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (9, 8); +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (9, 9); +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (9, 10); +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (9, 11); +INSERT INTO TBL_GROUP_PERM (group_id, perm_id) VALUES (9, 13); # Insert user_id 1 into the admin group |
From: Ulf E. <ulf...@us...> - 2005-10-31 21:34:44
|
Update of /cvsroot/phpbt/phpbt/inc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1698/inc Modified Files: auth.php functions.php Log Message: Adding a role-based permission system Index: auth.php =================================================================== RCS file: /cvsroot/phpbt/phpbt/inc/auth.php,v retrieving revision 1.25 retrieving revision 1.26 diff -u -r1.25 -r1.26 --- auth.php 2 Oct 2005 20:45:21 -0000 1.25 +++ auth.php 31 Oct 2005 21:34:35 -0000 1.26 @@ -61,6 +61,17 @@ function auth_validatelogin() { global $db, $select, $emailpass, $emailsuccess, $uid; + $role = array(); + $roles = $db->getAll("select group_id, group_name from ".TBL_AUTH_GROUP." ag where ag.is_role=1"); + + foreach ($roles as $r) { + $role[$r['group_name']] = $r['group_id']; + } + + $_SESSION['group'] = array(); + $_SESSION['group_ids'] = array(0); + $_SESSION['perms'] = array(); + extract($_POST); if (!$username) return 0; $_SESSION['uname'] = $username; @@ -79,11 +90,18 @@ $_SESSION['group_ids'][] = $groupid; $_SESSION['group'][$groupname] = true; } + $_SESSION['group_ids'][] = $role['User']; + $_SESSION['group']['User'] = true; + $perms = $db->getCol("select perm_name from ".TBL_AUTH_PERM." ap, ".TBL_GROUP_PERM." gp where group_id in (".@join(',', $_SESSION['group_ids']).") and gp.perm_id = ap.perm_id"); foreach ($perms as $perm) { $_SESSION['perms'][$perm] = true; } $_SESSION['uid'] = $u['user_id']; + $projs = $db->getCol("select project_id from ".TBL_PROJECT_PERM." where user_id = ".$_SESSION['uid']); + foreach ($projs as $proj) { + $_SESSION['projs'][$proj] = true; + } return $u['user_id']; } @@ -97,6 +115,9 @@ $_SESSION['group'] = array(); $_SESSION['group_ids'] = array(0); $_SESSION['db_fields'] = array(); + $_SESSION['queryinfo'] = array(); + $_SESSION = array(); + } } @@ -134,14 +155,14 @@ } if ($project_id == -1) { - if ( $db->getCol('SELECT user_id FROM '.TBL_PROJECT_PERM.' WHERE user_id = '.$_SESSION['uid']) ) { + if (isset($_SESSION['projs']) ) { return true; } else { return false; } } - if ( $db->getCol('SELECT user_id FROM '.TBL_PROJECT_PERM.' WHERE user_id = '.$_SESSION['uid']." AND project_id = $project_id") ) { + if (isset($_SESSION['projs'][$project_id]) ) { return true; } else { return false; @@ -161,12 +182,14 @@ if (is_array($reqs)) { foreach ($reqs as $req) { - if (!@isset($_SESSION[$auth_var][$req])) { + if (!@isset($_SESSION[$auth_var][$req]) && + ($auth_var!='perms' || !@isset($this->permissions[$req]))) { return false; } } } else { - if (!@isset($_SESSION[$auth_var][$reqs])) { + if (!@isset($_SESSION[$auth_var][$reqs]) && + ($auth_var!='perms' || !@isset($this->permissions[$reqs]))) { return false; } } @@ -201,6 +224,18 @@ exit(); } } + + function add_role($arole) { + global $db; + + $perms = $db->getCol("select perm_name from ".TBL_AUTH_PERM." ap, ".TBL_GROUP_PERM." gp, ".TBL_AUTH_GROUP." ag where ag.group_name='$arole' and ag.group_id=gp.group_id and gp.perm_id = ap.perm_id"); + if ($perms && !DB::isError($perms)) { + foreach ($perms as $p) { + $this->permissions[$p] = true; + } + } + } + } ?> Index: functions.php =================================================================== RCS file: /cvsroot/phpbt/phpbt/inc/functions.php,v retrieving revision 1.70 retrieving revision 1.71 diff -u -r1.70 -r1.71 --- functions.php 18 Oct 2005 18:43:15 -0000 1.70 +++ functions.php 31 Oct 2005 21:34:35 -0000 1.71 @@ -74,11 +74,11 @@ $querystart = "select {$box}_id, {$box}_name from $cfgDatabase[$box]"; $querymid = ' where sort_order > 0 order by sort_order'; $queries = array( - 'group' => $querystart.' order by group_name', + 'group' => $querystart.' where is_role = 0 order by group_name', 'severity' => $querystart.$querymid, 'priority' => $querystart.$querymid, 'site' => $querystart.$querymid, - 'status' => (!$limit || $perm->have_perm('CloseBug', $project) + 'status' => (!$limit || ($perm->have_perm('CloseBug', $project) or $perm->have_perm('ManageBug', $project)) ? $querystart.$querymid : $querystart." where sort_order > 0 and (bug_open = 1 or status_id = ".(!empty($selected)?$selected:0).") order by sort_order"), 'resolution' => $querystart.$querymid, |
From: Ulf E. <ulf...@us...> - 2005-10-31 21:34:44
|
Update of /cvsroot/phpbt/phpbt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1698 Modified Files: CHANGELOG bug.php Log Message: Adding a role-based permission system Index: CHANGELOG =================================================================== RCS file: /cvsroot/phpbt/phpbt/CHANGELOG,v retrieving revision 1.75 retrieving revision 1.76 diff -u -r1.75 -r1.76 --- CHANGELOG 5 Oct 2005 20:36:02 -0000 1.75 +++ CHANGELOG 31 Oct 2005 21:34:35 -0000 1.76 @@ -12,8 +12,8 @@ : Added the ability to update several bugs at once : Allow admins and project admins to delete bugs : Allow admins and project admins to change reporter -: Added two new permissions (AddBug, CloseBug) and one new group (Manager) : Added support to mark bugs as duplicates of each other +: Added several new permissions and a set of "user roles" -- 1.0 -- 3 Aug 2005 : Added links from project summary on home page (Phil Davis). Index: bug.php =================================================================== RCS file: /cvsroot/phpbt/phpbt/bug.php,v retrieving revision 1.156 retrieving revision 1.157 diff -u -r1.156 -r1.157 --- bug.php 10 Oct 2005 19:31:53 -0000 1.156 +++ bug.php 31 Oct 2005 21:34:35 -0000 1.157 @@ -416,17 +416,45 @@ return (array('status' => translate("Someone has updated this bug since you viewed it. The bug info has been reloaded with the latest changes."))); } - $may_edit = $perm->have_perm('EditBug', $buginfo['project_id']); - $may_close = $perm->have_perm('CloseBug', $buginfo['project_id']); + $is_reporter = false; + $is_assignee = false; + $is_owner = false; + + if (!empty($u) && $u == $buginfo['created_by']) { + $perm->add_role('Reporter'); + $is_reporter = true; + } + if (!empty($u) && $u == $buginfo['assigned_to']) { + $perm->add_role('Assignee'); + $is_assignee = true; + } + if (!empty($u) && $u == $db->getOne("select owner from ".TBL_COMPONENT." where owner = ".$u." and component_id = ".$buginfo['component_id'])) { + $perm->add_role('Owner'); + $is_owner = true; + } + + $is_user = (isset($_SESSION['uid']) && !empty($_SESSION['uid'])); + $is_admin = ($is_user && isset($perm) && $perm->have_perm_proj($buginfo['project_id'])); + $may_edit = (isset($perm) && $perm->have_perm('EditBug', $buginfo['project_id'])); + $may_manage = ($may_edit && $perm->have_perm('ManageBug', $buginfo['project_id'])); + $may_change_project = ($may_edit && $perm->have_perm('EditProject', $buginfo['project_id'])); + $may_change_component = ($may_edit && $perm->have_perm('EditComponent', $buginfo['project_id'])); + $may_change_assignment = ($may_edit && $perm->have_perm('EditAssignment', $buginfo['project_id'])); + $may_change_status = ($may_edit && $perm->have_perm('EditStatus', $buginfo['project_id'])); + $may_close = ($may_edit && $perm->have_perm('CloseBug', $buginfo['project_id'])); + $may_change_resolution = ($may_edit && $perm->have_perm('EditResolution', $buginfo['project_id'])); + $may_change_priority = ($may_edit && $perm->have_perm('EditPriority', $buginfo['project_id'])); + $may_change_severity = ($may_edit && $perm->have_perm('EditSeverity', $buginfo['project_id'])); + $may_add_comment = (isset($perm) && $perm->have_perm('CommentBug', $buginfo['project_id'])); - $project_id = isset($project_id) && $may_edit ? (int) $project_id : $buginfo['project_id']; + $project_id = isset($project_id) && $may_change_project ? (int) $project_id : $buginfo['project_id']; $title = isset($title) && $may_edit ? $title : $buginfo['title']; $url = isset($url) && $may_edit ? $url : $buginfo['url']; - $severity_id = isset($severity_id) && $may_edit ? (int) $severity_id : $buginfo['severity_id']; - $priority = isset($priority) && $may_edit ? (int) $priority : $buginfo['priority']; - $resolution_id = isset($resolution_id) && $may_close ? (int) $resolution_id : $buginfo['resolution_id']; - $status_id = isset($status_id) && $may_edit ? (int) $status_id : $buginfo['status_id']; - if (!$may_close) { + $severity_id = isset($severity_id) && ($may_change_severity or $may_manage) ? (int) $severity_id : $buginfo['severity_id']; + $priority = isset($priority) && ($may_change_priority or $may_manage) ? (int) $priority : $buginfo['priority']; + $resolution_id = isset($resolution_id) && ($may_close or $may_change_resolution or $may_manage) ? (int) $resolution_id : $buginfo['resolution_id']; + $status_id = isset($status_id) && ($may_change_status or $may_manage) ? (int) $status_id : $buginfo['status_id']; + if (!$may_close and !$may_manage) { if (is_closed($status_id)) { $status_id = $buginfo['status_id']; } @@ -436,22 +464,22 @@ } } $database_id = isset($database_id) && $may_edit ? (int) $database_id : $buginfo['database_id']; - $to_be_closed_in_version_id = isset($to_be_closed_in_version_id) && $may_close ? (int) $to_be_closed_in_version_id : $buginfo['to_be_closed_in_version_id']; - $closed_in_version_id = isset($closed_in_version_id) && $may_close ? (int) $closed_in_version_id : $buginfo['closed_in_version_id']; + $to_be_closed_in_version_id = isset($to_be_closed_in_version_id) && ($may_close or $may_manage) ? (int) $to_be_closed_in_version_id : $buginfo['to_be_closed_in_version_id']; + $closed_in_version_id = isset($closed_in_version_id) && ($may_close or $may_manage) ? (int) $closed_in_version_id : $buginfo['closed_in_version_id']; $site_id = isset($site_id) && $may_edit ? (int) $site_id : $buginfo['site_id']; - $assigned_to = isset($assigned_to) && $may_edit ? (int) $assigned_to : $buginfo['assigned_to']; + $assigned_to = isset($assigned_to) && ($may_change_assignment or $may_manage) ? (int) $assigned_to : $buginfo['assigned_to']; if (isset($perm) and $perm->have_perm_proj($project_id) and isset($created_by) && is_numeric($created_by)) { $created_by = (int) $created_by; } else { $created_by = $buginfo['created_by']; } $version_id = isset($version_id) && $may_edit ? (int) $version_id : $buginfo['version_id']; - $component_id = isset($component_id) && $may_edit ? (int) $component_id : $buginfo['component_id']; + $component_id = isset($component_id) && $may_change_component ? (int) $component_id : $buginfo['component_id']; $os_id = isset($os_id) && $may_edit ? (int) $os_id : $buginfo['os_id']; - $comments = isset($comments) ? $comments : null; + $comments = isset($comments) && $may_add_comment ? $comments : null; $add_cc = isset($add_cc) ? $add_cc : null; $remove_cc = isset($remove_cc) ? $remove_cc : null; - if (isset($remove_cc) && !$may_edit) { + if (isset($remove_cc) && !$is_admin && !$is_owner && !$may_manage) { if (in_array($u, $remove_cc)) { $remove_cc = array($u); } @@ -459,10 +487,10 @@ $remove_cc = null; } } - $add_dependency = isset($add_dependency) && $may_edit ? (int) $add_dependency : null; - $remove_dependency = isset($remove_dependency) && $may_edit ? (int) $remove_dependency : null; - $add_duplicate = isset($add_duplicate) && $may_edit ? (int) $add_duplicate : null; - $del_duplicate = isset($del_duplicate) && $may_edit ? (int) $del_duplicate : null; + $add_dependency = isset($add_dependency) && ($is_admin or $is_owner or $is_assignee or $may_manage) ? (int) $add_dependency : null; + $remove_dependency = isset($remove_dependency) && ($is_admin or $is_owner or $is_assignee or $may_manage) ? (int) $remove_dependency : null; + $add_duplicate = isset($add_duplicate) && ($is_admin or $is_owner or $is_assignee or $may_manage) ? (int) $add_duplicate : null; + $del_duplicate = isset($del_duplicate) && ($is_admin or $is_owner or $is_assignee or $may_manage) ? (int) $del_duplicate : null; if (isset($_POST)) { foreach ($_POST as $k => $v) { @@ -475,7 +503,7 @@ // Add CC if specified if (isset($add_cc) and $add_cc) { $cc_uid = $db->getOne("select user_id from ".TBL_AUTH_USER." where login = ".$db->quote(stripslashes($add_cc))); - if ($cc_uid != $u and !$may_edit) { + if ($cc_uid != $u and !$is_admin && !$is_owner && !$may_manage) { return (array('status' => translate("You may only add yourself to the CC list"))); } if (!$cc_uid) { @@ -834,7 +862,7 @@ } function show_bug($bugid = 0, $error = array()) { - global $db, $me, $t, $u, $QUERY, $restricted_projects, $auth; + global $db, $me, $t, $u, $QUERY, $restricted_projects, $auth, $perm; if (!ereg('^[0-9]+$',$bugid) or !$row = $db->getRow(sprintf($QUERY['bug-show-bug'], $bugid, @@ -844,11 +872,35 @@ } prev_next_links($bugid, isset($_GET['pos']) ? $_GET['pos'] : 0); + + $is_reporter = false; + $is_assignee = false; + $is_owner = false; + $is_admin = false; + + if (!empty($u) && $u == $row['created_by']) { + $perm->add_role('Reporter'); + $is_reporter = true; + } + if (!empty($u) && $u == $row['assigned_to']) { + $perm->add_role('Assignee'); + $is_assignee = true; + } + if (!empty($u) && $u == $db->getOne("select owner from ".TBL_COMPONENT." where owner = ".$u." and component_id = ".$row['component_id'])) { + $perm->add_role('Owner'); + $is_owner = true; + } + if (!empty($u) && $u == $db->getOne("select user_id from ".TBL_PROJECT_PERM." where user_id = ".$u." and project_id = ".$row['project_id'])) { + $perm->add_role('Admin'); + $is_admin = true; + } $t->assign($row); // Override the database values with posted values if there were errors if (count($error)) $t->assign($_POST); + $t->assign(array($is_reporter, $is_assignee, $is_owner, $is_admin)); + $bug_duplicates = $db->getAll("select b.bug_id, s.bug_open from ".TBL_BUG_DEPENDENCY." d1, ".TBL_BUG_DEPENDENCY." d2, ".TBL_BUG." b, ".TBL_STATUS." s where d1.bug_id = $bugid and d2.bug_id = b.bug_id and d2.bug_id = d1.depends_on and d2.depends_on = d1.bug_id and b.status_id = s.status_id"); $no_dupes = ""; @@ -894,6 +946,7 @@ } $t->assign(array('posinfo' => $posinfo)); + $t->assign(array('perm' => $perm)); $t->render('bugdisplay.html', translate("View Bug")); } |
From: Ulf E. <ulf...@us...> - 2005-10-31 21:34:43
|
Update of /cvsroot/phpbt/phpbt/inc/db In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1698/inc/db Modified Files: mssql.php mysql.php mysqli.php oci8.php pgsql.php Log Message: Adding a role-based permission system Index: mssql.php =================================================================== RCS file: /cvsroot/phpbt/phpbt/inc/db/mssql.php,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- mssql.php 18 Oct 2005 18:45:10 -0000 1.8 +++ mssql.php 31 Oct 2005 21:34:35 -0000 1.9 @@ -47,6 +47,8 @@ TBL_AUTH_GROUP.' ag '. 'left join '.TBL_USER_GROUP.' ug on ug.group_id = ag.group_id '. 'left join '.TBL_AUTH_USER.' au on ug.user_id = au.user_id '. + 'where '. + ' %s '. 'group by '. 'ag.group_id, '. 'group_name, '. Index: mysql.php =================================================================== RCS file: /cvsroot/phpbt/phpbt/inc/db/mysql.php,v retrieving revision 1.31 retrieving revision 1.32 diff -u -r1.31 -r1.32 --- mysql.php 18 Oct 2005 18:45:10 -0000 1.31 +++ mysql.php 31 Oct 2005 21:34:35 -0000 1.32 @@ -47,6 +47,8 @@ TBL_AUTH_GROUP.' ag '. 'left join '.TBL_USER_GROUP.' ug using (group_id) '. 'left join '.TBL_AUTH_USER.' using (user_id) '. + 'where '. + ' %s '. 'group by '. 'ag.group_id, '. 'group_name, '. Index: mysqli.php =================================================================== RCS file: /cvsroot/phpbt/phpbt/inc/db/mysqli.php,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- mysqli.php 18 Oct 2005 18:45:10 -0000 1.5 +++ mysqli.php 31 Oct 2005 21:34:35 -0000 1.6 @@ -47,6 +47,8 @@ TBL_AUTH_GROUP.' ag '. 'left join '.TBL_USER_GROUP.' ug using (group_id) '. 'left join '.TBL_AUTH_USER.' using (user_id) '. + 'where '. + ' %s '. 'group by '. 'ag.group_id, '. 'group_name, '. Index: oci8.php =================================================================== RCS file: /cvsroot/phpbt/phpbt/inc/db/oci8.php,v retrieving revision 1.24 retrieving revision 1.25 diff -u -r1.24 -r1.25 --- oci8.php 18 Oct 2005 18:45:10 -0000 1.24 +++ oci8.php 31 Oct 2005 21:34:35 -0000 1.25 @@ -53,6 +53,7 @@ 'where '. 'ag.group_id = ug.group_id(+) '. 'and ug.user_id = au.user_id(+) '. + 'and %s '. 'group by '. 'ag.group_id, '. 'ag.group_name, '. Index: pgsql.php =================================================================== RCS file: /cvsroot/phpbt/phpbt/inc/db/pgsql.php,v retrieving revision 1.32 retrieving revision 1.33 diff -u -r1.32 -r1.33 --- pgsql.php 18 Oct 2005 18:45:10 -0000 1.32 +++ pgsql.php 31 Oct 2005 21:34:35 -0000 1.33 @@ -47,6 +47,8 @@ TBL_AUTH_GROUP.' ag '. 'left join '.TBL_USER_GROUP.' ug using (group_id) '. 'left join '.TBL_AUTH_USER.' using (user_id) '. + 'where '. + ' %s '. 'group by '. 'ag.group_id, '. 'group_name, '. |
From: Ulf E. <ulf...@us...> - 2005-10-31 21:34:43
|
Update of /cvsroot/phpbt/phpbt/admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1698/admin Modified Files: group.php Log Message: Adding a role-based permission system Index: group.php =================================================================== RCS file: /cvsroot/phpbt/phpbt/admin/group.php,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- group.php 22 Aug 2005 20:04:05 -0000 1.15 +++ group.php 31 Oct 2005 21:34:35 -0000 1.16 @@ -85,7 +85,7 @@ } -function list_items($groupid = 0, $error = '') { +function list_items($do_group = true, $groupid = 0, $error = '') { global $me, $db, $t, $QUERY; if (empty($_GET['order'])) { @@ -98,12 +98,14 @@ $page = isset($_GET['page']) ? $_GET['page'] : 0; - $nr = $db->getOne("select count(*) from ".TBL_AUTH_GROUP); + $match = $do_group ? "is_role=0" : "is_role=1"; + + $nr = $db->getOne("select count(*) from ".TBL_AUTH_GROUP." where $match"); list($selrange, $llimit) = multipages($nr, $page, "order=$order&sort=$sort"); $t->assign('groups', $db->getAll($db->modifyLimitQuery( - sprintf($QUERY['admin-list-groups'], $order, $sort), $llimit, $selrange))); + sprintf($QUERY['admin-list-groups'], $match, $order, $sort), $llimit, $selrange))); $headers = array( 'groupid' => 'group_id', @@ -112,7 +114,8 @@ sorting_headers($me, $headers, $order, $sort, "page=$page"); - $t->render('grouplist.html', translate("Group List")); + $t->assign('do_group', $do_group); + $t->render('grouplist.html', $do_group ? translate("Group List") : translate("Role List")); } $perm->check('Admin'); @@ -121,8 +124,13 @@ switch($_REQUEST['op']) { case 'save' : do_form($_POST['group_id']); break; case 'edit' : show_form($_GET['group_id']); break; - case 'del' : del_group($_GET['group_id']); list_items($_GET['group_id']); break; - case 'purge' : purge_group($_GET['group_id']); list_items($_GET['group_id']); break; + case 'del' : del_group($_GET['group_id']); list_items(true, $_GET['group_id']); break; + case 'purge' : purge_group($_GET['group_id']); list_items(true, $_GET['group_id']); break; + case 'list-roles' : list_items(false); break; + case 'save-role' : do_form($_POST['group_id']); break; + case 'edit-role' : show_form($_GET['group_id']); break; + case 'del-role' : del_group($_GET['group_id']); list_items(false, $_GET['group_id']); break; + case 'purge-role' : purge_group($_GET['group_id']); list_items(false, $_GET['group_id']); break; } } else list_items(); |
From: Benjamin C. <php...@be...> - 2005-10-19 01:10:48
|
Yeah, I've been thinking for the last week or so that we should just do 1.1. Branching around the 1st sounds good to me. On Oct 18, 2005, at 12:13 PM, Ulf Erikson wrote: > Benjamin, > > Is the plan still to have a v1.0.2 update? Should I keep flagging > bugs as interesting for that release? or is it time to focus on 1.1? > > What do you think of branching over two weeks? (november 1st?) > > /Ulf > > > ------------------------------------------------------- > This SF.Net email is sponsored by: > Power Architecture Resource Center: Free content, downloads, > discussions, > and more. http://solutions.newsforge.com/ibmarch.tmpl > _______________________________________________ > phpbt-dev mailing list > php...@li... > https://lists.sourceforge.net/lists/listinfo/phpbt-dev > > |
From: Ulf E. <ulf...@fa...> - 2005-10-18 19:14:08
|
Benjamin, Is the plan still to have a v1.0.2 update? Should I keep flagging bugs as interesting for that release? or is it time to focus on 1.1? What do you think of branching over two weeks? (november 1st?) /Ulf |
From: Ulf E. <ulf...@us...> - 2005-10-18 19:00:41
|
Update of /cvsroot/phpbt/phpbt/admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28888/admin Modified Files: project.php Log Message: Bug #1292113 - Project created several times Avoid the redirect as suggested by Stéphane since it inserted duplcates on some systems. Also added a safe-guard (force unique names) when adding new projects/versions/components. Index: project.php =================================================================== RCS file: /cvsroot/phpbt/phpbt/admin/project.php,v retrieving revision 1.50 retrieving revision 1.51 diff -u -r1.50 -r1.51 --- project.php 2 Sep 2005 19:17:24 -0000 1.50 +++ project.php 18 Oct 2005 19:00:30 -0000 1.51 @@ -47,13 +47,19 @@ if (!$_POST['version_name'] = trim($_POST['version_name'])) $error = translate("Please enter a version"); if ($error) { - show_version($_POST['version_id'], $error); return; + show_version($_POST['version_id'], $error); + return; } extract($_POST); if (!isset($active)) $active = 0; if (empty($sort_order)) $sort_order = 0; if (!$version_id) { + if ($db->getOne('select count(*) from '.TBL_VERSION." where project_id = $project_id and version_name = ".$db->quote(stripslashes($version_name)))) { + $error = translate("That version already exists"); + show_version($_POST['version_id'], $error); + return; + } $db->query('insert into '.TBL_VERSION." (version_id, project_id, version_name, active, sort_order, created_by, created_date) values (".$db->nextId(TBL_VERSION).", $project_id, ".$db->quote(stripslashes($version_name)).", $active, $sort_order, $u, $now)"); } else { $db->query('update '.TBL_VERSION." set project_id = $project_id, version_name = ".$db->quote(stripslashes($version_name)).", active = $active, sort_order = $sort_order where version_id = '$version_id'"); @@ -114,6 +120,11 @@ if (!$active) $active = 0; if (empty($sort_order)) $sort_order = 0; if (!$component_id) { + if ($db->getOne('select count(*) from '.TBL_COMPONENT." where project_id = $project_id and component_name = ".$db->quote(stripslashes($component_name)))) { + $error = translate("That component already exists"); + show_component($_POST['component_id'], $error); + return; + } $db->query('insert into '.TBL_COMPONENT." (component_id, project_id, component_name, component_desc, owner, active, sort_order, created_by, created_date, last_modified_by, last_modified_date) values (".$db->nextId(TBL_COMPONENT).", $project_id, ".$db->quote(stripslashes($component_name)).", ".$db->quote(stripslashes($component_desc)).", $owner, $active, $sort_order, $u, $now, $u, $now)"); } else { $db->query('update '.TBL_COMPONENT." set component_name = ".$db->quote(stripslashes($component_name)).', component_desc = '.$db->quote(stripslashes($component_desc)).", owner = $owner, active = $active, sort_order = $sort_order, last_modified_by = $u, "."last_modified_date = $now where component_id = $component_id"); @@ -159,7 +170,9 @@ return; } + $typeOP = 'update'; if (!$projectid) { + $typeOP = 'add'; if (!$_POST['version_name'] = htmlspecialchars(trim($_POST['version_name']))) { $error['version_error'] = translate("Please enter a version"); } elseif (!$_POST['component_name'] = trim($_POST['component_name'])) { @@ -178,6 +191,11 @@ if (empty($version_sortorder)) $version_sortorder = 0; if (empty($component_sortorder)) $component_sortorder = 0; if (!$projectid) { + if ($db->getOne('select count(*) from '.TBL_PROJECT." where project_name = ".$db->quote(stripslashes($project_name)))) { + $error = translate("That project already exists"); + show_project($projectid, $error); + return; + } $projectid = $db->nextId(TBL_PROJECT); $db->query('insert into '.TBL_PROJECT." (project_id, project_name, project_desc, active, created_by, created_date) values ($projectid , ".$db->quote(stripslashes($project_name)).", ".$db->quote(stripslashes($project_desc)).", $active, $u, $now)"); $db->query('insert into '.TBL_VERSION." (version_id, project_id, version_name, active, sort_order, created_by, created_date) values (".$db->nextId(TBL_VERSION).", $projectid, ".$db->quote(stripslashes($version_name)).", 1, $version_sortorder, $u, $now)"); @@ -237,6 +255,18 @@ $db->query('delete from '.TBL_PROJECT_GROUP." where project_id = $projectid"); } + // This should only be used when the conditions for bug #1292113 are true + if (true) { + if ($typeOP == 'add') { + show_project($projectid); + return; + } + else if ($typeOP == 'update') { + list_projects(); + return; + } + } + header("Location: $me?op=edit&id=$projectid"); } |
From: Ulf E. <ulf...@us...> - 2005-10-18 18:52:36
|
Update of /cvsroot/phpbt/phpbt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28417 Modified Files: query.php Log Message: Bug #1325308 - error when query bugs Avoid an empty $bugs_with_comment. Problem found and patched by Alex Flint Index: query.php =================================================================== RCS file: /cvsroot/phpbt/phpbt/query.php,v retrieving revision 1.110 retrieving revision 1.111 diff -u -r1.110 -r1.111 --- query.php 5 Oct 2005 20:25:57 -0000 1.110 +++ query.php 18 Oct 2005 18:52:29 -0000 1.111 @@ -179,8 +179,8 @@ // Search for additional comments with 'description' // TODO: Change this to match the condition selected (see below for rlike, not rlike, etc.) + $bugs_with_comment = array(0); if (!empty($description)) { - $bugs_with_comment = array(0); foreach ($db->getAll('SELECT bug_id FROM '.TBL_COMMENT.' WHERE comment_text LIKE \'%'.$description.'%\'') as $row) { $bugs_with_comment[] = $row['bug_id']; } |
From: Ulf E. <ulf...@us...> - 2005-10-18 18:45:19
|
Update of /cvsroot/phpbt/phpbt/inc/db In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26965/inc/db Modified Files: mssql.php mysql.php mysqli.php oci8.php pgsql.php Log Message: Bug #1328267 - resolutions not sorted by sort_order on home page Added "order by sort_order" to 'index-projsummary-5' in inc/db/*.php Index: mssql.php =================================================================== RCS file: /cvsroot/phpbt/phpbt/inc/db/mssql.php,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- mssql.php 2 Oct 2005 20:50:11 -0000 1.7 +++ mssql.php 18 Oct 2005 18:45:10 -0000 1.8 @@ -394,7 +394,8 @@ 'index-projsummary-4' => "' then 1 else 0 end) as \"'", 'index-projsummary-5' => - " from ".TBL_RESOLUTION, + " from ".TBL_RESOLUTION. + " order by sort_order", 'index-projsummary-6' => '%s, count(bug_id) as "Total" '. 'from '.TBL_BUG.' b '. Index: mysql.php =================================================================== RCS file: /cvsroot/phpbt/phpbt/inc/db/mysql.php,v retrieving revision 1.30 retrieving revision 1.31 diff -u -r1.30 -r1.31 --- mysql.php 2 Oct 2005 20:50:11 -0000 1.30 +++ mysql.php 18 Oct 2005 18:45:10 -0000 1.31 @@ -393,7 +393,8 @@ 'index-projsummary-4' => "' then 1 else 0 end) as \"'", 'index-projsummary-5' => - " from ".TBL_RESOLUTION, + " from ".TBL_RESOLUTION. + " order by sort_order", 'index-projsummary-6' => '%s, count(bug_id) as "Total" '. 'from '.TBL_BUG.' b '. Index: mysqli.php =================================================================== RCS file: /cvsroot/phpbt/phpbt/inc/db/mysqli.php,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- mysqli.php 2 Oct 2005 20:50:11 -0000 1.4 +++ mysqli.php 18 Oct 2005 18:45:10 -0000 1.5 @@ -393,7 +393,8 @@ 'index-projsummary-4' => "' then 1 else 0 end) as \"'", 'index-projsummary-5' => - " from ".TBL_RESOLUTION, + " from ".TBL_RESOLUTION. + " order by sort_order", 'index-projsummary-6' => '%s, count(bug_id) as "Total" '. 'from '.TBL_BUG.' b '. Index: oci8.php =================================================================== RCS file: /cvsroot/phpbt/phpbt/inc/db/oci8.php,v retrieving revision 1.23 retrieving revision 1.24 diff -u -r1.23 -r1.24 --- oci8.php 2 Oct 2005 20:50:11 -0000 1.23 +++ oci8.php 18 Oct 2005 18:45:10 -0000 1.24 @@ -440,7 +440,8 @@ 'index-projsummary-4' => "', 1, 0)) as \"'", 'index-projsummary-5' => - "from ".TBL_RESOLUTION." b", + "from ".TBL_RESOLUTION." b". + " order by b.sort_order", 'index-projsummary-6' => "%s, count(bug_id) as \"Total\" ". 'from '.TBL_BUG.' b, '.TBL_PROJECT.' p '. Index: pgsql.php =================================================================== RCS file: /cvsroot/phpbt/phpbt/inc/db/pgsql.php,v retrieving revision 1.31 retrieving revision 1.32 diff -u -r1.31 -r1.32 --- pgsql.php 2 Oct 2005 20:50:11 -0000 1.31 +++ pgsql.php 18 Oct 2005 18:45:10 -0000 1.32 @@ -393,7 +393,8 @@ 'index-projsummary-4' => "' then 1 else 0 end) as \"'", 'index-projsummary-5' => - " from ".TBL_RESOLUTION, + " from ".TBL_RESOLUTION. + " order by sort_order", 'index-projsummary-6' => '%s, count(bug_id) as "Total" '. 'from '.TBL_BUG.' b '. |