Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add additional exceptions

  • Loading branch information...
commit 21843420e783b22fc1e9efd49d46da66e8dc3064 1 parent 83168de
@grangeway grangeway authored
Showing with 841 additions and 23 deletions.
  1. +1 −1  bug_file_add.php
  2. +2 −2 bug_relationship_add.php
  3. +1 −1  bug_relationship_delete.php
  4. +1 −1  bug_reminder.php
  5. +1 −1  bug_reminder_page.php
  6. +3 −3 bug_report.php
  7. +1 −1  bug_report_page.php
  8. +4 −4 bug_update.php
  9. +1 −1  bug_update_page.php
  10. +1 −1  bugnote_add.php
  11. +1 −1  bugnote_edit_page.php
  12. +1 −1  bugnote_set_view_state.php
  13. +1 −1  bugnote_update.php
  14. +2 −2 changelog_page.php
  15. +2 −1  core/bugnote_api.php
  16. +2 −1  core/category_api.php
  17. +48 −0 core/classes/Exception/Authentication/LostPasswordBlankEmail.class.php
  18. +48 −0 core/classes/Exception/Authentication/LostPasswordDisabled.class.php
  19. +48 −0 core/classes/Exception/Column/ColumnDuplicate.class.php
  20. +48 −0 core/classes/Exception/Column/ColumnInvalid.class.php
  21. +48 −0 core/classes/Exception/Configuration/OptionCannotBeSetInDatabase.class.php
  22. +48 −0 core/classes/Exception/Field/InvalidValue.class.php
  23. +48 −0 core/classes/Exception/File/FileTypeNotAllowed.class.php
  24. +48 −0 core/classes/Exception/File/InvalidUploadPath.class.php
  25. +48 −0 core/classes/Exception/Issue/IssueReadOnly.class.php
  26. +48 −0 core/classes/Exception/Issue/Note/NoteNotFound.class.php
  27. +48 −0 core/classes/Exception/Issue/Relationship/RelationshipDuplicate.class.php
  28. +48 −0 core/classes/Exception/News/NewsItemNotFound.class.php
  29. +48 −0 core/classes/Exception/Plugin/PluginInstallationFailed.class.php
  30. +48 −0 core/classes/Exception/Plugin/PluginNotRegistered.class.php
  31. +48 −0 core/classes/Exception/Plugin/PluginPageNotFound.class.php
  32. +48 −0 core/classes/Exception/Session/SessionInvalid.class.php
  33. +48 −0 core/classes/Exception/User/UserProfileNotFound.class.php
