diff --git a/config_defaults_inc.php b/config_defaults_inc.php index 276cda5bbe..0f88feed07 100644 --- a/config_defaults_inc.php +++ b/config_defaults_inc.php @@ -6,7 +6,7 @@ # See the README and LICENSE files for details # -------------------------------------------------------- - # $Id: config_defaults_inc.php,v 1.65 2003-01-25 21:13:16 jlatour Exp $ + # $Id: config_defaults_inc.php,v 1.66 2003-01-30 09:41:11 jfitzell Exp $ # -------------------------------------------------------- @@ -568,6 +568,12 @@ # details (not to add/delete projects), upload documentation, news, ...etc. $g_manage_project_threshold = MANAGER; + # Threshold required to delete a project + $g_delete_project_threshold = ADMINISTRATOR; + + # Threshold needed to create a new project + $g_create_project_threshold = ADMINISTRATOR; + # --- login method ---------------- # CRYPT or CRYPT_FULL_SALT or PLAIN or MD5 or LDAP or BASIC_AUTH # If you were using CRYPT and it now fails, try CRYPT_FULL_SALT diff --git a/core/category_api.php b/core/category_api.php index 82ef28e94c..1edc485772 100644 --- a/core/category_api.php +++ b/core/category_api.php @@ -6,7 +6,7 @@ # See the README and LICENSE files for details # -------------------------------------------------------- - # $Id: category_api.php,v 1.4 2003-01-03 03:24:24 jfitzell Exp $ + # $Id: category_api.php,v 1.5 2003-01-30 09:41:31 jfitzell Exp $ # -------------------------------------------------------- ########################################################################### @@ -84,16 +84,30 @@ function category_delete( $p_project_id, $p_category ) { } # -------------------- # return all categories for the specified project id - function category_get_all( $p_project_id ) { + function category_get_all_rows( $p_project_id ) { global $g_mantis_project_category_table; - $c_project_id = (integer)$p_project_id; + $c_project_id = db_prepare_int( $p_project_id ); + + $t_project_category_table = config_get( 'mantis_project_category_table' ); $query = "SELECT category, user_id - FROM $g_mantis_project_category_table + FROM $t_project_category_table WHERE project_id='$c_project_id' ORDER BY category"; - return db_query( $query ); + $result = db_query( $query ); + + $count = db_num_rows( $result ); + + $rows = array(); + + for ( $i = 0 ; $i < $count ; $i++ ) { + $row = db_fetch_array( $result ); + + $rows[] = $row; + } + + return $rows; } # -------------------- # delete all categories associated with a project diff --git a/core/file_api.php b/core/file_api.php index 98e0ab54e8..d5a8ab87ab 100644 --- a/core/file_api.php +++ b/core/file_api.php @@ -6,7 +6,7 @@ # See the README and LICENSE files for details # -------------------------------------------------------- - # $Id: file_api.php,v 1.21 2003-01-29 00:53:04 vboctor Exp $ + # $Id: file_api.php,v 1.22 2003-01-30 09:41:32 jfitzell Exp $ # -------------------------------------------------------- $t_core_dir = dirname( __FILE__ ).DIRECTORY_SEPARATOR; @@ -300,6 +300,19 @@ function file_add( $p_bug_id, $p_tmp_file, $p_file_name, $p_file_type='' ) { } } + + # -------------------- + # Return true if file uploading is enabled (in our config and PHP's), + # false otherwise + function file_is_uploading_enabled() { + if ( ini_get_bool( 'file_uploads' ) && + ON == config_get( 'allow_file_upload' ) ) { + return true; + } else { + return false; + } + } + # -------------------- # Check if the user can upload files for this project # return true if they can, false otherwise @@ -314,8 +327,7 @@ function file_allow_project_upload( $p_project_id = null, $p_user_id = null ) { $t_access = user_get_access_level( $p_user_id, $p_project_id ); - if ( ! ini_get_bool( 'file_uploads' ) || - OFF == config_get( 'allow_file_upload' ) || + if ( ! file_is_uploading_enabled() || $t_access < config_get( 'upload_project_file_threshold' ) ) { return false; } @@ -336,8 +348,7 @@ function file_allow_bug_upload( $p_bug_id = null, $p_user_id = null ) { } # If uploads are disbled just return false - if ( ! ini_get_bool( 'file_uploads' ) || - OFF == config_get( 'allow_file_upload' ) ) { + if ( ! file_is_uploading_enabled() ) { return false; } diff --git a/core/project_api.php b/core/project_api.php index effe9b994d..8695005f20 100644 --- a/core/project_api.php +++ b/core/project_api.php @@ -6,7 +6,7 @@ # See the README and LICENSE files for details # -------------------------------------------------------- - # $Id: project_api.php,v 1.25 2003-01-25 18:21:09 jlatour Exp $ + # $Id: project_api.php,v 1.26 2003-01-30 09:41:35 jfitzell Exp $ # -------------------------------------------------------- $t_core_dir = dirname( __FILE__ ).DIRECTORY_SEPARATOR; @@ -278,10 +278,16 @@ function project_update( $p_project_id, $p_name, $p_description, $p_status, $p_v # Data Access #=================================== + # -------------------- + # Return the row describing the given project + function project_get_row( $p_project_id ) { + return project_cache_row( $p_project_id ); + } + # -------------------- # Return the specified field of the specified project function project_get_field( $p_project_id, $p_field_name ) { - $row = project_cache_row( $p_project_id ); + $row = project_get_row( $p_project_id ); if ( isset( $row[$p_field_name] ) ) { return $row[$p_field_name]; diff --git a/core/version_api.php b/core/version_api.php index e19e6e6432..e15c36fac7 100644 --- a/core/version_api.php +++ b/core/version_api.php @@ -6,7 +6,7 @@ # See the README and LICENSE files for details # -------------------------------------------------------- - # $Id: version_api.php,v 1.5 2003-01-03 03:24:25 jfitzell Exp $ + # $Id: version_api.php,v 1.6 2003-01-30 09:41:39 jfitzell Exp $ # -------------------------------------------------------- ########################################################################### @@ -88,16 +88,28 @@ function version_delete( $p_project_id, $p_version ) { } # -------------------- # return all categories for the specified project id - function version_get_all( $p_project_id ) { - $c_project_id = db_prepare_int($p_project_id); + function version_get_all_rows( $p_project_id ) { + $c_project_id = db_prepare_int( $p_project_id ); - $t_project_version_table = config_get('mantis_project_version_table'); + $t_project_version_table = config_get( 'mantis_project_version_table' ); $query = "SELECT version, date_order FROM $t_project_version_table WHERE project_id='$c_project_id' ORDER BY date_order DESC"; - return db_query( $query ); + $result = db_query( $query ); + + $count = db_num_rows( $result ); + + $rows = array(); + + for ( $i = 0 ; $i < $count ; $i++ ) { + $row = db_fetch_array( $result ); + + $rows[] = $row; + } + + return $rows; } # -------------------- # delete all versions associated with a project diff --git a/doc/ChangeLog b/doc/ChangeLog index 1432c48902..d5519bc863 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -148,6 +148,9 @@ Mantis ChangeLog * New config option (custom_field_edit_after_create): new option to control whether a user is directed to edit a custom field after creating it * Enhancement: User names are now auto-generated for accounts that no longer exists. The user names are prefixed by the string (prefix_for_deleted_users). * Fix: when viewing all bugs for all projects you no longer see bugs from disabled projects + * New config option (create_project_threshold): provide a threshold for users who can create projects + * New config option (delete_project_threshold): provide a threshold for users who can delete projects + 2002.08.23 - 0.17.5 * Corrected bug_delete.php and bug_delete_page.php, which ignored the $g_allow_bug_delete_access_level setting. diff --git a/manage_proj_add.php b/manage_proj_add.php index e043d72fed..089b63ff95 100644 --- a/manage_proj_add.php +++ b/manage_proj_add.php @@ -4,11 +4,15 @@ # Copyright (C) 2002 - 2003 Mantis Team - mantisbt-dev@lists.sourceforge.net # This program is distributed under the terms and conditions of the GPL # See the README and LICENSE files for details + + # -------------------------------------------------------- + # $Id: manage_proj_add.php,v 1.25 2003-01-30 09:41:16 jfitzell Exp $ + # -------------------------------------------------------- ?>
'; + echo lang_get( 'operation_successful' ) . '
'; print_bracket_link( $t_redirect_url, lang_get( 'proceed' ) ); ?> diff --git a/manage_proj_cat_copy.php b/manage_proj_cat_copy.php index 1639db9929..4335a62d5b 100644 --- a/manage_proj_cat_copy.php +++ b/manage_proj_cat_copy.php @@ -31,10 +31,9 @@ trigger_error( ERROR_GENERIC, ERROR ); } - $result = category_get_all( $t_src_project_id ); - $category_count = db_num_rows( $result ); - for ($i=0;$i<$category_count;$i++) { - $row = db_fetch_array( $result ); + $rows = category_get_all_rows( $t_src_project_id ); + + foreach ( $rows as $row ) { $t_category = $row['category']; $t_category = addslashes( $t_category ); diff --git a/manage_proj_cat_edit_page.php b/manage_proj_cat_edit_page.php index d683cf0f18..bb0e77db8d 100644 --- a/manage_proj_cat_edit_page.php +++ b/manage_proj_cat_edit_page.php @@ -12,6 +12,8 @@ $f_project_id = gpc_get_int( 'project_id' ); $f_category = gpc_get_string( 'category' ); + + # @@@ we should optain this by looking it up $f_assigned_to = gpc_get_int( 'assigned_to', 0 ); ?> diff --git a/manage_proj_delete.php b/manage_proj_delete.php index 9d0dcb9a5f..467febecde 100644 --- a/manage_proj_delete.php +++ b/manage_proj_delete.php @@ -4,11 +4,15 @@ # Copyright (C) 2002 - 2003 Mantis Team - mantisbt-dev@lists.sourceforge.net # This program is distributed under the terms and conditions of the GPL # See the README and LICENSE files for details + + # -------------------------------------------------------- + # $Id: manage_proj_delete.php,v 1.23 2003-01-30 09:41:20 jfitzell Exp $ + # -------------------------------------------------------- ?> @@ -45,73 +32,88 @@
+ + +
+ + - + + +> - + + +> - + + +> - + + +> - - - - - - - + + + +> + + + + + + +> + +
- +
- /> + />
- - - -
+ + + +
- +
  @@ -122,46 +124,52 @@ +
- + + + +
- - + +
+
+ + + +
+ + - - - + + + + + + +
- -
@@ -170,13 +178,13 @@ @@ -184,45 +192,55 @@
- +
- - - + + +
- - - - + + + +
+ + +
+ + + + + + + - - - - + + + +
-
-
+
@@ -248,18 +266,22 @@
- - - + + +
+ + - +
diff --git a/manage_proj_update.php b/manage_proj_update.php index 8d5c550860..2cb3cb3b1f 100644 --- a/manage_proj_update.php +++ b/manage_proj_update.php @@ -4,6 +4,10 @@ # Copyright (C) 2002 - 2003 Mantis Team - mantisbt-dev@lists.sourceforge.net # This program is distributed under the terms and conditions of the GPL # See the README and LICENSE files for details + + # -------------------------------------------------------- + # $Id: manage_proj_update.php,v 1.22 2003-01-30 09:41:24 jfitzell Exp $ + # -------------------------------------------------------- ?>