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

Merge branch 'typo3V9' into 'master'

Typo3 v9

See merge request !123
parents a71f57f8 7b3cc0f3
......@@ -3695,60 +3695,7 @@ static function get_project_runs($project_id, $get_hidden=TRUE, $orderby='', $li
$GLOBALS['TYPO3_DB']->exec_UPDATEquery ('fe_users', 'fe_users.uid='.$userid, array('fe_users.usergroup' => $group));
}
}
}
/*
* DB integrity functions
*------------------------------------------------------------*/
/**
* Check the integrity of 'fe_rights_levels' table.
*/
static function check_db_rights_level(){
$queryParts = Array(
'SELECT' => 'fe_rights_levels.right_level_id, fe_rights_levels.right_level_label ',
'FROM' => 'fe_rights_levels ',
'WHERE' => '',
'GROUPBY' => '',
'ORDERBY' => '',
'LIMIT' => '',
);
$res = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts);
$res_tab = array();
while($res_row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
$res_tab = array(
'id' => $res_row['right_level_id'],
'label' => $res_row['right_level_label']
);
}
// insert
if( !in_array('member', array_values($res_tab)) ){
$insert_rows = Array(
'right_level_id' => 0,
'right_level_label' => 'member'
);
$GLOBALS['TYPO3_DB']->exec_INSERTquery('fe_rights_levels', $insert_rows);
}
if( !in_array('manager', array_values($res_tab)) ){
$insert_rows = Array(
'right_level_id' => 1,
'right_level_label' => 'manager'
);
$GLOBALS['TYPO3_DB']->exec_INSERTquery('fe_rights_levels', $insert_rows);
}
if( !in_array('administrator', array_values($res_tab)) ){
$insert_rows = Array(
'right_level_id' => 2,
'right_level_label' => 'administrator'
);
$GLOBALS['TYPO3_DB']->exec_INSERTquery('fe_rights_levels', $insert_rows);
}
}
}
}
if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/nG6/class.tx_nG6_db.php']) {
......
......@@ -298,16 +298,9 @@ $template_mail.='<p>Yours sincerely</p>
* @return hashed password
*/
static function hash_password($password){
$hashInstance = GeneralUtility::makeInstance(PasswordHashFactory::class)->getDefaultHashInstance('FE');
$hashInstance = TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(PasswordHashFactory::class)->getDefaultHashInstance('FE');
$hashedPassword = $hashInstance->getHashedPassword($password);
// if (\TYPO3\CMS\Crypto\PasswordHashing\SaltedPasswordsUtility::isUsageEnabled('FE')) {
// $objSalt = \TYPO3\CMS\Core\Crypto\PasswordHashing\PasswordHashFactory::getSaltingInstance(NULL);
// if (is_object($objSalt)) {
// $saltedPassword = $objSalt->getHashedPassword($password);
// }
// }
return $saltedPassword;
return $hashedPassword;
}
static function get_ssh_connection($user_login, $user_pwd){
......
......@@ -138,7 +138,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
</div>
<br />
<div class="alert alert-info" name="DownloadData_analysis">
<p style="text-align: center;">You can download your files easily with <a href="https://ng6.toulouse.inra.fr/index.php?id=59" target="_blank"><strong>Menu > Download</strong></a>. Please visit the <a href="https://ng6.toulouse.inra.fr/index.php?id=57" target="_blank"><strong>FAQ</strong></a> > "How to get my data?" section to know more.</p>
<p style="text-align: center;">You can download your files easily with <a href="https://ng6.toulouse.inra.fr/download" target="_blank"><strong>Menu > Download</strong></a>. Please visit the <a href="https://ng6.toulouse.inra.fr/faq" target="_blank"><strong>FAQ</strong></a> > "How to get my data?" section to know more.</p>
</div>
{foreach $dir|scandir as $file}
{assign var="link" value=(('fileadmin'|cat:'/'|cat:$analyse.directory)|cat:'/')|cat:$file}
......
......@@ -79,7 +79,7 @@ $(function () {
//Build tbody
var tbody = "" ;
var pattern_regexp = new RegExp( '<a[^>]+class="[^"]*imglink[^"]*"[^>]+href="(fileadmin\/data[_]*[a-z]*\/analyze\/[^"]+)' ) ;
var pattern_regexp = new RegExp( '<a[^>]+class="[^"]*imglink[^"]*"[^>]+href="(\/fileadmin\/data[_]*[a-z]*\/analyze\/[^"]+)' ) ;
for( var i = 0 ; i < samples.length ; i++ ) {
tbody += '<tr>' ;
for( var j = 0 ; j < columns.length ; j++ ) {
......
......@@ -84,8 +84,6 @@ class tx_nG6_pi1 extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin {
<link type="text/css" rel="stylesheet" media="screen" href="'.\TYPO3\CMS\Core\Utility\PathUtility::stripPathSitePrefix(ExtensionManagementUtility::extPath($this->extKey)).'res/css/jflow.min.css"/>
<link type="text/css" rel="stylesheet" media="screen" href="'.\TYPO3\CMS\Core\Utility\PathUtility::stripPathSitePrefix(ExtensionManagementUtility::extPath($this->extKey)).'res/css/tx_nG6.css"/>';
tx_nG6_db::check_db_rights_level();
// if asked to upgrade to version 1.2
if($this->piVars['upgrade']){
$content = '<div class="sub-content sc-top">'.tx_nG6_upgrade::upgrade($this->piVars['upgrade'], $this->conf["data"]).'</div>';
......@@ -257,9 +255,9 @@ class tx_nG6_pi1 extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin {
$txNG6Utils = new tx_nG6_utils;
//$smarty->register_object('tx_nG6_utils',$txNG6Utils);
$smarty->assign_by_ref('tx_nG6_utils', $txNG6Utils);
$smarty->assignByRef('tx_nG6_utils', $txNG6Utils);
$smarty->assign_by_ref('retention_policy', tx_nG6_utils::get_project_retention_policy($projects[key($projects)]['id']));
$smarty->assignByRef('retention_policy', tx_nG6_utils::get_project_retention_policy($projects[key($projects)]['id']));
$smarty->assign('space_purge_msg', tx_nG6_utils::get_project_purge_msg($projects[key($projects)]['id']));
}
......
......@@ -90,7 +90,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
</table>
<br />
<div class="alert alert-info" name="Adding_user">
<p style="text-align: center;">Your role is defined on the <strong>Users tab</strong> below. If you are manager or owner, you can add a collaborator yourself. Please visit the <a href="https://ng6.toulouse.inra.fr/index.php?id=57" target="_blank"><strong>FAQ</strong></a> > "<strong>What about user management</strong>" & "<strong>How to add a user to my project</strong>" to know more.</p>
<p style="text-align: center;">Your role is defined on the <strong>Users tab</strong> below. If you are manager or owner, you can add a collaborator yourself. Please visit the <a href="https://ng6.toulouse.inra.fr/faq" target="_blank"><strong>FAQ</strong></a> > "<strong>What about user management</strong>" & "<strong>How to add a user to my project</strong>" to know more.</p>
</div>
......
......@@ -144,7 +144,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
</div>
<br />
<div class="alert alert-info" name="DownloadData_run">
<p style="text-align: center;">You can download your files easily with <a href="https://ng6.toulouse.inra.fr/index.php?id=59" target="_blank"><strong>Menu > Download</strong></a>. Please visit the <a href="https://ng6.toulouse.inra.fr/index.php?id=57" target="_blank"><strong>FAQ</strong></a> > "<strong>How to get my data?</strong>" section to know more.</p>
<p style="text-align: center;">You can download your files easily with <a href="https://ng6.toulouse.inra.fr/download" target="_blank"><strong>Menu > Download</strong></a>. Please visit the <a href="https://ng6.toulouse.inra.fr/faq" target="_blank"><strong>FAQ</strong></a> > "<strong>How to get my data?</strong>" section to know more.</p>
</div>
{/if}
{assign var="nb_files" value=0}
......
......@@ -198,6 +198,7 @@ $(function () {
// Build dataTable
if ($(this).children("tbody").children("tr").children("td:has(input:checkbox)").length > 0) {
$(this).DataTable({
"lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]],
"scrollX" : "90%",
"sScrollXInner" : "100%",
"order" : [[1, 'desc']],
......@@ -206,6 +207,7 @@ $(function () {
});
} else {
$(this).DataTable({
"lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]],
"scrollX" : "90%",
"sScrollXInner" : "100%",
"order" : [[1, 'desc']],
......
......@@ -305,13 +305,13 @@ $(function () {
id : "download_url",
wfName : "DownloadURL",
run : function(form_options, modal){
form_options.parameters['url_base'] = location.href.replace(/index\.php.+/, "" ) + 'fileadmin';
form_options.parameters['url_base'] = location.href.replace(/download/, "" ) + 'fileadmin';
// display modal box
modal.$modal.modal();
modal.$modal.find('#wfform').wfform(form_options);
modal.$modal.find('#wfform').on('run.wfform', function(event, running_wf) {
_retrieve_url_list(modal, running_wf, 'output_urls.txt', function(filedata){
var link_prefix = location.href.replace(/index\.php.+/, "" ) + 'fileadmin' ;
var link_prefix = location.href.replace(/download/, "" ) + 'fileadmin' ;
var file_list = [];
$.each(filedata.trim().split('\n'), function(i, path){
file_list.push(link_prefix + path);
......
......@@ -738,8 +738,11 @@ class Smarty extends Smarty_Internal_Data {
public function __call($name, $args)
{
static $camel_func;
if (!isset($camel_func))
$camel_func = create_function('$c', 'return "_" . strtolower($c[1]);');
if (!isset($camel_func)){
$camel_func = function ($matches) {
return "_" . strtolower($matches[1]);
};
}
// see if this is a set/get for a property
$first3 = strtolower(substr($name, 0, 3));
if (in_array($first3, array('set', 'get')) && substr($name, 3, 1) !== '_') {
......
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