diff --git a/common/framework/exceptions/invalidrequest.php b/common/framework/exceptions/invalidrequest.php new file mode 100644 index 000000000..fcb2595f0 --- /dev/null +++ b/common/framework/exceptions/invalidrequest.php @@ -0,0 +1,18 @@ +stop('msg_invalid_request'); + throw new Rhymix\Framework\Exceptions\InvalidRequest; } $oMenuAdminController = getAdminController('menu'); diff --git a/modules/board/board.admin.controller.php b/modules/board/board.admin.controller.php index 78d5fbb95..112cb9c47 100644 --- a/modules/board/board.admin.controller.php +++ b/modules/board/board.admin.controller.php @@ -168,7 +168,7 @@ class boardAdminController extends board { $module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl); if($module_info->mid != $mid) { - throw new Rhymix\Framework\Exception('msg_invalid_request'); + throw new Rhymix\Framework\Exceptions\InvalidRequest; } $module_info->hide_category = Context::get('hide_category') == 'Y' ? 'Y' : 'N'; diff --git a/modules/board/board.controller.php b/modules/board/board.controller.php index d04024160..4cb135f90 100644 --- a/modules/board/board.controller.php +++ b/modules/board/board.controller.php @@ -24,7 +24,7 @@ class boardController extends board // check grant if(!$this->grant->write_document) { - throw new Rhymix\Framework\Exception('msg_not_permitted'); + throw new Rhymix\Framework\Exceptions\NotPermitted; } // setup variables @@ -107,7 +107,7 @@ class boardController extends board { if(!$oDocument->isGranted()) { - throw new Rhymix\Framework\Exception('msg_not_permitted'); + throw new Rhymix\Framework\Exceptions\NotPermitted; } // Protect admin document @@ -356,7 +356,7 @@ class boardController extends board // check grant if(!$this->grant->write_comment) { - throw new Rhymix\Framework\Exception('msg_not_permitted'); + throw new Rhymix\Framework\Exceptions\NotPermitted; } $logged_info = Context::get('logged_info'); @@ -398,7 +398,7 @@ class boardController extends board $oDocument = $oDocumentModel->getDocument($obj->document_srl); if(!$oDocument->isExists()) { - throw new Rhymix\Framework\Exception('msg_not_founded'); + throw new Rhymix\Framework\Exceptions\TargetNotFound; } // For anonymous use, remove writer's information and notifying information @@ -461,7 +461,7 @@ class boardController extends board $parent_comment = $oCommentModel->getComment($obj->parent_srl); if(!$parent_comment->comment_srl) { - throw new Rhymix\Framework\Exception('msg_invalid_request'); + throw new Rhymix\Framework\Exceptions\InvalidRequest; } if($parent_comment->isSecret() && $this->module_info->secret === 'Y') { @@ -496,7 +496,7 @@ class boardController extends board // check the grant if(!$comment->isGranted()) { - throw new Rhymix\Framework\Exception('msg_not_permitted'); + throw new Rhymix\Framework\Exceptions\NotPermitted; } $obj->parent_srl = $comment->parent_srl; $output = $oCommentController->updateComment($obj, $this->grant->manager); @@ -530,7 +530,7 @@ class boardController extends board if(!$comment_srl) { - throw new Rhymix\Framework\Exception('msg_invalid_request'); + throw new Rhymix\Framework\Exceptions\InvalidRequest; } $oCommentModel = getModel('comment'); @@ -662,7 +662,7 @@ class boardController extends board $oComment = $oCommentModel->getComment($comment_srl); if(!$oComment->isExists()) { - throw new Rhymix\Framework\Exception('msg_invalid_request'); + throw new Rhymix\Framework\Exceptions\InvalidRequest; } // compare the comment password and the user input password @@ -678,7 +678,7 @@ class boardController extends board $oDocument = $oDocumentModel->getDocument($document_srl); if(!$oDocument->isExists()) { - throw new Rhymix\Framework\Exception('msg_invalid_request'); + throw new Rhymix\Framework\Exceptions\InvalidRequest; } // compare the document password and the user input password diff --git a/modules/board/board.view.php b/modules/board/board.view.php index 24a9e80f4..838c5dd8f 100644 --- a/modules/board/board.view.php +++ b/modules/board/board.view.php @@ -998,7 +998,7 @@ class boardView extends board // if the parent comment is not existed if(!$parent_srl) { - throw new Rhymix\Framework\Exception('msg_invalid_request'); + throw new Rhymix\Framework\Exceptions\InvalidRequest; } // get the comment @@ -1060,7 +1060,7 @@ class boardView extends board // if the comment is not existed if(!$comment_srl) { - throw new Rhymix\Framework\Exception('msg_invalid_request'); + throw new Rhymix\Framework\Exceptions\InvalidRequest; } // get comment information @@ -1233,7 +1233,7 @@ class boardView extends board if($this->grant->update_view !== true) { - throw new Rhymix\Framework\Exception('msg_not_permitted'); + throw new Rhymix\Framework\Exceptions\NotPermitted; } $updatelog = $oDocumentModel->getDocumentUpdateLog($document_srl); @@ -1253,7 +1253,7 @@ class boardView extends board if($this->grant->update_view !== true) { - throw new Rhymix\Framework\Exception('msg_not_permitted'); + throw new Rhymix\Framework\Exceptions\NotPermitted; } $update_log = $oDocumentModel->getUpdateLog($update_id); @@ -1289,7 +1289,7 @@ class boardView extends board { iF($this->grant->vote_log_view !== true) { - throw new Rhymix\Framework\Exception('msg_not_permitted'); + throw new Rhymix\Framework\Exceptions\NotPermitted; } $oMemberModel = getModel('member'); diff --git a/modules/importer/importer.admin.controller.php b/modules/importer/importer.admin.controller.php index 5a96a6274..112e50406 100644 --- a/modules/importer/importer.admin.controller.php +++ b/modules/importer/importer.admin.controller.php @@ -297,7 +297,7 @@ class importerAdminController extends importer switch($type) { case 'ttxml' : - if(!$target_module) throw new Rhymix\Framework\Exception('msg_invalid_request'); + if(!$target_module) throw new Rhymix\Framework\Exceptions\InvalidRequest; $oModuleModel = getModel('module'); $columnList = array('module_srl', 'module'); @@ -317,7 +317,7 @@ class importerAdminController extends importer break; case 'module' : // Check if the target module exists - if(!$target_module) throw new Rhymix\Framework\Exception('msg_invalid_request'); + if(!$target_module) throw new Rhymix\Framework\Exceptions\InvalidRequest; $cur = $this->importModule($key, $cur, $index_file, $target_module); break; } diff --git a/modules/install/install.admin.controller.php b/modules/install/install.admin.controller.php index 54f7d64a1..524530a73 100644 --- a/modules/install/install.admin.controller.php +++ b/modules/install/install.admin.controller.php @@ -20,7 +20,7 @@ class installAdminController extends install function procInstallAdminInstall() { $module_name = Context::get('module_name'); - if(!$module_name) throw new Rhymix\Framework\Exception('invalid_request'); + if(!$module_name) throw new Rhymix\Framework\Exceptions\InvalidRequest; $oInstallController = getController('install'); $oInstallController->installModule($module_name, './modules/'.$module_name); @@ -35,10 +35,10 @@ class installAdminController extends install { @set_time_limit(0); $module_name = Context::get('module_name'); - if(!$module_name) throw new Rhymix\Framework\Exception('invalid_request'); + if(!$module_name) throw new Rhymix\Framework\Exceptions\InvalidRequest; $oModule = getModule($module_name, 'class'); - if(!$oModule) throw new Rhymix\Framework\Exception('invalid_request'); + if(!$oModule) throw new Rhymix\Framework\Exceptions\InvalidRequest; $output = $oModule->moduleUpdate(); if($output instanceof BaseObject && !$output->toBool()) diff --git a/modules/integration_search/integration_search.view.php b/modules/integration_search/integration_search.view.php index 3c2a0e9c0..45567e810 100644 --- a/modules/integration_search/integration_search.view.php +++ b/modules/integration_search/integration_search.view.php @@ -49,7 +49,10 @@ class integration_searchView extends integration_search } // Check permissions - if(!$this->grant->access) throw new Rhymix\Framework\Exception('msg_not_permitted'); + if(!$this->grant->access) + { + throw new Rhymix\Framework\Exceptions\NotPermitted; + } $config = $oModuleModel->getModuleConfig('integration_search'); if(!$config) $config = new stdClass; diff --git a/modules/point/point.admin.controller.php b/modules/point/point.admin.controller.php index 3e4f1490b..5996ffc91 100644 --- a/modules/point/point.admin.controller.php +++ b/modules/point/point.admin.controller.php @@ -198,7 +198,7 @@ class pointAdminController extends point function procPointAdminInsertPointModuleConfig() { $module_srl = Context::get('target_module_srl'); - if(!$module_srl) throw new Rhymix\Framework\Exception('msg_invalid_request'); + if(!$module_srl) throw new Rhymix\Framework\Exceptions\InvalidRequest; // In case of batch configuration of several modules if(preg_match('/^([0-9,]+)$/',$module_srl)) $module_srl = explode(',',$module_srl); else $module_srl = array($module_srl); @@ -375,7 +375,7 @@ class pointAdminController extends point $position = (int)Context::get('position'); $total = (int)Context::get('total'); - if(!file_exists('./files/cache/pointRecal.txt')) throw new Rhymix\Framework\Exception('msg_invalid_request'); + if(!file_exists('./files/cache/pointRecal.txt')) throw new Rhymix\Framework\Exceptions\InvalidRequest; $idx = 0; $f = fopen("./files/cache/pointRecal.txt","r"); @@ -418,7 +418,7 @@ class pointAdminController extends point function procPointAdminReset() { $module_srl = Context::get('module_srls'); - if(!$module_srl) throw new Rhymix\Framework\Exception('msg_invalid_request'); + if(!$module_srl) throw new Rhymix\Framework\Exceptions\InvalidRequest; // In case of batch configuration of several modules if(preg_match('/^([0-9,]+)$/',$module_srl)) $module_srl = explode(',',$module_srl); else $module_srl = array($module_srl);