Commit aebb7580 authored by Jerome Mariette's avatar Jerome Mariette

fixe a bug to access data

parent 041e248b
......@@ -1398,17 +1398,31 @@ class tx_nG6_db {
$authorized = false;
// public project ?
$queryParts = array(
'SELECT' => 'public',
'FROM' => 'tx_nG6_project',
'WHERE' => 'uid='.$project_id,
'GROUPBY' => '',
'ORDERBY' => '',
'LIMIT' => ''
);
$res = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts);
$val = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
$authorized = ($val['public'] == 0);
if ($project_id) {
$queryParts = array(
'SELECT' => 'public',
'FROM' => 'tx_nG6_project',
'WHERE' => 'uid='.$project_id,
'GROUPBY' => '',
'ORDERBY' => '',
'LIMIT' => ''
);
$res = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts);
$val = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
$authorized = ($val['public'] == 0);
} elseif($run_id) {
$queryParts = array(
'SELECT' => 'public',
'FROM' => 'tx_nG6_project INNER JOIN tx_nG6_project_run ON tx_nG6_project.uid=tx_nG6_project_run.project_id',
'WHERE' => 'tx_nG6_project_run.run_id='.$run_id,
'GROUPBY' => '',
'ORDERBY' => '',
'LIMIT' => ''
);
$res = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts);
$val = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
$authorized = ($val['public'] == 0);
}
// not a public project
if(!$authorized){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment