Commit 40550892 authored by Jerome Mariette's avatar Jerome Mariette

change user management system

parent e4de5bd4
This diff is collapsed.
<?php
if (!defined ('TYPO3_MODE')) die ('Access denied.');
$TCA["fe_rights_levels"] = Array(
"ctrl" => Array (
'title' => 'LLL:EXT:nG6/locallang_db.xml:fe_rights_levels',
'label' => 'right_level_id',
"default_sortby" => "ORDER BY right_level_id",
"dynamicConfigFile" => t3lib_extMgm::extPath($_EXTKEY)."tca.php"
),
"feInterface" => Array (
"fe_admin_fieldList" => "right_level_id, right_level_label",
)
);
$TCA["fe_rights"] = Array(
"ctrl" => Array (
'title' => 'LLL:EXT:nG6/locallang_db.xml:fe_rights',
'label' => 'right_id, project_id, fe_user_id',
"default_sortby" => "ORDER BY right_id",
"dynamicConfigFile" => t3lib_extMgm::extPath($_EXTKEY)."tca.php"
),
"feInterface" => Array (
"fe_admin_fieldList" => "fe_user_id, right_id, project_id",
)
);
t3lib_extMgm::allowTableOnStandardPages("tx_nG6_project");
$TCA["tx_nG6_project"] = Array (
"ctrl" => Array (
'title' => 'LLL:EXT:nG6/locallang_db.xml:tx_nG6_project',
'title' => 'LLL:EXT:nG6/locallang_db.xml:tx_nG6_project',
'label' => 'uid',
'tstamp' => 'tstamp',
'crdate' => 'crdate',
......@@ -14,13 +40,12 @@ $TCA["tx_nG6_project"] = Array (
"delete" => "deleted",
"enablecolumns" => Array (
"disabled" => "hidden",
"fe_group" => "fe_group",
),
"dynamicConfigFile" => t3lib_extMgm::extPath($_EXTKEY)."tca.php",
"iconfile" => t3lib_extMgm::extRelPath($_EXTKEY)."icon_tx_nG6_project.gif",
),
"feInterface" => Array (
"fe_admin_fieldList" => "hidden, public, fe_group, name, description",
"fe_admin_fieldList" => "hidden, public, name, description",
)
);
......
This diff is collapsed.
This diff is collapsed.
......@@ -6,6 +6,9 @@
</meta>
<data type="array">
<languageKey index="default" type="array">
<label index="fe_rights_levels">Rights levels</label>
<label index="fe_rights_levels.id">ID:</label>
<label index="fe_rights_levels.label">Label:</label>
<label index="tx_nG6_project">Project</label>
<label index="tx_nG6_project.name">Name:</label>
<label index="tx_nG6_project.description">Description:</label>
......@@ -55,6 +58,9 @@
<label index="tt_content.list_type_pi3">nG6 search results</label>
</languageKey>
<languageKey index="fr" type="array">
<label index="fe_rights_levels">Niveau des droits</label>
<label index="fe_rights_levels.id">ID:</label>
<label index="fe_rights_levels.label">Label:</label>
<label index="tx_nG6_project">Projet</label>
<label index="tx_nG6_project.name">Nom :</label>
<label index="tx_nG6_project.description">Description :</label>
......
......@@ -57,8 +57,8 @@ class tx_nG6_pi1 extends tslib_pibase {
// Configuring so caching is not expected. This value means that no cHash params are ever set. We do this, because it's a USER_INT object!
$this->pi_USER_INT_obj=1;
// Loading the LOCAL_LANG values
$this->pi_loadLL();
$this->pi_loadLL();
// Add the ng6 plugins css
$GLOBALS['TSFE']->additionalHeaderData[$this->prefixId] = '
<script type="text/javascript" src="'.t3lib_extMgm::siteRelPath($this->extKey).'res/js/jquery.js"></script>
......@@ -94,8 +94,10 @@ class tx_nG6_pi1 extends tslib_pibase {
<link type="text/css" rel="stylesheet" media="screen" href="'.t3lib_extMgm::siteRelPath($this->extKey).'res/css/jquery.ui.dialog.css"/>
<link type="text/css" rel="stylesheet" media="screen" href="'.t3lib_extMgm::siteRelPath($this->extKey).'res/css/jquery.ui.resizable.css"/>';
tx_nG6_db::check_db_rights_level();
// If the user is authorized to access the specified project/run, display the page
if (tx_nG6_db::user_is_authorized($GLOBALS['TSFE']->fe_user->user['usergroup'], $this->piVars['project_id'], $this->piVars['run_id'])) {
if (tx_nG6_db::user_is_authorized($GLOBALS['TSFE']->fe_user->user['uid'], $this->piVars['project_id'], $this->piVars['run_id'])) {
switch((string)$this->conf['view']) {
// If the plugin is configured to display results by project
case 'project':
......@@ -124,6 +126,7 @@ class tx_nG6_pi1 extends tslib_pibase {
} else {
$content .= $this->pi_getLL('not_authorized','[not_authorized]');
}
return $this->pi_wrapInBaseClass($content);
}
......@@ -137,7 +140,7 @@ class tx_nG6_pi1 extends tslib_pibase {
if ($this->piVars['project_id']) {
$projects = array('project_'.$this->piVars['project_id'] => tx_nG6_db::select_project($this->piVars['project_id']));
} else {
$projects = tx_nG6_db::select_all_user_projects($GLOBALS['TSFE']->fe_user->user['usergroup'], 'tx_nG6_project.name');
$projects = tx_nG6_db::select_all_user_projects($GLOBALS['TSFE']->fe_user->user['uid'], 'tx_nG6_project.name');
}
$smarty = new Smarty();
$smarty->setTemplateDir(t3lib_extMgm::extPath('nG6').'/pi1');
......@@ -145,12 +148,11 @@ class tx_nG6_pi1 extends tslib_pibase {
$smarty->setCacheDir(t3lib_extMgm::extPath('nG6').'/res/smarty/cache');
$smarty->setConfigDir(t3lib_extMgm::extPath('nG6').'/res/smarty/configs');
$smarty->security = true;
$smarty->security_settings['MODIFIER_FUNCS'] = array('count');
$smarty->security_settings['MODIFIER_FUNCS'] = array('count');
// Add some information to the table
$project_ids = "";
foreach($projects as $project_id => $project_values) {
if (tx_nG6_db::is_super_user($GLOBALS['TSFE']->fe_user->user['usergroup'], 'project', $project_values['id']) ) {
if (tx_nG6_db::is_administrator($GLOBALS['TSFE']->fe_user->user['uid'], 'project', $project_values['id']) ) {
$projects[$project_id]['superuser'] = true;
} else {
$projects[$project_id]['superuser'] = false;
......@@ -160,18 +162,18 @@ class tx_nG6_pi1 extends tslib_pibase {
}
$smarty->assign('projects', $projects);
$smarty->assign('login_user', $GLOBALS['TSFE']->loginUser);
$smarty->assign('user_group', $GLOBALS['TSFE']->fe_user->user['usergroup']);
$smarty->assign('user_id', $GLOBALS['TSFE']->fe_user->user['uid']);
$smarty->assign('data_folder', $this->conf["data"]);
$smarty->assign('server_name', $this->conf["server_name"]);
$smarty->assign('project_ids', substr($project_ids,0,-1));
// If it's a single project, add runs and analysis information
if (count($projects) == 1) {
$project_runs = tx_nG6_db::get_project_runs($GLOBALS['TSFE']->fe_user->user['usergroup'], $projects[key($projects)]['id']);
$project_runs = tx_nG6_db::get_project_runs($GLOBALS['TSFE']->fe_user->user['uid'], $projects[key($projects)]['id']);
// Add some information to the table
foreach($project_runs as $run_id => $run_values) {
if (tx_nG6_db::is_super_user($GLOBALS['TSFE']->fe_user->user['usergroup'], 'run', $run_values['id']) ) {
if (tx_nG6_db::is_administrator($GLOBALS['TSFE']->fe_user->user['uid'], 'run', $run_values['id']) ) {
$project_runs[$run_id]['superuser'] = true;
} else {
$project_runs[$run_id]['superuser'] = false;
......@@ -179,10 +181,10 @@ class tx_nG6_pi1 extends tslib_pibase {
$project_runs[$run_id]['href'] = $this->pi_list_linkSingle($run_values['name'],$run_values['id'],1, array('run_id'=>$run_values['id'], 'project_id'=>$run_values['project_id']));
}
$smarty->assign('project_runs', $project_runs);
$project_analysis = tx_nG6_db::get_project_analysis($GLOBALS['TSFE']->fe_user->user['usergroup'], $projects[key($projects)]['id']);
$project_analysis = tx_nG6_db::get_project_analysis($GLOBALS['TSFE']->fe_user->user['uid'], $projects[key($projects)]['id']);
// Add some information to the table
foreach($project_analysis as $analysis_id => $analysis_values) {
if (tx_nG6_db::is_super_user($GLOBALS['TSFE']->fe_user->user['usergroup'], 'analyze', $analysis_values['id']) ) {
if (tx_nG6_db::is_administrator($GLOBALS['TSFE']->fe_user->user['uid'], 'analyze', $analysis_values['id']) ) {
$project_analysis[$analysis_id]['superuser'] = true;
} else {
$project_analysis[$analysis_id]['superuser'] = false;
......@@ -191,26 +193,28 @@ class tx_nG6_pi1 extends tslib_pibase {
}
$smarty->assign('h_project_analysis', tx_nG6_utils::trace_hierarchy($project_analysis));
$smarty->assign('project_analysis', $project_analysis);
}
}
if (isset($this->LOCAL_LANG[$this->LLkey]) && count($this->LOCAL_LANG[$this->LLkey]) > 0) {
$smarty->assign('llang', $this->LOCAL_LANG[$this->LLkey]);
} else {
$smarty->assign('llang', $this->LOCAL_LANG['default']);
}
return $smarty->fetch('project_view.tpl');
}
/**
* Return the run view
*/
function pi_run_view() {
$runs = array();
// If a single element
if ($this->piVars['run_id']) {
$runs = array('run_'.$this->piVars['run_id'] => tx_nG6_db::select_run($this->piVars['run_id']));
} else {
$runs = tx_nG6_db::select_all_user_runs($GLOBALS['TSFE']->fe_user->user['usergroup']);
$runs = tx_nG6_db::select_all_user_runs($GLOBALS['TSFE']->fe_user->user['uid']);
}
$smarty = new Smarty();
$smarty->setTemplateDir(t3lib_extMgm::extPath('nG6').'/pi1');
......@@ -223,7 +227,7 @@ class tx_nG6_pi1 extends tslib_pibase {
// Add some information to the table
$run_ids = "";
foreach($runs as $run_id => $run_values) {
if (tx_nG6_db::is_super_user($GLOBALS['TSFE']->fe_user->user['usergroup'], 'run', $run_values['id']) ) {
if (tx_nG6_db::is_administrator($GLOBALS['TSFE']->fe_user->user['uid'], 'run', $run_values['id']) ) {
$runs[$run_id]['superuser'] = true;
} else {
$runs[$run_id]['superuser'] = false;
......@@ -238,17 +242,17 @@ class tx_nG6_pi1 extends tslib_pibase {
$smarty->assign('runs', $runs);
$smarty->assign('first_id', key($runs));
$smarty->assign('login_user', $GLOBALS['TSFE']->loginUser);
$smarty->assign('user_group', $GLOBALS['TSFE']->fe_user->user['usergroup']);
$smarty->assign('user_id', $GLOBALS['TSFE']->fe_user->user['uid']);
$smarty->assign('data_folder', $this->conf["data"]);
$smarty->assign('server_name', $this->conf["server_name"]);
$smarty->assign('run_ids', substr($run_ids,0,-1));
// If it's a single run, add analysis information
if (count($runs) == 1) {
$run_analysis = tx_nG6_db::get_run_analysis($GLOBALS['TSFE']->fe_user->user['usergroup'], $runs[key($runs)]['id']);
$run_analysis = tx_nG6_db::get_run_analysis($GLOBALS['TSFE']->fe_user->user['uid'], $runs[key($runs)]['id']);
// Add some information to the table
foreach($run_analysis as $analysis_id => $analysis_values) {
if (tx_nG6_db::is_super_user($GLOBALS['TSFE']->fe_user->user['usergroup'], 'analyze', $analysis_values['id']) ) {
if (tx_nG6_db::is_administrator($GLOBALS['TSFE']->fe_user->user['uid'], 'analyze', $analysis_values['id']) ) {
$run_analysis[$analysis_id]['superuser'] = true;
} else {
$run_analysis[$analysis_id]['superuser'] = false;
......@@ -268,14 +272,13 @@ class tx_nG6_pi1 extends tslib_pibase {
$smarty->assign('llang', $this->LOCAL_LANG['default']);
}
return $smarty->fetch('run_view.tpl');
}
}
/**
* Return the analysis view
*/
function pi_analyze_view() {
// First select the analyse
$analyse = tx_nG6_db::select_analyse($this->piVars['analyze_id']);
......@@ -366,7 +369,7 @@ class tx_nG6_pi1 extends tslib_pibase {
}
return $str;
}
}
if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/nG6/pi1/class.tx_nG6_pi1.php']) {
......
......@@ -37,7 +37,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<input type="hidden" id="user_login" value="{$llang.user_login}" />
<input type="hidden" id="user_pwd" value="{$llang.user_pwd}" />
<input type="hidden" id="user_group" value="{$user_group}" />
<input type="hidden" id="user_id" value="{$user_id}" />
<input type="hidden" id="deleting_dialog_title" value="{$llang.deleting_dialog_title}" />
<input type="hidden" id="delete_success_msg" value="{$llang.delete_success_msg}" />
......@@ -227,4 +227,4 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
</tfoot>
{/if}
</table>
{/if}
{/if}
\ No newline at end of file
......@@ -37,7 +37,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<input type="hidden" id="user_login" value="{$llang.user_login}" />
<input type="hidden" id="user_pwd" value="{$llang.user_pwd}" />
<input type="hidden" id="user_group" value="{$user_group}" />
<input type="hidden" id="user_id" value="{$user_id}" />
<input type="hidden" id="deleting_dialog_title" value="{$llang.deleting_dialog_title}" />
<input type="hidden" id="delete_success_msg" value="{$llang.delete_success_msg}" />
......
......@@ -56,146 +56,78 @@ class tx_nG6_pi3 extends tslib_pibase {
$this->pi_loadLL(); // Loading the LOCAL_LANG values
$this->pi_USER_INT_obj=1; // Configuring so caching is not expected. This value means that no cHash params are ever set. We do this, because it's a USER_INT object!
// Search into the project table
if (!$GLOBALS['TSFE']->loginUser) { // If the user is not logged on
// Make listing query, pass query to SQL database:
$res_project = $this->pi_exec_query('tx_nG6_project',0,'AND fe_group=0 AND (name LIKE "%'.$GLOBALS['_POST']['text-search'].'%" OR description LIKE "%'.$GLOBALS['_POST']['text-search'].'%")');
} else {
// Make listing query, pass query to SQL database:
$res_project = $this->pi_exec_query('tx_nG6_project',0,'AND fe_group IN('.tx_nG6_db::get_user_groups($GLOBALS['TSFE']->fe_user->user['usergroup']).') AND (name LIKE "%'.$GLOBALS['_POST']['text-search'].'%" OR description LIKE "%'.$GLOBALS['_POST']['text-search'].'%")');
}
// Search into the project table
$queryParts = array(
'SELECT' => 'pro.*, rights.right_id ',
'FROM' => 'fe_rights rights '
.' INNER JOIN tx_nG6_project pro ON pro.uid=rights.project_id ',
'WHERE' => 'rights.fe_user_id='.$GLOBALS['TSFE']->fe_user->user['uid']
.' AND (pro.name LIKE "%'.$GLOBALS['_POST']['text-search'].'%" '
.' OR pro.description LIKE "%'.$GLOBALS['_POST']['text-search'].'%")',
'GROUPBY' => '',
'ORDERBY' => '',
'LIMIT' => ''
);
$res_project = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts);
$nb_project = $GLOBALS['TYPO3_DB']->sql_num_rows($res_project);
// Search into the run table
if (!$GLOBALS['TSFE']->loginUser) { // If the user is not logged on
$res = $this->pi_exec_query('tx_nG6_project',0,'AND fe_group=0');
} else {
$res = $this->pi_exec_query('tx_nG6_project',0,'AND fe_group IN ('.tx_nG6_db::get_user_groups($GLOBALS['TSFE']->fe_user->user['usergroup']).')');
}
$where = 'tx_nG6_project_run.project_id IN (';
while($this->internal['currentRow'] = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
$where .= $this->internal['currentRow']['uid'] . ",";
}
$where = substr($where, 0, -1) . ")";
if ($GLOBALS['TYPO3_DB']->sql_num_rows($res) > 0) {
$queryParts = array(
'SELECT' => 'run_id',
'FROM' => 'tx_nG6_project_run',
'WHERE' => $where,
'GROUPBY' => '',
'ORDERBY' => '',
'LIMIT' => ''
);
$res = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts);
if ($GLOBALS['TYPO3_DB']->sql_num_rows($res) > 0) {
$where = 'AND tx_nG6_run.uid IN (';
while($this->internal['currentRow'] = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
$where .= $this->internal['currentRow']['run_id'] . ",";
}
$where = substr($where, 0, -1) . ")";
$where .= ' AND (name LIKE "%'.$GLOBALS['_POST']['text-search'].'%" OR species LIKE "%'.$GLOBALS['_POST']['text-search'].'%" OR data_nature LIKE "%'.$GLOBALS['_POST']['text-search'].'%" OR type LIKE "%'.$GLOBALS['_POST']['text-search'].'%" OR description LIKE "%'.$GLOBALS['_POST']['text-search'].'%" OR sequencer LIKE "%'.$GLOBALS['_POST']['text-search'].'%")';
$res_run = $this->pi_exec_query('tx_nG6_run', 0, $where);
$nb_run = $GLOBALS['TYPO3_DB']->sql_num_rows($res_run);
} else {
$nb_run = 0;
}
} else {
$nb_run = 0;
}
// Search into the analyze table
if ($GLOBALS['TYPO3_DB']->sql_num_rows($res) > 0) {
$where_list = '';
// Search into the run table
$queryParts = array(
'SELECT' => 'run.*, rights.right_id ',
'FROM' => 'fe_rights rights '
.' INNER JOIN tx_nG6_project pro ON pro.uid=rights.project_id '
.' INNER JOIN tx_nG6_project_run p_run ON pro.uid=p_run.project_id '
.' INNER JOIN tx_nG6_run run ON run.uid=p_run.run_id',
'WHERE' => 'rights.fe_user_id='.$GLOBALS['TSFE']->fe_user->user['uid']
.' AND (run.name LIKE "%'.$GLOBALS['_POST']['text-search'].'%" '
.' OR run.description LIKE "%'.$GLOBALS['_POST']['text-search'].'%")',
'GROUPBY' => '',
'ORDERBY' => '',
'LIMIT' => ''
);
$res_run = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts);
$nb_run = $GLOBALS['TYPO3_DB']->sql_num_rows($res_run);
// Search in Project analyzes
if (!$GLOBALS['TSFE']->loginUser) { // If the user is not logged on
$res = $this->pi_exec_query('tx_nG6_project',0,'AND fe_group=0');
} else {
$res = $this->pi_exec_query('tx_nG6_project',0,'AND fe_group IN ('.tx_nG6_db::get_user_groups($GLOBALS['TSFE']->fe_user->user['usergroup']).')');
}
$where = 'tx_nG6_project_analyze.project_id IN (';
while($this->internal['currentRow'] = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
$where .= $this->internal['currentRow']['uid'] . ",";
}
$where = substr($where, 0, -1) . ")";
$queryParts = array(
'SELECT' => 'analyze_id',
'FROM' => 'tx_nG6_project_analyze',
'WHERE' => $where,
'GROUPBY' => '',
'ORDERBY' => '',
'LIMIT' => ''
);
$res_pa = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts);
if ($GLOBALS['TYPO3_DB']->sql_num_rows($res_pa) > 0) {
while($this->internal['currentRow'] = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res_pa)) {
$where_list .= $this->internal['currentRow']['analyze_id'] . ",";
}
}
// Search in Run analyzes
if (!$GLOBALS['TSFE']->loginUser) { // If the user is not logged on
$res = $this->pi_exec_query('tx_nG6_project',0,'AND fe_group=0');
} else {
$res = $this->pi_exec_query('tx_nG6_project',0,'AND fe_group IN ('.tx_nG6_db::get_user_groups($GLOBALS['TSFE']->fe_user->user['usergroup']).')');
}
$where = 'tx_nG6_project_run.project_id IN (';
while($this->internal['currentRow'] = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
$where .= $this->internal['currentRow']['uid'] . ",";
}
$where = substr($where, 0, -1) . ")";
$queryParts = array(
'SELECT' => 'run_id',
'FROM' => 'tx_nG6_project_run',
'WHERE' => $where,
'GROUPBY' => '',
'ORDERBY' => '',
'LIMIT' => ''
);
$res_tmp = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts);
if ($GLOBALS['TYPO3_DB']->sql_num_rows($res_tmp) > 0) {
$where = 'tx_nG6_run_analyze.run_id IN (';
while($this->internal['currentRow'] = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res_tmp)) {
$where .= $this->internal['currentRow']['run_id'] . ",";
}
$where = substr($where, 0, -1) . ")";
$queryParts = array(
'SELECT' => 'analyze_id',
'FROM' => 'tx_nG6_run_analyze',
'WHERE' => $where,
'GROUPBY' => '',
'ORDERBY' => '',
'LIMIT' => ''
);
$res_ra = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts);
if ($GLOBALS['TYPO3_DB']->sql_num_rows($res_ra) > 0) {
while($this->internal['currentRow'] = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res_ra)) {
$where_list .= $this->internal['currentRow']['analyze_id'] . ",";
}
}
$where_list = substr($where_list, 0, -1);
}
// Make the final Search
if ($where_list) {
$where = 'AND tx_nG6_analyze.uid IN ('.$where_list.') AND (name LIKE "%'.$GLOBALS['_POST']['text-search'].'%" OR description LIKE "%'.$GLOBALS['_POST']['text-search'].'%" OR software LIKE "%'.$GLOBALS['_POST']['text-search'].'%")';
$res_analyze = $this->pi_exec_query('tx_nG6_analyze', 0, $where);
$nb_analyze = $GLOBALS['TYPO3_DB']->sql_num_rows($res_analyze);
} else {
$nb_analyze = 0;
}
} else {
$nb_analyze = 0;
}
// Search into the analyze table
// -- Search in Project analyzes
$queryParts = array(
'SELECT' => 'ana.*, rights.right_id ',
'FROM' => 'fe_rights rights '
.' INNER JOIN tx_nG6_project pro ON pro.uid=rights.project_id '
.' INNER JOIN tx_nG6_project_analyze p_ana ON pro.uid=p_ana.project_id '
.' INNER JOIN tx_nG6_analyze ana ON ana.uid=p_ana.analyze_id',
'WHERE' => 'rights.fe_user_id='.$GLOBALS['TSFE']->fe_user->user['uid']
.' AND (ana.name LIKE "%'.$GLOBALS['_POST']['text-search'].'%" '
.' OR ana.description LIKE "%'.$GLOBALS['_POST']['text-search'].'%")',
'GROUPBY' => '',
'ORDERBY' => '',
'LIMIT' => ''
);
$res_pa = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts);
$nb_analyze = $GLOBALS['TYPO3_DB']->sql_num_rows($res_pa);
// -- Search in Run analyzes
$queryParts = array(
'SELECT' => 'ana.*, rights.right_id ',
'FROM' => 'fe_rights rights '
.' INNER JOIN tx_nG6_project pro ON pro.uid=rights.project_id '
.' INNER JOIN tx_nG6_project_run p_run ON pro.uid=p_run.project_id '
.' INNER JOIN tx_nG6_run run ON run.uid=p_run.run_id'
.' INNER JOIN tx_nG6_run_analyze r_ana ON run.uid=r_ana.run_id'
.' INNER JOIN tx_nG6_analyze ana ON ana.uid=r_ana.analyze_id',
'WHERE' => 'rights.fe_user_id='.$GLOBALS['TSFE']->fe_user->user['uid']
.' AND (ana.name LIKE "%'.$GLOBALS['_POST']['text-search'].'%" '
.' OR ana.description LIKE "%'.$GLOBALS['_POST']['text-search'].'%")',
'GROUPBY' => '',
'ORDERBY' => '',
'LIMIT' => ''
);
$res_ra = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts);
$nb_analyze += $GLOBALS['TYPO3_DB']->sql_num_rows($res_ra);
// Finally...
$content = '<h2>'.str_replace(array('###SPAN_WORD###', '###SPAN_LEN###'), array($GLOBALS['_POST']['text-search'], $nb_project + $nb_run + $nb_analyze), $this->getFieldHeader('search_for_text')).'</h2>';
if ($nb_project > 0) {
$content .= $this->pi_project_list_view($res_project);
......
......@@ -60,7 +60,7 @@ class tx_nG6_pi4 extends tslib_pibase {
// Gets params from the pi1 plugin
$p1Vars = t3lib_div::GParrayMerged('tx_nG6_pi1');
if (tx_nG6_db::user_is_authorized($GLOBALS['TSFE']->fe_user->user['usergroup'], $this->piVars['project_id'], $this->piVars['run_id'])) {
if (tx_nG6_db::user_is_authorized($GLOBALS['TSFE']->fe_user->user['uid'], $this->piVars['project_id'], $this->piVars['run_id'])) {
if ($p1Vars['project_id'] && $p1Vars['run_id'] && $p1Vars['analyze_id']) {
$content = '<p '.$this->pi_classParam('path').'>'. $this->pi_list_linkSingle($this->pi_getLL('Projets','Projets'),0, 1, array());
......
......@@ -97,11 +97,11 @@ class tx_nG6_pi5 extends tslib_pibase {
} else {
$smarty->assign('directory_prefix', "");
}
$smarty->assign('user_group', $GLOBALS['TSFE']->fe_user->user['usergroup']);
$smarty->assign('user_id', $GLOBALS['TSFE']->fe_user->user['uid']);
$smarty->assign('tmp_url', substr($this->conf["temp"], strpos($this->conf["temp"], "fileadmin")));
// Build the lists of all elements
$projects = tx_nG6_db::select_all_user_projects($GLOBALS['TSFE']->fe_user->user['usergroup'], 'tx_nG6_project.name');
$projects = tx_nG6_db::select_all_user_projects($GLOBALS['TSFE']->fe_user->user['uid'], 'tx_nG6_project.name');
$smarty->assign('projects', $projects);
return $smarty->fetch('download_view.tpl');
......@@ -114,4 +114,4 @@ if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/nG6/pi5
include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/nG6/pi5/class.tx_nG6_pi5.php']);
}
?>
?>
\ No newline at end of file
......@@ -52,7 +52,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<input type="hidden" id="temp_folder" value="{$temp_folder}" />
<input type="hidden" id="directory_prefix" value="{$directory_prefix}" />
<input type="hidden" id="user_group" value="{$user_group}" />
<input type="hidden" id="user_id" value="{$user_id}" />
<input type="hidden" id="tmp_url" value="{$tmp_url}" />
<div id="user_information_dialog" title=""></div>
......@@ -98,4 +98,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<input class="tx-nG6-pi5-download tx-nG6-pi5-download-disable" id="download_btn" type="button" value="{$llang.download_btn_label}" />
</div>
</div>
......@@ -173,7 +173,7 @@ $(function () {
});
var size_url = "index.php?eID=tx_nG6&type=get_size";
size_url += "&user_group="+$("#user_group").val();
size_url += "&user_id="+$("#user_id").val();
size_url += "&view="+$("#view").val();
size_url += "&ids="+$("#ids").val();
size_url += "&data_folder="+$("#data_folder").val();
......@@ -507,7 +507,7 @@ $(function () {
// Built the url
var val_url = "index.php?eID=tx_nG6&type=hide";
val_url += "&hide_level="+hide_level;
val_url += "&user_group="+$("#user_group").val();
val_url += "&user_id="+$("#user_id").val();
val_url += "&ids=";
$(':checked[id^=chk_'+ hide_level +']').each(function(i){
val_url += $(this).val().split("_",2)[1]+";";
......@@ -556,7 +556,7 @@ $(function () {
// Built the url
var val_url = "index.php?eID=tx_nG6&type=unhide";
val_url += "&unhide_level="+unhide_level;
val_url += "&user_group="+$("#user_group").val();
val_url += "&user_id="+$("#user_id").val();
val_url += "&ids=";
$(':checked[id^=chk_'+ unhide_level +']').each(function(i){
val_url += $(this).val().split("_",2)[1]+";";
......@@ -602,7 +602,7 @@ $(function () {
// Built the url
var val_url = "index.php?eID=tx_nG6&type=publish";
val_url += "&user_group="+$("#user_group").val();
val_url += "&user_id="+$("#user_id").val();
val_url += "&ids=";
$(':checked[id^=chk_project_]').each(function(i){
val_url += $(this).val().split("_",2)[1]+";";
......@@ -648,7 +648,7 @@ $(function () {
// Built the url
var val_url = "index.php?eID=tx_nG6&type=unpublish";
val_url += "&user_group="+$("#user_group").val();
val_url += "&user_id="+$("#user_id").val();
val_url += "&ids=";
$(':checked[id^=chk_project_]').each(function(i){
val_url += $(this).val().split("_",2)[1]+";";
......@@ -710,7 +710,7 @@ $(function () {
// launch the delete request on server
var val_url = "index.php?eID=tx_nG6&type=delete&del_level="+del_level+"&data_folder=" + $("#data_folder").val();
val_url += "&user_login=" + $("#user_login_val").val() + "&user_pwd=" + $("#user_pwd_val").val();
val_url += "&user_group="+$("#user_group").val() + "&ids=";
val_url += "&user_id="+$("#user_id").val() + "&ids=";
$(':checked[id^=chk_'+ del_level +']').each(function(i){
val_url += $(this).val().split("_",2)[1]+";";
});
......@@ -779,4 +779,4 @@ $(function () {
}
});
});
});
\ No newline at end of file
......@@ -43,7 +43,7 @@ $(function () {
run_short_description : $("#run_short_description").val(),
run_description : $("#run_description").val(),
analyse_description : $("#analyse_description").val(),
user_group : $("#user_group").val(),
user_id : $("#user_id").val(),
id : n.attr("id").split("_")[1],
type : n.attr("id").split("_")[0]
};
......@@ -273,4 +273,4 @@ $(function () {
}
});
});
});
\ No newline at end of file
<?php
if (!defined ('TYPO3_MODE')) die ('Access denied.');
$TCA["fe_rights"] = Array (
"ctrl" => $TCA["fe_rights_levels"]["ctrl"],
);
$TCA["fe_rights_levels"] = Array (
"ctrl" => $TCA["fe_rights_levels"]["ctrl"],
"interface" => Array (
"showRecordFieldList" => "right_level_id, right_level_label"
),
"feInterface" => $TCA["fe_rights_levels"]["feInterface"],
"columns" => Array (
"right_level_id" => Array(
"exclude" => 1,
"label" => "LLL:EXT:lang/locallang_db.xml:fe_rights_levels.id",
"config" => Array (
"type" => "input",
"size" => "5",
"eval" => "trim",
)
),
"right_level_label" => Array(
"exclude" => 1,
"label" => "LLL:EXT:lang/locallang_db.xml:fe_rights_levels.label",
"config" => Array (
"type" => "input",
"size" => "20",
"eval" => "trim",
)
)
)
);
$TCA["tx_nG6_project"] = Array (
"ctrl" => $TCA["tx_nG6_project"]["ctrl"],
"interface" => Array (
"showRecordFieldList" => "hidden,public,fe_group,name,description"
"showRecordFieldList" => "hidden,public,name,description"
),
"feInterface" => $TCA["tx_nG6_project"]["feInterface"],
"columns" => Array (
......@@ -24,20 +58,6 @@ $TCA["tx_nG6_project"] = Array (
"default" => "0"
)
),
"fe_group" => Array (
"exclude" => 1,
"label" => "LLL:EXT:lang/locallang_general.xml:LGL.fe_group",
"config" => Array (
"type" => "select",
"items" => Array (
Array("", 0),
Array("LLL:EXT:lang/locallang_general.xml:LGL.hide_at_login", -1),
Array("LLL:EXT:lang/locallang_general.xml:LGL.any_login", -2),
Array("LLL:EXT:lang/locallang_general.xml:LGL.usergroups", "--div--")
),
"foreign_table" => "fe_groups"
)
),
"name" => Array (
"exclude" => 1,
"label" => "LLL:EXT:nG6/locallang_db.xml:tx_nG6_project.name",
......@@ -59,9 +79,6 @@ $TCA["tx_nG6_project"] = Array (
),