forked from mantisbt/mantisbt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use require_api/require_lib to pull in dependencies
Following up on ea3cd38 which introduced require_once calls within the core API files to included dependencies in-place, this commit does a similar thing for user viewable pages. Replacements for require_once have been created within core.php to help optimise the increased number of dependency checks. require_api and require_lib have the same syntax as require_once however the first will look within the core directory only, and the second will look within the library directory only. The library directory can now be relocated elsewhere by use of the $g_library_path configuration option. require_api and require_lib use a global array to keep track of which files have already been included. This is a much simpler check than what is performed by require_once and hence avoids expensive checking for symlinks with stat() calls and so forth.
- Loading branch information
1 parent
cf559e0
commit 2d5455c
Showing
263 changed files
with
6,806 additions
and
3,166 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,11 +37,31 @@ | |
* @copyright Copyright (C) 2000 - 2002 Kenzaburo Ito - [email protected] | ||
* @copyright Copyright (C) 2002 - 2010 MantisBT Team - [email protected] | ||
* @link http://www.mantisbt.org | ||
* | ||
* @uses core.php | ||
* @uses access_api.php | ||
* @uses authentication_api.php | ||
* @uses config_api.php | ||
* @uses constant_inc.php | ||
* @uses current_user_api.php | ||
* @uses form_api.php | ||
* @uses helper_api.php | ||
* @uses lang_api.php | ||
* @uses print_api.php | ||
* @uses user_api.php | ||
*/ | ||
/** | ||
* MantisBT Core API's | ||
*/ | ||
|
||
require_once( 'core.php' ); | ||
require_api( 'access_api.php' ); | ||
require_api( 'authentication_api.php' ); | ||
require_api( 'config_api.php' ); | ||
require_api( 'constant_inc.php' ); | ||
require_api( 'current_user_api.php' ); | ||
require_api( 'form_api.php' ); | ||
require_api( 'helper_api.php' ); | ||
require_api( 'lang_api.php' ); | ||
require_api( 'print_api.php' ); | ||
require_api( 'user_api.php' ); | ||
|
||
form_security_validate('account_delete'); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,21 +14,22 @@ | |
# You should have received a copy of the GNU General Public License | ||
# along with MantisBT. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
/** | ||
* @package MantisBT | ||
* @copyright Copyright (C) 2000 - 2002 Kenzaburo Ito - [email protected] | ||
* @copyright Copyright (C) 2002 - 2010 MantisBT Team - [email protected] | ||
* @link http://www.mantisbt.org | ||
*/ | ||
/** | ||
* MantisBT Core API's | ||
*/ | ||
require_once( 'core.php' ); | ||
|
||
require_once( 'authentication_api.php' ); | ||
require_once( 'columns_api.php' ); | ||
require_once( 'custom_field_api.php' ); | ||
require_once( 'helper_api.php' ); | ||
/** | ||
* @package MantisBT | ||
* @copyright Copyright (C) 2000 - 2002 Kenzaburo Ito - [email protected] | ||
* @copyright Copyright (C) 2002 - 2010 MantisBT Team - [email protected] | ||
* @link http://www.mantisbt.org | ||
* | ||
* @uses core.php | ||
* @uses current_user_api.php | ||
* @uses html_api.php | ||
* @uses lang_api.php | ||
*/ | ||
|
||
require_once( 'core.php' ); | ||
require_api( 'current_user_api.php' ); | ||
require_api( 'html_api.php' ); | ||
require_api( 'lang_api.php' ); | ||
|
||
html_page_top( lang_get( 'manage_columns_config' ) ); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,40 +14,64 @@ | |
# You should have received a copy of the GNU General Public License | ||
# along with MantisBT. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
/** | ||
* CALLERS | ||
* This page is called from: | ||
* - print_menu() | ||
* - print_account_menu() | ||
* - header redirects from account_*.php | ||
* - included by verify.php to allow user to change their password | ||
* | ||
* EXPECTED BEHAVIOUR | ||
* - Display the user's current settings | ||
* - Allow the user to edit their settings | ||
* - Allow the user to save their changes | ||
* - Allow the user to delete their account if account deletion is enabled | ||
* | ||
* CALLS | ||
* This page calls the following pages: | ||
* - account_update.php (to save changes) | ||
* - account_delete.php (to delete the user's account) | ||
* | ||
* RESTRICTIONS & PERMISSIONS | ||
* - User must be authenticated | ||
* - The user's account must not be protected | ||
* | ||
* @package MantisBT | ||
* @copyright Copyright (C) 2000 - 2002 Kenzaburo Ito - [email protected] | ||
* @copyright Copyright (C) 2002 - 2010 MantisBT Team - [email protected] | ||
* @link http://www.mantisbt.org | ||
*/ | ||
/** | ||
* MantisBT Core API's | ||
*/ | ||
require_once( 'core.php' ); | ||
|
||
require_once( 'current_user_api.php' ); | ||
/** | ||
* CALLERS | ||
* This page is called from: | ||
* - print_menu() | ||
* - print_account_menu() | ||
* - header redirects from account_*.php | ||
* - included by verify.php to allow user to change their password | ||
* | ||
* EXPECTED BEHAVIOUR | ||
* - Display the user's current settings | ||
* - Allow the user to edit their settings | ||
* - Allow the user to save their changes | ||
* - Allow the user to delete their account if account deletion is enabled | ||
* | ||
* CALLS | ||
* This page calls the following pages: | ||
* - account_update.php (to save changes) | ||
* - account_delete.php (to delete the user's account) | ||
* | ||
* RESTRICTIONS & PERMISSIONS | ||
* - User must be authenticated | ||
* - The user's account must not be protected | ||
* | ||
* @package MantisBT | ||
* @copyright Copyright (C) 2000 - 2002 Kenzaburo Ito - [email protected] | ||
* @copyright Copyright (C) 2002 - 2010 MantisBT Team - [email protected] | ||
* @link http://www.mantisbt.org | ||
* | ||
* @uses core.php | ||
* @uses authentication_api.php | ||
* @uses config_api.php | ||
* @uses constant_inc.php | ||
* @uses current_user_api.php | ||
* @uses form_api.php | ||
* @uses helper_api.php | ||
* @uses html_api.php | ||
* @uses lang_api.php | ||
* @uses ldap_api.php | ||
* @uses print_api.php | ||
* @uses string_api.php | ||
* @uses user_api.php | ||
* @uses utility_api.php | ||
*/ | ||
|
||
require_once( 'core.php' ); | ||
require_api( 'authentication_api.php' ); | ||
require_api( 'config_api.php' ); | ||
require_api( 'constant_inc.php' ); | ||
require_api( 'current_user_api.php' ); | ||
require_api( 'form_api.php' ); | ||
require_api( 'helper_api.php' ); | ||
require_api( 'html_api.php' ); | ||
require_api( 'lang_api.php' ); | ||
require_api( 'ldap_api.php' ); | ||
require_api( 'print_api.php' ); | ||
require_api( 'string_api.php' ); | ||
require_api( 'user_api.php' ); | ||
require_api( 'utility_api.php' ); | ||
|
||
#============ Parameters ============ | ||
# (none) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,17 +14,38 @@ | |
# You should have received a copy of the GNU General Public License | ||
# along with MantisBT. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
/** | ||
* @package MantisBT | ||
* @copyright Copyright (C) 2000 - 2002 Kenzaburo Ito - [email protected] | ||
* @copyright Copyright (C) 2002 - 2010 MantisBT Team - [email protected] | ||
* @link http://www.mantisbt.org | ||
*/ | ||
/** | ||
* MantisBT Core API's | ||
*/ | ||
/** | ||
* @package MantisBT | ||
* @copyright Copyright (C) 2000 - 2002 Kenzaburo Ito - [email protected] | ||
* @copyright Copyright (C) 2002 - 2010 MantisBT Team - [email protected] | ||
* @link http://www.mantisbt.org | ||
* | ||
* @uses authentication_api.php | ||
* @uses config_api.php | ||
* @uses constant_inc.php | ||
* @uses event_api.php | ||
* @uses form_api.php | ||
* @uses helper_api.php | ||
* @uses html_api.php | ||
* @uses lang_api.php | ||
* @uses print_api.php | ||
* @uses user_api.php | ||
* @uses user_pref_api.php | ||
* @uses utility_api.php | ||
*/ | ||
|
||
require_once( 'user_pref_api.php' ); | ||
require_api( 'authentication_api.php' ); | ||
require_api( 'config_api.php' ); | ||
require_api( 'constant_inc.php' ); | ||
require_api( 'event_api.php' ); | ||
require_api( 'form_api.php' ); | ||
require_api( 'helper_api.php' ); | ||
require_api( 'html_api.php' ); | ||
require_api( 'lang_api.php' ); | ||
require_api( 'print_api.php' ); | ||
require_api( 'user_api.php' ); | ||
require_api( 'user_pref_api.php' ); | ||
require_api( 'utility_api.php' ); | ||
|
||
function edit_account_prefs($p_user_id = null, $p_error_if_protected = true, $p_accounts_menu = true, $p_redirect_url = '') { | ||
if ( null === $p_user_id ) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,37 +14,43 @@ | |
# You should have received a copy of the GNU General Public License | ||
# along with MantisBT. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
/** | ||
* CALLERS | ||
* This page is called from: | ||
* - print_account_menu() | ||
* - header redirects from account_*.php | ||
* | ||
* EXPECTED BEHAVIOUR | ||
* - Display the user's current preferences | ||
* - Allow the user to edit the preferences | ||
* - Provide the option of saving changes or resetting to default values | ||
* | ||
* CALLS | ||
* This page calls the following pages: | ||
* - acount_prefs_update.php (to save changes) | ||
* - account_prefs_reset.php (to reset preferences to default values) | ||
* | ||
* RESTRICTIONS & PERMISSIONS | ||
* - User must be authenticated | ||
* - The user's account must not be protected | ||
* | ||
* @package MantisBT | ||
* @copyright Copyright (C) 2000 - 2002 Kenzaburo Ito - [email protected] | ||
* @copyright Copyright (C) 2002 - 2010 MantisBT Team - [email protected] | ||
* @link http://www.mantisbt.org | ||
*/ | ||
/** | ||
* MantisBT Core API's | ||
*/ | ||
require_once( 'core.php' ); | ||
|
||
require_once( 'current_user_api.php' ); | ||
/** | ||
* CALLERS | ||
* This page is called from: | ||
* - print_account_menu() | ||
* - header redirects from account_*.php | ||
* | ||
* EXPECTED BEHAVIOUR | ||
* - Display the user's current preferences | ||
* - Allow the user to edit the preferences | ||
* - Provide the option of saving changes or resetting to default values | ||
* | ||
* CALLS | ||
* This page calls the following pages: | ||
* - acount_prefs_update.php (to save changes) | ||
* - account_prefs_reset.php (to reset preferences to default values) | ||
* | ||
* RESTRICTIONS & PERMISSIONS | ||
* - User must be authenticated | ||
* - The user's account must not be protected | ||
* | ||
* @package MantisBT | ||
* @copyright Copyright (C) 2000 - 2002 Kenzaburo Ito - [email protected] | ||
* @copyright Copyright (C) 2002 - 2010 MantisBT Team - [email protected] | ||
* @link http://www.mantisbt.org | ||
* | ||
* @uses core.php | ||
* @uses authentication_api.php | ||
* @uses current_user_api.php | ||
* @uses html_api.php | ||
* @uses lang_api.php | ||
*/ | ||
|
||
require_once( 'core.php' ); | ||
require_api( 'authentication_api.php' ); | ||
require_api( 'current_user_api.php' ); | ||
require_api( 'html_api.php' ); | ||
require_api( 'lang_api.php' ); | ||
|
||
#============ Parameters ============ | ||
# (none) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,33 +14,49 @@ | |
# You should have received a copy of the GNU General Public License | ||
# along with MantisBT. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
/** | ||
* CALLERS | ||
* This page is called from: | ||
* - account_prefs_inc.php | ||
* | ||
* EXPECTED BEHAVIOUR | ||
* - Reset the user's preferences to default values | ||
* - Redirect to account_prefs_page.php or another page, if given | ||
* | ||
* CALLS | ||
* This page conditionally redirects upon completion | ||
* | ||
* RESTRICTIONS & PERMISSIONS | ||
* - User must be authenticated | ||
* - User must not be protected | ||
* | ||
* @package MantisBT | ||
* @copyright Copyright (C) 2000 - 2002 Kenzaburo Ito - [email protected] | ||
* @copyright Copyright (C) 2002 - 2010 MantisBT Team - [email protected] | ||
* @link http://www.mantisbt.org | ||
*/ | ||
/** | ||
* MantisBT Core API's | ||
*/ | ||
require_once( 'core.php' ); | ||
/** | ||
* CALLERS | ||
* This page is called from: | ||
* - account_prefs_inc.php | ||
* | ||
* EXPECTED BEHAVIOUR | ||
* - Reset the user's preferences to default values | ||
* - Redirect to account_prefs_page.php or another page, if given | ||
* | ||
* CALLS | ||
* This page conditionally redirects upon completion | ||
* | ||
* RESTRICTIONS & PERMISSIONS | ||
* - User must be authenticated | ||
* - User must not be protected | ||
* | ||
* @package MantisBT | ||
* @copyright Copyright (C) 2000 - 2002 Kenzaburo Ito - [email protected] | ||
* @copyright Copyright (C) 2002 - 2010 MantisBT Team - [email protected] | ||
* @link http://www.mantisbt.org | ||
* | ||
* @uses core.php | ||
* @uses access_api.php | ||
* @uses authentication_api.php | ||
* @uses config_api.php | ||
* @uses form_api.php | ||
* @uses gpc_api.php | ||
* @uses print_api.php | ||
* @uses string_api.php | ||
* @uses user_api.php | ||
* @uses user_pref_api.php | ||
*/ | ||
|
||
require_once( 'user_pref_api.php' ); | ||
require_once( 'core.php' ); | ||
require_api( 'access_api.php' ); | ||
require_api( 'authentication_api.php' ); | ||
require_api( 'config_api.php' ); | ||
require_api( 'form_api.php' ); | ||
require_api( 'gpc_api.php' ); | ||
require_api( 'print_api.php' ); | ||
require_api( 'string_api.php' ); | ||
require_api( 'user_api.php' ); | ||
require_api( 'user_pref_api.php' ); | ||
|
||
#============ Parameters ============ | ||
$f_user_id = gpc_get_int( 'user_id' ); | ||
|
Oops, something went wrong.