remove dbInfo.php, CORE #38
This commit is contained in:
@@ -1,138 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* dbInfo.php
|
||||
*
|
||||
* {projectName}
|
||||
*
|
||||
*/
|
||||
function lookup($target)
|
||||
{
|
||||
global $ntarget;
|
||||
$msg = $target . ' => ';
|
||||
//if( eregi('[a-zA-Z]', $target) )
|
||||
if (preg_match('[a-zA-Z]', $target)) { //Made compatible to PHP 5.3
|
||||
$ntarget = gethostbyname($target);
|
||||
} else {
|
||||
$ntarget = gethostbyaddr($target);
|
||||
}
|
||||
$msg .= $ntarget;
|
||||
return($msg);
|
||||
}
|
||||
|
||||
function getDbServicesAvailables()
|
||||
{
|
||||
$servicesAvailables = array();
|
||||
|
||||
$dbServices = array(
|
||||
'mysql' => array(
|
||||
'id' => 'mysql',
|
||||
'command' => 'mysqli_connect',
|
||||
'name' => 'MySql'
|
||||
),
|
||||
'pgsql' => array(
|
||||
'id' => 'pgsql',
|
||||
'command' => 'pg_connect',
|
||||
'name' => 'PostgreSQL'
|
||||
),
|
||||
'mssql' => array(
|
||||
'id' => 'mssql',
|
||||
'command' => 'mssql_connect',
|
||||
'name' => 'Microsoft SQL Server'),
|
||||
'oracle'=> array(
|
||||
'id' => 'oracle',
|
||||
'command' => 'oci_connect',
|
||||
'name' => 'Oracle'
|
||||
),
|
||||
'informix'=> array(
|
||||
'id' => 'informix',
|
||||
'command' => 'ifx_connect',
|
||||
'name' => 'Informix'
|
||||
),
|
||||
'sqlite' => array(
|
||||
'id' => 'sqlite',
|
||||
'command' => 'sqlite_open',
|
||||
'name' => 'SQLite'
|
||||
)
|
||||
);
|
||||
|
||||
foreach ($dbServices as $service) {
|
||||
if (@function_exists($service['command'])) {
|
||||
$servicesAvailables[] = $service;
|
||||
}
|
||||
}
|
||||
return $servicesAvailables;
|
||||
}
|
||||
|
||||
function getDbServerVersion($driver)
|
||||
{
|
||||
try {
|
||||
switch ($driver) {
|
||||
case 'mysql':
|
||||
$results = \Illuminate\Support\Facades\DB::select(rawQuery("select version()"));
|
||||
|
||||
preg_match('@[0-9]+\.[0-9]+\.[0-9]+@', $results[0]->{'version()'}, $version);
|
||||
|
||||
$v = $version[0];
|
||||
break;
|
||||
}
|
||||
return (isset($v))?$v:'none';
|
||||
} catch (Exception $e) {
|
||||
return ($e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
if (file_exists(PATH_METHODS . 'login/version-{projectName}.php')) {
|
||||
include('version-{projectName}.php');
|
||||
} else {
|
||||
define('PRG_VERSION', 'Development Version');
|
||||
}
|
||||
|
||||
if (getenv('HTTP_CLIENT_IP')) {
|
||||
$ip = getenv('HTTP_CLIENT_IP');
|
||||
} elseif (getenv('HTTP_X_FORWARDED_FOR')) {
|
||||
$ip = getenv('HTTP_X_FORWARDED_FOR');
|
||||
} else {
|
||||
$ip = getenv('REMOTE_ADDR');
|
||||
}
|
||||
|
||||
$redhat = '';
|
||||
if (file_exists('/etc/redhat-release')) {
|
||||
$fnewsize = filesize('/etc/redhat-release');
|
||||
$fp = fopen('/etc/redhat-release', 'r');
|
||||
$redhat = fread($fp, $fnewsize);
|
||||
fclose($fp);
|
||||
}
|
||||
|
||||
$redhat .= " (" . PHP_OS . ")";
|
||||
|
||||
//$dbNetView = new NET(DB_HOST);
|
||||
//$dbNetView->loginDbServer(DB_USER, DB_PASS);
|
||||
|
||||
$availdb = '';
|
||||
foreach (getDbServicesAvailables() as $key => $val) {
|
||||
if ($availdb != '') {
|
||||
$availdb .= ', ';
|
||||
}
|
||||
$availdb .= $val['name'];
|
||||
}
|
||||
|
||||
$Fields['SYSTEM'] = $redhat;
|
||||
$Fields['DATABASE'] = 'MySql (Version ' . getDbServerVersion('mysql') .')';
|
||||
$Fields['DATABASE_SERVER'] = DB_HOST;
|
||||
$Fields['DATABASE_NAME'] = DB_NAME;
|
||||
$Fields['PHP'] = phpversion();
|
||||
$Fields['FLUID'] = PRG_VERSION;
|
||||
$Fields['IP'] = lookup($ip);
|
||||
$Fields['ENVIRONMENT'] = SYS_SYS;
|
||||
$Fields['SERVER_SOFTWARE'] = getenv('SERVER_SOFTWARE');
|
||||
$Fields['SERVER_NAME'] = getenv('SERVER_NAME');
|
||||
$Fields['AVAILABLE_DB'] = $availdb;
|
||||
$Fields['SERVER_PROTOCOL'] = getenv('SERVER_PROTOCOL');
|
||||
$Fields['SERVER_PORT'] = getenv('SERVER_PORT');
|
||||
$Fields['REMOTE_HOST'] = getenv('REMOTE_HOST');
|
||||
$Fields['SERVER_ADDR'] = getenv('SERVER_ADDR');
|
||||
$Fields['HTTP_USER_AGENT'] = getenv('HTTP_USER_AGENT');
|
||||
|
||||
$G_PUBLISH = new Publisher;
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/dbInfo', '', $Fields);
|
||||
G::RenderPage('publish', 'raw');
|
||||
@@ -1,43 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<dynaForm name="dbInfo" basedir="" width="450">
|
||||
<DYNA_HEADER type="title" >
|
||||
<en>System Information</en>
|
||||
</DYNA_HEADER>
|
||||
<FLUID type="caption" group="5" >
|
||||
<en> {projectName}</en>
|
||||
</FLUID>
|
||||
<SYSTEM type="caption" >
|
||||
<en>Operating System</en>
|
||||
</SYSTEM>
|
||||
|
||||
<SERVER_SOFTWARE type="caption" >
|
||||
<en>Web Server</en>
|
||||
</SERVER_SOFTWARE>
|
||||
<SERVER_NAME type="caption" group="4" >
|
||||
<en>Server Name</en>
|
||||
</SERVER_NAME>
|
||||
<SERVER_ADDR type="caption" >
|
||||
<en>Server IP Address</en>
|
||||
</SERVER_ADDR>
|
||||
<PHP type="caption" >
|
||||
<en>PHP version</en>
|
||||
</PHP>
|
||||
<DATABASE type="caption" >
|
||||
<en>Database</en>
|
||||
</DATABASE>
|
||||
<DATABASE_SERVER type="caption" >
|
||||
<en>Database Server IP Address</en>
|
||||
</DATABASE_SERVER>
|
||||
<DATABASE_NAME type="caption" >
|
||||
<en>Database Name</en>
|
||||
</DATABASE_NAME>
|
||||
<AVAILABLE_DB type="caption" >
|
||||
<en>Available Databases </en>
|
||||
</AVAILABLE_DB >
|
||||
<HTTP_USER_AGENT type="caption" >
|
||||
<en>User's Browser</en>
|
||||
</HTTP_USER_AGENT>
|
||||
<IP type="caption" >
|
||||
<en>User's Ip Address</en>
|
||||
</IP>
|
||||
</dynaForm>
|
||||
@@ -312,7 +312,7 @@ $docuroot = explode ( PATH_SEP , $_SERVER['DOCUMENT_ROOT'] );
|
||||
else {
|
||||
//This sentence is used when you lost the Session
|
||||
if ( SYS_TARGET != 'authentication' and SYS_TARGET != 'login'
|
||||
and SYS_TARGET != 'dbInfo' and SYS_TARGET != 'sysLoginVerify'
|
||||
and SYS_TARGET != 'sysLoginVerify'
|
||||
and SYS_TARGET != 'updateTranslation' and SYS_COLLECTION != 'services' ){
|
||||
header ("location: ".SYS_URI."login/login.php");
|
||||
die();
|
||||
|
||||
@@ -288,7 +288,6 @@ class PmBootstrap extends Bootstrap
|
||||
$noLoginFiles[] = 'login';
|
||||
$noLoginFiles[] = 'authentication';
|
||||
$noLoginFiles[] = 'login_Ajax';
|
||||
$noLoginFiles[] = 'dbInfo';
|
||||
$noLoginFiles[] = 'sysLoginVerify';
|
||||
$noLoginFiles[] = 'processes_Ajax';
|
||||
$noLoginFiles[] = 'updateTranslation';
|
||||
|
||||
@@ -542,30 +542,25 @@ if (defined('SYS_TEMP') && SYS_TEMP != '') {
|
||||
require_once($phpFile);
|
||||
die();
|
||||
} else {
|
||||
if (SYS_TARGET == "dbInfo") { //Show dbInfo when no SYS_SYS
|
||||
$pathFile = PATH_METHODS . "login/dbInfo.php";
|
||||
require_once($pathFile);
|
||||
} else {
|
||||
if (substr(SYS_SKIN, 0,
|
||||
2) === 'ux' && SYS_TARGET != 'sysLoginVerify') { // new ux sysLogin - extjs based form
|
||||
$pathFile = PATH_CONTROLLERS . 'main.php';
|
||||
require_once $pathFile;
|
||||
$controllerClass = 'Main';
|
||||
$controllerAction = SYS_TARGET == 'sysLoginVerify' ? SYS_TARGET : 'sysLogin';
|
||||
//if the method exists
|
||||
if (method_exists(
|
||||
$controllerClass,
|
||||
$controllerAction
|
||||
)) {
|
||||
$controller = new $controllerClass();
|
||||
$controller->setHttpRequestData($_REQUEST);
|
||||
$controller->call($controllerAction);
|
||||
}
|
||||
} else { // classic sysLogin interface
|
||||
$pathFile = PATH_METHODS . "login/sysLogin.php";
|
||||
require_once($pathFile);
|
||||
die();
|
||||
if (substr(SYS_SKIN, 0,
|
||||
2) === 'ux' && SYS_TARGET != 'sysLoginVerify') { // new ux sysLogin - extjs based form
|
||||
$pathFile = PATH_CONTROLLERS . 'main.php';
|
||||
require_once $pathFile;
|
||||
$controllerClass = 'Main';
|
||||
$controllerAction = SYS_TARGET == 'sysLoginVerify' ? SYS_TARGET : 'sysLogin';
|
||||
//if the method exists
|
||||
if (method_exists(
|
||||
$controllerClass,
|
||||
$controllerAction
|
||||
)) {
|
||||
$controller = new $controllerClass();
|
||||
$controller->setHttpRequestData($_REQUEST);
|
||||
$controller->call($controllerAction);
|
||||
}
|
||||
} else { // classic sysLogin interface
|
||||
$pathFile = PATH_METHODS . "login/sysLogin.php";
|
||||
require_once($pathFile);
|
||||
die();
|
||||
}
|
||||
if (DEBUG_TIME_LOG) {
|
||||
Bootstrap::logTimeByPage();
|
||||
@@ -873,7 +868,6 @@ if (!defined('EXECUTE_BY_CRON')) {
|
||||
$noLoginFiles[] = 'authentication';
|
||||
$noLoginFiles[] = 'authenticationSso';
|
||||
$noLoginFiles[] = 'login_Ajax';
|
||||
$noLoginFiles[] = 'dbInfo';
|
||||
$noLoginFiles[] = 'sysLoginVerify';
|
||||
$noLoginFiles[] = 'processes_Ajax';
|
||||
$noLoginFiles[] = 'showLogoFile';
|
||||
|
||||
Reference in New Issue
Block a user