Skip to content

Commit

Permalink
Sync in another batch of db_prepare_int/numrows/phpdoc stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
mantis committed Oct 15, 2013
1 parent efbcc33 commit ad7009c
Show file tree
Hide file tree
Showing 38 changed files with 426 additions and 298 deletions.
5 changes: 2 additions & 3 deletions admin/copy_field.php
Expand Up @@ -16,14 +16,13 @@
# This upgrade moves attachments from the database to the disk

/**
* Copy Custom fields to built in fields
*
* @package MantisBT
* @copyright Copyright 2000 - 2002 Kenzaburo Ito - kenito@300baud.org
* @copyright Copyright 2002 MantisBT Team - mantisbt-dev@lists.sourceforge.net
* @link http://www.mantisbt.org
*/
/**
* MantisBT Core API's
*/
require_once( dirname( dirname( __FILE__ ) ) . '/core.php' );

access_ensure_global_level( config_get_global( 'admin_site_threshold' ) );
Expand Down
407 changes: 194 additions & 213 deletions admin/schema.php

Large diffs are not rendered by default.

10 changes: 9 additions & 1 deletion api/soap/mantisconnect.php
@@ -1,11 +1,19 @@
<?php
# MantisConnect - A webservice interface to Mantis Bug Tracker
# Copyright 2004 Victor Boctor - vboctor@users.sourceforge.net
#
# This program is distributed under dual licensing. These include
# GPL and a commercial licenses. Victor Boctor reserves the right to
# change the license of future releases.
# See docs/ folder for more details

/**
* MantisConnect - A webservice interface to Mantis Bug Tracker
*
* @package MantisBT
* @copyright Copyright 2004 Victor Boctor - vboctor@users.sourceforge.net
* @link http://www.mantisbt.org
*/

set_include_path( '../../library' );

# Path to MantisBT is assumed to be the grand parent directory. If this is not
Expand Down
8 changes: 8 additions & 0 deletions api/soap/mc_account_api.php
Expand Up @@ -6,6 +6,14 @@
# change the license of future releases.
# See docs/ folder for more details

/**
* MantisConnect - A webservice interface to Mantis Bug Tracker
*
* @package MantisBT
* @copyright Copyright 2004 Victor Boctor - vboctor@users.sourceforge.net
* @link http://www.mantisbt.org
*/

/**
* Get username, realname and email from for a given user id
*/
Expand Down
8 changes: 8 additions & 0 deletions api/soap/mc_api.php
Expand Up @@ -6,6 +6,14 @@
# change the license of future releases.
# See docs/ folder for more details

/**
* MantisConnect - A webservice interface to Mantis Bug Tracker
*
* @package MantisBT
* @copyright Copyright 2004 Victor Boctor - vboctor@users.sourceforge.net
* @link http://www.mantisbt.org
*/

# set up error_handler() as the new default error handling function
set_error_handler( 'mc_error_handler' );

Expand Down
14 changes: 14 additions & 0 deletions api/soap/mc_config_api.php
Expand Up @@ -6,6 +6,20 @@
# change the license of future releases.
# See docs/ folder for more details

/**
* MantisConnect - A webservice interface to Mantis Bug Tracker
*
* @package MantisBT
* @copyright Copyright 2004 Victor Boctor - vboctor@users.sourceforge.net
* @link http://www.mantisbt.org
*/