View
2  bug_file_add.php
@@ -56,7 +56,7 @@
if ( $f_bug_id == -1 && $f_file == -1 ) {
# _POST/_FILES does not seem to get populated if you exceed size limit so check if bug_id is -1
- throw new MantisBT\Exception\File_Too_Big();
+ throw new MantisBT\Exception\File\FileTooBig();
}
form_security_validate( 'bug_file_add' );
View
4 bug_relationship_add.php
@@ -78,7 +78,7 @@
# bug is not read-only...
if ( bug_is_readonly( $f_src_bug_id ) ) {
- throw new MantisBT\Exception\Bug_Read_Only_Action_Denied( $f_src_bug_id );
+ throw new MantisBT\Exception\Issue\IssueReadOnly( $f_src_bug_id );
}
# user can access to the related bug at least as viewer...
@@ -98,7 +98,7 @@
if ( $t_old_id_relationship == -1 ) {
# the relationship type is exactly the same of the new one. No sense to proceed
- throw new MantisBT\Exception\Relationship_Already_Exists();
+ throw new MantisBT\Exception\Issue\Relationship\RelationshipDuplicate();
}
else if ( $t_old_id_relationship > 0 ) {
# there is already a relationship between them -> we have to update it and not to add a new one
View
2  bug_relationship_delete.php
@@ -73,7 +73,7 @@
# bug is not read-only...
if ( bug_is_readonly( $f_bug_id ) ) {
- throw new MantisBT\Exception\Bug_Read_Only_Action_Denied( $f_bug_id );
+ throw new MantisBT\Exception\Issue\IssueReadOnly( $f_bug_id );
}
# retrieve the destination bug of the relationship
View
2  bug_reminder.php
@@ -67,7 +67,7 @@
}
if ( bug_is_readonly( $f_bug_id ) ) {
- throw new MantisBT\Exception\Bug_Read_Only_Action_Denied( $f_bug_id );
+ throw new MantisBT\Exception\Issue\IssueReadOnly( $f_bug_id );
}
access_ensure_bug_level( config_get( 'bug_reminder_threshold' ), $f_bug_id );
View
2  bug_reminder_page.php
@@ -57,7 +57,7 @@
}
if ( bug_is_readonly( $f_bug_id ) ) {
- throw new MantisBT\Exception\Bug_Read_Only_Action_Denied( $f_bug_id );
+ throw new MantisBT\Exception\Issue\IssueReadOnly( $f_bug_id );
}
access_ensure_bug_level( config_get( 'bug_reminder_threshold' ), $f_bug_id );
View
6 bug_report.php
@@ -79,7 +79,7 @@
if( isset( $_GET['posted'] ) && empty( $_FILE ) && empty( $_POST ) ) {
# _POST/_FILES are not populated if you exceed size limit
- throw new MantisBT\Exception\File_Too_Big();
+ throw new MantisBT\Exception\File\FileTooBig();
}
$t_bug_data = new MantisBug;
@@ -154,7 +154,7 @@
throw new MantisBT\Exception\Field\EmptyField( lang_get_defaulted( custom_field_get_field( $t_id, 'name' ) ) );
}
if ( !custom_field_validate( $t_id, gpc_get_custom_field( "custom_field_$t_id", $t_def['type'], NULL ) ) ) {
- throw new MantisBT\Exception\Custom_Field_Invalid_Value( lang_get_defaulted( custom_field_get_field( $t_id, 'name' ) ));
+ throw new MantisBT\Exception\Field\InvalidValue( lang_get_defaulted( custom_field_get_field( $t_id, 'name' ) ));
}
}
@@ -181,7 +181,7 @@
$t_def = custom_field_get_definition( $t_id );
if( !custom_field_set_value( $t_id, $t_bug_id, gpc_get_custom_field( "custom_field_$t_id", $t_def['type'], '' ), false ) ) {
- throw new MantisBT\Exception\Custom_Field_Invalid_Value( lang_get_defaulted( custom_field_get_field( $t_id, 'name' ) ));
+ throw new MantisBT\Exception\Field\InvalidValue( lang_get_defaulted( custom_field_get_field( $t_id, 'name' ) ));
}
}
View
2  bug_report_page.php
@@ -88,7 +88,7 @@
# master bug is not read-only...
if ( bug_is_readonly( $f_master_bug_id ) ) {
- throw new MantisBT\Exception\Bug_Read_Only_Action_Denied( $f_master_bug_id );
+ throw new MantisBT\Exception\Issue\IssueReadOnly( $f_master_bug_id );
}
$t_bug = bug_get( $f_master_bug_id, true );
View
8 bug_update.php
@@ -78,7 +78,7 @@
# Check if the bug is in a read-only state and whether the current user has
# permission to update read-only bugs.
if ( bug_is_readonly( $f_bug_id ) ) {
- throw new MantisBT\Exception\Bug_Read_Only_Action_Denied( $f_bug_id );
+ throw new MantisBT\Exception\Issue\IssueReadOnly( $f_bug_id );
}
$t_updated_bug = clone $t_existing_bug;
@@ -150,7 +150,7 @@
if ( $t_existing_bug->status !== $t_updated_bug->status ) {
access_ensure_bug_level( config_get( 'update_bug_status_threshold' ), $f_bug_id );
if ( !bug_check_workflow( $t_existing_bug->status, $t_updated_bug->status ) ) {
- throw new MantisBT\Exception\Custom_Field_Invalid_Value( lang_get( 'status' ) );
+ throw new MantisBT\Exception\Field\InvalidValue( lang_get( 'status' ) );
}
if ( !access_has_bug_level( access_get_status_threshold( $t_updated_bug->status, $t_updated_bug->project_id ), $f_bug_id ) ) {
# The reporter may be allowed to close or reopen the issue regardless.
@@ -206,7 +206,7 @@
if ( $t_existing_bug->resolution !== $t_updated_bug->resolution &&
$t_updated_bug->resolution >= config_get( 'bug_resolution_fixed_threshold' ) &&
$t_updated_bug->status < $t_resolved_status ) {
- throw new MantisBT\Exception\Custom_Field_Invalid_Value( lang_get( 'resolution' ) );
+ throw new MantisBT\Exception\Field\InvalidValue( lang_get( 'resolution' ) );
}
# Ensure that the user has permission to change the target version of the issue.
@@ -260,7 +260,7 @@
# modified such that old values that were once OK are now considered
# invalid.
if ( !custom_field_validate( $t_cf_id, $t_new_custom_field_value ) ) {
- throw new MantisBT\Exception\Custom_Field_Invalid_Value( lang_get_defaulted( custom_field_get_field( $t_cf_id, 'name' ) ) );
+ throw new MantisBT\Exception\Field\InvalidValue( lang_get_defaulted( custom_field_get_field( $t_cf_id, 'name' ) ) );
}
# Remember the new custom field values so we can set them when updating
View
2  bug_update_page.php
@@ -81,7 +81,7 @@
}
if ( bug_is_readonly( $f_bug_id ) ) {
- throw new MantisBT\Exception\Bug_Read_Only_Action_Denied( $f_bug_id );
+ throw new MantisBT\Exception\Issue\IssueReadOnly( $f_bug_id );
}
access_ensure_bug_level( config_get( 'update_bug_threshold' ), $f_bug_id );
View
2  bugnote_add.php
@@ -62,7 +62,7 @@
}
if ( bug_is_readonly( $t_bug->id ) ) {
- throw new MantisBT\Exception\Bug_Read_Only_Action_Denied( $t_bug->id );
+ throw new MantisBT\Exception\Issue\IssueReadOnly( $t_bug->id );
}
access_ensure_bug_level( config_get( 'add_bugnote_threshold' ), $t_bug->id );
View
2  bugnote_edit_page.php
@@ -88,7 +88,7 @@
# Check if the bug is readonly
if ( bug_is_readonly( $t_bug_id ) ) {
- throw new MantisBT\Exception\Bug_Read_Only_Action_Denied( $t_bug_id );
+ throw new MantisBT\Exception\Issue\IssueReadOnly( $t_bug_id );
}
$t_bugnote_text = string_textarea( bugnote_get_text( $f_bugnote_id ) );
View
2  bugnote_set_view_state.php
@@ -66,7 +66,7 @@
# Check if the bug is readonly
$t_bug_id = bugnote_get_field( $f_bugnote_id, 'bug_id' );
if ( bug_is_readonly( $t_bug_id ) ) {
- throw new MantisBT\Exception\Bug_Read_Only_Action_Denied( $t_bug_id );
+ throw new MantisBT\Exception\Issue\IssueReadOnly( $t_bug_id );
}
# Check if the current user is allowed to change the view state of this bugnote
View
2  bugnote_update.php
@@ -68,7 +68,7 @@
# Check if the bug is readonly
$t_bug_id = bugnote_get_field( $f_bugnote_id, 'bug_id' );
if ( bug_is_readonly( $t_bug_id ) ) {
- throw new MantisBT\Exception\Bug_Read_Only_Action_Denied( $t_bug_id );
+ throw new MantisBT\Exception\Issue\IssueReadOnly( $t_bug_id );
}
$f_bugnote_text = trim( $f_bugnote_text ) . "\n\n";
View
4 changelog_page.php
@@ -117,7 +117,7 @@ function print_project_header_changelog ( $p_project_name ) {
$f_project_id = project_get_id_by_name( $f_project );
if ( $f_project_id === 0 ) {
- throw new MantisBT\Exception\Project_Not_Found();
+ throw new MantisBT\Exception\Project\ProjectNotFound();
}
}
@@ -146,7 +146,7 @@ function print_project_header_changelog ( $p_project_name ) {
$f_version_id = version_get_id( $f_version, $t_project_id );
if ( $f_version_id === false ) {
- throw new MantisBT\Exception\Version_Not_Found( $f_version );
+ throw new MantisBT\Exception\Issue\Version\VersionNotFound( $f_version );
}
}
View
3  core/bugnote_api.php
@@ -134,10 +134,11 @@ function bugnote_exists( $p_bugnote_id ) {
* return true if the bugnote exists, raise an error if not
* @param int $p_bugnote_id bugnote id
* @access public
+ * @throws MantisBT\Exception\Issue\Note\NoteNotFound
*/
function bugnote_ensure_exists( $p_bugnote_id ) {
if( !bugnote_exists( $p_bugnote_id ) ) {
- throw new MantisBT\Exception\BugNote_Not_Found();
+ throw new MantisBT\Exception\Issue\Note\NoteNotFound();
}
}
View
3  core/category_api.php
@@ -260,6 +260,7 @@ function category_remove_all( $p_project_id, $p_new_category_id = 0 ) {
* @param int $p_category_id Category id
* @return array array containing category details
* @access public
+ * @throws MantisBT\Exception\Issue\Category\CategoryNotFound
*/
function category_get_row( $p_category_id ) {
global $g_category_cache;
@@ -271,7 +272,7 @@ function category_get_row( $p_category_id ) {
$t_result = db_query( $t_query, array( $p_category_id ) );
$t_row = db_fetch_array( $t_result );
if( !$t_row ) {
- throw new MantisBT\Exception\Category_Not_Found();
+ throw new MantisBT\Exception\Issue\Category\CategoryNotFound();
}
$g_category_cache[$p_category_id] = $t_row;
View
48 core/classes/Exception/Authentication/LostPasswordBlankEmail.class.php
@@ -0,0 +1,48 @@
+<?php
+/**
+ * MantisBT - A PHP based bugtracking system
+ *
+ * MantisBT is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * MantisBT is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with MantisBT. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * @copyright Copyright (C) 2002 - 2012 MantisBT Team - mantisbt-dev@lists.sourceforge.
+ * @link http://www.mantisbt.org
+ * @package MantisBT
+ */
+
+namespace MantisBT\Exception\Authentication;
+use MantisBT\Exception\ExceptionAbstract;
+
+/**
+ * Lost Password Blank Email Exception
+ * @package MantisBT
+ * @subpackage classes
+ */
+class LostPasswordBlankEmail extends ExceptionAbstract
+{
+ /**
+ * Constructor
+ * @param array $p_parameters parameters
+ * @param \Exception previous exception
+ */
+ public function __construct($p_parameters = null, \Exception $p_previous = null)
+ {
+ if ($p_parameters === null) {
+ $t_message = _('You must provide an e-mail address in order to reset the password.');
+ } else {
+ $t_message = vsprintf( _('You must provide an e-mail address in order to reset the password.'), $p_parameters);
+ }
+ parent::__construct($t_message, 500, $p_previous);
+ }
+}
+?>
View
48 core/classes/Exception/Authentication/LostPasswordDisabled.class.php
@@ -0,0 +1,48 @@
+<?php
+/**
+ * MantisBT - A PHP based bugtracking system
+ *
+ * MantisBT is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * MantisBT is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with MantisBT. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * @copyright Copyright (C) 2002 - 2012 MantisBT Team - mantisbt-dev@lists.sourceforge.
+ * @link http://www.mantisbt.org
+ * @package MantisBT
+ */
+
+namespace MantisBT\Exception\Authentication;
+use MantisBT\Exception\ExceptionAbstract;
+
+/**
+ * Lost Password Disabled Exception
+ * @package MantisBT
+ * @subpackage classes
+ */
+class LostPasswordDisabled extends ExceptionAbstract
+{
+ /**
+ * Constructor
+ * @param array $p_parameters parameters
+ * @param \Exception previous exception
+ */
+ public function __construct($p_parameters = null, \Exception $p_previous = null)
+ {
+ if ($p_parameters === null) {
+ $t_message = _('The "lost your password" feature is not available.');
+ } else {
+ $t_message = vsprintf( _('The "lost your password" feature is not available.'), $p_parameters);
+ }
+ parent::__construct($t_message, 500, $p_previous);
+ }
+}
+?>
View
48 core/classes/Exception/Column/ColumnDuplicate.class.php
@@ -0,0 +1,48 @@
+<?php
+/**
+ * MantisBT - A PHP based bugtracking system
+ *
+ * MantisBT is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * MantisBT is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with MantisBT. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * @copyright Copyright (C) 2002 - 2012 MantisBT Team - mantisbt-dev@lists.sourceforge.
+ * @link http://www.mantisbt.org
+ * @package MantisBT
+ */
+
+namespace MantisBT\Exception\Column;
+use MantisBT\Exception\ExceptionAbstract;
+
+/**
+ * Column Duplicate Exception
+ * @package MantisBT
+ * @subpackage classes
+ */
+class ColumnDuplicate extends ExceptionAbstract
+{
+ /**
+ * Constructor
+ * @param array $p_parameters parameters
+ * @param \Exception previous exception
+ */
+ public function __construct($p_parameters = null, \Exception $p_previous = null)
+ {
+ if ($p_parameters === null) {
+ $t_message = _('Field "%1$s" contains duplicate column "%2$s".');
+ } else {
+ $t_message = vsprintf( _('Field "%1$s" contains duplicate column "%2$s".'), $p_parameters);
+ }
+ parent::__construct($t_message, 500, $p_previous);
+ }
+}
+?>
View
48 core/classes/Exception/Column/ColumnInvalid.class.php
@@ -0,0 +1,48 @@
+<?php
+/**
+ * MantisBT - A PHP based bugtracking system
+ *
+ * MantisBT is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * MantisBT is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with MantisBT. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * @copyright Copyright (C) 2002 - 2012 MantisBT Team - mantisbt-dev@lists.sourceforge.
+ * @link http://www.mantisbt.org
+ * @package MantisBT
+ */
+
+namespace MantisBT\Exception\Column;
+use MantisBT\Exception\ExceptionAbstract;
+
+/**
+ * Column Invalid Exception
+ * @package MantisBT
+ * @subpackage classes
+ */
+class ColumnInvalid extends ExceptionAbstract
+{
+ /**
+ * Constructor
+ * @param array $p_parameters parameters
+ * @param \Exception previous exception
+ */
+ public function __construct($p_parameters = null, \Exception $p_previous = null)
+ {
+ if ($p_parameters === null) {
+ $t_message = _('Field "%1$s" contains invalid field "%2$s".');
+ } else {
+ $t_message = vsprintf( _('Field "%1$s" contains invalid field "%2$s".'), $p_parameters);
+ }
+ parent::__construct($t_message, 500, $p_previous);
+ }
+}
+?>
View
48 core/classes/Exception/Configuration/OptionCannotBeSetInDatabase.class.php
@@ -0,0 +1,48 @@
+<?php
+/**
+ * MantisBT - A PHP based bugtracking system
+ *
+ * MantisBT is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * MantisBT is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with MantisBT. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * @copyright Copyright (C) 2002 - 2012 MantisBT Team - mantisbt-dev@lists.sourceforge.
+ * @link http://www.mantisbt.org
+ * @package MantisBT
+ */
+
+namespace MantisBT\Exception\Configuration;
+use MantisBT\Exception\ExceptionAbstract;
+
+/**
+ * Configuration Option Cannot Be Set In Database
+ * @package MantisBT
+ * @subpackage classes
+ */
+class OptionCanNotBeSetInDatabase extends ExceptionAbstract
+{
+ /**
+ * Constructor
+ * @param array $p_parameters parameters
+ * @param \Exception previous exception
+ */
+ public function __construct($p_parameters = null, \Exception $p_previous = null)
+ {
+ if ($p_parameters === null) {
+ $t_message = _('Configuration option "%1$s" can not be set in the database. It must be set in config_inc.php.');
+ } else {
+ $t_message = vsprintf( _('Configuration option "%1$s" can not be set in the database. It must be set in config_inc.php.'), $p_parameters);
+ }
+ parent::__construct($t_message, 500, $p_previous);
+ }
+}
+?>
View
48 core/classes/Exception/Field/InvalidValue.class.php
@@ -0,0 +1,48 @@
+<?php
+/**
+ * MantisBT - A PHP based bugtracking system
+ *
+ * MantisBT is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * MantisBT is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with MantisBT. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * @copyright Copyright (C) 2002 - 2012 MantisBT Team - mantisbt-dev@lists.sourceforge.
+ * @link http://www.mantisbt.org
+ * @package MantisBT
+ */
+
+namespace MantisBT\Exception\Field;
+use MantisBT\Exception\ExceptionAbstract;
+
+/**
+ * Invalid Value Exception
+ * @package MantisBT
+ * @subpackage classes
+ */
+class InvalidValue extends ExceptionAbstract
+{
+ /**
+ * Constructor
+ * @param array $p_parameters parameters
+ * @param \Exception previous exception
+ */
+ public function __construct($p_parameters = null, \Exception $p_previous = null)
+ {
+ if ($p_parameters === null) {
+ $t_message = _('Invalid value for field "%1$s".');
+ } else {
+ $t_message = vsprintf( _('Invalid value for field "%1$s".'), $p_parameters);
+ }
+ parent::__construct($t_message, 500, $p_previous);
+ }
+}
+?>
View
48 core/classes/Exception/File/FileTypeNotAllowed.class.php
@@ -0,0 +1,48 @@
+<?php
+/**
+ * MantisBT - A PHP based bugtracking system
+ *
+ * MantisBT is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * MantisBT is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with MantisBT. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * @copyright Copyright (C) 2002 - 2012 MantisBT Team - mantisbt-dev@lists.sourceforge.
+ * @link http://www.mantisbt.org
+ * @package MantisBT
+ */
+
+namespace MantisBT\Exception\File;
+use MantisBT\Exception\ExceptionAbstract;
+
+/**
+ * File Type Not Allowed Exception
+ * @package MantisBT
+ * @subpackage classes
+ */
+class FileTypeNotAllowed extends ExceptionAbstract
+{
+ /**
+ * Constructor
+ * @param array $p_parameters parameters
+ * @param \Exception previous exception
+ */
+ public function __construct($p_parameters = null, \Exception $p_previous = null)
+ {
+ if ($p_parameters === null) {
+ $t_message = _('File type not allowed for uploads.');
+ } else {
+ $t_message = vsprintf( _('File type not allowed for uploads.'), $p_parameters);
+ }
+ parent::__construct($t_message, 500, $p_previous);
+ }
+}
+?>
View
48 core/classes/Exception/File/InvalidUploadPath.class.php
@@ -0,0 +1,48 @@
+<?php
+/**
+ * MantisBT - A PHP based bugtracking system
+ *
+ * MantisBT is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * MantisBT is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with MantisBT. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * @copyright Copyright (C) 2002 - 2012 MantisBT Team - mantisbt-dev@lists.sourceforge.
+ * @link http://www.mantisbt.org
+ * @package MantisBT
+ */
+
+namespace MantisBT\Exception\File;
+use MantisBT\Exception\ExceptionAbstract;
+
+/**
+ * Invalid Upload Path Exception
+ * @package MantisBT
+ * @subpackage classes
+ */
+class InvalidUploadPath extends ExceptionAbstract
+{
+ /**
+ * Constructor
+ * @param array $p_parameters parameters
+ * @param \Exception previous exception
+ */
+ public function __construct($p_parameters = null, \Exception $p_previous = null)
+ {
+ if ($p_parameters === null) {
+ $t_message = _('Invalid upload path. Directory either does not exist or is not writable to web server.');
+ } else {
+ $t_message = vsprintf( _('Invalid upload path. Directory either does not exist or is not writable to web server.'), $p_parameters);
+ }
+ parent::__construct($t_message, 500, $p_previous);
+ }
+}
+?>
View
48 core/classes/Exception/Issue/IssueReadOnly.class.php
@@ -0,0 +1,48 @@
+<?php
+/**
+ * MantisBT - A PHP based bugtracking system
+ *
+ * MantisBT is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * MantisBT is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with MantisBT. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * @copyright Copyright (C) 2002 - 2012 MantisBT Team - mantisbt-dev@lists.sourceforge.
+ * @link http://www.mantisbt.org
+ * @package MantisBT
+ */
+
+namespace MantisBT\Exception\Issue;
+use MantisBT\Exception\ExceptionAbstract;
+
+/**
+ * Issue Read Only Exception
+ * @package MantisBT
+ * @subpackage classes
+ */
+class IssueReadOnly extends ExceptionAbstract
+{
+ /**
+ * Constructor
+ * @param array $p_parameters parameters
+ * @param \Exception previous exception
+ */
+ public function __construct($p_parameters = null, \Exception $p_previous = null)
+ {
+ if ($p_parameters === null) {
+ $t_message = _('The action cannot be performed because issue "%1$d" is read-only.');
+ } else {
+ $t_message = vsprintf( _('The action cannot be performed because issue "%1$d" is read-only.'), $p_parameters);
+ }
+ parent::__construct($t_message, 400, $p_previous);
+ }
+}
+?>
View
48 core/classes/Exception/Issue/Note/NoteNotFound.class.php
@@ -0,0 +1,48 @@
+<?php
+/**
+ * MantisBT - A PHP based bugtracking system
+ *
+ * MantisBT is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * MantisBT is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with MantisBT. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * @copyright Copyright (C) 2002 - 2012 MantisBT Team - mantisbt-dev@lists.sourceforge.
+ * @link http://www.mantisbt.org
+ * @package MantisBT
+ */
+
+namespace MantisBT\Exception\Issue\Note;
+use MantisBT\Exception\ExceptionAbstract;
+
+/**
+ * Issue Note Not Found Exception
+ * @package MantisBT
+ * @subpackage classes
+ */
+class NoteNotFound extends ExceptionAbstract
+{
+ /**
+ * Constructor
+ * @param array $p_parameters parameters
+ * @param \Exception previous exception
+ */
+ public function __construct($p_parameters = null, \Exception $p_previous = null)
+ {
+ if ($p_parameters === null) {
+ $t_message = _('Note not found.');
+ } else {
+ $t_message = vsprintf( _('Note not found.'), $p_parameters);
+ }
+ parent::__construct($t_message, 500, $p_previous);
+ }
+}
+?>
View
48 core/classes/Exception/Issue/Relationship/RelationshipDuplicate.class.php
@@ -0,0 +1,48 @@
+<?php
+/**
+ * MantisBT - A PHP based bugtracking system
+ *
+ * MantisBT is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * MantisBT is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with MantisBT. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * @copyright Copyright (C) 2002 - 2012 MantisBT Team - mantisbt-dev@lists.sourceforge.
+ * @link http://www.mantisbt.org
+ * @package MantisBT
+ */
+
+namespace MantisBT\Exception\Issue\Relationship;
+use MantisBT\Exception\ExceptionAbstract;
+
+/**
+ * Relationship Duplicate Exception
+ * @package MantisBT
+ * @subpackage classes
+ */
+class RelationshipDuplicate extends ExceptionAbstract
+{
+ /**
+ * Constructor
+ * @param array $p_parameters parameters
+ * @param \Exception previous exception
+ */
+ public function __construct($p_parameters = null, \Exception $p_previous = null)
+ {
+ if ($p_parameters === null) {
+ $t_message = _('There is already a relationship between these two issues.');
+ } else {
+ $t_message = vsprintf( _('There is already a relationship between these two issues.'), $p_parameters);
+ }
+ parent::__construct($t_message, 500, $p_previous);
+ }
+}
+?>
View
48 core/classes/Exception/News/NewsItemNotFound.class.php
@@ -0,0 +1,48 @@
+<?php
+/**
+ * MantisBT - A PHP based bugtracking system
+ *
+ * MantisBT is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * MantisBT is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with MantisBT. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * @copyright Copyright (C) 2002 - 2012 MantisBT Team - mantisbt-dev@lists.sourceforge.
+ * @link http://www.mantisbt.org
+ * @package MantisBT
+ */
+
+namespace MantisBT\Exception\News;
+use MantisBT\Exception\ExceptionAbstract;
+
+/**
+ * News Item Not Found Exception
+ * @package MantisBT
+ * @subpackage classes
+ */
+class NewsItemNotFound extends ExceptionAbstract
+{
+ /**
+ * Constructor
+ * @param array $p_parameters parameters
+ * @param \Exception previous exception
+ */
+ public function __construct($p_parameters = null, \Exception $p_previous = null)
+ {
+ if ($p_parameters === null) {
+ $t_message = _('News item not found.');
+ } else {
+ $t_message = vsprintf( _('News item not found.'), $p_parameters);
+ }
+ parent::__construct($t_message, 404, $p_previous);
+ }
+}
+?>
View
48 core/classes/Exception/Plugin/PluginInstallationFailed.class.php
@@ -0,0 +1,48 @@
+<?php
+/**
+ * MantisBT - A PHP based bugtracking system
+ *
+ * MantisBT is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * MantisBT is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with MantisBT. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * @copyright Copyright (C) 2002 - 2012 MantisBT Team - mantisbt-dev@lists.sourceforge.
+ * @link http://www.mantisbt.org
+ * @package MantisBT
+ */
+
+namespace MantisBT\Exception\Plugin;
+use MantisBT\Exception\ExceptionAbstract;
+
+/**
+ * Plugin Installation Failed Exception
+ * @package MantisBT
+ * @subpackage classes
+ */
+class PluginInstallationFailed extends ExceptionAbstract
+{
+ /**
+ * Constructor
+ * @param array $p_parameters parameters
+ * @param \Exception previous exception
+ */
+ public function __construct($p_parameters = null, \Exception $p_previous = null)
+ {
+ if ($p_parameters === null) {
+ $t_message = _('Plugin installation failed: %1$s.');
+ } else {
+ $t_message = vsprintf( _('Plugin installation failed: %1$s.'), $p_parameters);
+ }
+ parent::__construct($t_message, 500, $p_previous);
+ }
+}
+?>
View
48 core/classes/Exception/Plugin/PluginNotRegistered.class.php
@@ -0,0 +1,48 @@
+<?php
+/**
+ * MantisBT - A PHP based bugtracking system
+ *
+ * MantisBT is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * MantisBT is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with MantisBT. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * @copyright Copyright (C) 2002 - 2012 MantisBT Team - mantisbt-dev@lists.sourceforge.
+ * @link http://www.mantisbt.org
+ * @package MantisBT
+ */
+
+namespace MantisBT\Exception\Plugin;
+use MantisBT\Exception\ExceptionAbstract;
+
+/**
+ * Plugin Not Registered Exception
+ * @package MantisBT
+ * @subpackage classes
+ */
+class PluginNotRegistered extends ExceptionAbstract
+{
+ /**
+ * Constructor
+ * @param array $p_parameters parameters
+ * @param \Exception previous exception
+ */
+ public function __construct($p_parameters = null, \Exception $p_previous = null)
+ {
+ if ($p_parameters === null) {
+ $t_message = _('Plugin is not registered with MantisBT.');
+ } else {
+ $t_message = vsprintf( _('Plugin is not registered with MantisBT.'), $p_parameters);
+ }
+ parent::__construct($t_message, 500, $p_previous);
+ }
+}
+?>
View
48 core/classes/Exception/Plugin/PluginPageNotFound.class.php
@@ -0,0 +1,48 @@
+<?php
+/**
+ * MantisBT - A PHP based bugtracking system
+ *
+ * MantisBT is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * MantisBT is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with MantisBT. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * @copyright Copyright (C) 2002 - 2012 MantisBT Team - mantisbt-dev@lists.sourceforge.
+ * @link http://www.mantisbt.org
+ * @package MantisBT
+ */
+
+namespace MantisBT\Exception\Plugin;
+use MantisBT\Exception\ExceptionAbstract;
+
+/**
+ * Plugin Page Not Found Exception
+ * @package MantisBT
+ * @subpackage classes
+ */
+class PluginPageNotFound extends ExceptionAbstract
+{
+ /**
+ * Constructor
+ * @param array $p_parameters parameters
+ * @param \Exception previous exception
+ */
+ public function __construct($p_parameters = null, \Exception $p_previous = null)
+ {
+ if ($p_parameters === null) {
+ $t_message = _('Plugin page not found.');
+ } else {
+ $t_message = vsprintf( _('Plugin page not found.'), $p_parameters);
+ }
+ parent::__construct($t_message, 500, $p_previous);
+ }
+}
+?>
View
48 core/classes/Exception/Session/SessionInvalid.class.php
@@ -0,0 +1,48 @@
+<?php
+/**
+ * MantisBT - A PHP based bugtracking system
+ *
+ * MantisBT is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * MantisBT is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with MantisBT. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * @copyright Copyright (C) 2002 - 2012 MantisBT Team - mantisbt-dev@lists.sourceforge.
+ * @link http://www.mantisbt.org
+ * @package MantisBT
+ */
+
+namespace MantisBT\Exception\Session;
+use MantisBT\Exception\ExceptionAbstract;
+
+/**
+ * Session Invalid Exception
+ * @package MantisBT
+ * @subpackage classes
+ */
+class SessionInvalid extends ExceptionAbstract
+{
+ /**
+ * Constructor
+ * @param array $p_parameters parameters
+ * @param \Exception previous exception
+ */
+ public function __construct($p_parameters = null, \Exception $p_previous = null)
+ {
+ if ($p_parameters === null) {
+ $t_message = _('Your session has become invalidated.');
+ } else {
+ $t_message = vsprintf( _('Your session has become invalidated.'), $p_parameters);
+ }
+ parent::__construct($t_message, 500, $p_previous);
+ }
+}
+?>
View
48 core/classes/Exception/User/UserProfileNotFound.class.php
@@ -0,0 +1,48 @@
+<?php
+/**
+ * MantisBT - A PHP based bugtracking system
+ *
+ * MantisBT is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * MantisBT is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with MantisBT. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * @copyright Copyright (C) 2002 - 2012 MantisBT Team - mantisbt-dev@lists.sourceforge.
+ * @link http://www.mantisbt.org
+ * @package MantisBT
+ */
+
+namespace MantisBT\Exception\User;
+use MantisBT\Exception\ExceptionAbstract;
+
+/**
+ * User Profile Not Found Exception
+ * @package MantisBT
+ * @subpackage classes
+ */
+class UserProfileNotFound extends ExceptionAbstract
+{
+ /**
+ * Constructor
+ * @param array $p_parameters parameters
+ * @param \Exception previous exception
+ */
+ public function __construct($p_parameters = null, \Exception $p_previous = null)
+ {
+ if ($p_parameters === null) {
+ $t_message = _('Profile not found.');
+ } else {
+ $t_message = vsprintf( _('Profile not found.'), $p_parameters);
+ }
+ parent::__construct($t_message, 401, $p_previous);
+ }
+}
+?>
Please sign in to comment.
Something went wrong with that request. Please try again.