Skip to content
Snippets Groups Projects
Commit 3ef85fff authored by Nick Barry's avatar Nick Barry
Browse files

Updated methods to correctly check to see if a file exists on admin actions

parent a1226881
No related branches found
No related tags found
No related merge requests found
......@@ -79,7 +79,7 @@ class Bulletin_AdminController extends Creq_Controller_Action
// get file path and name for major
$filePath = 'data' .DIRECTORY_SEPARATOR. Bulletin_RepositoryModel::getInstance()->getFilePathForCollegeMajorYear($in['college'], $major, $currentYear);
if (!$filePath) {
if (!is_file($filePath)) {
$this->_helper->getHelper('FlashMessenger')->addMessage('Unable to find an existing file for that college/major.');
$this->redirect('/bulletin/admin/change-major-name');
}
......@@ -147,7 +147,7 @@ class Bulletin_AdminController extends Creq_Controller_Action
// get file path and name for major
$filePath = 'data' .DIRECTORY_SEPARATOR. Bulletin_RepositoryModel::getInstance()->getFilePathForCollegeMajorYear($in['college'], $major, $currentYear);
if (!$filePath) {
if (!is_file($filePath)) {
$this->_helper->getHelper('FlashMessenger')->addMessage('Unable to find an existing file for that college/major.');
$this->redirect('/bulletin/admin/change-major-name');
}
......@@ -468,7 +468,7 @@ class Bulletin_AdminController extends Creq_Controller_Action
// get file path and name for major
$filePath = 'data' .DIRECTORY_SEPARATOR. Bulletin_RepositoryModel::getInstance()->getFilePathForCollegeMajorYear($in['college'], $major, $currentYear);
if (!$filePath) {
if (!is_file($filePath)) {
$this->_helper->getHelper('FlashMessenger')->addMessage('Unable to find an existing file for that college/major.');
$this->redirect('/bulletin/admin/remove-major');
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment