This commit is contained in:
Marco Antonio Nina Mena
2017-12-04 13:25:35 +00:00
committed by Julio Cesar Laura Avendaño
parent abe71a6ffe
commit 0d533e19d9
363 changed files with 23948 additions and 44623 deletions

View File

@@ -1,108 +1,106 @@
<?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
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);
} else {
$ntarget = gethostbyaddr($target);
}
$msg .= $ntarget;
return($msg);
}
function getDbServicesAvailables()
{
$servicesAvailables = Array();
$dbServices = Array(
'mysql' => Array(
'id' => 'mysql',
'command' => 'mysql_connect',
function getDbServicesAvailables()
{
$servicesAvailables = array();
$dbServices = array(
'mysql' => array(
'id' => 'mysql',
'command' => 'mysqli_connect',
'name' => 'MySql'
),
'pgsql' => Array(
'pgsql' => array(
'id' => 'pgsql',
'command' => 'pg_connect',
'name' => 'PostgreSQL'
),
'mssql' => Array(
'mssql' => array(
'id' => 'mssql',
'command' => 'mssql_connect',
'name' => 'Microsoft SQL Server'),
'oracle'=> Array(
'oracle'=> array(
'id' => 'oracle',
'command' => 'oci_connect',
'name' => 'Oracle'
),
'informix'=> Array(
'informix'=> array(
'id' => 'informix',
'command' => 'ifx_connect',
'name' => 'Informix'
),
'sqlite' => Array(
'sqlite' => array(
'id' => 'sqlite',
'command' => 'sqlite_open',
'name' => 'SQLite'
)
);
foreach($dbServices as $service) {
if(@function_exists($service['command'])){
$servicesAvailables[] = $service;
}
}
return $servicesAvailables;
}
);
foreach ($dbServices as $service) {
if (@function_exists($service['command'])) {
$servicesAvailables[] = $service;
}
}
return $servicesAvailables;
}
function getDbServerVersion($driver) {
try{
switch($driver)
{
function getDbServerVersion($driver)
{
try {
switch ($driver) {
case 'mysql':
if($link = @mysql_connect( DB_HOST, DB_USER, DB_PASS)){
$v = @mysql_get_server_info();
if ($link = mysqli_connect(DB_HOST, DB_USER, DB_PASS)) {
$v = mysqli_get_server_info($link);
} else {
throw new Exception(@mysql_error($link));
throw new Exception(mysqli_error($link));
}
break;
}
return (isset($v))?$v:'none';
} catch (Exception $e){
return ($e->getMessage());
}
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 (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');
$ip = getenv('HTTP_CLIENT_IP');
} elseif (getenv('HTTP_X_FORWARDED_FOR')) {
$ip = getenv('HTTP_X_FORWARDED_FOR');
} else {
$ip = getenv('REMOTE_ADDR');
$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 );
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 . ")";
@@ -111,9 +109,11 @@ function lookup($target)
//$dbNetView->loginDbServer(DB_USER, DB_PASS);
$availdb = '';
foreach ( getDbServicesAvailables() as $key => $val ) {
if ( $availdb != '' ) $availdb .= ', ';
$availdb .= $val['name'];
foreach (getDbServicesAvailables() as $key => $val) {
if ($availdb != '') {
$availdb .= ', ';
}
$availdb .= $val['name'];
}
$Fields['SYSTEM'] = $redhat;
@@ -122,7 +122,7 @@ function lookup($target)
$Fields['DATABASE_NAME'] = DB_NAME;
$Fields['PHP'] = phpversion();
$Fields['FLUID'] = PRG_VERSION;
$Fields['IP'] = lookup ($ip);
$Fields['IP'] = lookup($ip);
$Fields['ENVIRONMENT'] = SYS_SYS;
$Fields['SERVER_SOFTWARE'] = getenv('SERVER_SOFTWARE');
$Fields['SERVER_NAME'] = getenv('SERVER_NAME');

View File

@@ -25,7 +25,7 @@
$smarty->display('blank.html');
}
else {
$oHeadPublisher =& headPublisher::getSingleton();
$oHeadPublisher = headPublisher::getSingleton();
if (isset($oHeadPublisher)) $header = $oHeadPublisher->printHeader();
$smarty->assign('username', (isset($_SESSION['USR_USERNAME']) ? '(' . $_SESSION['USR_USERNAME'] . ' ' . G::LoadTranslation('ID_IN') . ' ' . SYS_SYS . ')' : '') );
$smarty->assign('header', $header );

View File

@@ -7,7 +7,7 @@
try {
/* Render page */
$oHeadPublisher = &headPublisher::getSingleton();
$oHeadPublisher = headPublisher::getSingleton();
$G_MAIN_MENU = "processmaker";
$G_ID_MENU_SELECTED = "{menuId}_MNU_01";

View File

@@ -1,6 +1,6 @@
<?php
try {
$oHeadPublisher = &headPublisher::getSingleton();
$oHeadPublisher = headPublisher::getSingleton();
$oHeadPublisher->addContent("{className}/{className}Application2"); //Adding a html file .html.
$oHeadPublisher->addExtJsScript("{className}/{className}Application2", false); //Adding a javascript file .js

View File

@@ -1,6 +1,6 @@
<?php
try {
$oHeadPublisher = &headPublisher::getSingleton();
$oHeadPublisher = headPublisher::getSingleton();
$oHeadPublisher->addContent("{className}/{className}Application3"); //Adding a html file .html.
$oHeadPublisher->addExtJsScript("{className}/{className}Application3", false); //Adding a javascript file .js

View File

@@ -111,5 +111,5 @@ class {className}Plugin extends PMPlugin
<!-- END BLOCK : dashboard -->
}
$oPluginRegistry = &PMPluginRegistry::getSingleton();
$oPluginRegistry = PMPluginRegistry::getSingleton();
$oPluginRegistry->registerPlugin("{className}", __FILE__);

View File

@@ -1,7 +1,7 @@
<?php
try {
global $Fields;
$oHeadPublisher = &headPublisher::getSingleton();
$oHeadPublisher = headPublisher::getSingleton();
//SYS_SYS //Workspace name
//PROCESS //Process UID

View File

@@ -124,7 +124,7 @@ $docuroot = explode ( PATH_SEP , $_SERVER['DOCUMENT_ROOT'] );
//***************** Call Gulliver Classes **************************
$oHeadPublisher =& headPublisher::getSingleton();
$oHeadPublisher = headPublisher::getSingleton();
//***************** database and workspace definition ************************
//if SYS_TEMP exists, the URL has a workspace, now we need to verify if exists their db.php file
@@ -203,7 +203,7 @@ $docuroot = explode ( PATH_SEP , $_SERVER['DOCUMENT_ROOT'] );
// //the singleton has a list of enabled plugins
// $sSerializedFile = PATH_DATA_SITE . 'plugin.singleton';
// $oPluginRegistry =& PMPluginRegistry::getSingleton();
// $oPluginRegistry = PMPluginRegistry::getSingleton();
// if ( file_exists ($sSerializedFile) )
// $oPluginRegistry->unSerializeInstance( file_get_contents ( $sSerializedFile ) );
//
@@ -297,7 +297,7 @@ $docuroot = explode ( PATH_SEP , $_SERVER['DOCUMENT_ROOT'] );
// ***************** enable rbac **************************
$RBAC =& RBAC::getSingleton();
$RBAC = RBAC::getSingleton();
$RBAC->sSystem = '{rbacProjectName}';
// ***************** Headers **************************