<?php
class SecureLabConfigurationManager {
private $Configuration;
private $SecureLabLockConfiguration = false;
public function __construct() {
global $_SecureLabMainClass;
include_once( SECURELAB_DIRECTORY . "system\configuration\SLConfiguration.Main.Secured.php");
$this->Configuration = $SLPublicMainConfig;
return true;
}
public function ConfigurationKey ( $NeedleConfigurationTree ) {
try {
if( $this->SecureLabLockConfiguration == false ) {
$NeedleConfigurationKeys = explode( ":", $NeedleConfigurationTree, 2 );
$ConfiguationOut = $this->Configuration[ $NeedleConfigurationKeys[0] ][ $NeedleConfigurationKeys[1] ];
if( $ConfiguationOut == null and $ConfiguationOut != "0" ) {
throw new Exception ("Unable to get the configuration key: incorrect incoming parameter");
} else {
return $ConfiguationOut;
}
} else {
throw new Exception("Trying to access SecureLab Configuration after calling of configuration lock command is disallowed");
}
} catch( Exception $ErrorMsg ) {
global $_SecureLabMainClass;
$_SecureLabMainClass->DumpAPI->CreateDumpEvent( array(
"ErrorReporterFile" => __FILE__,
"ErrorReporterMessage" => $ErrorMsg->getMessage(),
"ErrorOccuredObject" => __METHOD__,
"ErrorIncomingEvent" => $NeedleConfigurationTree,
"ErrorFileLine" => __LINE__
) );
}
}
public function SL_LockConfigurationAccess() {
$this->SecureLabLockConfiguration = true;
}
}
?>