diff --git a/public_html/deployment/inc_functions.php b/public_html/deployment/inc_functions.php index 0d522afc3ebd382c8cc88c14c245c3a317e88b69..86b533d291eb1476f1a887cb6bfb19cff0395596 100644 --- a/public_html/deployment/inc_functions.php +++ b/public_html/deployment/inc_functions.php @@ -213,6 +213,9 @@ function getTopNavLeft($aEmbed=[]) { $sCurrentPar3=(array_key_exists("par3", $aParams) && $aParams["par3"]) ? $aParams["par3"] : false; $sLiActive=' class="active"'; + // $aReturn[]=['label'=>'=' ]; + $aReturn[]=['href'=>$sBaseUrl . '', 'label'=>' Deployment UI <small>v2</small>', 'icon'=>'', 'class'=>'imllogo topbrand' ]; + if($oUser->getUsername()){ $oPrj1 = new project(); $aPrjItems=[]; @@ -226,10 +229,7 @@ function getTopNavLeft($aEmbed=[]) { ]; } - $aReturn=[ - // ['label'=>'=' ], - ['href'=>$sBaseUrl . '', 'label'=>' Deployment UI <small>v2</small>', 'icon'=>'', 'class'=>'imllogo topbrand' ], - [ + $aReturn[]=[ 'href'=>$sBaseUrl, 'label'=>t("menu"), 'class'=>(array_key_exists("prj", $aParams) && $aParams['prj']==='all' ? 'active' : ''), 'icon'=>'fa-solid fa-chevron-right', 'children'=>[ @@ -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/', 'label'=>t("menu-settings"), 'icon'=>'fa-solid fa-gear'], ] - ], - [ + ]; + $aReturn[]=[ 'href'=>'#','label'=>t("menu-projects"), 'icon'=>'fa-solid fa-box-open', 'children'=>$aPrjItems ] - ] ; if ($sCurrentProject){ $oPrj = new project($aParams["prj"]); @@ -301,8 +300,10 @@ function getTopNavRight() { 'children'=>[ ['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'=>[ ['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'=>'' ], @@ -310,10 +311,8 @@ function getTopNavRight() { ['href'=>$sWikiBaseUrl . '/it/infrastruktur/dienste/imldeployment', 'target'=>'_help', 'label'=>'WIKI (Admin): Verzeichnisse und Dateien', 'icon'=>'' ], ] ] - ] ; - } // echo '<pre>'.print_r($aReturn, 1); die(__FUNCTION__); return $aReturn; } diff --git a/public_html/deployment/index.php b/public_html/deployment/index.php index 2527c111ff33dcb7ab289ec3683814359d8b2fd1..bbcd34da533bb42bf92e3527c19066a8e9c0b67d 100644 --- a/public_html/deployment/index.php +++ b/public_html/deployment/index.php @@ -57,6 +57,9 @@ $aReplace=include("./ui/page_replacements.php"); // html header // ---------------------------------------------------------------------- + + $oUser=new user(); + $sHeader = "\n<!-- generated CSS for phases -->\n<style>\n"; foreach ($aConfig["phases"] as $sPhase => $aData) { $sHeader.=array_key_exists("bgdark", $aData["css"]) ? 'th.' . $sPhase . '{' . $aData["css"]["bgdark"] . '}' : ''; @@ -83,34 +86,35 @@ $aReplace=include("./ui/page_replacements.php"); : '' ; $aNavRight=[]; - foreach ($aEnabledShellPlugins as $sPlugin){ - if ($CI_plugins->testPlugin($sPlugin)){ - $aPluginConfig=$CI_plugins->getPluginConfig(); - $sHeader.=$CI_plugins->getHtmlLoadScript('render.js'); - $sShellOuptut.=$CI_plugins->getHtmlOutwindow(); - $aNavRight[]=['href'=>'#' , 'label'=>$sPlugin, 'icon'=>(isset($aPluginConfig['icon']) ? $aPluginConfig['icon'] : ''), 'onclick'=>'toggleShellWindow(\''.$CI_plugins->getHtmlOutId().'\', this);']; - /* - $sTopRight.='' - .'<li >' - .$oHtml->getLink(array( - 'href'=>'#', - // 'onclick'=>'toggleShellWindow(\''.$CI_plugins->getHtmlOutIdWrapper().'\', this);', - 'onclick'=>'toggleShellWindow(\''.$CI_plugins->getHtmlOutId().'\', this);', - 'role'=>'button', - 'aria-expanded'=>'false', - 'icon'=> (isset($aPluginConfig['icon']) ? $aPluginConfig['icon'] : ''), - 'label'=>$sPlugin, - )) - .'</li>' - ; - */ + if ($oUser->getUsername()){ + foreach ($aEnabledShellPlugins as $sPlugin){ + if ($CI_plugins->testPlugin($sPlugin)){ + $aPluginConfig=$CI_plugins->getPluginConfig(); + $sHeader.=$CI_plugins->getHtmlLoadScript('render.js'); + $sShellOuptut.=$CI_plugins->getHtmlOutwindow(); + $aNavRight[]=['href'=>'#' , 'label'=>$sPlugin, 'icon'=>(isset($aPluginConfig['icon']) ? $aPluginConfig['icon'] : ''), 'onclick'=>'toggleShellWindow(\''.$CI_plugins->getHtmlOutId().'\', this);']; + /* + $sTopRight.='' + .'<li >' + .$oHtml->getLink(array( + 'href'=>'#', + // 'onclick'=>'toggleShellWindow(\''.$CI_plugins->getHtmlOutIdWrapper().'\', this);', + 'onclick'=>'toggleShellWindow(\''.$CI_plugins->getHtmlOutId().'\', this);', + 'role'=>'button', + 'aria-expanded'=>'false', + 'icon'=> (isset($aPluginConfig['icon']) ? $aPluginConfig['icon'] : ''), + 'label'=>$sPlugin, + )) + .'</li>' + ; + */ + } + } + if(count($aNavRight)){ + $aNavRight[]=['label'=>'|']; } - } - if(count($aNavRight)){ - $aNavRight[]=['label'=>'|']; } - // ---------------------------------------------------------------------- // html body // ---------------------------------------------------------------------- @@ -130,7 +134,6 @@ $aReplace=include("./ui/page_replacements.php"); // . '<span class="description">' . $oPrj->getDescription() . '</span>'; // ------ action - $oUser=new user(); if (isset($aConfig["auth"]['forceuser']) && $aConfig["auth"]['forceuser']){ $oCLog->add("Found config -> auth -> forceuser: using fake identity [".$aConfig["auth"]['forceuser'].']', "warning"); $oUser->setUser($aConfig["auth"]['forceuser']); @@ -205,7 +208,7 @@ $aReplace=include("./ui/page_replacements.php"); . $sHeader . $sShellOuptut .' - ' . $sBanner . getBreadcrumb() . ' + ' . $sBanner . ($oUser->getUsername() ? getBreadcrumb() : '') . ' ' . $BODY . ' @@ -270,7 +273,7 @@ if(!file_exists($sIncfile)){ $aReplace['{{PAGE_BODY}}']=$BODY; $aReplace['{{PAGE_BODY}}']=$BODY; $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'); echo $renderAdminLTE->render($sTemplate,$aReplace); diff --git a/public_html/deployment/main.css b/public_html/deployment/main.css index f667b8dcbb9dd936ef0f2b8b75a8ee464ad55fc6..b942558f7c1fef5b64197b63b0cf04e57fb44bc5 100644 --- a/public_html/deployment/main.css +++ b/public_html/deployment/main.css @@ -322,7 +322,7 @@ input[type="radio"]:checked+label, input[type="checkbox"]:checked+label{ /* ----- visualized process ----- */ .visualprocess{float: left; margin-top: 1em;} .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 .process .title{margin-bottom: 1em; font-weight: bold; font-size: 120%; color:#aaa;} diff --git a/public_html/deployment/pages/act_installer.php b/public_html/deployment/pages/act_installer.php index bb871eeace828623001520cad076457533a846ef..5ebeed795aacc1d6f1358f2a21f2641854069e04 100644 --- a/public_html/deployment/pages/act_installer.php +++ b/public_html/deployment/pages/act_installer.php @@ -24,7 +24,7 @@ $sOut = '' <br> Copy 2 <code>*.dist</code> files to <code>config_custom.php</code> and <code>inc_user2roles.php</code>.<br> <br> - <a href="?" class="btn btn-default">Reload</a><br> + <a href="?" class="btn btn-primary">Reload</a><br> <br> </p> <script> diff --git a/public_html/deployment/pages/act_login.php b/public_html/deployment/pages/act_login.php index d760a4f76480a71db8b49e40249137d4c0cd1a2b..7a862ef98dae1972948a19eb1d2a36badbd5c1e2 100644 --- a/public_html/deployment/pages/act_login.php +++ b/public_html/deployment/pages/act_login.php @@ -48,11 +48,15 @@ if (!$oUser->getUsername() && array_key_exists('user', $aParams)) { // if user is logged in, then show user infos if ($oUser->getUsername()) { + + // ------------------------------------------------------------ + // show user and roles + logoff + // ------------------------------------------------------------ $sGrouplist=''; foreach ($oUser->getUserGroups() as $sGroupname){ $sGrouplist.='<li>' . $sGroupname . '</li>'; } - $sOut.='<div style="width: 50%; margin-left: 25%;">' + $sOut.='' . '<h2>' . t("page-login-info") . '</h2>' . '<p>' . t("page-login-userloggedin") . '<br><br>' @@ -65,9 +69,12 @@ if ($oUser->getUsername()) { // . '<br><br>INFO: <pre style="">roles:<br>' . print_r($oUser->getUserPermission(), true) . '</pre>' . '</p>' - . '</div>'; + ; } else { - if (!array_key_exists("goback", $_SESSION) || true){ + // ------------------------------------------------------------ + // login page + // ------------------------------------------------------------ + if (!isset($_SESSION['goback']) || true){ $sUrlback=$_SERVER["HTTP_REFERER"]; if( strpos($sUrlback, $_SERVER["SERVER_NAME"])>0 @@ -134,16 +141,28 @@ if ($oUser->getUsername()) { ); $oForm = new formgen($aForms); - $sOut.='<div style="width: 50%; min-width: 60em; margin-left: 15%;">' + $sOut.='' . '<h2>' . t("page-login-info") . '</h2>' - . '<p>' . t("page-login-info-introtext") . '</p>'; - if (array_key_exists('user', $aParams)) { - $sOut.='<div class="alert alert-danger" role="alert">'.t('page-login-auth-failed').'</div>'; - } - $sOut.= $oForm->renderHtml("login") - . '</div>'; + . '<p>' . t("page-login-info-introtext") . '</p>' + . (array_key_exists('user', $aParams) + ? '<div class="alert alert-danger" role="alert">'.t('page-login-auth-failed').'</div>' + : '' + ) + .$oForm->renderHtml("login"); } // $sOut.= '<div id="navbuttom">' . aPrjHome() . '</div>'; // -- Ausgabe -echo $sOut; +// echo $sOut; +$BODY= +$renderAdminLTE->addRow( + $renderAdminLTE->addCol('',3) + .$renderAdminLTE->addCol( + $renderAdminLTE->getCard([ + 'type'=>'', + 'variant'=>'outline', + 'text'=>$sOut, + ]), + ) + .$renderAdminLTE->addCol('',3) +); diff --git a/public_html/deployment/plugins/rollout/ssh/rollout_ssh.php b/public_html/deployment/plugins/rollout/ssh/rollout_ssh.php index f896fe92d73199bc46585ca547ae7ad820b6a7c2..f4e38fcb2b224705895f0c8590fdb7e8c0de8e24 100644 --- a/public_html/deployment/plugins/rollout/ssh/rollout_ssh.php +++ b/public_html/deployment/plugins/rollout/ssh/rollout_ssh.php @@ -29,10 +29,11 @@ class rollout_ssh extends rollout_base { /** * 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 */ - public function getDeployCommands($sPhase){ + public function getDeployCommands($sPhase,$bMask=false){ $aReturn=array(); $aConfig=$this->getConfig($sPhase); $aTargethosts = explode(',', $aConfig['hosts']);