BASE . LOG,
'log_file_id' => $LOG_FILE_ID,
// add file date
'log_per_date' => true,
]);
$db = new CoreLibs\DB\IO(DB_CONFIG, $log);
$login = new CoreLibs\ACL\Login(
$db,
$log,
$session,
[
'auto_login' => true,
'default_acl_level' => DEFAULT_ACL_LEVEL,
'logout_target' => '',
'site_locale' => SITE_LOCALE,
'site_domain' => SITE_DOMAIN,
'site_encoding' => SITE_ENCODING,
'locale_path' => BASE . INCLUDES . LOCALE,
]
);
$locale = $login->loginGetLocale();
$l10n = new \CoreLibs\Language\L10n(
$locale['locale'],
$locale['domain'],
$locale['path'],
$locale['encoding'],
);
$backend = new CoreLibs\Admin\Backend(
$db,
$log,
$session,
$l10n,
DEFAULT_ACL_LEVEL
);
$backend->db->dbInfo(true);
ob_end_flush();
print "";
print "
TEST CLASS";
print "";
print '';
print '';
print '';
print '';
print '';
print '';
print '';
print '';
print '';
print '';
print '';
print '';
print '';
print '';
print '';
print '';
print '';
print '';
print '';
print '';
print '';
print '';
print '';
print '';
print '';
print '';
print '';
print '';
print '';
print '';
print '';
print '';
print '';
print '';
print '';
print '';
print '';
print '';
print '';
print '';
print '';
print '';
print '';
print "
";
print "L: " . Support::dumpVar($locale) . "
";
// print all _ENV vars set
print "READ _ENV ARRAY:
";
print Support::dumpVar(array_map('htmlentities', $_ENV));
// set + check edit access id
$edit_access_id = 3;
if (is_object($login) && isset($login->loginGetAcl()['unit'])) {
print "ACL UNIT: " . print_r(array_keys($login->loginGetAcl()['unit']), true) . "
";
print "ACCESS CHECK: " . (string)$login->loginCheckEditAccess($edit_access_id) . "
";
if ($login->loginCheckEditAccess($edit_access_id)) {
$backend->edit_access_id = $edit_access_id;
} else {
$backend->edit_access_id = $login->loginGetAcl()['unit_id'];
}
} else {
print "Something went wrong with the login
";
}
// $backend->log->debug('SESSION', \CoreLibs\Debug\Support::dumpVar($_SESSION));
print '';
print "Log Level: " . $backend->log->getLoggingLevel()->getName() . "
";
print "Log ID: " . $backend->log->getLogFileId() . "
";
print "Log Date: " . $backend->log->getLogDate() . "
";
print "Log Max File Size: " . $backend->log->getLogMaxFileSize() . " bytes
";
print "Log Flags: " . $backend->log->getLogFlags() . "
";
foreach (
[
Logging\Logger\Flag::per_run,
Logging\Logger\Flag::per_date,
Logging\Logger\Flag::per_group,
Logging\Logger\Flag::per_page,
Logging\Logger\Flag::per_class,
Logging\Logger\Flag::per_level
] as $flag
) {
print "Log Flag: " . $flag->name . ": "
. CoreLibs\Debug\Support::printBool($backend->log->getLogFlag($flag)) . "
";
}
$log->debug('SOME MARK', 'Some error output');
// INTERNAL SET
print "EDIT ACCESS ID: " . $backend->edit_access_id . "
";
if (is_object($login)) {
// print "ACL:
".$backend->print_ar($login->loginGetAcl())."
";
$log->debug('ACL', "ACL: " . \CoreLibs\Debug\Support::dumpVar($login->loginGetAcl()));
// print "DEFAULT ACL:
".$backend->print_ar($login->default_acl_list)."
";
// print "DEFAULT ACL:
".$backend->print_ar($login->default_acl_list)."
";
// $result = array_flip(
// array_filter(
// array_flip($login->default_acl_list),
// function ($key) {
// if (is_numeric($key)) {
// return $key;
// }
// }
// )
// );
// print "DEFAULT ACL:
".$backend->print_ar($result)."
";
// DEPRICATED CALL
// $backend->adbSetACL($login->loginGetAcl());
}
print "THIS HOST: " . HOST_NAME . ", with PROTOCOL: " . HOST_PROTOCOL . " is running SSL: " . HOST_SSL . "
";
print "DIR: " . DIR . "
";
print "BASE: " . BASE . "
";
print "ROOT: " . ROOT . "
";
print "HOST: " . HOST_NAME . " => DB HOST: " . DB_CONFIG_NAME . " => " . Support::dumpVar(DB_CONFIG) . "
";
print "DS is: " . DIRECTORY_SEPARATOR . "
";
print "SERVER HOST: " . $_SERVER['HTTP_HOST'] . "
";
print "";
# __END__