/**
* Get config string
* @param string $p_username username
* @param string $p_password password
* @param string $p_config_var config variable
*/
function mc_config_get_string( $p_username, $p_password, $p_config_var ) {
$t_user_id = mci_check_login( $p_username, $p_password );
if( $t_user_id === false ) {
Expand Down
8 changes: 8 additions & 0 deletions api/soap/mc_config_defaults_inc.php
Expand Up @@ -6,6 +6,14 @@
# change the license of future releases.
# See docs/ folder for more details

/**
* MantisConnect - A webservice interface to Mantis Bug Tracker
*
* @package MantisBT
* @copyright Copyright 2004 Victor Boctor - vboctor@users.sourceforge.net
* @link http://www.mantisbt.org
*/

# Minimum global access level required to access webservice for readonly operations.
$g_mc_readonly_access_level_threshold = REPORTER;

Expand Down
7 changes: 7 additions & 0 deletions api/soap/mc_core.php
Expand Up @@ -6,6 +6,13 @@
# change the license of future releases.
# See docs/ folder for more details

/**
* MantisConnect - A webservice interface to Mantis Bug Tracker
*
* @package MantisBT
* @copyright Copyright 2004 Victor Boctor - vboctor@users.sourceforge.net
* @link http://www.mantisbt.org
*/

# MantisConnect APIs
# mc_* = public methods
Expand Down
8 changes: 8 additions & 0 deletions api/soap/mc_custom_field_api.php
Expand Up @@ -6,6 +6,14 @@
# change the license of future releases.
# See docs/ folder for more details

/**
* MantisConnect - A webservice interface to Mantis Bug Tracker
*
* @package MantisBT
* @copyright Copyright 2004 Victor Boctor - vboctor@users.sourceforge.net
* @link http://www.mantisbt.org
*/

/**
* Get the custom field id given an object ref. The id is set based on the following algorithm:
* - id from objectref (if not zero).
Expand Down
8 changes: 8 additions & 0 deletions api/soap/mc_enum_api.php
Expand Up @@ -6,6 +6,14 @@
# change the license of future releases.
# See docs/ folder for more details

/**
* MantisConnect - A webservice interface to Mantis Bug Tracker
*
* @package MantisBT
* @copyright Copyright 2004 Victor Boctor - vboctor@users.sourceforge.net
* @link http://www.mantisbt.org
*/

/**
* Get all available status.
*
Expand Down
8 changes: 8 additions & 0 deletions api/soap/mc_file_api.php
Expand Up @@ -6,6 +6,14 @@
# change the license of future releases.
# See docs/ folder for more details

/**
* MantisConnect - A webservice interface to Mantis Bug Tracker
*
* @package MantisBT
* @copyright Copyright 2004 Victor Boctor - vboctor@users.sourceforge.net
* @link http://www.mantisbt.org
*/

# Check if the current user can download attachments for the specified bug.
function mci_file_can_download_bug_attachments( $p_bug_id, $p_user_id ) {
$t_can_download = access_has_bug_level( config_get( 'download_attachments_threshold' ), $p_bug_id );
Expand Down
8 changes: 8 additions & 0 deletions api/soap/mc_filter_api.php
Expand Up @@ -6,6 +6,14 @@
# change the license of future releases.
# See docs/ folder for more details

/**
* MantisConnect - A webservice interface to Mantis Bug Tracker
*
* @package MantisBT
* @copyright Copyright 2004 Victor Boctor - vboctor@users.sourceforge.net
* @link http://www.mantisbt.org
*/

/**
* Get all user defined issue filters for the given project.
*
Expand Down
8 changes: 8 additions & 0 deletions api/soap/mc_issue_api.php
Expand Up @@ -6,6 +6,14 @@
# change the license of future releases.
# See docs/ folder for more details

/**
* MantisConnect - A webservice interface to Mantis Bug Tracker
*
* @package MantisBT
* @copyright Copyright 2004 Victor Boctor - vboctor@users.sourceforge.net
* @link http://www.mantisbt.org
*/

require_once( dirname( __FILE__ ) . '/mc_core.php' );

/**
Expand Down
8 changes: 8 additions & 0 deletions api/soap/mc_issue_attachment_api.php
Expand Up @@ -6,6 +6,14 @@
# change the license of future releases.
# See docs/ folder for more details

/**
* MantisConnect - A webservice interface to Mantis Bug Tracker
*
* @package MantisBT
* @copyright Copyright 2004 Victor Boctor - vboctor@users.sourceforge.net
* @link http://www.mantisbt.org
*/

require_once( dirname( __FILE__ ) . '/mc_core.php' );

/**
Expand Down
13 changes: 13 additions & 0 deletions api/soap/mc_project_api.php
Expand Up @@ -6,6 +6,13 @@
# change the license of future releases.
# See docs/ folder for more details

/**
* MantisConnect - A webservice interface to Mantis Bug Tracker
*
* @package MantisBT
* @copyright Copyright 2004 Victor Boctor - vboctor@users.sourceforge.net
* @link http://www.mantisbt.org
*/

/**
* Use a standard filter to get issues associated with the specified user.
Expand Down Expand Up @@ -78,6 +85,9 @@ function mc_project_get_issues_for_user( $p_username, $p_password, $p_project_id
return $t_result;
}

/**
* Project Get Issues
*/
function mc_project_get_issues( $p_username, $p_password, $p_project_id, $p_page_number, $p_per_page ) {
global $g_project_override;

Expand Down Expand Up @@ -978,6 +988,9 @@ function mc_project_delete( $p_username, $p_password, $p_project_id ) {
return project_delete( $p_project_id );
}

/**
* Get Issue Headers
*/
function mc_project_get_issue_headers( $p_username, $p_password, $p_project_id, $p_page_number, $p_per_page ) {
global $g_project_override;

Expand Down
8 changes: 8 additions & 0 deletions api/soap/mc_project_attachment_api.php
Expand Up @@ -6,6 +6,14 @@
# change the license of future releases.
# See docs/ folder for more details

/**
* MantisConnect - A webservice interface to Mantis Bug Tracker
*
* @package MantisBT
* @copyright Copyright 2004 Victor Boctor - vboctor@users.sourceforge.net
* @link http://www.mantisbt.org
*/

require_once( dirname( __FILE__ ) . '/mc_core.php' );

/**
Expand Down
7 changes: 7 additions & 0 deletions api/soap/mc_tag_api.php
Expand Up @@ -14,6 +14,13 @@
# You should have received a copy of the GNU General Public License
# along with MantisBT. If not, see <http://www.gnu.org/licenses/>.

/**
* MantisConnect - A webservice interface to Mantis Bug Tracker
*
* @package MantisBT
* @link http://www.mantisbt.org
*/

/**
* Retrieves all tags, unless the users
*
Expand Down
8 changes: 8 additions & 0 deletions api/soap/mc_user_pref_api.php
Expand Up @@ -6,6 +6,14 @@
# change the license of future releases.
# See docs/ folder for more details

/**
* MantisConnect - A webservice interface to Mantis Bug Tracker
*
* @package MantisBT
* @copyright Copyright 2004 Victor Boctor - vboctor@users.sourceforge.net
* @link http://www.mantisbt.org
*/

/**
* Get the value for the specified user preference.
*
Expand Down
7 changes: 7 additions & 0 deletions api/soap/mc_user_profile_api.php
Expand Up @@ -14,6 +14,13 @@
# You should have received a copy of the GNU General Public License
# along with MantisBT. If not, see <http://www.gnu.org/licenses/>.

/**
* MantisConnect - A webservice interface to Mantis Bug Tracker
*
* @package MantisBT
* @link http://www.mantisbt.org
*/

/**
* Returns all the profiles for the user, including the global ones
*
Expand Down
2 changes: 1 addition & 1 deletion bug_actiongroup_add_note_inc.php
Expand Up @@ -94,7 +94,7 @@ function action_add_note_print_fields() {
echo get_enum_element( 'view_state', $t_default_state );
?>
<input type="hidden" name="view_state" value="<?php echo $t_default_state; ?>" />';
<?
<?php
}
?>
</td>
Expand Down
19 changes: 16 additions & 3 deletions core.php
Expand Up @@ -98,7 +98,11 @@
# Remember (globally) which API files have already been loaded
$g_api_included = array();

# Define an API inclusion function to replace require_once
/**
* Define an API inclusion function to replace require_once
*
* @param string $p_api_name api file name
*/
function require_api( $p_api_name ) {
global $g_api_included;
global $g_core_path;
Expand All @@ -117,7 +121,12 @@ function require_api( $p_api_name ) {
# Remember (globally) which library files have already been loaded
$g_libraries_included = array();

# Define an API inclusion function to replace require_once

/**
* Define an API inclusion function to replace require_once
*
* @param string $p_library_name lib file name
*/
function require_lib( $p_library_name ) {
global $g_libraries_included;
global $g_library_path;
Expand All @@ -140,7 +149,11 @@ function require_lib( $p_library_name ) {
}
}

# Define an autoload function to automatically load classes when referenced
/**
* Define an autoload function to automatically load classes when referenced
*
* @param string $p_class class name
*/
function __autoload( $className ) {
global $g_class_path;
global $g_library_path;
Expand Down
2 changes: 0 additions & 2 deletions core/access_api.php
Expand Up @@ -126,7 +126,6 @@ function access_cache_matrix_project( $p_project_id ) {

if( !in_array( (int) $p_project_id, $g_cache_access_matrix_project_ids ) ) {
$t_project_user_list_table = db_get_table( 'project_user_list' );

$query = "SELECT user_id, access_level
FROM $t_project_user_list_table
WHERE project_id=" . db_param();
Expand Down Expand Up @@ -160,7 +159,6 @@ function access_cache_matrix_user( $p_user_id ) {

if( !in_array( (int) $p_user_id, $g_cache_access_matrix_user_ids ) ) {
$t_project_user_list_table = db_get_table( 'project_user_list' );

$t_query = "SELECT project_id, access_level
FROM $t_project_user_list_table
WHERE user_id=" . db_param();
Expand Down
9 changes: 4 additions & 5 deletions core/authentication_api.php
Expand Up @@ -567,12 +567,10 @@ function auth_generate_unique_cookie_string() {
*/
function auth_is_cookie_string_unique( $p_cookie_string ) {
$t_user_table = db_get_table( 'user' );
$t_query = "SELECT COUNT(*) FROM $t_user_table WHERE cookie_string=" . db_param();
$t_result = db_query_bound( $t_query, array( $p_cookie_string ) );

$query = "SELECT COUNT(*)
FROM $t_user_table
WHERE cookie_string=" . db_param();
$result = db_query_bound( $query, array( $p_cookie_string ) );
$t_count = db_result( $result );
$t_count = db_result( $t_result );

if( $t_count > 0 ) {
return false;
Expand Down Expand Up @@ -835,6 +833,7 @@ function auth_get_current_user_id() {


/**
* Generate HTTP 401 Access Denied header and page for user, prompting for BASIC authentication
*
* @access public
*/
Expand Down

0 comments on commit ad7009c

Please sign in to comment.