Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feedback MRI Popup] Don't call functions that don't exist! #4092

Merged
merged 2 commits into from
Nov 21, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 12 additions & 17 deletions htdocs/feedback_mri_popup.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,38 +10,36 @@
* @license http://www.gnu.org/licenses/gpl-3.0.txt GPLv3
* @link https://www.github.com/aces/Loris/
*/
set_include_path(get_include_path().":../project/libraries:../php/libraries:");
require_once __DIR__ . "/../vendor/autoload.php";
ini_set('default_charset', 'utf-8');
ob_start('ob_gzhandler');
require_once "NDB_Client.class.inc";
$client = new NDB_Client;
if ($client->initialize() == false) {
$login = $_SESSION['State']->getProperty('login');
$login->showLoginScreen();
return false;
http_response_code(401);
echo "User not authenticated.";
return;
}

require_once "FeedbackMRI.class.inc";

// create DB object
$DB =& Database::singleton();
$DB = \Database::singleton();

// user is logged in, let's continue with the show...
$user =& User::singleton($_SESSION['State']->getUsername());
$user = \User::singleton($_SESSION['State']->getUsername());

// check permissions
if ($user->hasPermission('imaging_browser_qc')) {
$tpl_data['has_permission'] = true;
if (!$user->hasPermission('imaging_browser_qc')) {
http_response_code(403);
return;
}

$tpl_data['has_permission'] = true;
// instantiate feedback mri object
$comments = new FeedbackMRI($_REQUEST['fileID'], $_REQUEST['sessionID']);

/*
* UPDATE SECTION
*/
if ($_POST['fire_away'] && $user->hasPermission('imaging_browser_qc')) {
if ($_POST['fire_away']) {
// clear all predefined comments
$comments->clearAllComments();

Expand Down Expand Up @@ -156,13 +154,10 @@
}

//Output template using Smarty
$config =& NDB_Config::singleton();
$tpl_data['css'] =$config->getSetting('css');
$config = \NDB_Config::singleton();
$tpl_data['css'] = $config->getSetting('css');
$smarty = new Smarty_neurodb;
$smarty->assign($tpl_data);
$smarty->display('feedback_mri_popup.tpl');

ob_end_flush();

exit;
?>