HOR-4527
This commit is contained in:
committed by
Julio Cesar Laura Avendaño
parent
abe71a6ffe
commit
0d533e19d9
@@ -7,7 +7,6 @@ $request = isset($_POST['request']) ? $_POST['request'] : (isset($_GET['request'
|
||||
|
||||
function testConnection($type, $server, $user, $passwd, $port = 'none', $dbName = "")
|
||||
{
|
||||
|
||||
if (($port == 'none') || ($port == '') || ($port == 0)) {
|
||||
//setting defaults ports
|
||||
switch ($type) {
|
||||
@@ -43,29 +42,29 @@ function testConnection($type, $server, $user, $passwd, $port = 'none', $dbName
|
||||
$server = $filter->validateInput($server);
|
||||
$user = $filter->validateInput($user);
|
||||
$passwd = $filter->validateInput($passwd);
|
||||
$connDatabase = @mysql_connect($server, $user, $passwd);
|
||||
$connDatabase = mysqli_connect($server, $user, $passwd);
|
||||
$dbNameTest = "PROCESSMAKERTESTDC";
|
||||
$dbNameTest = $filter->validateInput($dbNameTest, 'nosql');
|
||||
$query = "CREATE DATABASE %s";
|
||||
$query = $filter->preventSqlInjection($query, array($dbNameTest), $connDatabase);
|
||||
$db = @mysql_query($query, $connDatabase);
|
||||
$db = mysqli_query($connDatabase, $query);
|
||||
$success = false;
|
||||
if (!$db) {
|
||||
$message = mysql_error();;
|
||||
$message = mysqli_error($connDatabase);
|
||||
} else {
|
||||
$usrTest = "wfrbtest";
|
||||
$chkG = "GRANT ALL PRIVILEGES ON `%s`.* TO %s@'%%' IDENTIFIED BY 'sample' WITH GRANT OPTION";
|
||||
$chkG = $filter->preventSqlInjection($chkG, array($dbNameTest, $usrTest), $connDatabase);
|
||||
$ch = @mysql_query($chkG, $connDatabase);
|
||||
$ch = mysqli_query($connDatabase, $chkG);
|
||||
if (!$ch) {
|
||||
$message = mysql_error();
|
||||
$message = mysqli_error($connDatabase);
|
||||
} else {
|
||||
$sqlCreateUser = "CREATE USER '%s'@'%%' IDENTIFIED BY '%s'";
|
||||
$user = $filter->validateInput($user, 'nosql');
|
||||
$sqlCreateUser = $filter->preventSqlInjection($sqlCreateUser, array($user . "_usertest", "sample"), $connDatabase);
|
||||
$result = @mysql_query($sqlCreateUser, $connDatabase);
|
||||
$result = mysqli_query($connDatabase, $sqlCreateUser);
|
||||
if (!$result) {
|
||||
$message = mysql_error();
|
||||
$message = mysqli_error($connDatabase);
|
||||
} else {
|
||||
$success = true;
|
||||
$message = G::LoadTranslation('ID_SUCCESSFUL_CONNECTION');
|
||||
@@ -73,17 +72,17 @@ function testConnection($type, $server, $user, $passwd, $port = 'none', $dbName
|
||||
$sqlDropUser = "DROP USER '%s'@'%%'";
|
||||
$user = $filter->validateInput($user, 'nosql');
|
||||
$sqlDropUser = $filter->preventSqlInjection($sqlDropUser, array($user . "_usertest"), $connDatabase);
|
||||
@mysql_query($sqlDropUser, $connDatabase);
|
||||
mysqli_query($connDatabase, $sqlDropUser);
|
||||
|
||||
$sqlDropUser = "DROP USER %s@'%%'";
|
||||
$usrTest = $filter->validateInput($usrTest, 'nosql');
|
||||
$sqlDropUser = $filter->preventSqlInjection($sqlDropUser, array($usrTest), $connDatabase);
|
||||
@mysql_query($sqlDropUser, $connDatabase);
|
||||
mysqli_query($connDatabase, $sqlDropUser);
|
||||
}
|
||||
$sqlDropDb = "DROP DATABASE %s";
|
||||
$dbNameTest = $filter->validateInput($dbNameTest, 'nosql');
|
||||
$sqlDropDb = $filter->preventSqlInjection($sqlDropDb, array($dbNameTest), $connDatabase);
|
||||
@mysql_query($sqlDropDb, $connDatabase);
|
||||
mysqli_query($connDatabase, $sqlDropDb);
|
||||
}
|
||||
return array($success, ($message != "") ? $message : $Server->error);
|
||||
} else {
|
||||
@@ -107,7 +106,7 @@ switch ($request) {
|
||||
//check if the APP_CACHE VIEW table and their triggers are installed
|
||||
case 'info':
|
||||
$result = new stdClass();
|
||||
$result->info = array();
|
||||
$result->info = [];
|
||||
|
||||
//check the language, if no info in config about language, the default is 'en'
|
||||
$oConf = new Configurations();
|
||||
@@ -126,7 +125,7 @@ switch ($request) {
|
||||
}
|
||||
|
||||
//get user Root from hash
|
||||
$result->info = array();
|
||||
$result->info = [];
|
||||
$result->error = false;
|
||||
|
||||
//setup the appcacheview object, and the path for the sql files
|
||||
@@ -201,17 +200,17 @@ switch ($request) {
|
||||
case 'getLangList':
|
||||
$Translations = G::getModel('Translation');
|
||||
$result = new stdClass();
|
||||
$result->rows = array();
|
||||
$result->rows = [];
|
||||
|
||||
$langs = $Translations->getTranslationEnvironments();
|
||||
foreach ($langs as $lang) {
|
||||
$result->rows[] = array('LAN_ID' => $lang['LOCALE'], 'LAN_NAME' => $lang['LANGUAGE']);
|
||||
}
|
||||
|
||||
print (G::json_encode($result));
|
||||
print(G::json_encode($result));
|
||||
break;
|
||||
case 'build':
|
||||
$sqlToExe = array();
|
||||
$sqlToExe = [];
|
||||
$conf = new Configurations();
|
||||
|
||||
//DEPRECATED $lang = $_POST['lang'];
|
||||
@@ -225,38 +224,30 @@ switch ($request) {
|
||||
|
||||
//Update APP_DELEGATION.DEL_LAST_INDEX data
|
||||
$res = $appCache->updateAppDelegationDelLastIndex($lang, true);
|
||||
//$result->info[] = array("name" => "update APP_DELEGATION.DEL_LAST_INDEX", "value" => $res);
|
||||
|
||||
//APP_DELEGATION INSERT
|
||||
$res = $appCache->triggerAppDelegationInsert($lang, true);
|
||||
//$result->info[] = array ('name' => 'Trigger APP_DELEGATION INSERT', 'value'=> $res);
|
||||
|
||||
|
||||
//APP_DELEGATION Update
|
||||
$res = $appCache->triggerAppDelegationUpdate($lang, true);
|
||||
//$result->info[] = array ('name' => 'Trigger APP_DELEGATION UPDATE', 'value'=> $res);
|
||||
|
||||
|
||||
//APPLICATION UPDATE
|
||||
$res = $appCache->triggerApplicationUpdate($lang, true);
|
||||
//$result->info[] = array ('name' => 'Trigger APPLICATION UPDATE', 'value'=> $res);
|
||||
|
||||
|
||||
//APPLICATION DELETE
|
||||
$res = $appCache->triggerApplicationDelete($lang, true);
|
||||
//$result->info[] = array ('name' => 'Trigger APPLICATION DELETE', 'value'=> $res);
|
||||
|
||||
//SUB_APPLICATION INSERT
|
||||
$res = $appCache->triggerSubApplicationInsert($lang, false);
|
||||
|
||||
//CONTENT UPDATE
|
||||
$res = $appCache->triggerContentUpdate($lang, true);
|
||||
//$result->info[] = array("name" => "Trigger CONTENT UPDATE", "value" => $res);
|
||||
|
||||
//build using the method in AppCacheView Class
|
||||
$res = $appCache->fillAppCacheView($lang);
|
||||
//$result->info[] = array ('name' => 'build APP_CACHE_VIEW', 'value'=> $res);
|
||||
|
||||
|
||||
//set status in config table
|
||||
$confParams = array('LANG' => $lang, 'STATUS' => 'active');
|
||||
@@ -268,7 +259,6 @@ switch ($request) {
|
||||
$result->msg = G::LoadTranslation('ID_TITLE_COMPLETED');
|
||||
G::auditLog("BuildCache");
|
||||
echo G::json_encode($result);
|
||||
|
||||
} catch (Exception $e) {
|
||||
$confParams = array('lang' => $lang, 'status' => 'failed');
|
||||
$appCacheViewEngine = $oServerConf->setProperty('APP_CACHE_VIEW_ENGINE', $confParams);
|
||||
@@ -276,7 +266,7 @@ switch ($request) {
|
||||
$token = strtotime("now");
|
||||
PMException::registerErrorLog($e, $token);
|
||||
$varRes = '{success: false, msg:"' . G::LoadTranslation("ID_EXCEPTION_LOG_INTERFAZ", array($token)) . '"}';
|
||||
G::outRes( $varRes );
|
||||
G::outRes($varRes);
|
||||
}
|
||||
break;
|
||||
case 'recreate-root':
|
||||
@@ -299,7 +289,7 @@ switch ($request) {
|
||||
$sh = G::encryptOld(filemtime(PATH_GULLIVER . "/class.g.php"));
|
||||
$h = G::encrypt($_POST['host'] . $sh . $_POST['user'] . $sh . $_POST['password'] . $sh . (1), $sh);
|
||||
$insertStatements = "define ( 'HASH_INSTALLATION','{$h}' ); \ndefine ( 'SYSTEM_HASH', '{$sh}' ); \n";
|
||||
$lines = array();
|
||||
$lines = [];
|
||||
$content = '';
|
||||
$filename = PATH_HOME . 'engine' . PATH_SEP . 'config' . PATH_SEP . 'paths_installed.php';
|
||||
$lines = file($filename);
|
||||
|
||||
@@ -1,38 +1,37 @@
|
||||
<?php
|
||||
global $RBAC;
|
||||
$RBAC->requirePermissions( 'PM_SETUP' );
|
||||
$RBAC->requirePermissions('PM_SETUP');
|
||||
// header('Pragma: no-cache');
|
||||
// header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
|
||||
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
$oHeadPublisher = headPublisher::getSingleton();
|
||||
//$oHeadPublisher->setExtSkin( 'xtheme-blue');
|
||||
|
||||
|
||||
$oHeadPublisher->addExtJsScript( 'setup/appCacheViewConf', false ); //adding a javascript file .js
|
||||
$oHeadPublisher->addContent( 'setup/appCacheViewConf' ); //adding a html file .html.
|
||||
$oHeadPublisher->addExtJsScript('setup/appCacheViewConf', false); //adding a javascript file .js
|
||||
$oHeadPublisher->addContent('setup/appCacheViewConf'); //adding a html file .html.
|
||||
|
||||
$oConf = new Configurations();
|
||||
$oConf->loadConfig( $x, 'APP_CACHE_VIEW_ENGINE', '', '', '', '' );
|
||||
$oConf->loadConfig($x, 'APP_CACHE_VIEW_ENGINE', '', '', '', '');
|
||||
|
||||
//first check about APP_CACHE_VIEW is enabled or not,
|
||||
if (isset( $oConf->aConfig['LANG'] ) && isset( $oConf->aConfig['STATUS'] ) && $oConf->aConfig['STATUS'] == 'active') {
|
||||
if (isset($oConf->aConfig['LANG']) && isset($oConf->aConfig['STATUS']) && $oConf->aConfig['STATUS'] == 'active') {
|
||||
$appCacheViewEnabled = true;
|
||||
} else {
|
||||
$appCacheViewEnabled = false;
|
||||
}
|
||||
$lang = isset( $oConf->aConfig['LANG'] ) ? $oConf->aConfig['LANG'] : 'en';
|
||||
$lang = isset($oConf->aConfig['LANG']) ? $oConf->aConfig['LANG'] : 'en';
|
||||
|
||||
//$oHeadPublisher->assign('appCacheViewEnabled', $appCacheViewEnabled);
|
||||
|
||||
|
||||
$labels = G::getTranslations( Array ('ID_PROCESSING','ID_CACHE_LANGUAGE','ID_CACHE_HOST','ID_CACHE_USER','ID_CACHE_PASSWORD','ID_CACHE_TITLE_INFO','ID_CACHE_SUBTITLE_REBUILD','ID_CACHE_BTN_BUILD','ID_CACHE_BUILDING','ID_CACHE_SUBTITLE_SETUP_DB','ID_CACHE_BTN_SETUP_PASSWRD','ID_CACHE_SUBTITLE_SETUP_SESSION','ID_CACHE_BTN_SETUP_SESSION'
|
||||
) );
|
||||
$labels = G::getTranslations(array('ID_PROCESSING','ID_CACHE_LANGUAGE','ID_CACHE_HOST','ID_CACHE_USER','ID_CACHE_PASSWORD','ID_CACHE_TITLE_INFO','ID_CACHE_SUBTITLE_REBUILD','ID_CACHE_BTN_BUILD','ID_CACHE_BUILDING','ID_CACHE_SUBTITLE_SETUP_DB','ID_CACHE_BTN_SETUP_PASSWRD','ID_CACHE_SUBTITLE_SETUP_SESSION','ID_CACHE_BTN_SETUP_SESSION'
|
||||
));
|
||||
// $oHeadPublisher->assign('TRANSLATIONS', $labels);
|
||||
// $TRANSLATIONS->ID_PROCESSING = G::LoadTranslation('ID_PROCESSING');
|
||||
// $oHeadPublisher->assign( 'TRANSLATIONS', $TRANSLATIONS); //translations
|
||||
$oHeadPublisher->assign( 'currentLang', $lang ); //current language
|
||||
$oHeadPublisher->assign('currentLang', $lang); //current language
|
||||
|
||||
|
||||
G::RenderPage( 'publish', 'extJs' );
|
||||
|
||||
G::RenderPage('publish', 'extJs');
|
||||
|
||||
@@ -7,10 +7,10 @@ if ($RBAC->userCanAccess("PM_SETUP") != 1) {
|
||||
}
|
||||
|
||||
$c = new Configurations();
|
||||
$configPage = $c->getConfiguration( "auditLogList", "pageSize", null, $_SESSION["USER_LOGGED"] );
|
||||
$configPage = $c->getConfiguration("auditLogList", "pageSize", null, $_SESSION["USER_LOGGED"]);
|
||||
|
||||
$config = array ();
|
||||
$config["pageSize"] = (isset( $configPage["pageSize"] )) ? $configPage["pageSize"] : 20;
|
||||
$config = array();
|
||||
$config["pageSize"] = (isset($configPage["pageSize"])) ? $configPage["pageSize"] : 20;
|
||||
|
||||
$arrayAction = array(
|
||||
"CreateUser" => G::LoadTranslation("ID_CREATE_USER"),
|
||||
@@ -164,9 +164,8 @@ foreach ($arrayActionAux as $key => $value) {
|
||||
$arrayAction[] = array($key, $value);
|
||||
}
|
||||
|
||||
$oHeadPublisher = &headPublisher::getSingleton();
|
||||
$oHeadPublisher->addExtJsScript( "setup/auditLog", true );
|
||||
$oHeadPublisher->assign( "CONFIG", $config );
|
||||
$oHeadPublisher->assign( "ACTION", $arrayAction );
|
||||
G::RenderPage( "publish", "extJs" );
|
||||
|
||||
$oHeadPublisher = headPublisher::getSingleton();
|
||||
$oHeadPublisher->addExtJsScript("setup/auditLog", true);
|
||||
$oHeadPublisher->assign("CONFIG", $config);
|
||||
$oHeadPublisher->assign("ACTION", $arrayAction);
|
||||
G::RenderPage("publish", "extJs");
|
||||
|
||||
@@ -4,11 +4,11 @@ global $G_TMP_MENU;
|
||||
switch ($_GET['action']) {
|
||||
case 'saveOption':
|
||||
try {
|
||||
$oServerConf = & ServerConf::getSingleton();
|
||||
$oServerConf = ServerConf::getSingleton();
|
||||
$response = new $oServerConf;
|
||||
$conf = new Configurations();
|
||||
/*you can use SYS_TEMP or SYS_SYS ON AUDIT_LOG_CONF to save for each workspace*/
|
||||
if (isset( $_POST['acceptAL'] )) {
|
||||
if (isset($_POST['acceptAL'])) {
|
||||
$conf->aConfig = 'true';
|
||||
$conf->saveConfig('AUDIT_LOG', 'log');
|
||||
$response->enable = true;
|
||||
@@ -24,7 +24,6 @@ switch ($_GET['action']) {
|
||||
$response->success = false;
|
||||
$response->msg = $e->getMessage();
|
||||
}
|
||||
echo G::json_encode( $response );
|
||||
echo G::json_encode($response);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -37,13 +37,12 @@ $G_ID_SUB_MENU_SELECTED = 'CALENDAR';
|
||||
$G_PUBLISH = new Publisher();
|
||||
|
||||
$c = new Configurations();
|
||||
$configPage = $c->getConfiguration( 'calendarList', 'pageSize', '', $_SESSION['USER_LOGGED'] );
|
||||
$Config['pageSize'] = isset( $configPage['pageSize'] ) ? $configPage['pageSize'] : 20;
|
||||
$configPage = $c->getConfiguration('calendarList', 'pageSize', '', $_SESSION['USER_LOGGED']);
|
||||
$Config['pageSize'] = isset($configPage['pageSize']) ? $configPage['pageSize'] : 20;
|
||||
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
$oHeadPublisher->addExtJsScript( 'setup/calendarList', false ); //adding a javascript file .js
|
||||
$oHeadPublisher->addContent( 'setup/calendarList' ); //adding a html file .html.
|
||||
$oHeadPublisher->assign( 'CONFIG', $Config );
|
||||
|
||||
G::RenderPage( 'publish', 'extJs' );
|
||||
$oHeadPublisher = headPublisher::getSingleton();
|
||||
$oHeadPublisher->addExtJsScript('setup/calendarList', false); //adding a javascript file .js
|
||||
$oHeadPublisher->addContent('setup/calendarList'); //adding a html file .html.
|
||||
$oHeadPublisher->assign('CONFIG', $Config);
|
||||
|
||||
G::RenderPage('publish', 'extJs');
|
||||
|
||||
@@ -29,9 +29,8 @@ if (!$resultRbac) {
|
||||
die();
|
||||
}
|
||||
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
$oHeadPublisher->addExtJsScript( 'setup/clearCompiled', true ); //adding a javascript file .js
|
||||
$oHeadPublisher = headPublisher::getSingleton();
|
||||
$oHeadPublisher->addExtJsScript('setup/clearCompiled', true); //adding a javascript file .js
|
||||
|
||||
|
||||
G::RenderPage( 'publish', 'extJs' );
|
||||
|
||||
G::RenderPage('publish', 'extJs');
|
||||
|
||||
@@ -48,43 +48,43 @@ if ($osIsLinux) {
|
||||
|
||||
//Data
|
||||
$c = new Configurations();
|
||||
$configPage = $c->getConfiguration( "cronList", "pageSize", null, $_SESSION["USER_LOGGED"] );
|
||||
$configPage = $c->getConfiguration("cronList", "pageSize", null, $_SESSION["USER_LOGGED"]);
|
||||
|
||||
$config = array ();
|
||||
$config["pageSize"] = (isset( $configPage["pageSize"] )) ? $configPage["pageSize"] : 20;
|
||||
$config = array();
|
||||
$config["pageSize"] = (isset($configPage["pageSize"])) ? $configPage["pageSize"] : 20;
|
||||
|
||||
$cronInfo = array ();
|
||||
$cronInfo = array();
|
||||
$fileLog = PATH_DATA . "log" . PATH_SEP . "cron.log";
|
||||
$fileLogSize = (file_exists( $fileLog )) ? number_format( filesize( $fileLog ) * (1 / 1024) * (1 / 1024), 4, ".", "" ) : 0;
|
||||
$fileLogSize = (file_exists($fileLog)) ? number_format(filesize($fileLog) * (1 / 1024) * (1 / 1024), 4, ".", "") : 0;
|
||||
|
||||
$cronInfo["status"] = G::LoadTranslation( (($bCronIsRunning) ? "ID_CRON_STATUS_ACTIVE" : "ID_CRON_STATUS_INACTIVE") );
|
||||
$cronInfo["lastExecution"] = (! empty( $sLastExecution )) ? $sLastExecution : "";
|
||||
$cronInfo["status"] = G::LoadTranslation((($bCronIsRunning) ? "ID_CRON_STATUS_ACTIVE" : "ID_CRON_STATUS_INACTIVE"));
|
||||
$cronInfo["lastExecution"] = (! empty($sLastExecution)) ? $sLastExecution : "";
|
||||
$cronInfo["fileLogName"] = "cron.log";
|
||||
$cronInfo["fileLogSize"] = $fileLogSize;
|
||||
$cronInfo["fileLogPath"] = $fileLog;
|
||||
|
||||
//Workspaces
|
||||
$workspaces = System::listWorkspaces();
|
||||
$arrayAux = array ();
|
||||
$arrayAux = array();
|
||||
|
||||
foreach ($workspaces as $index => $workspace) {
|
||||
$arrayAux[] = $workspace->name;
|
||||
}
|
||||
|
||||
sort( $arrayAux );
|
||||
sort($arrayAux);
|
||||
|
||||
//Status
|
||||
$arrayStatus = array (array ("ALL",G::LoadTranslation( "ID_ALL" )
|
||||
),array ("COMPLETED",G::LoadTranslation( "COMPLETED" )
|
||||
),array ("FAILED",G::LoadTranslation( "ID_FAILED" )
|
||||
$arrayStatus = array(array("ALL",G::LoadTranslation("ID_ALL")
|
||||
),array("COMPLETED",G::LoadTranslation("COMPLETED")
|
||||
),array("FAILED",G::LoadTranslation("ID_FAILED")
|
||||
)
|
||||
);
|
||||
|
||||
$oHeadPublisher = &headPublisher::getSingleton();
|
||||
$oHeadPublisher->addContent( "setup/cron" ); //Adding a html file .html
|
||||
$oHeadPublisher->addExtJsScript( "setup/cron", false ); //Adding a javascript file .js
|
||||
$oHeadPublisher->assign( "CONFIG", $config );
|
||||
$oHeadPublisher->assign( "CRON", $cronInfo );
|
||||
$oHeadPublisher->assign( "STATUS", $arrayStatus );
|
||||
$oHeadPublisher = headPublisher::getSingleton();
|
||||
$oHeadPublisher->addContent("setup/cron"); //Adding a html file .html
|
||||
$oHeadPublisher->addExtJsScript("setup/cron", false); //Adding a javascript file .js
|
||||
$oHeadPublisher->assign("CONFIG", $config);
|
||||
$oHeadPublisher->assign("CRON", $cronInfo);
|
||||
$oHeadPublisher->assign("STATUS", $arrayStatus);
|
||||
|
||||
G::RenderPage( "publish", "extJs" );
|
||||
G::RenderPage("publish", "extJs");
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
<?php
|
||||
global $RBAC;
|
||||
$RBAC->requirePermissions( 'PM_SETUP' );
|
||||
$RBAC->requirePermissions('PM_SETUP');
|
||||
|
||||
$c = new Configurations();
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
$oHeadPublisher->addExtJsScript( 'setup/environmentSettings', true );
|
||||
$oHeadPublisher = headPublisher::getSingleton();
|
||||
$oHeadPublisher->addExtJsScript('setup/environmentSettings', true);
|
||||
//$conf->aConfig['startCaseHideProcessInf']
|
||||
$oHeadPublisher->assign( 'FORMATS', $c->getFormats() );
|
||||
G::RenderPage( 'publish', 'extJs' );
|
||||
|
||||
$oHeadPublisher->assign('FORMATS', $c->getFormats());
|
||||
G::RenderPage('publish', 'extJs');
|
||||
|
||||
@@ -22,26 +22,25 @@
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
global $RBAC;
|
||||
$RBAC->requirePermissions( 'PM_SETUP' );
|
||||
$RBAC->requirePermissions('PM_SETUP');
|
||||
|
||||
$oConf = new Configurations();
|
||||
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
$oServerConf = & ServerConf::getSingleton();
|
||||
$oHeadPublisher = headPublisher::getSingleton();
|
||||
$oServerConf = ServerConf::getSingleton();
|
||||
|
||||
$oHeadPublisher->addExtJsScript( 'setup/loginSettings', true ); //adding a javascript file .js
|
||||
$oHeadPublisher->addContent( 'setup/loginSettings' ); //adding a html file .html.
|
||||
$oHeadPublisher->addExtJsScript('setup/loginSettings', true); //adding a javascript file .js
|
||||
$oHeadPublisher->addContent('setup/loginSettings'); //adding a html file .html.
|
||||
|
||||
|
||||
$oConf->loadConfig( $obj, 'ENVIRONMENT_SETTINGS', '' );
|
||||
$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';
|
||||
|
||||
$oHeadPublisher->assign( 'currentLang', $defaultLanguaje );
|
||||
$oHeadPublisher->assign( 'forgotPasswd', $forgotPasswd );
|
||||
$oHeadPublisher->assign( 'virtualKeyboad', $virtualKeyboad );
|
||||
|
||||
G::RenderPage( 'publish', 'extJs' );
|
||||
$oHeadPublisher->assign('currentLang', $defaultLanguaje);
|
||||
$oHeadPublisher->assign('forgotPasswd', $forgotPasswd);
|
||||
$oHeadPublisher->assign('virtualKeyboad', $virtualKeyboad);
|
||||
|
||||
G::RenderPage('publish', 'extJs');
|
||||
|
||||
@@ -1,47 +1,49 @@
|
||||
<?php
|
||||
$request = isset( $_REQUEST['request'] ) ? $_REQUEST['request'] : null;
|
||||
$request = isset($_REQUEST['request']) ? $_REQUEST['request'] : null;
|
||||
|
||||
switch ($request) {
|
||||
case 'getLangList':
|
||||
|
||||
$Translations = new Translation();
|
||||
$result = new stdClass();
|
||||
$result->rows = Array ();
|
||||
$result->rows = array();
|
||||
|
||||
$langs = $Translations->getTranslationEnvironments();
|
||||
foreach ($langs as $lang) {
|
||||
$result->rows[] = Array ('LAN_ID' => $lang['LOCALE'],'LAN_NAME' => $lang['LANGUAGE']
|
||||
$result->rows[] = array(
|
||||
'LAN_ID' => $lang['LOCALE'],
|
||||
'LAN_NAME' => $lang['LANGUAGE']
|
||||
);
|
||||
}
|
||||
|
||||
$result->rows[] = array ("LAN_ID" => "", "LAN_NAME" => G::LoadTranslation("ID_USE_LANGUAGE_URL"));
|
||||
$result->rows[] = array("LAN_ID" => "", "LAN_NAME" => G::LoadTranslation("ID_USE_LANGUAGE_URL"));
|
||||
|
||||
print (G::json_encode( $result )) ;
|
||||
print(G::json_encode($result));
|
||||
break;
|
||||
case 'saveSettings':
|
||||
$memcache = & PMmemcached::getSingleton( !empty(config("system.workspace")) ? config("system.workspace") : '' );
|
||||
$memcache = PMmemcached::getSingleton(!empty(config("system.workspace")) ? config("system.workspace") : '');
|
||||
|
||||
$conf = new Configurations();
|
||||
$conf->loadConfig( $obj, 'ENVIRONMENT_SETTINGS', '' );
|
||||
$conf->loadConfig($obj, 'ENVIRONMENT_SETTINGS', '');
|
||||
|
||||
$conf->aConfig['login_enableForgotPassword'] = isset( $_REQUEST['forgotPasswd'] );
|
||||
$conf->aConfig['login_enableVirtualKeyboard'] = isset( $_REQUEST['virtualKeyboad'] );
|
||||
$conf->aConfig['login_defaultLanguage'] = isset( $_REQUEST['lang'] ) ? $_REQUEST['lang'] : 'en';
|
||||
$conf->aConfig['login_enableForgotPassword'] = isset($_REQUEST['forgotPasswd']);
|
||||
$conf->aConfig['login_enableVirtualKeyboard'] = isset($_REQUEST['virtualKeyboad']);
|
||||
$conf->aConfig['login_defaultLanguage'] = isset($_REQUEST['lang']) ? $_REQUEST['lang'] : 'en';
|
||||
|
||||
$conf->saveConfig( 'ENVIRONMENT_SETTINGS', '' );
|
||||
$conf->saveConfig('ENVIRONMENT_SETTINGS', '');
|
||||
|
||||
$lang = isset( $_REQUEST['lang'] ) ? $_REQUEST['lang'] : 'en';
|
||||
$lang = isset($_REQUEST['lang']) ? $_REQUEST['lang'] : 'en';
|
||||
//remove from memcache when this value is updated/created
|
||||
$memcache->delete( 'flagForgotPassword' );
|
||||
$memcache->delete('flagForgotPassword');
|
||||
|
||||
$response = new stdclass();
|
||||
$response->success = true;
|
||||
|
||||
$messEnableForgotPassword = (isset($conf->aConfig["login_enableForgotPassword"]) && $conf->aConfig["login_enableForgotPassword"] == "1")? G::LoadTranslation("ID_YES") : G::LoadTranslation("ID_NO");
|
||||
G::auditLog("UpdateLoginSettings", "DefaultLanguage-> " . $lang . " EnableForgotPassword-> " . $messEnableForgotPassword);
|
||||
$messEnableForgotPassword = (isset($conf->aConfig["login_enableForgotPassword"]) && $conf->aConfig["login_enableForgotPassword"] == "1") ? G::LoadTranslation("ID_YES") : G::LoadTranslation("ID_NO");
|
||||
G::auditLog("UpdateLoginSettings",
|
||||
"DefaultLanguage-> " . $lang . " EnableForgotPassword-> " . $messEnableForgotPassword);
|
||||
|
||||
echo G::json_encode( $response );
|
||||
echo G::json_encode($response);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -22,28 +22,27 @@
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
|
||||
$RBAC->requirePermissions( 'PM_SETUP', 'PM_USERS' );
|
||||
$RBAC->requirePermissions('PM_SETUP', 'PM_USERS');
|
||||
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_ID_MENU_SELECTED = 'SETUP';
|
||||
$G_PUBLISH = new Publisher();
|
||||
|
||||
if (isset( $_GET['i18'] ))
|
||||
$_SESSION['DEV_FLAG'] = $_SESSION['TOOLS_VIEWTYPE'] = isset( $_GET['i18'] );
|
||||
else {
|
||||
unset( $_SESSION['DEV_FLAG'] );
|
||||
unset( $_SESSION['TOOLS_VIEWTYPE'] );
|
||||
if (isset($_GET['i18'])) {
|
||||
$_SESSION['DEV_FLAG'] = $_SESSION['TOOLS_VIEWTYPE'] = isset($_GET['i18']);
|
||||
} else {
|
||||
unset($_SESSION['DEV_FLAG']);
|
||||
unset($_SESSION['TOOLS_VIEWTYPE']);
|
||||
}
|
||||
|
||||
if (isset( $_GET['s'] ))
|
||||
if (isset($_GET['s'])) {
|
||||
$_SESSION['ADMIN_SELECTED'] = $_GET['s'];
|
||||
else {
|
||||
unset( $_SESSION['ADMIN_SELECTED'] );
|
||||
} else {
|
||||
unset($_SESSION['ADMIN_SELECTED']);
|
||||
}
|
||||
|
||||
$G_PUBLISH->AddContent( 'view', 'setup/main_Load' );
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
$G_PUBLISH->AddContent('view', 'setup/main_Load');
|
||||
$oHeadPublisher = headPublisher::getSingleton();
|
||||
$oHeadPublisher->addScriptFile('/jscore/src/PM.js');
|
||||
$oHeadPublisher->addScriptFile('/jscore/src/Sessions.js');
|
||||
G::RenderPage( 'publish' );
|
||||
|
||||
G::RenderPage('publish');
|
||||
|
||||
@@ -22,32 +22,32 @@
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
|
||||
$RBAC->requirePermissions( "PM_SETUP", "PM_USERS" );
|
||||
$RBAC->requirePermissions("PM_SETUP", "PM_USERS");
|
||||
|
||||
///////
|
||||
$adminSelected = null;
|
||||
|
||||
if (isset( $_REQUEST["s"] )) {
|
||||
if (isset($_REQUEST["s"])) {
|
||||
$adminSelected = $_REQUEST["s"];
|
||||
} else {
|
||||
if (isset( $_SESSION["ADMIN_SELECTED"] )) {
|
||||
if (isset($_SESSION["ADMIN_SELECTED"])) {
|
||||
$adminSelected = $_SESSION["ADMIN_SELECTED"];
|
||||
}
|
||||
}
|
||||
|
||||
///////
|
||||
$oHeadPublisher = &headPublisher::getSingleton();
|
||||
$oHeadPublisher = headPublisher::getSingleton();
|
||||
|
||||
global $G_TMP_MENU;
|
||||
|
||||
$oMenu = new Menu();
|
||||
$oMenu->load( "setup" );
|
||||
$items = array ();
|
||||
$oMenu->load("setup");
|
||||
$items = array();
|
||||
|
||||
$menuTypes = array_unique( $oMenu->Types );
|
||||
$menuTypes = array_unique($oMenu->Types);
|
||||
foreach ($menuTypes as $i => $v) {
|
||||
if ($v == "admToolsContent") {
|
||||
unset( $menuTypes[$i] );
|
||||
unset($menuTypes[$i]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -55,18 +55,18 @@ foreach ($menuTypes as $i => $v) {
|
||||
//sort($menuTypes);
|
||||
|
||||
|
||||
$tabItems = array ();
|
||||
$tabItems = array();
|
||||
$i = 0;
|
||||
|
||||
foreach ($menuTypes as $menuType) {
|
||||
$tabItems[$i] = new stdclass();
|
||||
$tabItems[$i]->id = $menuType;
|
||||
$LABEL_TRANSLATION = G::LoadTranslation( "ID_" . strtoupper( $menuType ) );
|
||||
$LABEL_TRANSLATION = G::LoadTranslation("ID_" . strtoupper($menuType));
|
||||
|
||||
if (substr( $LABEL_TRANSLATION, 0, 2 ) !== "**") {
|
||||
if (substr($LABEL_TRANSLATION, 0, 2) !== "**") {
|
||||
$title = $LABEL_TRANSLATION;
|
||||
} else {
|
||||
$title = str_replace( "_", " ", ucwords( $menuType ) );
|
||||
$title = str_replace("_", " ", ucwords($menuType));
|
||||
}
|
||||
|
||||
$tabItems[$i]->title = $title;
|
||||
@@ -79,38 +79,37 @@ $tabActive = "";
|
||||
if ($adminSelected != null) {
|
||||
foreach ($oMenu->Options as $i => $option) {
|
||||
if ($oMenu->Id[$i] == $adminSelected) {
|
||||
$tabActive = (in_array( $oMenu->Types[$i], array ("","admToolsContent"
|
||||
) )) ? "plugins" : $oMenu->Types[$i];
|
||||
$tabActive = (in_array($oMenu->Types[$i], array("","admToolsContent"
|
||||
))) ? "plugins" : $oMenu->Types[$i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
///////
|
||||
$oHeadPublisher->addExtJsScript( "setup/main", true ); //adding a javascript file .js
|
||||
$oHeadPublisher->addContent( "setup/main" ); //adding a html file .html.
|
||||
$oHeadPublisher->assign( "tabActive", $tabActive );
|
||||
$oHeadPublisher->assign( "tabItems", $tabItems );
|
||||
$oHeadPublisher->assign( "_item_selected", (($adminSelected != null) ? $adminSelected : "") );
|
||||
$oHeadPublisher->addExtJsScript("setup/main", true); //adding a javascript file .js
|
||||
$oHeadPublisher->addContent("setup/main"); //adding a html file .html.
|
||||
$oHeadPublisher->assign("tabActive", $tabActive);
|
||||
$oHeadPublisher->assign("tabItems", $tabItems);
|
||||
$oHeadPublisher->assign("_item_selected", (($adminSelected != null) ? $adminSelected : ""));
|
||||
|
||||
$oServerConf = & ServerConf::getSingleton();
|
||||
if ($oServerConf->isRtl( SYS_LANG )) {
|
||||
$oServerConf = ServerConf::getSingleton();
|
||||
if ($oServerConf->isRtl(SYS_LANG)) {
|
||||
$regionTreePanel = 'east';
|
||||
$regionDebug = 'west';
|
||||
} else {
|
||||
$regionTreePanel = 'west';
|
||||
$regionDebug = 'east';
|
||||
}
|
||||
$oHeadPublisher->assign( 'regionTreePanel', $regionTreePanel );
|
||||
$oHeadPublisher->assign('regionTreePanel', $regionTreePanel);
|
||||
|
||||
G::RenderPage( "publish", "extJs" );
|
||||
G::RenderPage("publish", "extJs");
|
||||
|
||||
//this patch enables the load of the plugin list panel inside de main admin panel iframe
|
||||
if (isset( $_GET["action"] ) && $_GET["action"] == "pluginsList") {
|
||||
if (isset($_GET["action"]) && $_GET["action"] == "pluginsList") {
|
||||
echo "
|
||||
<script type=\"text/javascript\">
|
||||
document.getElementById(\"setup-frame\").src = \"pluginsList\";
|
||||
</script>
|
||||
";
|
||||
}
|
||||
|
||||
|
||||
@@ -28,12 +28,12 @@ use ProcessMaker\Core\System;
|
||||
use ProcessMaker\Plugins\PluginRegistry;
|
||||
|
||||
global $RBAC;
|
||||
$RBAC->requirePermissions( 'PM_SETUP_ADVANCE' );
|
||||
$RBAC->requirePermissions('PM_SETUP_ADVANCE');
|
||||
|
||||
try {
|
||||
//load the variables
|
||||
if (! isset( $_FILES['form']['error']['PLUGIN_FILENAME'] ) || $_FILES['form']['error']['PLUGIN_FILENAME'] == 1) {
|
||||
throw (new Exception( G::loadTranslation( 'ID_ERROR_UPLOADING_PLUGIN_FILENAME' ) ));
|
||||
if (!isset($_FILES['form']['error']['PLUGIN_FILENAME']) || $_FILES['form']['error']['PLUGIN_FILENAME'] == 1) {
|
||||
throw (new Exception(G::loadTranslation('ID_ERROR_UPLOADING_PLUGIN_FILENAME')));
|
||||
}
|
||||
|
||||
//save the file
|
||||
@@ -41,7 +41,7 @@ try {
|
||||
$filename = $_FILES['form']['name']['PLUGIN_FILENAME'];
|
||||
$path = PATH_DOCUMENT . 'input' . PATH_SEP;
|
||||
$tempName = $_FILES['form']['tmp_name']['PLUGIN_FILENAME'];
|
||||
G::uploadFile( $tempName, $path, $filename );
|
||||
G::uploadFile($tempName, $path, $filename);
|
||||
}
|
||||
|
||||
//save the files Enterprise
|
||||
@@ -49,11 +49,9 @@ try {
|
||||
$filename = $_FILES['form']['name']['PLUGIN_FILENAME'];
|
||||
$path = PATH_DOCUMENT . 'input' . PATH_SEP;
|
||||
if (strpos($filename, 'enterprise') !== false) {
|
||||
|
||||
|
||||
$tar = new Archive_Tar( $path . $filename );
|
||||
$sFileName = substr( $filename, 0, strrpos( $filename, '.' ) );
|
||||
$sClassName = substr( $filename, 0, strpos( $filename, '-' ) );
|
||||
$tar = new Archive_Tar($path . $filename);
|
||||
$sFileName = substr($filename, 0, strrpos($filename, '.'));
|
||||
$sClassName = substr($filename, 0, strpos($filename, '-'));
|
||||
$sClassName = !empty($sClassName) ? $sClassName : $sFileName;
|
||||
|
||||
$files = $tar->listContent();
|
||||
@@ -67,8 +65,8 @@ try {
|
||||
$licenseName = trim($val['filename']);
|
||||
}
|
||||
}
|
||||
$tar->extractList( $listFiles, PATH_PLUGINS . 'data');
|
||||
$tar->extractList( $licenseName, PATH_PLUGINS);
|
||||
$tar->extractList($listFiles, PATH_PLUGINS . 'data');
|
||||
$tar->extractList($licenseName, PATH_PLUGINS);
|
||||
|
||||
$pluginRegistry = PluginRegistry::loadSingleton();
|
||||
$autoPlugins = glob(PATH_PLUGINS . "data/enterprise/data/*.tar");
|
||||
@@ -83,14 +81,14 @@ try {
|
||||
}
|
||||
|
||||
$aPlugins = $autoPluginsA;
|
||||
foreach ($aPlugins as $key=>$aPlugin) {
|
||||
foreach ($aPlugins as $key => $aPlugin) {
|
||||
$sClassName = substr($aPlugin["sFilename"], 0, strpos($aPlugin["sFilename"], "-"));
|
||||
|
||||
$oTar = new Archive_Tar(PATH_PLUGINS . "data/enterprise/data/" . $aPlugin["sFilename"]);
|
||||
$oTar->extract(PATH_PLUGINS);
|
||||
|
||||
if (!(class_exists($sClassName))) {
|
||||
require_once (PATH_PLUGINS . $sClassName . ".php");
|
||||
require_once(PATH_PLUGINS . $sClassName . ".php");
|
||||
}
|
||||
|
||||
$pluginDetail = $pluginRegistry->getPluginDetails($sClassName . ".php");
|
||||
@@ -99,20 +97,20 @@ try {
|
||||
}
|
||||
$licfile = glob(PATH_PLUGINS . "*.dat");
|
||||
|
||||
if ((isset($licfile[0])) && ( is_file($licfile[0]) )) {
|
||||
if ((isset($licfile[0])) && (is_file($licfile[0]))) {
|
||||
$licfilename = basename($licfile[0]);
|
||||
@copy($licfile[0], PATH_DATA_SITE . $licfilename);
|
||||
@unlink($licfile[0]);
|
||||
}
|
||||
|
||||
require_once ('classes/model/AddonsStore.php');
|
||||
require_once('classes/model/AddonsStore.php');
|
||||
AddonsStore::checkLicenseStore();
|
||||
$licenseManager = &PmLicenseManager::getSingleton();
|
||||
$licenseManager = PmLicenseManager::getSingleton();
|
||||
AddonsStore::updateAll(false);
|
||||
|
||||
$message = G::loadTranslation( 'ID_ENTERPRISE_INSTALLED') . ' ' . G::loadTranslation( 'ID_LOG_AGAIN');
|
||||
$message = G::loadTranslation('ID_ENTERPRISE_INSTALLED') . ' ' . G::loadTranslation('ID_LOG_AGAIN');
|
||||
G::SendMessageText($message, "INFO");
|
||||
$licenseManager = &PmLicenseManager::getSingleton();
|
||||
$licenseManager = PmLicenseManager::getSingleton();
|
||||
die('<script type="text/javascript">parent.parent.location = "../login/login";</script>');
|
||||
}
|
||||
}
|
||||
@@ -122,11 +120,9 @@ try {
|
||||
$filename = $_FILES['form']['name']['PLUGIN_FILENAME'];
|
||||
$path = PATH_DOCUMENT . 'input' . PATH_SEP;
|
||||
if (strpos($filename, 'plugins-') !== false) {
|
||||
|
||||
|
||||
$tar = new Archive_Tar( $path . $filename );
|
||||
$sFileName = substr( $filename, 0, strrpos( $filename, '.' ) );
|
||||
$sClassName = substr( $filename, 0, strpos( $filename, '-' ) );
|
||||
$tar = new Archive_Tar($path . $filename);
|
||||
$sFileName = substr($filename, 0, strrpos($filename, '.'));
|
||||
$sClassName = substr($filename, 0, strpos($filename, '-'));
|
||||
$sClassName = !empty($sClassName) ? $sClassName : $sFileName;
|
||||
|
||||
$files = $tar->listContent();
|
||||
@@ -140,8 +136,8 @@ try {
|
||||
$licenseName = trim($val['filename']);
|
||||
}
|
||||
}
|
||||
$tar->extractList( $listFiles, PATH_PLUGINS . 'data');
|
||||
$tar->extractList( $licenseName, PATH_PLUGINS);
|
||||
$tar->extractList($listFiles, PATH_PLUGINS . 'data');
|
||||
$tar->extractList($licenseName, PATH_PLUGINS);
|
||||
|
||||
$pluginRegistry = PluginRegistry::loadSingleton();
|
||||
$autoPlugins = glob(PATH_PLUGINS . "data/plugins/*.tar");
|
||||
@@ -149,21 +145,20 @@ try {
|
||||
|
||||
foreach ($autoPlugins as $filePath) {
|
||||
$plName = basename($filePath);
|
||||
//if (!(in_array($plName, $def))) {
|
||||
if (strpos($plName, 'enterprise') === false) {
|
||||
$autoPluginsA[]["sFilename"] = $plName;
|
||||
}
|
||||
}
|
||||
|
||||
$aPlugins = $autoPluginsA;
|
||||
foreach ($aPlugins as $key=>$aPlugin) {
|
||||
foreach ($aPlugins as $key => $aPlugin) {
|
||||
$sClassName = substr($aPlugin["sFilename"], 0, strpos($aPlugin["sFilename"], "-"));
|
||||
|
||||
$oTar = new Archive_Tar(PATH_PLUGINS . "data/plugins/" . $aPlugin["sFilename"]);
|
||||
$oTar->extract(PATH_PLUGINS);
|
||||
|
||||
if (!(class_exists($sClassName))) {
|
||||
require_once (PATH_PLUGINS . $sClassName . ".php");
|
||||
require_once(PATH_PLUGINS . $sClassName . ".php");
|
||||
}
|
||||
|
||||
$pluginDetail = $pluginRegistry->getPluginDetails($sClassName . ".php");
|
||||
@@ -173,48 +168,50 @@ try {
|
||||
|
||||
$licfile = glob(PATH_PLUGINS . "*.dat");
|
||||
|
||||
if ((isset($licfile[0])) && ( is_file($licfile[0]) )) {
|
||||
if ((isset($licfile[0])) && (is_file($licfile[0]))) {
|
||||
$licfilename = basename($licfile[0]);
|
||||
@copy($licfile[0], PATH_DATA_SITE . $licfilename);
|
||||
@unlink($licfile[0]);
|
||||
}
|
||||
|
||||
require_once ('classes/model/AddonsStore.php');
|
||||
require_once('classes/model/AddonsStore.php');
|
||||
AddonsStore::checkLicenseStore();
|
||||
$licenseManager = &PmLicenseManager::getSingleton();
|
||||
$licenseManager = PmLicenseManager::getSingleton();
|
||||
AddonsStore::updateAll(false);
|
||||
|
||||
$message = G::loadTranslation( 'ID_ENTERPRISE_INSTALLED') . ' ' . G::loadTranslation( 'ID_LOG_AGAIN');
|
||||
$message = G::loadTranslation('ID_ENTERPRISE_INSTALLED') . ' ' . G::loadTranslation('ID_LOG_AGAIN');
|
||||
G::SendMessageText($message, "INFO");
|
||||
$licenseManager = &PmLicenseManager::getSingleton();
|
||||
$licenseManager = PmLicenseManager::getSingleton();
|
||||
die('<script type="text/javascript">parent.parent.location = "../login/login";</script>');
|
||||
}
|
||||
}
|
||||
|
||||
if (! $_FILES['form']['type']['PLUGIN_FILENAME'] == 'application/octet-stream') {
|
||||
if (!$_FILES['form']['type']['PLUGIN_FILENAME'] == 'application/octet-stream') {
|
||||
$pluginFilename = $_FILES['form']['type']['PLUGIN_FILENAME'];
|
||||
throw (new Exception( G::loadTranslation( 'ID_FILES_INVALID_PLUGIN_FILENAME', SYS_LANG, array ("pluginFilename" => $pluginFilename
|
||||
) ) ));
|
||||
throw new Exception(G::loadTranslation('ID_FILES_INVALID_PLUGIN_FILENAME', SYS_LANG, array("pluginFilename" => $pluginFilename
|
||||
)));
|
||||
}
|
||||
|
||||
|
||||
$tar = new Archive_Tar( $path . $filename );
|
||||
$sFileName = substr( $filename, 0, strrpos( $filename, '.' ) );
|
||||
$sClassName = substr( $filename, 0, strpos( $filename, '-' ) );
|
||||
$tar = new Archive_Tar($path . $filename);
|
||||
$sFileName = substr($filename, 0, strrpos($filename, '.'));
|
||||
$sClassName = substr($filename, 0, strpos($filename, '-'));
|
||||
$sClassName = !empty($sClassName) ? $sClassName : $sFileName;
|
||||
|
||||
$aFiles = $tar->listContent();
|
||||
$bMainFile = false;
|
||||
$bClassFile = false;
|
||||
if (! is_array( $aFiles )) {
|
||||
throw (new Exception( G::loadTranslation( 'ID_FAILED_IMPORT_PLUGINS', SYS_LANG, array ("filename" => $filename
|
||||
) ) ));
|
||||
if (!is_array($aFiles)) {
|
||||
throw new Exception(G::loadTranslation('ID_FAILED_IMPORT_PLUGINS', SYS_LANG, array("filename" => $filename
|
||||
)));
|
||||
}
|
||||
foreach ($aFiles as $key => $val) {
|
||||
if (trim($val['filename']) == $sClassName . '.php')
|
||||
if (trim($val['filename']) == $sClassName . '.php') {
|
||||
$bMainFile = true;
|
||||
if (trim($val['filename']) == $sClassName . PATH_SEP . 'class.' . $sClassName . '.php')
|
||||
}
|
||||
if (trim($val['filename']) == $sClassName . PATH_SEP . 'class.' . $sClassName . '.php') {
|
||||
$bClassFile = true;
|
||||
}
|
||||
}
|
||||
|
||||
$partnerFlag = (defined('PARTNER_FLAG')) ? PARTNER_FLAG : false;
|
||||
@@ -229,18 +226,18 @@ try {
|
||||
if ($bMainFile && $bClassFile) {
|
||||
$sAux = $sClassName . 'Plugin';
|
||||
$fVersionOld = 0.0;
|
||||
if (file_exists( PATH_PLUGINS . $pluginFile )) {
|
||||
if (! class_exists( $sAux ) && ! class_exists( $sClassName . 'plugin' )) {
|
||||
if (file_exists(PATH_PLUGINS . $pluginFile)) {
|
||||
if (!class_exists($sAux) && !class_exists($sClassName . 'plugin')) {
|
||||
include PATH_PLUGINS . $pluginFile;
|
||||
}
|
||||
if (! class_exists( $sAux )) {
|
||||
if (!class_exists($sAux)) {
|
||||
$sAux = $sClassName . 'plugin';
|
||||
}
|
||||
$oClass = new $sAux( $sClassName );
|
||||
$oClass = new $sAux($sClassName);
|
||||
$fVersionOld = $oClass->iVersion;
|
||||
unset( $oClass );
|
||||
unset($oClass);
|
||||
}
|
||||
$res = $tar->extract( $path );
|
||||
$res = $tar->extract($path);
|
||||
|
||||
//Check if is enterprise plugin
|
||||
if ($oPluginRegistry->isEnterprisePlugin($sClassName, $path)) {
|
||||
@@ -262,22 +259,22 @@ try {
|
||||
/*----------------------------------********---------------------------------*/
|
||||
|
||||
//Get contents of plugin file
|
||||
$sContent = file_get_contents( $path . $pluginFile );
|
||||
$sContent = str_ireplace( $sAux, $sAux . '_', $sContent );
|
||||
$sContent = str_ireplace( 'PATH_PLUGINS', "'" . $path . "'", $sContent );
|
||||
$sContent = preg_replace( "/\\\$oPluginRegistry\s*=\s*&\s*PMPluginRegistry::getSingleton\s*\(\s*\)\s*;/i", null, $sContent );
|
||||
$sContent = preg_replace( "/\\\$oPluginRegistry->registerPlugin\s*\(\s*[\"\']" . $sClassName . "[\"\']\s*,\s*__FILE__\s*\)\s*;/i", null, $sContent );
|
||||
$sContent = file_get_contents($path . $pluginFile);
|
||||
$sContent = str_ireplace($sAux, $sAux . '_', $sContent);
|
||||
$sContent = str_ireplace('PATH_PLUGINS', "'" . $path . "'", $sContent);
|
||||
$sContent = preg_replace("/\\\$oPluginRegistry\s*=\s*&\s*PMPluginRegistry::getSingleton\s*\(\s*\)\s*;/i", null, $sContent);
|
||||
$sContent = preg_replace("/\\\$oPluginRegistry->registerPlugin\s*\(\s*[\"\']" . $sClassName . "[\"\']\s*,\s*__FILE__\s*\)\s*;/i", null, $sContent);
|
||||
|
||||
//header('Content-Type: text/plain');var_dump($sClassName, $sContent);die;
|
||||
file_put_contents( $path . $pluginFile, $sContent );
|
||||
file_put_contents($path . $pluginFile, $sContent);
|
||||
|
||||
$sAux = $sAux . '_';
|
||||
|
||||
include ($path . $pluginFile);
|
||||
include($path . $pluginFile);
|
||||
|
||||
$oClass = new $sAux( $sClassName );
|
||||
$oClass = new $sAux($sClassName);
|
||||
$fVersionNew = $oClass->iVersion;
|
||||
if (! isset( $oClass->iPMVersion )) {
|
||||
if (!isset($oClass->iPMVersion)) {
|
||||
$oClass->iPMVersion = 0;
|
||||
}
|
||||
if ($oClass->iPMVersion > 0) {
|
||||
@@ -287,45 +284,45 @@ try {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (! isset( $oClass->aDependences )) {
|
||||
if (!isset($oClass->aDependences)) {
|
||||
$oClass->aDependences = null;
|
||||
}
|
||||
if (! empty( $oClass->aDependences )) {
|
||||
if (!empty($oClass->aDependences)) {
|
||||
foreach ($oClass->aDependences as $aDependence) {
|
||||
if (file_exists( PATH_PLUGINS . $aDependence['sClassName'] . '.php' )) {
|
||||
if (file_exists(PATH_PLUGINS . $aDependence['sClassName'] . '.php')) {
|
||||
require_once PATH_PLUGINS . $aDependence['sClassName'] . '.php';
|
||||
if (! $oPluginRegistry->getPluginDetails( $aDependence['sClassName'] . '.php' )) {
|
||||
if (!$oPluginRegistry->getPluginDetails($aDependence['sClassName'] . '.php')) {
|
||||
$sDependence = $aDependence['sClassName'];
|
||||
throw new Exception( G::loadTranslation( 'ID_PLUGIN_DEPENDENCE_PLUGIN', SYS_LANG, array ("Dependence" => $sDependence
|
||||
) ) );
|
||||
throw new Exception(G::loadTranslation('ID_PLUGIN_DEPENDENCE_PLUGIN', SYS_LANG, array("Dependence" => $sDependence
|
||||
)));
|
||||
}
|
||||
} else {
|
||||
$sDependence = $aDependence['sClassName'];
|
||||
throw new Exception( G::loadTranslation( 'ID_PLUGIN_DEPENDENCE_PLUGIN', SYS_LANG, array ("Dependence" => $sDependence
|
||||
) ) );
|
||||
throw new Exception(G::loadTranslation('ID_PLUGIN_DEPENDENCE_PLUGIN', SYS_LANG, array("Dependence" => $sDependence
|
||||
)));
|
||||
}
|
||||
}
|
||||
}
|
||||
unset( $oClass );
|
||||
unset($oClass);
|
||||
if ($fVersionOld > $fVersionNew) {
|
||||
throw new Exception( G::loadTranslation( 'ID_RECENT_VERSION_PLUGIN' ) );
|
||||
throw new Exception(G::loadTranslation('ID_RECENT_VERSION_PLUGIN'));
|
||||
}
|
||||
$res = $tar->extract( PATH_PLUGINS );
|
||||
$res = $tar->extract(PATH_PLUGINS);
|
||||
} else {
|
||||
throw (new Exception( G::loadTranslation( 'ID_FILE_CONTAIN_CLASS_PLUGIN', SYS_LANG, array ("filename" => $filename,"className" => $sClassName
|
||||
) ) ));
|
||||
throw new Exception(G::loadTranslation('ID_FILE_CONTAIN_CLASS_PLUGIN', SYS_LANG, array("filename" => $filename, "className" => $sClassName
|
||||
)));
|
||||
}
|
||||
|
||||
if (! file_exists( PATH_PLUGINS . $sClassName . '.php' )) {
|
||||
throw (new Exception( G::loadTranslation( 'ID_FILE_PLUGIN_NOT_EXISTS', SYS_LANG, array ("pluginFile" => $pluginFile
|
||||
) ) ));
|
||||
if (!file_exists(PATH_PLUGINS . $sClassName . '.php')) {
|
||||
throw new Exception(G::loadTranslation('ID_FILE_PLUGIN_NOT_EXISTS', SYS_LANG, array("pluginFile" => $pluginFile
|
||||
)));
|
||||
}
|
||||
|
||||
require_once (PATH_PLUGINS . $pluginFile);
|
||||
require_once(PATH_PLUGINS . $pluginFile);
|
||||
|
||||
$oPluginRegistry->registerPlugin( $sClassName, PATH_PLUGINS . $sClassName . ".php" );
|
||||
$oPluginRegistry->registerPlugin($sClassName, PATH_PLUGINS . $sClassName . ".php");
|
||||
|
||||
$details = $oPluginRegistry->getPluginDetails( $pluginFile );
|
||||
$details = $oPluginRegistry->getPluginDetails($pluginFile);
|
||||
|
||||
$oPluginRegistry->installPlugin($details->getNamespace());
|
||||
|
||||
@@ -334,16 +331,10 @@ try {
|
||||
|
||||
$response = $oPluginRegistry->verifyTranslation($details->getNamespace());
|
||||
G::auditLog("InstallPlugin", "Plugin Name: " . $details->getNamespace());
|
||||
|
||||
//if ($response->recordsCountSuccess <= 0) {
|
||||
//throw (new Exception( 'The plugin ' . $details->sNamespace . ' couldn\'t verify any translation item. Verified Records:' . $response->recordsCountSuccess));
|
||||
//}
|
||||
|
||||
G::header( "Location: pluginsMain" );
|
||||
G::header("Location: pluginsMain");
|
||||
die();
|
||||
} catch (Exception $e) {
|
||||
$_SESSION['__PLUGIN_ERROR__'] = $e->getMessage();
|
||||
G::header( 'Location: pluginsMain' );
|
||||
G::header('Location: pluginsMain');
|
||||
die();
|
||||
}
|
||||
|
||||
|
||||
@@ -26,21 +26,21 @@ use ProcessMaker\Plugins\PluginRegistry;
|
||||
|
||||
/** @var RBAC $RBAC */
|
||||
global $RBAC;
|
||||
$RBAC->requirePermissions( 'PM_SETUP' );
|
||||
$RBAC->requirePermissions('PM_SETUP');
|
||||
|
||||
$headPublisher = & headPublisher::getSingleton();
|
||||
$headPublisher->addExtJsScript( 'setup/pluginsMain', false );
|
||||
$headPublisher->assign( "PROCESSMAKER_URL", "/sys" . config("system.workspace") . "/" . SYS_LANG . "/" . SYS_SKIN );
|
||||
$headPublisher->assign( "SYS_SKIN", SYS_SKIN );
|
||||
$headPublisher = headPublisher::getSingleton();
|
||||
$headPublisher->addExtJsScript('setup/pluginsMain', false);
|
||||
$headPublisher->assign("PROCESSMAKER_URL", "/sys" . config("system.workspace") . "/" . SYS_LANG . "/" . SYS_SKIN);
|
||||
$headPublisher->assign("SYS_SKIN", SYS_SKIN);
|
||||
|
||||
$oPluginRegistry = PluginRegistry::loadSingleton();
|
||||
if ($oPluginRegistry->getStatusPlugin('pmWorkspaceManagement') && $oPluginRegistry->getStatusPlugin('pmWorkspaceManagement') == "enabled") {
|
||||
$headPublisher = $oPluginRegistry->executeMethod('pmWorkspaceManagement', 'disableButtonsPluginMain', $headPublisher);
|
||||
$headPublisher = $oPluginRegistry->executeMethod('pmWorkspaceManagement', 'disableButtonsPluginMain',
|
||||
$headPublisher);
|
||||
}
|
||||
|
||||
if (isset( $_SESSION['__PLUGIN_ERROR__'] )) {
|
||||
$headPublisher->assign( '__PLUGIN_ERROR__', $_SESSION['__PLUGIN_ERROR__'] );
|
||||
unset( $_SESSION['__PLUGIN_ERROR__'] );
|
||||
if (isset($_SESSION['__PLUGIN_ERROR__'])) {
|
||||
$headPublisher->assign('__PLUGIN_ERROR__', $_SESSION['__PLUGIN_ERROR__']);
|
||||
unset($_SESSION['__PLUGIN_ERROR__']);
|
||||
}
|
||||
G::RenderPage( 'publish', 'extJs' );
|
||||
|
||||
G::RenderPage('publish', 'extJs');
|
||||
@@ -3,29 +3,27 @@
|
||||
switch ($_GET['action']) {
|
||||
case 'saveOption':
|
||||
try {
|
||||
$oServerConf = & ServerConf::getSingleton();
|
||||
$oServerConf = ServerConf::getSingleton();
|
||||
$response = new stdclass();
|
||||
/*you can use SYS_TEMP or SYS_SYS ON HEAR_BEAT_CONF to save for each workspace*/
|
||||
$oServerConf->unsetHeartbeatProperty( 'HB_BEAT_TYPE', 'HEART_BEAT_CONF' );
|
||||
if (isset( $_POST['acceptHB'] )) {
|
||||
$oServerConf->setHeartbeatProperty( 'HB_OPTION', 1, 'HEART_BEAT_CONF' );
|
||||
$oServerConf->unsetHeartbeatProperty( 'HB_NEXT_BEAT_DATE', 'HEART_BEAT_CONF' );
|
||||
$oServerConf->unsetHeartbeatProperty('HB_BEAT_TYPE', 'HEART_BEAT_CONF');
|
||||
if (isset($_POST['acceptHB'])) {
|
||||
$oServerConf->setHeartbeatProperty('HB_OPTION', 1, 'HEART_BEAT_CONF');
|
||||
$oServerConf->unsetHeartbeatProperty('HB_NEXT_BEAT_DATE', 'HEART_BEAT_CONF');
|
||||
$response->enable = true;
|
||||
G::auditLog("EnableHeartBeat");
|
||||
} else {
|
||||
$oServerConf->setHeartbeatProperty( 'HB_OPTION', 0, 'HEART_BEAT_CONF' );
|
||||
$oServerConf->unsetHeartbeatProperty( 'HB_NEXT_BEAT_DATE', 'HEART_BEAT_CONF' );
|
||||
$oServerConf->setHeartbeatProperty( 'HB_BEAT_TYPE', 'endbeat', 'HEART_BEAT_CONF' );
|
||||
$oServerConf->setHeartbeatProperty('HB_OPTION', 0, 'HEART_BEAT_CONF');
|
||||
$oServerConf->unsetHeartbeatProperty('HB_NEXT_BEAT_DATE', 'HEART_BEAT_CONF');
|
||||
$oServerConf->setHeartbeatProperty('HB_BEAT_TYPE', 'endbeat', 'HEART_BEAT_CONF');
|
||||
$response->enable = false;
|
||||
G::auditLog("DisableHeartBeat");
|
||||
}
|
||||
$response->success = true;
|
||||
|
||||
} catch (Exception $e) {
|
||||
$response->success = false;
|
||||
$response->msg = $e->getMessage();
|
||||
}
|
||||
echo G::json_encode( $response );
|
||||
echo G::json_encode($response);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -22,18 +22,17 @@
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
global $RBAC;
|
||||
$RBAC->requirePermissions( 'PM_SETUP', 'PM_SETUP_HEART_BEAT');
|
||||
$RBAC->requirePermissions('PM_SETUP', 'PM_SETUP_HEART_BEAT');
|
||||
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
$oServerConf = & ServerConf::getSingleton();
|
||||
$oHeadPublisher = headPublisher::getSingleton();
|
||||
$oServerConf = ServerConf::getSingleton();
|
||||
|
||||
//you can use SYS_TEMP or SYS_SYS ON HEAR_BEAT_CONF to save for each workspace
|
||||
$sflag = $oServerConf->getHeartbeatProperty( 'HB_OPTION', 'HEART_BEAT_CONF' );
|
||||
$sflag = $oServerConf->getHeartbeatProperty('HB_OPTION', 'HEART_BEAT_CONF');
|
||||
$heartBeatChecked = $sflag == 1 ? true : false;
|
||||
|
||||
$oHeadPublisher->addExtJsScript( 'setup/processHeartBeatConfig', true ); //adding a javascript file .js
|
||||
$oHeadPublisher->addExtJsScript('setup/processHeartBeatConfig', true); //adding a javascript file .js
|
||||
|
||||
|
||||
$oHeadPublisher->assign( 'heartBeatChecked', $heartBeatChecked );
|
||||
G::RenderPage( 'publish', 'extJs' );
|
||||
|
||||
$oHeadPublisher->assign('heartBeatChecked', $heartBeatChecked);
|
||||
G::RenderPage('publish', 'extJs');
|
||||
|
||||
@@ -1,33 +1,29 @@
|
||||
<?php
|
||||
|
||||
if ($RBAC->userCanAccess( 'PM_SETUP' ) != 1 && $RBAC->userCanAccess( 'PM_SETUP_ADVANCE' ) != 1) {
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||
if ($RBAC->userCanAccess('PM_SETUP') != 1 && $RBAC->userCanAccess('PM_SETUP_ADVANCE') != 1) {
|
||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
|
||||
//G::header('location: ../login/login');
|
||||
die();
|
||||
}
|
||||
try {
|
||||
$oServerConf = & ServerConf::getSingleton();
|
||||
$oServerConf = ServerConf::getSingleton();
|
||||
/*you can use SYS_TEMP or SYS_SYS ON HEAR_BEAT_CONF to save for each workspace*/
|
||||
$sflag = $_POST['HB_OPTION'];
|
||||
$oServerConf->unsetHeartbeatProperty( 'HB_BEAT_TYPE', 'HEART_BEAT_CONF' );
|
||||
$oServerConf->unsetHeartbeatProperty('HB_BEAT_TYPE', 'HEART_BEAT_CONF');
|
||||
if ($sflag) {
|
||||
$oServerConf->setHeartbeatProperty( 'HB_OPTION', 1, 'HEART_BEAT_CONF' );
|
||||
$oServerConf->unsetHeartbeatProperty( 'HB_NEXT_BEAT_DATE', 'HEART_BEAT_CONF' );
|
||||
$oServerConf->setHeartbeatProperty('HB_OPTION', 1, 'HEART_BEAT_CONF');
|
||||
$oServerConf->unsetHeartbeatProperty('HB_NEXT_BEAT_DATE', 'HEART_BEAT_CONF');
|
||||
echo "active";
|
||||
} else {
|
||||
$oServerConf->setHeartbeatProperty( 'HB_OPTION', 0, 'HEART_BEAT_CONF' );
|
||||
$oServerConf->unsetHeartbeatProperty( 'HB_NEXT_BEAT_DATE', 'HEART_BEAT_CONF' );
|
||||
$oServerConf->setHeartbeatProperty( 'HB_BEAT_TYPE', 'endbeat', 'HEART_BEAT_CONF' );
|
||||
$oServerConf->setHeartbeatProperty('HB_OPTION', 0, 'HEART_BEAT_CONF');
|
||||
$oServerConf->unsetHeartbeatProperty('HB_NEXT_BEAT_DATE', 'HEART_BEAT_CONF');
|
||||
$oServerConf->setHeartbeatProperty('HB_BEAT_TYPE', 'endbeat', 'HEART_BEAT_CONF');
|
||||
echo "inactive";
|
||||
|
||||
}
|
||||
//$oServerConf->setHeartbeatProperty('HB_OPTION',$_POST['HB_OPTION'],'HEART_BEAT_CONF');
|
||||
|
||||
|
||||
} catch (Exception $e) {
|
||||
$G_PUBLISH = new Publisher();
|
||||
$aMessage['MESSAGE'] = $e->getMessage();
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
|
||||
G::RenderPage( 'publishBlank', 'blank' );
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage);
|
||||
G::RenderPage('publishBlank', 'blank');
|
||||
}
|
||||
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
|
||||
if ($RBAC->userCanAccess( 'PM_SETUP' ) != 1 && $RBAC->userCanAccess( 'PM_SETUP_ADVANCE' ) != 1) {
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||
if ($RBAC->userCanAccess('PM_SETUP') != 1 && $RBAC->userCanAccess('PM_SETUP_ADVANCE') != 1) {
|
||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
|
||||
//G::header('location: ../login/login');
|
||||
die();
|
||||
}
|
||||
@@ -36,94 +36,121 @@ $G_ID_SUB_MENU_SELECTED = 'CALENDAR';
|
||||
$G_PUBLISH = new Publisher();
|
||||
|
||||
$c = new Configurations();
|
||||
$configPage = $c->getConfiguration( 'skinList', 'pageSize', '', $_SESSION['USER_LOGGED'] );
|
||||
$Config['pageSize'] = isset( $configPage['pageSize'] ) ? $configPage['pageSize'] : 20;
|
||||
$configPage = $c->getConfiguration('skinList', 'pageSize', '', $_SESSION['USER_LOGGED']);
|
||||
$Config['pageSize'] = isset($configPage['pageSize']) ? $configPage['pageSize'] : 20;
|
||||
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
$oHeadPublisher->addExtJsScript( 'setup/skinList', false ); //adding a javascript file .js
|
||||
$oHeadPublisher->addContent( 'setup/skinList' ); //adding a html file .html.
|
||||
$oHeadPublisher->assign( 'CONFIG', $Config );
|
||||
$oHeadPublisher->assign( 'SYS_SKIN', SYS_SKIN );
|
||||
$oHeadPublisher->assign( 'SYS_SYS', "sys".config("system.workspace") );
|
||||
$oHeadPublisher = headPublisher::getSingleton();
|
||||
$oHeadPublisher->addExtJsScript('setup/skinList', false); //adding a javascript file .js
|
||||
$oHeadPublisher->addContent('setup/skinList'); //adding a html file .html.
|
||||
$oHeadPublisher->assign('CONFIG', $Config);
|
||||
$oHeadPublisher->assign('SYS_SKIN', SYS_SKIN);
|
||||
$oHeadPublisher->assign('SYS_SYS', "sys" . config("system.workspace"));
|
||||
$oHeadPublisher->assign('FORMATS', $c->getFormats());
|
||||
|
||||
$oHeadPublisher->assign( 'FORMATS', $c->getFormats() );
|
||||
|
||||
G::RenderPage( 'publish', 'extJs' );
|
||||
G::RenderPage('publish', 'extJs');
|
||||
die();
|
||||
|
||||
global $RBAC;
|
||||
$access = $RBAC->userCanAccess( 'PM_SETUP' );
|
||||
$access = $RBAC->userCanAccess('PM_SETUP');
|
||||
if ($access != 1) {
|
||||
switch ($access) {
|
||||
case - 1:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
case -1:
|
||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
|
||||
G::header('location: ../login/login');
|
||||
die();
|
||||
break;
|
||||
case - 2:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
case -2:
|
||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels');
|
||||
G::header('location: ../login/login');
|
||||
die();
|
||||
break;
|
||||
default:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
|
||||
G::header('location: ../login/login');
|
||||
die();
|
||||
break;
|
||||
}
|
||||
}
|
||||
// lets display the items
|
||||
$items[] = array ('id' => 'char','title' => 'char','type' => 'char','creator' => 'char','modifiedBy' => 'char','filename' => 'char','size' => 'char','mime' => 'char'
|
||||
);
|
||||
$items[] = [
|
||||
'id' => 'char',
|
||||
'title' => 'char',
|
||||
'type' => 'char',
|
||||
'creator' => 'char',
|
||||
'modifiedBy' => 'char',
|
||||
'filename' => 'char',
|
||||
'size' => 'char',
|
||||
'mime' => 'char'
|
||||
];
|
||||
|
||||
//***************** Skins **************************
|
||||
$aFiles = array ();
|
||||
if ($handle = opendir( PATH_SKINS )) {
|
||||
while (false !== ($file = readdir( $handle ))) {
|
||||
G::pr( $file );
|
||||
$filename = substr( $file, 0, strrpos( $file, '.' ) );
|
||||
$aFiles = [];
|
||||
if ($handle = opendir(PATH_SKINS)) {
|
||||
while (false !== ($file = readdir($handle))) {
|
||||
G::pr($file);
|
||||
$filename = substr($file, 0, strrpos($file, '.'));
|
||||
|
||||
// list of no complete skins
|
||||
$aFilterSkinsList = Array ('blank','green','raw','tracker','iphone','green-submenu','extJsInitLoad','extJs'
|
||||
);
|
||||
$aFilterSkinsList = [
|
||||
'blank',
|
||||
'green',
|
||||
'raw',
|
||||
'tracker',
|
||||
'iphone',
|
||||
'green-submenu',
|
||||
'extJsInitLoad',
|
||||
'extJs'
|
||||
];
|
||||
|
||||
if (! is_dir( PATH_SKINS . $file )) {
|
||||
if (! in_array( $filename, $aFilterSkinsList ) /*&& /*/ && ! strpos( $file, '.tar', 1 )) {
|
||||
if (! isset( $aFiles[$filename] ))
|
||||
if (!is_dir(PATH_SKINS . $file)) {
|
||||
if (!in_array($filename, $aFilterSkinsList) /*&& /*/ && !strpos($file, '.tar', 1)) {
|
||||
if (!isset($aFiles[$filename])) {
|
||||
$aFiles[$filename] = 0;
|
||||
if (strpos( $file, '.php', 1 ))
|
||||
}
|
||||
if (strpos($file, '.php', 1)) {
|
||||
$aFiles[$filename] += 1;
|
||||
if (strpos( $file, '.html', 1 ))
|
||||
}
|
||||
if (strpos($file, '.html', 1)) {
|
||||
$aFiles[$filename] += 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
closedir( $handle );
|
||||
closedir($handle);
|
||||
|
||||
//now walk in the array to get the .cnf file and display properties
|
||||
foreach ($aFiles as $key => $val) {
|
||||
$description = '';
|
||||
$version = '';
|
||||
if (file_exists( PATH_SKINS . $key . '.cnf' )) {
|
||||
$serial = file_get_contents( PATH_SKINS . $key . '.cnf' );
|
||||
$previousErrorRep = ini_get( "error_reporting" );
|
||||
error_reporting( E_ERROR );
|
||||
$prop = unserialize( $serial );
|
||||
error_reporting( $previousErrorRep );
|
||||
if (! is_object( $prop )) {
|
||||
@unlink( PATH_SKINS . $key . '.cnf' );
|
||||
if (file_exists(PATH_SKINS . $key . '.cnf')) {
|
||||
$serial = file_get_contents(PATH_SKINS . $key . '.cnf');
|
||||
$previousErrorRep = ini_get("error_reporting");
|
||||
error_reporting(E_ERROR);
|
||||
$prop = unserialize($serial);
|
||||
error_reporting($previousErrorRep);
|
||||
if (!is_object($prop)) {
|
||||
@unlink(PATH_SKINS . $key . '.cnf');
|
||||
}
|
||||
if (isset( $prop ) && isset( $prop->description ))
|
||||
if (isset($prop) && isset($prop->description)) {
|
||||
$description = $prop->description;
|
||||
if (isset( $prop ) && isset( $prop->version ))
|
||||
}
|
||||
if (isset($prop) && isset($prop->version)) {
|
||||
$version = $prop->version;
|
||||
}
|
||||
}
|
||||
|
||||
$linkPackValue = G::LoadTranslation( 'ID_EXPORT' );
|
||||
$linkPackValue = G::LoadTranslation('ID_EXPORT');
|
||||
$link = 'skinsExport?id=' . $key;
|
||||
$items[] = array ('id' => count( $items ),'name' => $key,'filename' => $key,'description' => $description,'version' => $version,'url' => $link,'linkPackValue' => $linkPackValue
|
||||
);
|
||||
$items[] = [
|
||||
'id' => count($items),
|
||||
'name' => $key,
|
||||
'filename' => $key,
|
||||
'description' => $description,
|
||||
'version' => $version,
|
||||
'url' => $link,
|
||||
'linkPackValue' => $linkPackValue
|
||||
];
|
||||
}
|
||||
$folders['items'] = $items;
|
||||
}
|
||||
@@ -131,9 +158,9 @@ if ($handle = opendir( PATH_SKINS )) {
|
||||
$_DBArray['plugins'] = $items;
|
||||
$_SESSION['_DBArray'] = $_DBArray;
|
||||
|
||||
$c = new Criteria( 'dbarray' );
|
||||
$c->setDBArrayTable( 'plugins' );
|
||||
$c->addAscendingOrderByColumn( 'id' );
|
||||
$c = new Criteria('dbarray');
|
||||
$c->setDBArrayTable('plugins');
|
||||
$c->addAscendingOrderByColumn('id');
|
||||
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_ID_MENU_SELECTED = 'SETUP';
|
||||
@@ -142,7 +169,6 @@ $G_ID_SUB_MENU_SELECTED = 'SKINS';
|
||||
|
||||
$G_PUBLISH = new Publisher();
|
||||
|
||||
$G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'setup/skinsList', $c );
|
||||
|
||||
G::RenderPage( 'publishBlank', 'blank' );
|
||||
$G_PUBLISH->AddContent('propeltable', 'paged-table', 'setup/skinsList', $c);
|
||||
|
||||
G::RenderPage('publishBlank', 'blank');
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
global $RBAC;
|
||||
$RBAC->requirePermissions( 'PM_SETUP' );
|
||||
$RBAC->requirePermissions('PM_SETUP');
|
||||
|
||||
$option = (isset($_GET["option"]))? $_GET["option"] : null;
|
||||
|
||||
@@ -9,14 +9,14 @@ switch ($option) {
|
||||
phpinfo(INFO_GENERAL + INFO_CREDITS + INFO_CONFIGURATION + INFO_MODULES + INFO_ENVIRONMENT + INFO_VARIABLES);
|
||||
break;
|
||||
case "php":
|
||||
$oHeadPublisher = &headPublisher::getSingleton();
|
||||
$oHeadPublisher = headPublisher::getSingleton();
|
||||
$oHeadPublisher->addContent("setup/phpInfo"); //Adding a html file .html
|
||||
$oHeadPublisher->addExtJsScript("setup/phpInfo", false); //Adding a javascript file .js
|
||||
|
||||
G::RenderPage("publish", "extJs");
|
||||
break;
|
||||
case "processInfo":
|
||||
$oHeadPublisher = &headPublisher::getSingleton();
|
||||
$oHeadPublisher = headPublisher::getSingleton();
|
||||
$oHeadPublisher->assign('skin', $_SESSION['currentSkin']);
|
||||
$oHeadPublisher->addContent("setup/dbInfo"); //Adding a html file .html
|
||||
$oHeadPublisher->addExtJsScript("setup/dbInfo", false); //Adding a javascript file .js
|
||||
@@ -30,7 +30,7 @@ switch ($option) {
|
||||
|
||||
$systemInfo = $installer->getSystemInfo();
|
||||
|
||||
$oHeadPublisher = &headPublisher::getSingleton();
|
||||
$oHeadPublisher = headPublisher::getSingleton();
|
||||
$oHeadPublisher->addContent("setup/systemInfo"); //Adding a html file .html
|
||||
$oHeadPublisher->addExtJsScript("setup/systemInfo", false); //Adding a javascript file .js
|
||||
|
||||
@@ -50,4 +50,3 @@ switch ($option) {
|
||||
G::RenderPage("publish", "extJs");
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -31,19 +31,19 @@ use ProcessMaker\Core\System;
|
||||
* @date May 12th, 2010
|
||||
*/
|
||||
global $RBAC;
|
||||
switch ($RBAC->userCanAccess( 'PM_SETUP_ADVANCE' )) {
|
||||
switch ($RBAC->userCanAccess('PM_SETUP_ADVANCE')) {
|
||||
case - 2:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels');
|
||||
G::header('location: ../login/login');
|
||||
die();
|
||||
break;
|
||||
case - 1:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
|
||||
G::header('location: ../login/login');
|
||||
die();
|
||||
break;
|
||||
}
|
||||
set_time_limit( 0 );
|
||||
set_time_limit(0);
|
||||
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_SUB_MENU = 'setup';
|
||||
@@ -55,27 +55,28 @@ $oSystem = new System();
|
||||
|
||||
try {
|
||||
if (! $oSystem->verifyFileForUpgrade()) {
|
||||
throw (new Exception( G::LoadTranslation( 'ID_ERROR_UPLOADING_FILENAME')) );
|
||||
throw (new Exception(G::LoadTranslation('ID_ERROR_UPLOADING_FILENAME')));
|
||||
}
|
||||
$oSystem->cleanupUpgradeDirectory();
|
||||
$oSystem->getUpgradedFilesList();
|
||||
|
||||
$ver = $oSystem->upgrade();
|
||||
$G_PUBLISH = new Publisher();
|
||||
$aMessage['THEMESSAGE1'] = G::LoadTranslation( 'ID_UPGRADE_READY' ) . " <b>" . $ver[0] . "</b> " . G::LoadTranslation( 'ID_TO' ) . " <b>" . $ver[1] . "</b>";
|
||||
$aMessage['THEMESSAGE2'] = file_get_contents( $oSystem->sUpgradeFileList );
|
||||
$aMessage['THEMESSAGE1'] = G::LoadTranslation('ID_UPGRADE_READY') . " <b>" . $ver[0] . "</b> " . G::LoadTranslation('ID_TO') . " <b>" . $ver[1] . "</b>";
|
||||
$aMessage['THEMESSAGE2'] = file_get_contents($oSystem->sUpgradeFileList);
|
||||
$aMessage['THEMESSAGE3'] = '';
|
||||
|
||||
if (! is_Array( $oSystem->aErrors ) || count( $oSystem->aErrors ) == 0)
|
||||
$aMessage['THEMESSAGE4'] = G::LoadTranslation( 'ID_NONE' );
|
||||
else
|
||||
$aMessage['THEMESSAGE4'] = implode( "\n", $oSystem->aErrors );
|
||||
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
if (file_exists( PATH_CORE . 'js' . PATH_SEP . 'setup' . PATH_SEP . 'upgrade_System.js' )) {
|
||||
$oHeadPublisher->addScriptFile( '/jscore/setup/upgrade_System.js' );
|
||||
if (! is_Array($oSystem->aErrors) || count($oSystem->aErrors) == 0) {
|
||||
$aMessage['THEMESSAGE4'] = G::LoadTranslation('ID_NONE');
|
||||
} else {
|
||||
$oHeadPublisher->addScriptCode( "function upgradeSystem(wsCount) {
|
||||
$aMessage['THEMESSAGE4'] = implode("\n", $oSystem->aErrors);
|
||||
}
|
||||
|
||||
$oHeadPublisher = headPublisher::getSingleton();
|
||||
if (file_exists(PATH_CORE . 'js' . PATH_SEP . 'setup' . PATH_SEP . 'upgrade_System.js')) {
|
||||
$oHeadPublisher->addScriptFile('/jscore/setup/upgrade_System.js');
|
||||
} else {
|
||||
$oHeadPublisher->addScriptCode("function upgradeSystem(wsCount) {
|
||||
document.getElementById('form[THETITLE3]').innerHTML = wsCount + ' workspaces to update.';
|
||||
document.getElementById('form[SUBTITLE4]').innerHTML = ' <img src='/images/alert.gif' width='13' height='13' border='0'> Please wait...';
|
||||
updateWorkspace(wsCount);
|
||||
@@ -93,18 +94,17 @@ try {
|
||||
updateWorkspace(id-1);
|
||||
}.extend(this);
|
||||
oRPC.make();
|
||||
};" );
|
||||
};");
|
||||
}
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showInfoUpdate', '', $aMessage );
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showInfoUpdate', '', $aMessage);
|
||||
|
||||
G::RenderPage( 'publishBlank', 'blank' );
|
||||
G::evalJScript( 'upgradeSystem(' . count( $oSystem->aWorkspaces ) . ')' );
|
||||
exit( 0 );
|
||||
G::RenderPage('publishBlank', 'blank');
|
||||
G::evalJScript('upgradeSystem(' . count($oSystem->aWorkspaces) . ')');
|
||||
exit(0);
|
||||
} catch (Exception $e) {
|
||||
$G_PUBLISH = new Publisher();
|
||||
$aMessage['MESSAGE'] = $e->getMessage();
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
|
||||
G::RenderPage( 'publishBlank', 'blank' );
|
||||
exit( 0 );
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage);
|
||||
G::RenderPage('publishBlank', 'blank');
|
||||
exit(0);
|
||||
}
|
||||
|
||||
|
||||
@@ -24,24 +24,25 @@
|
||||
|
||||
global $RBAC;
|
||||
|
||||
if ($RBAC->userCanAccess( 'PM_SETUP' ) != 1 && $RBAC->userCanAccess( 'PM_SETUP_ADVANCE' ) != 1) {
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||
if ($RBAC->userCanAccess('PM_SETUP') != 1 && $RBAC->userCanAccess('PM_SETUP_ADVANCE') != 1) {
|
||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
|
||||
die();
|
||||
}
|
||||
|
||||
//calculating the max upload file size;
|
||||
$POST_MAX_SIZE = ini_get( 'post_max_size' );
|
||||
$mul = substr( $POST_MAX_SIZE, - 1 );
|
||||
$POST_MAX_SIZE = ini_get('post_max_size');
|
||||
$mul = substr($POST_MAX_SIZE, - 1);
|
||||
$mul = ($mul == 'M' ? 1048576 : ($mul == 'K' ? 1024 : ($mul == 'G' ? 1073741824 : 1)));
|
||||
$postMaxSize = (int) $POST_MAX_SIZE * $mul;
|
||||
|
||||
$UPLOAD_MAX_SIZE = ini_get( 'upload_max_filesize' );
|
||||
$mul = substr( $UPLOAD_MAX_SIZE, - 1 );
|
||||
$UPLOAD_MAX_SIZE = ini_get('upload_max_filesize');
|
||||
$mul = substr($UPLOAD_MAX_SIZE, - 1);
|
||||
$mul = ($mul == 'M' ? 1048576 : ($mul == 'K' ? 1024 : ($mul == 'G' ? 1073741824 : 1)));
|
||||
$uploadMaxSize = (int) $UPLOAD_MAX_SIZE * $mul;
|
||||
|
||||
if ($postMaxSize < $uploadMaxSize)
|
||||
if ($postMaxSize < $uploadMaxSize) {
|
||||
$uploadMaxSize = $postMaxSize;
|
||||
}
|
||||
$Fields['MAX_FILE_SIZE'] = $uploadMaxSize . " (" . $UPLOAD_MAX_SIZE . ") ";
|
||||
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
@@ -50,11 +51,11 @@ $G_ID_MENU_SELECTED = 'SETUP';
|
||||
$G_ID_SUB_MENU_SELECTED = 'LOGO';
|
||||
|
||||
$G_PUBLISH = new Publisher();
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'setup/uplogo', '', $Fields );
|
||||
$oHeadPublisher = headPublisher::getSingleton();
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'setup/uplogo', '', $Fields);
|
||||
|
||||
$G_PUBLISH->AddContent( 'view', 'setup/uplogo' );
|
||||
G::RenderPage( "publishBlank", "blank" );
|
||||
$G_PUBLISH->AddContent('view', 'setup/uplogo');
|
||||
G::RenderPage("publishBlank", "blank");
|
||||
|
||||
?>
|
||||
<script>
|
||||
|
||||
Reference in New Issue
Block a user