Commit 7cd29580 authored by gsalin's avatar gsalin
Browse files
parent 1637572b
......@@ -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']) {
......
......@@ -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>';
......
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