|
|
|
|
@@ -29,7 +29,6 @@ class Main extends Controller
|
|
|
|
|
$meta = new stdClass;
|
|
|
|
|
$showSystemInfo = $RBAC->userCanAccess('PM_SETUP') == 1;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// setting variables for template
|
|
|
|
|
$this->setVar('logo_company', $this->getCompanyLogo());
|
|
|
|
|
$this->setVar('userfullname', $this->getUserFullName());
|
|
|
|
|
@@ -127,35 +126,35 @@ class Main extends Controller
|
|
|
|
|
}
|
|
|
|
|
$sFailedLogins = $_SESSION ['FAILED_LOGINS'];
|
|
|
|
|
|
|
|
|
|
if ( isset ($_SESSION ['USER_LOGGED']) ) {
|
|
|
|
|
if (isset ($_SESSION ['USER_LOGGED'])) {
|
|
|
|
|
//close the session, if the current session_id was used in PM.
|
|
|
|
|
$oCriteria = new Criteria ( 'workflow' );
|
|
|
|
|
$oCriteria->add ( LoginLogPeer::LOG_SID, session_id () );
|
|
|
|
|
$oCriteria->add ( LoginLogPeer::USR_UID, isset ( $_SESSION ['USER_LOGGED'] ) ? $_SESSION ['USER_LOGGED'] : '-' );
|
|
|
|
|
$oCriteria->add ( LoginLogPeer::LOG_STATUS, 'ACTIVE' );
|
|
|
|
|
$oCriteria->add ( LoginLogPeer::LOG_END_DATE, NULL, Criteria::ISNULL );
|
|
|
|
|
$oDataset = LoginLogPeer::doSelectRS ( $oCriteria );
|
|
|
|
|
$oDataset->setFetchmode ( ResultSet::FETCHMODE_ASSOC );
|
|
|
|
|
$oCriteria = new Criteria ('workflow');
|
|
|
|
|
$oCriteria->add (LoginLogPeer::LOG_SID, session_id ());
|
|
|
|
|
$oCriteria->add (LoginLogPeer::USR_UID, isset ($_SESSION ['USER_LOGGED']) ?
|
|
|
|
|
$_SESSION ['USER_LOGGED'] : '-');
|
|
|
|
|
$oCriteria->add (LoginLogPeer::LOG_STATUS, 'ACTIVE');
|
|
|
|
|
$oCriteria->add (LoginLogPeer::LOG_END_DATE, null, Criteria::ISNULL);
|
|
|
|
|
$oDataset = LoginLogPeer::doSelectRS ($oCriteria);
|
|
|
|
|
$oDataset->setFetchmode (ResultSet::FETCHMODE_ASSOC);
|
|
|
|
|
$oDataset->next ();
|
|
|
|
|
$aRow = $oDataset->getRow ();
|
|
|
|
|
if ($aRow) {
|
|
|
|
|
if ($aRow ['LOG_STATUS'] != 'CLOSED' && $aRow ['LOG_END_DATE'] == NULL) {
|
|
|
|
|
$weblog = new LoginLog ( );
|
|
|
|
|
if ($aRow ['LOG_STATUS'] != 'CLOSED' && $aRow ['LOG_END_DATE'] == null) {
|
|
|
|
|
$weblog = new LoginLog ();
|
|
|
|
|
$aLog ['LOG_UID'] = $aRow ['LOG_UID'];
|
|
|
|
|
$aLog ['LOG_STATUS'] = 'CLOSED';
|
|
|
|
|
$aLog ['LOG_IP'] = $aRow ['LOG_IP'];
|
|
|
|
|
$aLog ['LOG_SID'] = session_id ();
|
|
|
|
|
$aLog ['LOG_INIT_DATE'] = $aRow ['LOG_INIT_DATE'];
|
|
|
|
|
$aLog ['LOG_END_DATE'] = date ( 'Y-m-d H:i:s' );
|
|
|
|
|
$aLog ['LOG_END_DATE'] = date ('Y-m-d H:i:s');
|
|
|
|
|
$aLog ['LOG_CLIENT_HOSTNAME'] = $aRow ['LOG_CLIENT_HOSTNAME'];
|
|
|
|
|
$aLog ['USR_UID'] = $aRow ['USR_UID'];
|
|
|
|
|
$weblog->update ( $aLog );
|
|
|
|
|
$weblog->update ($aLog);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//remove memcached session
|
|
|
|
|
$this->memcache->delete( 'rbacSession' . session_id() ) ;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
$this->memcache->delete('rbacSession' . session_id()) ;
|
|
|
|
|
} else {
|
|
|
|
|
// Execute SSO trigger
|
|
|
|
|
$pluginRegistry =& PMPluginRegistry::getSingleton();
|
|
|
|
|
if (defined('PM_SINGLE_SIGN_ON')) {
|
|
|
|
|
@@ -183,22 +182,23 @@ class Main extends Controller
|
|
|
|
|
session_start ();
|
|
|
|
|
session_regenerate_id ();
|
|
|
|
|
|
|
|
|
|
if (strlen ( $msg ) > 0) {
|
|
|
|
|
if (strlen ($msg) > 0) {
|
|
|
|
|
$_SESSION ['G_MESSAGE'] = $msg;
|
|
|
|
|
}
|
|
|
|
|
if (strlen ( $msgType ) > 0) {
|
|
|
|
|
if (strlen ($msgType) > 0) {
|
|
|
|
|
$_SESSION ['G_MESSAGE_TYPE'] = $msgType;
|
|
|
|
|
}
|
|
|
|
|
$_SESSION ['FAILED_LOGINS'] = $sFailedLogins;
|
|
|
|
|
|
|
|
|
|
$availableLangArray = $this->getLanguagesList();
|
|
|
|
|
|
|
|
|
|
//$G_PUBLISH = new Publisher ( );
|
|
|
|
|
//$G_PUBLISH->AddContent ( 'xmlform', 'xmlform', 'login/login', '', $aFields, SYS_URI . 'login/authentication.php' );
|
|
|
|
|
//$G_PUBLISH = new Publisher ();
|
|
|
|
|
//$G_PUBLISH->AddContent ('xmlform', 'xmlform', 'login/login', '', $aFields, SYS_URI .
|
|
|
|
|
//'login/authentication.php');
|
|
|
|
|
|
|
|
|
|
G::LoadClass ( 'serverConfiguration' );
|
|
|
|
|
G::LoadClass ('serverConfiguration');
|
|
|
|
|
|
|
|
|
|
if ( ($nextBeatDate = $this->memcache->get('nextBeatDate')) === false ) {
|
|
|
|
|
if (($nextBeatDate = $this->memcache->get('nextBeatDate')) === false) {
|
|
|
|
|
//get the serverconf singleton, and check if we can send the heartbeat
|
|
|
|
|
$oServerConf = & serverConf::getSingleton ();
|
|
|
|
|
|
|
|
|
|
@@ -207,33 +207,23 @@ class Main extends Controller
|
|
|
|
|
|
|
|
|
|
//get date of next beat
|
|
|
|
|
$nextBeatDate = $oServerConf->getHeartbeatProperty('HB_NEXT_BEAT_DATE','HEART_BEAT_CONF');
|
|
|
|
|
$this->memcache->set( 'nextBeatDate', $nextBeatDate, 1*3600 );
|
|
|
|
|
$this->memcache->set('nextBeatDate', $nextBeatDate, 1*3600);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$sflag = 1;
|
|
|
|
|
//TODO analize this & enable to work with this new login
|
|
|
|
|
// if flag to send heartbeat is enabled, and it is time to send heartbeat, sent it using asynchronous beat.
|
|
|
|
|
// if( ($sflag=="1") && ((strtotime ( "now" ) > $nextBeatDate) || is_null($nextBeatDate) ) ){
|
|
|
|
|
// $oHeadPublisher =& headPublisher::getSingleton();
|
|
|
|
|
// //To do: we need to change to ExtJs
|
|
|
|
|
// $oHeadPublisher->addScriptCode( 'var flagHeartBeat = 1; ');
|
|
|
|
|
// }
|
|
|
|
|
// else
|
|
|
|
|
// $oHeadPublisher->addScriptCode( 'var flagHeartBeat = 0; ');
|
|
|
|
|
|
|
|
|
|
//check if we show the panel with the getting started info
|
|
|
|
|
if ( ($flagGettingStarted = $this->memcache->get('flagGettingStarted')) === false ) {
|
|
|
|
|
if (($flagGettingStarted = $this->memcache->get('flagGettingStarted')) === false) {
|
|
|
|
|
require_once 'classes/model/Configuration.php';
|
|
|
|
|
$oConfiguration = new Configuration ( );
|
|
|
|
|
$oCriteria = new Criteria ( 'workflow' );
|
|
|
|
|
$oCriteria->add ( ConfigurationPeer::CFG_UID, 'getStarted' );
|
|
|
|
|
$oCriteria->add ( ConfigurationPeer::OBJ_UID, '' );
|
|
|
|
|
$oCriteria->add ( ConfigurationPeer::CFG_VALUE, '1' );
|
|
|
|
|
$oCriteria->add ( ConfigurationPeer::PRO_UID, '' );
|
|
|
|
|
$oCriteria->add ( ConfigurationPeer::USR_UID, '' );
|
|
|
|
|
$oCriteria->add ( ConfigurationPeer::APP_UID, '' );
|
|
|
|
|
$flagGettingStarted = ConfigurationPeer::doCount ( $oCriteria );
|
|
|
|
|
$this->memcache->set( 'flagGettingStarted', $flagGettingStarted, 8*3600 ) ;
|
|
|
|
|
$oConfiguration = new Configuration ();
|
|
|
|
|
$oCriteria = new Criteria ('workflow');
|
|
|
|
|
$oCriteria->add (ConfigurationPeer::CFG_UID, 'getStarted');
|
|
|
|
|
$oCriteria->add (ConfigurationPeer::OBJ_UID, '');
|
|
|
|
|
$oCriteria->add (ConfigurationPeer::CFG_VALUE, '1');
|
|
|
|
|
$oCriteria->add (ConfigurationPeer::PRO_UID, '');
|
|
|
|
|
$oCriteria->add (ConfigurationPeer::USR_UID, '');
|
|
|
|
|
$oCriteria->add (ConfigurationPeer::APP_UID, '');
|
|
|
|
|
$flagGettingStarted = ConfigurationPeer::doCount ($oCriteria);
|
|
|
|
|
$this->memcache->set('flagGettingStarted', $flagGettingStarted, 8*3600) ;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$this->setJSVar('flagGettingStarted', ($flagGettingStarted == 0));
|
|
|
|
|
@@ -242,8 +232,8 @@ class Main extends Controller
|
|
|
|
|
$oConf = new Configurations;
|
|
|
|
|
$oConf->loadConfig($obj, 'ENVIRONMENT_SETTINGS','');
|
|
|
|
|
|
|
|
|
|
$flagForgotPassword = isset($oConf->aConfig['login_enableForgotPassword'])? $oConf->aConfig['login_enableForgotPassword']: 'off';
|
|
|
|
|
//$oHeadPublisher->addScriptCode("var flagForgotPassword = '$flagForgotPassword';");
|
|
|
|
|
$flagForgotPassword = isset($oConf->aConfig['login_enableForgotPassword'])?
|
|
|
|
|
$oConf->aConfig['login_enableForgotPassword']: 'off';
|
|
|
|
|
|
|
|
|
|
$this->includeExtJSLib('ux/virtualkeyboard');
|
|
|
|
|
$this->includeExtJS('main/login');
|
|
|
|
|
@@ -251,10 +241,12 @@ class Main extends Controller
|
|
|
|
|
|
|
|
|
|
$oConf->loadConfig($obj, 'ENVIRONMENT_SETTINGS','');
|
|
|
|
|
|
|
|
|
|
$forgotPasswd = isset($oConf->aConfig['login_enableForgotPassword'])? $oConf->aConfig['login_enableForgotPassword']: false;
|
|
|
|
|
$virtualKeyboad = isset($oConf->aConfig['login_enableVirtualKeyboard'])? $oConf->aConfig['login_enableVirtualKeyboard']: false;
|
|
|
|
|
$defaultLanguaje = isset($oConf->aConfig['login_defaultLanguage'])? $oConf->aConfig['login_defaultLanguage']: 'en';
|
|
|
|
|
|
|
|
|
|
$forgotPasswd = isset($oConf->aConfig['login_enableForgotPassword'])?
|
|
|
|
|
$oConf->aConfig['login_enableForgotPassword']: false;
|
|
|
|
|
$virtualKeyboad = isset($oConf->aConfig['login_enableVirtualKeyboard'])?
|
|
|
|
|
$oConf->aConfig['login_enableVirtualKeyboard']: false;
|
|
|
|
|
$defaultLanguaje = isset($oConf->aConfig['login_defaultLanguage'])?
|
|
|
|
|
$oConf->aConfig['login_defaultLanguage']: 'en';
|
|
|
|
|
|
|
|
|
|
$this->setJSVar('forgotPasswd', $forgotPasswd);
|
|
|
|
|
$this->setJSVar('virtualKeyboad', $virtualKeyboad);
|
|
|
|
|
@@ -275,7 +267,7 @@ class Main extends Controller
|
|
|
|
|
$this->setVar('logo_company', $this->getCompanyLogo());
|
|
|
|
|
$this->setVar('pmos_version', System::getVersion());
|
|
|
|
|
|
|
|
|
|
$footerText = 'Copyright © 2003-2011 Colosa, Inc. All rights reserved.';
|
|
|
|
|
$footerText = 'Copyright ? 2003-2011 Colosa, Inc. All rights reserved.';
|
|
|
|
|
$adviseText = 'Supplied free of charge with no support, certification, warranty,
|
|
|
|
|
maintenance nor indemnity by Colosa and its Certified Partners. ';
|
|
|
|
|
$this->setVar('footer_text', $footerText);
|
|
|
|
|
@@ -298,9 +290,9 @@ class Main extends Controller
|
|
|
|
|
require_once ("propel/Propel.php");
|
|
|
|
|
require_once ("creole/Creole.php");
|
|
|
|
|
G::LoadClass('system');
|
|
|
|
|
G::LoadThirdParty ( "pake", "pakeColor.class" );
|
|
|
|
|
Propel::init ( PATH_CORE . "config/databases.php" );
|
|
|
|
|
Creole::registerDriver ( 'dbarray', 'creole.contrib.DBArrayConnection' );
|
|
|
|
|
G::LoadThirdParty ("pake", "pakeColor.class");
|
|
|
|
|
Propel::init (PATH_CORE . "config/databases.php");
|
|
|
|
|
Creole::registerDriver ('dbarray', 'creole.contrib.DBArrayConnection');
|
|
|
|
|
|
|
|
|
|
// getting posibles errors passed by GET method
|
|
|
|
|
$this->getInUrlError();
|
|
|
|
|
@@ -315,7 +307,7 @@ class Main extends Controller
|
|
|
|
|
$aField ['LOGIN_VERIFY_MSG'] = G::loadTranslation('LOGIN_VERIFY_MSG');
|
|
|
|
|
|
|
|
|
|
//Get Server Configuration
|
|
|
|
|
G::LoadClass ( 'serverConfiguration' );
|
|
|
|
|
G::LoadClass ('serverConfiguration');
|
|
|
|
|
$oServerConf = & serverConf::getSingleton ();
|
|
|
|
|
|
|
|
|
|
$availableLangArray = $this->getLanguagesList();
|
|
|
|
|
@@ -327,7 +319,7 @@ class Main extends Controller
|
|
|
|
|
$this->setVar('logo_company', $this->getCompanyLogo());
|
|
|
|
|
$this->setVar('pmos_version', System::getVersion());
|
|
|
|
|
|
|
|
|
|
$footerText = 'Copyright © 2003-2011 Colosa, Inc. All rights reserved.';
|
|
|
|
|
$footerText = 'Copyright ? 2003-2011 Colosa, Inc. All rights reserved.';
|
|
|
|
|
$adviseText = 'Supplied free of charge with no support, certification, warranty,
|
|
|
|
|
maintenance nor indemnity by Colosa and its Certified Partners. ';
|
|
|
|
|
$this->setVar('footer_text', $footerText);
|
|
|
|
|
@@ -370,7 +362,8 @@ class Main extends Controller
|
|
|
|
|
$userData = $rbacUser->getByUsername($httpData->username);
|
|
|
|
|
|
|
|
|
|
if (!$userData) {
|
|
|
|
|
$msg = G::LoadTranslation('ID_USER') . ' <b>' . $httpData->username . '</b> '. G::LoadTranslation('ID_IS_NOT_REGISTERED');
|
|
|
|
|
$msg = G::LoadTranslation('ID_USER') . ' <b>' . $httpData->username . '</b> '.
|
|
|
|
|
G::LoadTranslation('ID_IS_NOT_REGISTERED');
|
|
|
|
|
throw new Exception($msg);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -408,7 +401,7 @@ class Main extends Controller
|
|
|
|
|
|
|
|
|
|
$result->success = true;
|
|
|
|
|
$result->message = G::LoadTranslation('ID_NEW_PASSWORD_SENT');
|
|
|
|
|
} catch(Exception $e) {
|
|
|
|
|
} catch (Exception $e) {
|
|
|
|
|
$result->success = false;
|
|
|
|
|
$result->message = $e->getMessage();
|
|
|
|
|
}
|
|
|
|
|
@@ -418,7 +411,6 @@ class Main extends Controller
|
|
|
|
|
/** *
|
|
|
|
|
* Private Functions *
|
|
|
|
|
* **/
|
|
|
|
|
|
|
|
|
|
private function getMenu()
|
|
|
|
|
{
|
|
|
|
|
global $G_MAIN_MENU;
|
|
|
|
|
@@ -433,48 +425,44 @@ class Main extends Controller
|
|
|
|
|
$G_ID_MENU_SELECTED = 'BPMN';
|
|
|
|
|
|
|
|
|
|
$oMenu = new Menu();
|
|
|
|
|
$menus = $oMenu->generateArrayForTemplate($G_MAIN_MENU, 'SelectedMenu', 'mainMenu', $G_MENU_SELECTED, $G_ID_MENU_SELECTED);
|
|
|
|
|
$menus = $oMenu->generateArrayForTemplate($G_MAIN_MENU, 'SelectedMenu', 'mainMenu', $G_MENU_SELECTED,
|
|
|
|
|
$G_ID_MENU_SELECTED);
|
|
|
|
|
|
|
|
|
|
foreach ($menus as $i => $menu) {
|
|
|
|
|
if (strpos($menu['target'], 'cases/main') !== false)
|
|
|
|
|
if (strpos($menu['target'], 'cases/main') !== false) {
|
|
|
|
|
$menus[$i]['target'] = str_replace('cases/main', 'cases/main_init', $menus[$i]['target']);
|
|
|
|
|
|
|
|
|
|
if (strpos($menu['target'], 'bpmn/main') !== false)
|
|
|
|
|
}
|
|
|
|
|
if (strpos($menu['target'], 'bpmn/main') !== false) {
|
|
|
|
|
$menus[$i]['target'] = str_replace('bpmn/main', 'bpmn/mainInit', $menus[$i]['target']);
|
|
|
|
|
|
|
|
|
|
if (strpos($menu['target'], 'processes/main') !== false)
|
|
|
|
|
}
|
|
|
|
|
if (strpos($menu['target'], 'processes/main') !== false) {
|
|
|
|
|
$menus[$i]['target'] = str_replace('processes/main', 'processes/mainInit', $menus[$i]['target']);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
if (strpos($menu['target'], 'setup/main') !== false) {
|
|
|
|
|
$menus[$i]['target'] = str_replace('setup/main', 'setup/main_init', $menus[$i]['target']);
|
|
|
|
|
|
|
|
|
|
// $param = '';
|
|
|
|
|
// if (isset($_GET['i18']) || isset($_GET['i18n'])) {
|
|
|
|
|
// $s = strpos($menus[$i]['target'], '?') !== false ? '&' : '?';
|
|
|
|
|
// $menus[$i]['target'] .= $s . 'i18';
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (strpos($menu['target'], 'dashboard/main') !== false)
|
|
|
|
|
if (strpos($menu['target'], 'dashboard/main') !== false) {
|
|
|
|
|
$menus[$i]['target'] = str_replace('dashboard/main', 'dashboard', $menus[$i]['target']);
|
|
|
|
|
|
|
|
|
|
$menus[$i]['elementclass'] = preg_replace(array('/class=/', '/"/'), array('', ''), $menus[$i]['elementclass']) ;
|
|
|
|
|
}
|
|
|
|
|
$menus[$i]['elementclass'] = preg_replace(array('/class=/', '/"/'), array('', ''),
|
|
|
|
|
$menus[$i]['elementclass']) ;
|
|
|
|
|
}
|
|
|
|
|
return $menus;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private function resolveUrlToTabIndex($url)
|
|
|
|
|
{
|
|
|
|
|
if (strpos($url, 'cases/main') !== false)
|
|
|
|
|
if (strpos($url, 'cases/main') !== false) {
|
|
|
|
|
$activeTab = 0;
|
|
|
|
|
else if (strpos($url, 'processes/main') !== false)
|
|
|
|
|
} elseif (strpos($url, 'processes/main') !== false) {
|
|
|
|
|
$activeTab = 1;
|
|
|
|
|
else if (strpos($url, 'dashboard/main') !== false)
|
|
|
|
|
} elseif (strpos($url, 'dashboard/main') !== false) {
|
|
|
|
|
$activeTab = 2;
|
|
|
|
|
else if (strpos($url, 'setup/main') !== false)
|
|
|
|
|
} elseif (strpos($url, 'setup/main') !== false) {
|
|
|
|
|
$activeTab = 3;
|
|
|
|
|
else
|
|
|
|
|
} else {
|
|
|
|
|
$activeTab = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return $activeTab;
|
|
|
|
|
}
|
|
|
|
|
@@ -483,15 +471,15 @@ class Main extends Controller
|
|
|
|
|
{
|
|
|
|
|
$sCompanyLogo = '/images/processmaker2.logo2.png';
|
|
|
|
|
|
|
|
|
|
if(defined("SYS_SYS")){
|
|
|
|
|
if ( ($aFotoSelect = $this->memcache->get('aFotoSelect')) === false ) {
|
|
|
|
|
G::LoadClass( 'replacementLogo' );
|
|
|
|
|
if (defined("SYS_SYS")) {
|
|
|
|
|
if (($aFotoSelect = $this->memcache->get('aFotoSelect')) === false) {
|
|
|
|
|
G::LoadClass('replacementLogo');
|
|
|
|
|
$oLogoR = new replacementLogo();
|
|
|
|
|
$aFotoSelect = $oLogoR->getNameLogo((isset($_SESSION['USER_LOGGED']))?$_SESSION['USER_LOGGED']:'');
|
|
|
|
|
$this->memcache->set( 'aFotoSelect', $aFotoSelect, 1*3600 );
|
|
|
|
|
$this->memcache->set('aFotoSelect', $aFotoSelect, 1*3600);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( is_array ( $aFotoSelect ) ) {
|
|
|
|
|
if (is_array ($aFotoSelect)) {
|
|
|
|
|
$sFotoSelect = trim($aFotoSelect['DEFAULT_LOGO_NAME']);
|
|
|
|
|
$sWspaceSelect = trim($aFotoSelect['WORKSPACE_LOGO_NAME']);
|
|
|
|
|
}
|
|
|
|
|
@@ -500,11 +488,11 @@ class Main extends Controller
|
|
|
|
|
if (class_exists('PMPluginRegistry')) {
|
|
|
|
|
$oPluginRegistry = &PMPluginRegistry::getSingleton();
|
|
|
|
|
|
|
|
|
|
if ( isset($sFotoSelect) && $sFotoSelect!='' && !(strcmp($sWspaceSelect,SYS_SYS)) ){
|
|
|
|
|
if (isset($sFotoSelect) && $sFotoSelect!='' && !(strcmp($sWspaceSelect,SYS_SYS))) {
|
|
|
|
|
$sCompanyLogo = $oPluginRegistry->getCompanyLogo($sFotoSelect);
|
|
|
|
|
$sCompanyLogo = "/sys".SYS_SYS."/".SYS_LANG."/".SYS_SKIN."/adminProxy/showLogoFile?id=".base64_encode($sCompanyLogo);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
$sCompanyLogo = "/sys".SYS_SYS."/".SYS_LANG."/".SYS_SKIN."/adminProxy/showLogoFile?id=".
|
|
|
|
|
base64_encode($sCompanyLogo);
|
|
|
|
|
} else {
|
|
|
|
|
$sCompanyLogo = $oPluginRegistry->getCompanyLogo($sCompanyLogo);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@@ -518,44 +506,47 @@ class Main extends Controller
|
|
|
|
|
$Translations = G::getModel("Translation");
|
|
|
|
|
$translationsTable = $Translations->getTranslationEnvironments();
|
|
|
|
|
|
|
|
|
|
if ( ($languagesList = $this->memcache->get('languagesList')) === false ) {
|
|
|
|
|
if (($languagesList = $this->memcache->get('languagesList')) === false) {
|
|
|
|
|
$languagesList = array ();
|
|
|
|
|
|
|
|
|
|
foreach ( $translationsTable as $locale ) {
|
|
|
|
|
foreach ($translationsTable as $locale) {
|
|
|
|
|
$LANG_ID = $locale['LOCALE'];
|
|
|
|
|
|
|
|
|
|
if( $locale['COUNTRY'] != '.' )
|
|
|
|
|
if ($locale['COUNTRY'] != '.') {
|
|
|
|
|
$LANG_NAME = $locale['LANGUAGE'] . ' (' . (ucwords(strtolower($locale['COUNTRY']))) . ')';
|
|
|
|
|
else
|
|
|
|
|
} else {
|
|
|
|
|
$LANG_NAME = $locale['LANGUAGE'];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$languagesList [] = array($LANG_ID, $LANG_NAME);
|
|
|
|
|
}
|
|
|
|
|
$this->memcache->set('languagesList', $languagesList, 1*3600 );
|
|
|
|
|
$this->memcache->set('languagesList', $languagesList, 1*3600);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return $languagesList;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private function getWorkspacesAvailable() {
|
|
|
|
|
G::LoadClass ( 'serverConfiguration' );
|
|
|
|
|
private function getWorkspacesAvailable()
|
|
|
|
|
{
|
|
|
|
|
G::LoadClass ('serverConfiguration');
|
|
|
|
|
$oServerConf = & serverConf::getSingleton ();
|
|
|
|
|
$dir = PATH_DB;
|
|
|
|
|
$filesArray = array ();
|
|
|
|
|
if (file_exists ( $dir )) {
|
|
|
|
|
if ($handle = opendir ( $dir )) {
|
|
|
|
|
while ( false !== ($file = readdir ( $handle )) ) {
|
|
|
|
|
if (file_exists ($dir)) {
|
|
|
|
|
if ($handle = opendir ($dir)) {
|
|
|
|
|
while (false !== ($file = readdir ($handle))) {
|
|
|
|
|
if (($file != ".") && ($file != "..")) {
|
|
|
|
|
if (file_exists ( PATH_DB . $file . '/db.php' )) {
|
|
|
|
|
if (! $oServerConf->isWSDisabled ( $file ))
|
|
|
|
|
if (file_exists (PATH_DB . $file . '/db.php')) {
|
|
|
|
|
if (! $oServerConf->isWSDisabled ($file)) {
|
|
|
|
|
$filesArray [] = $file;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
closedir ( $handle );
|
|
|
|
|
}
|
|
|
|
|
closedir ($handle);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
sort ( $filesArray, SORT_STRING );
|
|
|
|
|
sort ($filesArray, SORT_STRING);
|
|
|
|
|
return $filesArray;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -578,7 +569,6 @@ class Main extends Controller
|
|
|
|
|
return $rolName ? $rolName : $rolCode;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* binding G::SendTemporalMessage() to Javascript routine Ext.msgBoxSlider.msgTopCenter()
|
|
|
|
|
*/
|
|
|
|
|
@@ -595,36 +585,40 @@ class Main extends Controller
|
|
|
|
|
if (isset($_SESSION['G_MESSAGE_TYPE'])) {
|
|
|
|
|
$flyNotify['type'] = $_SESSION['G_MESSAGE_TYPE'];
|
|
|
|
|
unset($_SESSION['G_MESSAGE_TYPE']);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
} else {
|
|
|
|
|
$flyNotify['type'] = '';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ($flyNotify['title'] == '') {
|
|
|
|
|
switch($flyNotify['type']) {
|
|
|
|
|
case 'alert': case 'warning': case 'tmp-warning':
|
|
|
|
|
case 'alert':
|
|
|
|
|
case 'warning':
|
|
|
|
|
case 'tmp-warning':
|
|
|
|
|
$flyNotify['title'] = G::loadTranslation('ID_WARNING');
|
|
|
|
|
break;
|
|
|
|
|
case 'error': case 'tmp-error':
|
|
|
|
|
case 'error':
|
|
|
|
|
case 'tmp-error':
|
|
|
|
|
$flyNotify['title'] = G::loadTranslation('ID_ERROR');
|
|
|
|
|
break;
|
|
|
|
|
case 'tmp-info': case 'info':
|
|
|
|
|
case 'tmp-info':
|
|
|
|
|
case 'info':
|
|
|
|
|
$flyNotify['title'] = G::loadTranslation('ID_INFO');
|
|
|
|
|
break;
|
|
|
|
|
case 'success': case 'ok':
|
|
|
|
|
case 'success':
|
|
|
|
|
case 'ok':
|
|
|
|
|
$flyNotify['title'] = G::loadTranslation('ID_SUCCESS');
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
$flyNotify['title'] = strtoupper($flyNotify['title']);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$flyNotify['time'] = 5; //TODO make dinamic
|
|
|
|
|
//TODO make dinamic
|
|
|
|
|
$flyNotify['time'] = 5;
|
|
|
|
|
$this->flyNotify = $flyNotify;
|
|
|
|
|
|
|
|
|
|
return $this->flyNotify;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private function setFlyNotify($type, $title, $text, $time = 5)
|
|
|
|
|
private function setFlyNotify($type, $title, $text, $time=5)
|
|
|
|
|
{
|
|
|
|
|
$this->flyNotify = array(
|
|
|
|
|
'type' => $type,
|
|
|
|
|
@@ -641,11 +635,16 @@ class Main extends Controller
|
|
|
|
|
{
|
|
|
|
|
if (isset($_GET['errno'])) {
|
|
|
|
|
switch ($_GET['errno']) {
|
|
|
|
|
case '1': $trnLabel = 'ID_USER_HAVENT_RIGHTS_PAGE'; break;
|
|
|
|
|
case '2': $trnLabel = 'ID_NOT_WORKSPACE'; break;
|
|
|
|
|
default : $trnLabel = 'ID_USER_HAVENT_RIGHTS_PAGE';
|
|
|
|
|
case '1':
|
|
|
|
|
$trnLabel = 'ID_USER_HAVENT_RIGHTS_PAGE';
|
|
|
|
|
break;
|
|
|
|
|
case '2':
|
|
|
|
|
$trnLabel = 'ID_NOT_WORKSPACE';
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
$trnLabel = 'ID_USER_HAVENT_RIGHTS_PAGE';
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$this->setFlyNotify('error', 'ERROR', G::loadTranslation($trnLabel));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@@ -654,17 +653,25 @@ class Main extends Controller
|
|
|
|
|
{
|
|
|
|
|
if (!is_numeric($activeTab)) {
|
|
|
|
|
switch ($activeTab) {
|
|
|
|
|
case 'home' : $activeTab = 0; break;
|
|
|
|
|
case 'designer' : $activeTab = 1; break;
|
|
|
|
|
case 'dashboard': $activeTab = 2; break;
|
|
|
|
|
case 'admin' : $activeTab = 3; break;
|
|
|
|
|
default: $activeTab = 0;
|
|
|
|
|
case 'home':
|
|
|
|
|
$activeTab = 0;
|
|
|
|
|
break;
|
|
|
|
|
case 'designer':
|
|
|
|
|
$activeTab = 1;
|
|
|
|
|
break;
|
|
|
|
|
case 'dashboard':
|
|
|
|
|
$activeTab = 2;
|
|
|
|
|
break;
|
|
|
|
|
case 'admin':
|
|
|
|
|
$activeTab = 3;
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
$activeTab = 0;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
} else {
|
|
|
|
|
$activeTab = $activeTab > -1 && $activeTab < 3 ? (int) $activeTab : '';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return $activeTab;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -687,47 +694,43 @@ class Main extends Controller
|
|
|
|
|
{
|
|
|
|
|
G::LoadClass("system");
|
|
|
|
|
|
|
|
|
|
if (getenv ( 'HTTP_CLIENT_IP' )) {
|
|
|
|
|
$ip = getenv ( 'HTTP_CLIENT_IP' );
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
if (getenv ( 'HTTP_X_FORWARDED_FOR' )) {
|
|
|
|
|
$ip = getenv ( 'HTTP_X_FORWARDED_FOR' );
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
$ip = getenv ( 'REMOTE_ADDR' );
|
|
|
|
|
if (getenv('HTTP_CLIENT_IP')) {
|
|
|
|
|
$ip = getenv('HTTP_CLIENT_IP');
|
|
|
|
|
} else {
|
|
|
|
|
if (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 = trim ( fread ( $fp, $fnewsize ) );
|
|
|
|
|
fclose ( $fp );
|
|
|
|
|
if (file_exists ('/etc/redhat-release')) {
|
|
|
|
|
$fnewsize = filesize ('/etc/redhat-release');
|
|
|
|
|
$fp = fopen ('/etc/redhat-release', 'r');
|
|
|
|
|
$redhat = trim (fread ($fp, $fnewsize));
|
|
|
|
|
fclose ($fp);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$redhat .= " (" . PHP_OS . ")";
|
|
|
|
|
if (defined ( "DB_HOST" )) {
|
|
|
|
|
G::LoadClass ( 'net' );
|
|
|
|
|
G::LoadClass ( 'dbConnections' );
|
|
|
|
|
$dbNetView = new NET ( DB_HOST );
|
|
|
|
|
$dbNetView->loginDbServer ( DB_USER, DB_PASS );
|
|
|
|
|
if (defined ("DB_HOST")) {
|
|
|
|
|
G::LoadClass ('net');
|
|
|
|
|
G::LoadClass ('dbConnections');
|
|
|
|
|
$dbNetView = new NET (DB_HOST);
|
|
|
|
|
$dbNetView->loginDbServer (DB_USER, DB_PASS);
|
|
|
|
|
|
|
|
|
|
$dbConns = new dbConnections ( '' );
|
|
|
|
|
$dbConns = new dbConnections ('');
|
|
|
|
|
$availdb = '';
|
|
|
|
|
foreach ( $dbConns->getDbServicesAvailables () as $key => $val ) {
|
|
|
|
|
if ($availdb != '')
|
|
|
|
|
foreach ($dbConns->getDbServicesAvailables () as $key => $val) {
|
|
|
|
|
if ($availdb != '') {
|
|
|
|
|
$availdb .= ', ';
|
|
|
|
|
}
|
|
|
|
|
$availdb .= $val ['name'];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
|
|
$sMySQLVersion = $dbNetView->getDbServerVersion ( DB_ADAPTER );
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
catch ( Exception $oException ) {
|
|
|
|
|
$sMySQLVersion = $dbNetView->getDbServerVersion (DB_ADAPTER);
|
|
|
|
|
} catch (Exception $oException) {
|
|
|
|
|
$sMySQLVersion = '?????';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@@ -740,45 +743,46 @@ class Main extends Controller
|
|
|
|
|
$properties[] = array('ProcessMaker Ver.', System::getVersion() . $ee, $pmSection);
|
|
|
|
|
$properties[] = array('Operating System', $redhat, $sysSection);
|
|
|
|
|
$properties[] = array('Time Zone', (defined('TIME_ZONE')) ? TIME_ZONE : "Unknown", $sysSection);
|
|
|
|
|
$properties[] = array('Web Server', getenv ( 'SERVER_SOFTWARE'), $sysSection);
|
|
|
|
|
$properties[] = array('Server Name', getenv ( 'SERVER_NAME'), $pmSection);
|
|
|
|
|
$properties[] = array('Web Server', getenv ('SERVER_SOFTWARE'), $sysSection);
|
|
|
|
|
$properties[] = array('Server Name', getenv ('SERVER_NAME'), $pmSection);
|
|
|
|
|
$properties[] = array('Server IP Address', $this->lookup ($ip), $sysSection);
|
|
|
|
|
$properties[] = array('PHP Version', phpversion(), $sysSection);
|
|
|
|
|
|
|
|
|
|
if (defined ( "DB_HOST" )) {
|
|
|
|
|
$properties[] = array('Data Base', $dbNetView->dbName(DB_ADAPTER) . ' (Version ' . $sMySQLVersion . ')', $pmSection);
|
|
|
|
|
if (defined ("DB_HOST")) {
|
|
|
|
|
$properties[] = array('Data Base', $dbNetView->dbName(DB_ADAPTER) . ' (Version ' . $sMySQLVersion . ')',
|
|
|
|
|
$pmSection);
|
|
|
|
|
$properties[] = array('Data Base Server', DB_HOST, $pmSection);
|
|
|
|
|
$properties[] = array('Data Base Name', DB_NAME, $pmSection);
|
|
|
|
|
$properties[] = array('Available DB Engines', $availdb, $sysSection);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
} else {
|
|
|
|
|
$properties[] = array('Data Base', "Not defined", $pmSection);
|
|
|
|
|
$properties[] = array('Data Base Server', "Not defined", $pmSection);
|
|
|
|
|
$properties[] = array('Data Base Name', "Not defined", $pmSection);
|
|
|
|
|
$properties[] = array('Available DB Engines', "Not defined", $sysSection);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$properties[] = array('Workspace', defined ( "SYS_SYS" ) ? SYS_SYS : "Not defined", $pmSection);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$properties[] = array('Server Protocol', getenv ( 'SERVER_PROTOCOL'), $sysSection);
|
|
|
|
|
$properties[] = array('Server Port', getenv ( 'SERVER_PORT'), $sysSection);
|
|
|
|
|
//$properties[] = array('Remote Host', getenv ( 'REMOTE_HOST'), $sysSection);
|
|
|
|
|
$properties[] = array('Server Addr.', getenv ( 'SERVER_ADDR'), $sysSection);
|
|
|
|
|
$properties[] = array('User\'s Browser', getenv ( 'HTTP_USER_AGENT'), $sysSection);
|
|
|
|
|
$properties[] = array('Workspace', defined ("SYS_SYS") ? SYS_SYS : "Not defined", $pmSection);
|
|
|
|
|
|
|
|
|
|
$properties[] = array('Server Protocol', getenv ('SERVER_PROTOCOL'), $sysSection);
|
|
|
|
|
$properties[] = array('Server Port', getenv ('SERVER_PORT'), $sysSection);
|
|
|
|
|
//$properties[] = array('Remote Host', getenv ('REMOTE_HOST'), $sysSection);
|
|
|
|
|
$properties[] = array('Server Addr.', getenv ('SERVER_ADDR'), $sysSection);
|
|
|
|
|
$properties[] = array('User\'s Browser', getenv ('HTTP_USER_AGENT'), $sysSection);
|
|
|
|
|
|
|
|
|
|
return $properties;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private function lookup( $target ) {
|
|
|
|
|
private 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 );
|
|
|
|
|
//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);
|
|
|
|
|
}
|
|
|
|
|
@@ -793,3 +797,4 @@ class Main extends Controller
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|