Skip to content
Snippets Groups Projects
Commit ec9f704e authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

update manu if not logged in

parent b2d9400c
No related branches found
No related tags found
1 merge request!62V2.0
...@@ -213,6 +213,9 @@ function getTopNavLeft($aEmbed=[]) { ...@@ -213,6 +213,9 @@ function getTopNavLeft($aEmbed=[]) {
$sCurrentPar3=(array_key_exists("par3", $aParams) && $aParams["par3"]) ? $aParams["par3"] : false; $sCurrentPar3=(array_key_exists("par3", $aParams) && $aParams["par3"]) ? $aParams["par3"] : false;
$sLiActive=' class="active"'; $sLiActive=' class="active"';
// $aReturn[]=['label'=>'=' ];
$aReturn[]=['href'=>$sBaseUrl . '', 'label'=>'&nbsp;Deployment UI <small>v2</small>', 'icon'=>'', 'class'=>'imllogo topbrand' ];
if($oUser->getUsername()){ if($oUser->getUsername()){
$oPrj1 = new project(); $oPrj1 = new project();
$aPrjItems=[]; $aPrjItems=[];
...@@ -226,10 +229,7 @@ function getTopNavLeft($aEmbed=[]) { ...@@ -226,10 +229,7 @@ function getTopNavLeft($aEmbed=[]) {
]; ];
} }
$aReturn=[ $aReturn[]=[
// ['label'=>'=' ],
['href'=>$sBaseUrl . '', 'label'=>'&nbsp;Deployment UI <small>v2</small>', 'icon'=>'', 'class'=>'imllogo topbrand' ],
[
'href'=>$sBaseUrl, 'label'=>t("menu"), 'class'=>(array_key_exists("prj", $aParams) && $aParams['prj']==='all' ? 'active' : ''), 'href'=>$sBaseUrl, 'label'=>t("menu"), 'class'=>(array_key_exists("prj", $aParams) && $aParams['prj']==='all' ? 'active' : ''),
'icon'=>'fa-solid fa-chevron-right', 'icon'=>'fa-solid fa-chevron-right',
'children'=>[ 'children'=>[
...@@ -238,12 +238,11 @@ function getTopNavLeft($aEmbed=[]) { ...@@ -238,12 +238,11 @@ function getTopNavLeft($aEmbed=[]) {
['href'=>$sBaseUrl . 'all/setup/checklang/', 'label'=>t("menu-checklang"), 'icon'=>'fa-regular fa-comment'], ['href'=>$sBaseUrl . 'all/setup/checklang/', 'label'=>t("menu-checklang"), 'icon'=>'fa-regular fa-comment'],
['href'=>$sBaseUrl . 'all/setup/', 'label'=>t("menu-settings"), 'icon'=>'fa-solid fa-gear'], ['href'=>$sBaseUrl . 'all/setup/', 'label'=>t("menu-settings"), 'icon'=>'fa-solid fa-gear'],
] ]
], ];
[ $aReturn[]=[
'href'=>'#','label'=>t("menu-projects"), 'icon'=>'fa-solid fa-box-open', 'href'=>'#','label'=>t("menu-projects"), 'icon'=>'fa-solid fa-box-open',
'children'=>$aPrjItems 'children'=>$aPrjItems
] ]
]
; ;
if ($sCurrentProject){ if ($sCurrentProject){
$oPrj = new project($aParams["prj"]); $oPrj = new project($aParams["prj"]);
...@@ -301,8 +300,10 @@ function getTopNavRight() { ...@@ -301,8 +300,10 @@ function getTopNavRight() {
'children'=>[ 'children'=>[
['href'=>$sBaseUrl . 'all/login/', 'label'=>t("login"), 'icon'=>'fa-solid fa-right-to-bracket' ], ['href'=>$sBaseUrl . 'all/login/', 'label'=>t("login"), 'icon'=>'fa-solid fa-right-to-bracket' ],
] ]
], ]
['href'=>'#', 'label'=>t('menu-help'), 'icon'=>'fa-solid fa-life-ring', 'class'=>'', ];
}
$aReturn[]=['href'=>'#', 'label'=>t('menu-help'), 'icon'=>'fa-solid fa-life-ring', 'class'=>'',
'children'=>[ 'children'=>[
['href'=>$sWikiBaseUrl . '/it/entwicklung/continuous_deployment', 'target'=>'_help', 'label'=>'WIKI: Übersicht Continous Deployment', 'icon'=>'' ], ['href'=>$sWikiBaseUrl . '/it/entwicklung/continuous_deployment', 'target'=>'_help', 'label'=>'WIKI: Übersicht Continous Deployment', 'icon'=>'' ],
['href'=>$sWikiBaseUrl . '/it/entwicklung/continuous_deployment#konventionen', 'target'=>'_help', 'label'=>'WIKI: Konventionen für Entwickler', 'icon'=>'' ], ['href'=>$sWikiBaseUrl . '/it/entwicklung/continuous_deployment#konventionen', 'target'=>'_help', 'label'=>'WIKI: Konventionen für Entwickler', 'icon'=>'' ],
...@@ -310,10 +311,8 @@ function getTopNavRight() { ...@@ -310,10 +311,8 @@ function getTopNavRight() {
['href'=>$sWikiBaseUrl . '/it/infrastruktur/dienste/imldeployment', 'target'=>'_help', 'label'=>'WIKI (Admin): Verzeichnisse und Dateien', 'icon'=>'' ], ['href'=>$sWikiBaseUrl . '/it/infrastruktur/dienste/imldeployment', 'target'=>'_help', 'label'=>'WIKI (Admin): Verzeichnisse und Dateien', 'icon'=>'' ],
] ]
] ]
]
; ;
}
// echo '<pre>'.print_r($aReturn, 1); die(__FUNCTION__); // echo '<pre>'.print_r($aReturn, 1); die(__FUNCTION__);
return $aReturn; return $aReturn;
} }
......
...@@ -57,6 +57,9 @@ $aReplace=include("./ui/page_replacements.php"); ...@@ -57,6 +57,9 @@ $aReplace=include("./ui/page_replacements.php");
// html header // html header
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
$oUser=new user();
$sHeader = "\n<!-- generated CSS for phases -->\n<style>\n"; $sHeader = "\n<!-- generated CSS for phases -->\n<style>\n";
foreach ($aConfig["phases"] as $sPhase => $aData) { foreach ($aConfig["phases"] as $sPhase => $aData) {
$sHeader.=array_key_exists("bgdark", $aData["css"]) ? 'th.' . $sPhase . '{' . $aData["css"]["bgdark"] . '}' : ''; $sHeader.=array_key_exists("bgdark", $aData["css"]) ? 'th.' . $sPhase . '{' . $aData["css"]["bgdark"] . '}' : '';
...@@ -83,6 +86,7 @@ $aReplace=include("./ui/page_replacements.php"); ...@@ -83,6 +86,7 @@ $aReplace=include("./ui/page_replacements.php");
: '' : ''
; ;
$aNavRight=[]; $aNavRight=[];
if ($oUser->getUsername()){
foreach ($aEnabledShellPlugins as $sPlugin){ foreach ($aEnabledShellPlugins as $sPlugin){
if ($CI_plugins->testPlugin($sPlugin)){ if ($CI_plugins->testPlugin($sPlugin)){
$aPluginConfig=$CI_plugins->getPluginConfig(); $aPluginConfig=$CI_plugins->getPluginConfig();
...@@ -109,7 +113,7 @@ $aReplace=include("./ui/page_replacements.php"); ...@@ -109,7 +113,7 @@ $aReplace=include("./ui/page_replacements.php");
if(count($aNavRight)){ if(count($aNavRight)){
$aNavRight[]=['label'=>'|']; $aNavRight[]=['label'=>'|'];
} }
}
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
// html body // html body
...@@ -130,7 +134,6 @@ $aReplace=include("./ui/page_replacements.php"); ...@@ -130,7 +134,6 @@ $aReplace=include("./ui/page_replacements.php");
// . '<span class="description">' . $oPrj->getDescription() . '</span>'; // . '<span class="description">' . $oPrj->getDescription() . '</span>';
// ------ action // ------ action
$oUser=new user();
if (isset($aConfig["auth"]['forceuser']) && $aConfig["auth"]['forceuser']){ if (isset($aConfig["auth"]['forceuser']) && $aConfig["auth"]['forceuser']){
$oCLog->add("Found config -> auth -> forceuser: using fake identity [".$aConfig["auth"]['forceuser'].']', "warning"); $oCLog->add("Found config -> auth -> forceuser: using fake identity [".$aConfig["auth"]['forceuser'].']', "warning");
$oUser->setUser($aConfig["auth"]['forceuser']); $oUser->setUser($aConfig["auth"]['forceuser']);
...@@ -205,7 +208,7 @@ $aReplace=include("./ui/page_replacements.php"); ...@@ -205,7 +208,7 @@ $aReplace=include("./ui/page_replacements.php");
. $sHeader . $sHeader
. $sShellOuptut . $sShellOuptut
.' .'
' . $sBanner . getBreadcrumb() . ' ' . $sBanner . ($oUser->getUsername() ? getBreadcrumb() : '') . '
' . $BODY . ' ' . $BODY . '
...@@ -270,7 +273,7 @@ if(!file_exists($sIncfile)){ ...@@ -270,7 +273,7 @@ if(!file_exists($sIncfile)){
$aReplace['{{PAGE_BODY}}']=$BODY; $aReplace['{{PAGE_BODY}}']=$BODY;
$aReplace['{{PAGE_BODY}}']=$BODY; $aReplace['{{PAGE_BODY}}']=$BODY;
$aReplace['{{PAGE_HEADER_LEFT}}']='<h2>'.$TITLE.'</h2>'; $aReplace['{{PAGE_HEADER_LEFT}}']='<h2>'.$TITLE.'</h2>';
$aReplace['{{PAGE_HEADER_RIGHT}}']=getBreadcrumb("link"); $aReplace['{{PAGE_HEADER_RIGHT}}']=$oUser->getUsername() ? getBreadcrumb("link") : '';
$sTemplate=file_get_contents('ui/page.tpl.php'); $sTemplate=file_get_contents('ui/page.tpl.php');
echo $renderAdminLTE->render($sTemplate,$aReplace); echo $renderAdminLTE->render($sTemplate,$aReplace);
...@@ -322,7 +322,7 @@ input[type="radio"]:checked+label, input[type="checkbox"]:checked+label{ ...@@ -322,7 +322,7 @@ input[type="radio"]:checked+label, input[type="checkbox"]:checked+label{
/* ----- visualized process ----- */ /* ----- visualized process ----- */
.visualprocess{float: left; margin-top: 1em;} .visualprocess{float: left; margin-top: 1em;}
.visualprocess .process{float:left; text-align: center; padding: 0 0 5px; } .visualprocess .process{float:left; text-align: center; padding: 0 0 5px; }
.visualprocess .process.box{border: 3px dotted #bcd; padding: 0.5em; min-height: 14em;} .visualprocess .process.box{border: 3px dotted #bcd; padding: 0.5em; min-height: 16em;}
.visualprocess .action{float:left;padding: 0em 1em 1em 1em; background: #fff;} .visualprocess .action{float:left;padding: 0em 1em 1em 1em; background: #fff;}
.visualprocess .process .title{margin-bottom: 1em; font-weight: bold; font-size: 120%; color:#aaa;} .visualprocess .process .title{margin-bottom: 1em; font-weight: bold; font-size: 120%; color:#aaa;}
......
...@@ -24,7 +24,7 @@ $sOut = '' ...@@ -24,7 +24,7 @@ $sOut = ''
<br> <br>
Copy 2 <code>*.dist</code> files to <code>config_custom.php</code> and <code>inc_user2roles.php</code>.<br> Copy 2 <code>*.dist</code> files to <code>config_custom.php</code> and <code>inc_user2roles.php</code>.<br>
<br> <br>
<a href="?" class="btn btn-default">Reload</a><br> <a href="?" class="btn btn-primary">Reload</a><br>
<br> <br>
</p> </p>
<script> <script>
......
...@@ -48,11 +48,15 @@ if (!$oUser->getUsername() && array_key_exists('user', $aParams)) { ...@@ -48,11 +48,15 @@ if (!$oUser->getUsername() && array_key_exists('user', $aParams)) {
// if user is logged in, then show user infos // if user is logged in, then show user infos
if ($oUser->getUsername()) { if ($oUser->getUsername()) {
// ------------------------------------------------------------
// show user and roles + logoff
// ------------------------------------------------------------
$sGrouplist=''; $sGrouplist='';
foreach ($oUser->getUserGroups() as $sGroupname){ foreach ($oUser->getUserGroups() as $sGroupname){
$sGrouplist.='<li>' . $sGroupname . '</li>'; $sGrouplist.='<li>' . $sGroupname . '</li>';
} }
$sOut.='<div style="width: 50%; margin-left: 25%;">' $sOut.=''
. '<h2>' . t("page-login-info") . '</h2>' . '<h2>' . t("page-login-info") . '</h2>'
. '<p>' . '<p>'
. t("page-login-userloggedin") . '<br><br>' . t("page-login-userloggedin") . '<br><br>'
...@@ -65,9 +69,12 @@ if ($oUser->getUsername()) { ...@@ -65,9 +69,12 @@ if ($oUser->getUsername()) {
// . '<br><br>INFO: <pre style="">roles:<br>' . print_r($oUser->getUserPermission(), true) . '</pre>' // . '<br><br>INFO: <pre style="">roles:<br>' . print_r($oUser->getUserPermission(), true) . '</pre>'
. '</p>' . '</p>'
. '</div>'; ;
} else { } else {
if (!array_key_exists("goback", $_SESSION) || true){ // ------------------------------------------------------------
// login page
// ------------------------------------------------------------
if (!isset($_SESSION['goback']) || true){
$sUrlback=$_SERVER["HTTP_REFERER"]; $sUrlback=$_SERVER["HTTP_REFERER"];
if( if(
strpos($sUrlback, $_SERVER["SERVER_NAME"])>0 strpos($sUrlback, $_SERVER["SERVER_NAME"])>0
...@@ -134,16 +141,28 @@ if ($oUser->getUsername()) { ...@@ -134,16 +141,28 @@ if ($oUser->getUsername()) {
); );
$oForm = new formgen($aForms); $oForm = new formgen($aForms);
$sOut.='<div style="width: 50%; min-width: 60em; margin-left: 15%;">' $sOut.=''
. '<h2>' . t("page-login-info") . '</h2>' . '<h2>' . t("page-login-info") . '</h2>'
. '<p>' . t("page-login-info-introtext") . '</p>'; . '<p>' . t("page-login-info-introtext") . '</p>'
if (array_key_exists('user', $aParams)) { . (array_key_exists('user', $aParams)
$sOut.='<div class="alert alert-danger" role="alert">'.t('page-login-auth-failed').'</div>'; ? '<div class="alert alert-danger" role="alert">'.t('page-login-auth-failed').'</div>'
} : ''
$sOut.= $oForm->renderHtml("login") )
. '</div>'; .$oForm->renderHtml("login");
} }
// $sOut.= '<div id="navbuttom">' . aPrjHome() . '</div>'; // $sOut.= '<div id="navbuttom">' . aPrjHome() . '</div>';
// -- Ausgabe // -- Ausgabe
echo $sOut; // echo $sOut;
$BODY=
$renderAdminLTE->addRow(
$renderAdminLTE->addCol('',3)
.$renderAdminLTE->addCol(
$renderAdminLTE->getCard([
'type'=>'',
'variant'=>'outline',
'text'=>$sOut,
]),
)
.$renderAdminLTE->addCol('',3)
);
...@@ -30,9 +30,10 @@ class rollout_ssh extends rollout_base { ...@@ -30,9 +30,10 @@ class rollout_ssh extends rollout_base {
* get array with commands to execute to deploy a package * get array with commands to execute to deploy a package
* *
* @param string $sPhase phase * @param string $sPhase phase
* @param boolean $bMask Flag for public output; if true then mask your secrets
* @return array * @return array
*/ */
public function getDeployCommands($sPhase){ public function getDeployCommands($sPhase,$bMask=false){
$aReturn=array(); $aReturn=array();
$aConfig=$this->getConfig($sPhase); $aConfig=$this->getConfig($sPhase);
$aTargethosts = explode(',', $aConfig['hosts']); $aTargethosts = explode(',', $aConfig['hosts']);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment