Skip to content
Snippets Groups Projects
Select Git revision
  • aa9dd62661ead0f8b39e69a4eef6f2fe3cc50e63
  • master default protected
  • Legacy_Php7
3 results

index.php

Blame
  • index.php 3.82 KiB
    <?php
    
    /* ######################################################################
    
      IML DEPLOYMENT
    
      webgui - index file - controller like
      ensure that you activated the rewrite rules
    
      RewriteEngine on
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_URI} !^/server-status$
      RewriteRule ^(.*)$ index.php [QSA,L]
    
      ---------------------------------------------------------------------
      2013-11-08  Axel <axel.hahn@iml.unibe.ch>
      ###################################################################### */
    
    session_start();
    
    ini_set('display_errors', 1);
    ini_set('display_startup_errors', 1);
    error_reporting(E_ALL);
    
    require_once("./classes/page.class.php");
    require_once("../../config/inc_projects_config.php");
    require_once("./classes/logger.class.php");
    require_once("./classes/user.class.php");
    global $oCLog;
    $oCLog = new logger();
    $oCLog->enableDebugByIp($aConfig['showdebug']['ip']);
    require_once("./inc_functions.php");
    require_once("./classes/htmlguielements.class.php");
    $oHtml=new htmlguielements();
    
    $sPrj = "";
    $sAction = "overview";
    
    // ------ check parameters
    
    if (array_key_exists("prj", $aParams)) {
        $sPrj = $aParams["prj"];
    }
    if (array_key_exists("action", $aParams)) {
        if (file_exists(__DIR__ . '/pages/act_' . $aParams["action"] . ".php")) {
            $sAction = $aParams["action"];
        }
    }
    $oCLog->add("parsing params "
            . '<pre>GET '.print_r($_GET, true).'</pre>'
            . '<pre>POST '.print_r($_POST, true).'</pre>'
            . '<pre>aParams: '.print_r($aParams, true).'</pre>'
            );
    
    
    // ------ Ausgabe
    $sHeader = '<style>';
    foreach ($aConfig["phases"] as $sPhase => $aData) {
        $sHeader.=array_key_exists("bgdark", $aData["css"]) ? 'th.' . $sPhase . '{' . $aData["css"]["bgdark"] . '}' : '';
        $sHeader.=array_key_exists("bglight", $aData["css"]) ? 'td.' . $sPhase . ', div.' . $sPhase . '{' . $aData["css"]["bglight"] . '}' : '';
        $sHeader.=array_key_exists("bgbutton", $aData["css"]) ? 'a.' . $sPhase . ',a.' . $sPhase . ':hover,button.' . $sPhase . ',button.' . $sPhase . ':hover{' . $aData["css"]["bgbutton"] . '}' : '';
    }
    $sHeader.='</style>';
    $sTopArea=getTopArea();
    $sTopAction=getAction();
    
    // ------ action 
    $oUser=new user();
    if ($oUser->hasPermission('page_'.$sAction)){