Commit 62827323 authored by Gerald Salin's avatar Gerald Salin
Browse files

Merge branch 'user_management' into 'master'

User management

See merge request !15
parents e223c65f 7162812c
...@@ -28,6 +28,8 @@ server_socket_host = 127.0.0.1 ...@@ -28,6 +28,8 @@ server_socket_host = 127.0.0.1
# on which socket port should run the web server # on which socket port should run the web server
server_socket_port = 8080 server_socket_port = 8080
#server_socket_port = 8083 #server_socket_port = 8083
# protocol used to access web server (http|https)
server_socket_protocol = https
# date format # date format
date_format = %d/%m/%Y date_format = %d/%m/%Y
# data retention time (in years) # data retention time (in years)
......
...@@ -112,9 +112,9 @@ class JFlowConfigReader(object): ...@@ -112,9 +112,9 @@ class JFlowConfigReader(object):
def get_socket_options(self): def get_socket_options(self):
try: try:
return [self.reader.get("global", "server_socket_host"), int(self.reader.get("global", "server_socket_port"))] return [self.reader.get("global", "server_socket_host"), int(self.reader.get("global", "server_socket_port")), self.reader.get("global", "server_socket_protocol")]
except: except:
return ["127.0.0.1", 8080] return ["127.0.0.1", 8080,"http"]
def get_ssl_files(self): def get_ssl_files(self):
try: try:
......
...@@ -530,7 +530,7 @@ class JFlowServer (object): ...@@ -530,7 +530,7 @@ class JFlowServer (object):
socket_opt = self.jflow_config_reader.get_socket_options() socket_opt = self.jflow_config_reader.get_socket_options()
if not os.path.isdir(path): if not os.path.isdir(path):
return { return {
'url':'http://' + socket_opt[0] + ':' + str(socket_opt[1]) + '/' + path.replace(work_dir, web_path), 'url':socket_opt[2]+'://' + socket_opt[0] + ':' + str(socket_opt[1]) + '/' + path.replace(work_dir, web_path),
'size': get_octet_string_representation(os.path.getsize(os.path.abspath(path))), 'size': get_octet_string_representation(os.path.getsize(os.path.abspath(path))),
'extension': os.path.splitext(path)[1] 'extension': os.path.splitext(path)[1]
} }
......
...@@ -159,12 +159,13 @@ class NG6ConfigReader(object): ...@@ -159,12 +159,13 @@ class NG6ConfigReader(object):
def get_server_parameters(self): def get_server_parameters(self):
""" """
return the server parameters return the server parameters
@return: server_socket_host, server_socket_port @return: server_socket_host, server_socket_port, server_socket_protocol
""" """
# try: # try:
server_params = [] server_params = []
server_params.append(self.reader.get('global', 'server_socket_host')) server_params.append(self.reader.get('global', 'server_socket_host'))
server_params.append(self.reader.get('global', 'server_socket_port')) server_params.append(self.reader.get('global', 'server_socket_port'))
server_params.append(self.reader.get("global", 'server_socket_protocol'))
return server_params return server_params
# except : # except :
# raise Error("Failed when parsing the config file !") # raise Error("Failed when parsing the config file !")
......
...@@ -61,7 +61,7 @@ class tx_nG6_eid { ...@@ -61,7 +61,7 @@ class tx_nG6_eid {
//error_log("tx_nG6_eid ".$type." \n ", 3, "/work/tmp/mes-erreurs.log"); //error_log("tx_nG6_eid ".$type." \n ", 3, "/work/tmp/mes-erreurs.log");
// If the type of data requested is project // If the type of data requested is project
if ($type == 'project') { if ($type == 'project') {
$project_id = trim(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('id')); $project_id = trim(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('object_id'));
// Select all runs linked to the project // Select all runs linked to the project
$project_runs = tx_nG6_db::get_user_project_runs($user_id, $project_id, 'tx_nG6_run.date DESC'); $project_runs = tx_nG6_db::get_user_project_runs($user_id, $project_id, 'tx_nG6_run.date DESC');
// for each run // for each run
...@@ -79,7 +79,7 @@ class tx_nG6_eid { ...@@ -79,7 +79,7 @@ class tx_nG6_eid {
// If the type of data requested is run // If the type of data requested is run
} else if ($type == 'run'){ } else if ($type == 'run'){
$run_id = trim(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('id')); $run_id = trim(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('object_id'));
// Select all analysis linked to the run and the run information // Select all analysis linked to the run and the run information
$run_analysis = tx_nG6_db::get_user_run_analysis($user_id, $run_id, 'tx_nG6_analyze.name'); $run_analysis = tx_nG6_db::get_user_run_analysis($user_id, $run_id, 'tx_nG6_analyze.name');
$run_info = tx_nG6_db::select_run($run_id); $run_info = tx_nG6_db::select_run($run_id);
...@@ -639,7 +639,7 @@ class tx_nG6_eid { ...@@ -639,7 +639,7 @@ class tx_nG6_eid {
$group_name = trim(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('title')); $group_name = trim(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('title'));
$location = trim(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('location')); $location = trim(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('location'));
$organism = trim(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('organism')); $organism = trim(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('organism'));
$user_id = trim(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('id')); $user_id = trim(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('user_id'));
$password = trim(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('password')); $password = trim(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('password'));
$cruser_id = trim(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('creator')); $cruser_id = trim(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('creator'));
$send_an_email = filter_var(trim(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('send_an_email')), FILTER_VALIDATE_BOOLEAN); $send_an_email = filter_var(trim(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('send_an_email')), FILTER_VALIDATE_BOOLEAN);
...@@ -681,7 +681,7 @@ class tx_nG6_eid { ...@@ -681,7 +681,7 @@ class tx_nG6_eid {
print $nb_updated; print $nb_updated;
} }
else if ($type == 'get_user_group'){ else if ($type == 'get_user_group'){
$id = trim(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('id')); $id = trim(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('user_id'));
print json_encode(tx_nG6_db::get_group_informations(tx_nG6_db::get_user_usergroup($id))); print json_encode(tx_nG6_db::get_group_informations(tx_nG6_db::get_user_usergroup($id)));
} }
elseif($type == 'runs_table') { elseif($type == 'runs_table') {
......
{*
Copyright (C) 2009 INRA
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*}
{extends file='AnalysisTemplate.tpl'}
{block name=description_update}
<br/>
<div style="float:right;">
{if $is_project_admin }
<button id="add_file" type="button" class="btn btn-sm btn-primary"><i class="glyphicon glyphicon-plus"></i> add files</button>
{/if}
</div>
{/block}
{* No result tab*}
{block name=nav_menu_results}{/block}
{block name=tab_content_results}{/block}
\ No newline at end of file
...@@ -394,7 +394,7 @@ $(function () { ...@@ -394,7 +394,7 @@ $(function () {
console.log("update_pwd " + update_pwd); console.log("update_pwd " + update_pwd);
// get title laboratory and organism from ajax query // get title laboratory and organism from ajax query
$.ajax({ $.ajax({
url: "index.php?eID=tx_nG6&type=get_user_group&id=" + user_id , url: "index.php?eID=tx_nG6&type=get_user_group&user_id=" + user_id ,
dataType: 'json', dataType: 'json',
success: function (data) { success: function (data) {
update_user_call_back(data, first_name); update_user_call_back(data, first_name);
......
...@@ -398,7 +398,7 @@ $(function () { ...@@ -398,7 +398,7 @@ $(function () {
run_description : "Run ###SPAN_NAME### (###SPAN_SPECIES###) - (###SPAN_DATE###) produced ###SPAN_NB_SEQ### reads", run_description : "Run ###SPAN_NAME### (###SPAN_SPECIES###) - (###SPAN_DATE###) produced ###SPAN_NB_SEQ### reads",
analyse_description : "Analyse ###SPAN_NAME###", analyse_description : "Analyse ###SPAN_NAME###",
user_id : $("#user_id").val(), user_id : $("#user_id").val(),
id : n.attr("id").split("_")[1], object_id : n.attr("id").split("_")[1],
type : n.attr("id").split("_")[0] type : n.attr("id").split("_")[0]
}; };
} }
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
# #
import os, sys import os, sys
import logging
from subprocess import Popen, PIPE from subprocess import Popen, PIPE
from jflow.utils import get_argument_pattern from jflow.utils import get_argument_pattern
...@@ -96,7 +97,7 @@ class SubsetAssignation (Analysis): ...@@ -96,7 +97,7 @@ class SubsetAssignation (Analysis):
self.use_index = "true" self.use_index = "true"
if not os.path.exists( self.databank + ".00.idx" ) : if not os.path.exists( self.databank + ".00.idx" ) :
self.use_index = "false" self.use_index = "false"
sys.stderr.write("[WARNING] " + self.__class__.__name__ + " works more quickly with megablast index.\n") logging.getLogger("SubsetAssignation").warn("would work more quickly with megablast index")
if group_prefix == None : if group_prefix == None :
self.add_parameter_list("group_prefixes", "group_prefix", default=list(map(os.path.basename, self.get_outputs('{basename_woext}', self.sequence_files)))) self.add_parameter_list("group_prefixes", "group_prefix", default=list(map(os.path.basename, self.get_outputs('{basename_woext}', self.sequence_files))))
......
Supports Markdown
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