Merge branch 'master' of bitbucket.org:colosa/processmaker

This commit is contained in:
Wendy Nestor
2014-10-09 08:47:19 -04:00
66 changed files with 1977 additions and 458 deletions

View File

@@ -7,7 +7,7 @@ CREATE TABLE `LANGUAGE` (
`LAN_ENABLED` char(1) NOT NULL default '1',
`LAN_CALENDAR` varchar(30) NOT NULL default 'GREGORIAN',
PRIMARY KEY (`LAN_ID`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `LANGUAGE`

View File

@@ -4,7 +4,7 @@
<table name="PLUGIN_DEMO">
<vendor type="mysql">
<parameter name="Name" value="PLUGIN_DEMO"/>
<parameter name="Engine" value="MyISAM"/>
<parameter name="Engine" value="InnoDB"/>
<parameter name="Version" value="10"/>
<parameter name="Row_format" value="Dynamic"/>
<parameter name="Auto_increment" value=""/>

View File

@@ -4,7 +4,7 @@
<table name="CONFIGURATION">
<vendor type="mysql">
<parameter name="Name" value="CONFIGURATION"/>
<parameter name="Engine" value="MyISAM"/>
<parameter name="Engine" value="InnoDB"/>
<parameter name="Version" value="10"/>
<parameter name="Row_format" value="Dynamic"/>
<parameter name="Rows" value="11"/>
@@ -88,7 +88,7 @@
<table name="LANGUAGE">
<vendor type="mysql">
<parameter name="Name" value="LANGUAGE"/>
<parameter name="Engine" value="MyISAM"/>
<parameter name="Engine" value="InnoDB"/>
<parameter name="Version" value="10"/>
<parameter name="Row_format" value="Dynamic"/>
<parameter name="Rows" value="136"/>
@@ -189,7 +189,7 @@
<table name="TRANSLATION">
<vendor type="mysql">
<parameter name="Name" value="TRANSLATION"/>
<parameter name="Engine" value="MyISAM"/>
<parameter name="Engine" value="InnoDB"/>
<parameter name="Version" value="10"/>
<parameter name="Row_format" value="Dynamic"/>
<parameter name="Rows" value="121"/>
@@ -268,7 +268,7 @@
<table name="USERS">
<vendor type="mysql">
<parameter name="Name" value="USERS"/>
<parameter name="Engine" value="MyISAM"/>
<parameter name="Engine" value="InnoDB"/>
<parameter name="Version" value="10"/>
<parameter name="Row_format" value="Dynamic"/>
<parameter name="Rows" value="9"/>

View File

@@ -225,6 +225,8 @@ class Bootstrap
self::registerClass("cronFile", PATH_CLASSES . "class.plugin.php");
self::registerClass("pluginDetail", PATH_CLASSES . "class.pluginRegistry.php");
self::registerClass("PMPluginRegistry", PATH_CLASSES . "class.pluginRegistry.php");
self::registerClass("featuresDetail", PATH_CLASSES . "class.licensedFeatures.php");
self::registerClass("PMLicensedFeatures", PATH_CLASSES . "class.licensedFeatures.php");
self::registerClass("PMDashlet", PATH_CLASSES . "class.pmDashlet.php");
self::registerClass("pmGauge", PATH_CLASSES . "class.pmGauge.php");
self::registerClass("pmPhing", PATH_CLASSES . "class.pmPhing.php");

View File

@@ -682,7 +682,7 @@ class database extends database_base
`OP_OBJ_UID` varchar(32) NOT NULL,
`OP_ACTION` varchar(10) NOT NULL default 'VIEW',
KEY `PRO_UID` (`PRO_UID`,`TAS_UID`,`USR_UID`,`OP_TASK_SOURCE`,`OP_OBJ_UID`)
)ENGINE=MyISAM DEFAULT CHARSET=latin1;";
)ENGINE=InnoDB DEFAULT CHARSET=latin1;";
return $sql;
}

View File

@@ -5271,6 +5271,22 @@ class G
$oLogger->write($message);
}
/**
*/
public function auditLog($actionToLog, $valueToLog = "")
{
$oServerConf = & serverConf::getSingleton();
$sflagAudit = $oServerConf->getAuditLogProperty( 'AL_OPTION', SYS_SYS );
$ipClient = G::getIpAddress();
if ($sflagAudit) {
$workspace = defined('SYS_SYS') ? SYS_SYS : 'Wokspace Undefined';
$username = isset($_SESSION['USER_LOGGED']) && $_SESSION['USER_LOGGED'] != '' ? $_SESSION['USER_LOGGED'] : 'Unknow User';
$fullname = isset($_SESSION['USR_FULLNAME']) && $_SESSION['USR_FULLNAME'] != '' ? $_SESSION['USR_FULLNAME'] : '-';
G::log("|". $workspace ."|". $ipClient ."|". $username . "|" . $fullname ."|" . $actionToLog . "|" . $valueToLog, PATH_DATA, "audit.log");
}
}
/**
* Changes all keys in an array and sub-arrays
*
@@ -5347,8 +5363,8 @@ class G
if((preg_match('/^\*\.?[a-z]{2,8}$/', $val)) || ($val == '*.*')){
$allowedDocTypes = substr($val, 2);
if(($dtype[count($dtype) -1]) == $allowedDocTypes || $allowedDocTypes == '*'){
$res->status = true;
return $res;
$res->status = true;
return $res;
break;
} else {
$flag = 1;
@@ -5376,7 +5392,7 @@ class G
break;
case 'xls':
if($docType[1] == 'vnd.ms-excel' || ($dtype[count($dtype) - 1] == 'xls' && $docType[1] == 'plain')){
$res->status = true;
$res->status = true;
return $res;
} else {
$flag = 1;
@@ -5384,7 +5400,7 @@ class G
break;
case 'doc':
if($docType[1] == 'msword' || ($dtype[count($dtype) - 1] == 'doc' && $docType[1] == 'html')){
$res->status = true;
$res->status = true;
return $res;
} else {
$flag = 1;
@@ -5476,7 +5492,7 @@ class G
if ($docType[1] != $allowedDocTypes){
$flag = 1;
} else {
$res->status = true;
$res->status = true;
return $res;
}
break;

View File

@@ -21,7 +21,7 @@ CREATE TABLE clientinfo (
name char(100) NOT NULL default '',
version char(20) NOT NULL default '',
resultsURL char(255) NOT NULL default ''
) TYPE=MyISAM;
) TYPE=InnoDB;
# --------------------------------------------------------
#
@@ -41,7 +41,7 @@ CREATE TABLE results (
error text,
wire text NOT NULL,
PRIMARY KEY (id)
) TYPE=MyISAM;
) TYPE=InnoDB;
# --------------------------------------------------------
#
@@ -56,7 +56,7 @@ CREATE TABLE serverinfo (
endpointURL char(255) NOT NULL default '',
wsdlURL char(255) NOT NULL default '',
PRIMARY KEY (id)
) TYPE=MyISAM;
) TYPE=InnoDB;
# --------------------------------------------------------
#
@@ -70,7 +70,7 @@ CREATE TABLE services (
wsdlURL char(255) NOT NULL default '',
websiteURL char(255) NOT NULL default '',
PRIMARY KEY (id)
) TYPE=MyISAM;
) TYPE=InnoDB;

View File

@@ -37,7 +37,7 @@ CREATE TABLE <?php echo "`" . $table->getName() . "`" ?>
if(isset($vendorSpecific['Type']))
$mysqlTableType = $vendorSpecific['Type'];
else
$mysqlTableType = 'MyISAM';
$mysqlTableType = 'InnoDB';
}
?>

View File

@@ -69,6 +69,7 @@ class AuthenticationSource extends BaseAuthenticationSource {
$oConnection->begin();
$iResult = $oAuthenticationSource->save();
$oConnection->commit();
G::auditLog("CreateAuthSource", $aData['AUTH_SOURCE_NAME']);
return $aData['AUTH_SOURCE_UID'];
}
else {
@@ -97,6 +98,7 @@ class AuthenticationSource extends BaseAuthenticationSource {
$oConnection->begin();
$iResult = $oAuthenticationSource->save();
$oConnection->commit();
G::auditLog("UpdateAuthSource", $aData['AUTH_SOURCE_NAME']." (".$aData['AUTH_SOURCE_UID'].") ");
return $iResult;
}
else {
@@ -126,10 +128,14 @@ class AuthenticationSource extends BaseAuthenticationSource {
$oConnection = Propel::getConnection(AuthenticationSourcePeer::DATABASE_NAME);
try {
$oAuthenticationSource = AuthenticationSourcePeer::retrieveByPK($sUID);
$authenticationSource = $this->load($sUID);
if (!is_null($oAuthenticationSource)) {
$oConnection->begin();
$iResult = $oAuthenticationSource->delete();
$oConnection->commit();
G::auditLog("DeleteAuthSource", $authenticationSource['AUTH_SOURCE_NAME']." (".$sUID.") ");
return $iResult;
}
else {

View File

@@ -236,9 +236,8 @@ class Roles extends BaseRoles {
if ($obj->validate()) {
$result = $obj->save();
$con->commit();
$obj->setRolName($rol_name);
G::auditLog("CreateRole", $rol_name);
} else {
$e = new Exception("Failed Validation in class " . get_class($this) . ".");
$e->aValidationFailures = $this->getValidationFailures();
@@ -263,8 +262,8 @@ class Roles extends BaseRoles {
if ($this->validate()) {
$result = $this->save();
$con->commit();
$this->setRolName($rol_name);
G::auditLog("UpdateRole", $rol_name." (".$fields['ROL_UID'].") ");
return $result;
} else {
$con->rollback();
@@ -281,10 +280,11 @@ class Roles extends BaseRoles {
try {
$con->begin();
$this->setRolUid($ROL_UID);
$rol_name = $this->load($ROL_UID);
Content::removeContent('ROL_NAME', '', $this->getRolUid());
$result = $this->delete();
$con->commit();
G::auditLog("DeleteRole", $rol_name['ROL_NAME']." (".$ROL_UID.") ");
return $result;
} catch( exception $e ) {
$con->rollback();
@@ -514,6 +514,10 @@ class Roles extends BaseRoles {
$oUsersRoles->setRolUid($aData['ROL_UID']);
$oUsersRoles->save();
$rol = $this->load($aData['ROL_UID']);
$oUsersRbac = new RbacUsers();
$user = $oUsersRbac->load($aData['USR_UID']);
G::auditLog("AssignUsersToRole", "Assign user ".$user['USR_USERNAME']." (".$aData['USR_UID'].") to Role ".$rol['ROL_NAME']." (".$aData['ROL_UID'].") ");
}
function deleteUserRole($ROL_UID, $USR_UID) {
@@ -524,6 +528,11 @@ class Roles extends BaseRoles {
$crit->add(UsersRolesPeer::ROL_UID, $ROL_UID);
}
UsersRolesPeer::doDelete($crit);
$rol = $this->load($ROL_UID);
$oUsersRbac = new RbacUsers();
$user = $oUsersRbac->load($USR_UID);
G::auditLog("DeleteUsersToRole", "Delete user ".$user['USR_USERNAME']." (".$USR_UID.") to Role ".$rol['ROL_NAME']." (".$ROL_UID.") ");
}
function getRolePermissions($ROL_UID, $filter='', $status=null) {
@@ -619,7 +628,10 @@ class Roles extends BaseRoles {
if (isset($sData['PER_NAME'])) {
$o->setPermissionName($sData['PER_NAME']);
}
$permission = $o->getPermissionName($sData['PER_UID']);
$role = $this->load($sData['ROL_UID']);
$o->save();
G::auditLog("AddPermissionToRole", "Add Permission ".$permission." (".$sData['PER_UID'].") to Role ".$role['ROL_NAME']." (".$sData['ROL_UID'].") ");
}
function deletePermissionRole($ROL_UID, $PER_UID) {
@@ -627,6 +639,13 @@ class Roles extends BaseRoles {
$crit->add(RolesPermissionsPeer::ROL_UID, $ROL_UID);
$crit->add(RolesPermissionsPeer::PER_UID, $PER_UID);
RolesPermissionsPeer::doDelete($crit);
$o = new RolesPermissions();
$o->setPerUid($PER_UID);
$permission = $o->getPermissionName($PER_UID);
$role = $this->load($ROL_UID);
G::auditLog("DeletePermissionToRole", "Delete Permission ".$permission." (".$PER_UID.") to Role ".$role['ROL_NAME']." (".$ROL_UID.") ");
}
function numUsersWithRole($ROL_UID) {

View File

@@ -4,7 +4,7 @@
<table name="RBAC_PERMISSIONS">
<vendor type="mysql">
<parameter name="Name" value="RBAC_PERMISSIONS"/>
<parameter name="Engine" value="MyISAM"/>
<parameter name="Engine" value="InnoDB"/>
<parameter name="Version" value="10"/>
<parameter name="Row_format" value="Dynamic"/>
<parameter name="Rows" value="5"/>
@@ -32,7 +32,7 @@
<table name="RBAC_ROLES">
<vendor type="mysql">
<parameter name="Name" value="RBAC_ROLES"/>
<parameter name="Engine" value="MyISAM"/>
<parameter name="Engine" value="InnoDB"/>
<parameter name="Version" value="10"/>
<parameter name="Row_format" value="Dynamic"/>
<parameter name="Rows" value="3"/>
@@ -61,7 +61,7 @@
<table name="RBAC_ROLES_PERMISSIONS">
<vendor type="mysql">
<parameter name="Name" value="RBAC_ROLES_PERMISSIONS"/>
<parameter name="Engine" value="MyISAM"/>
<parameter name="Engine" value="InnoDB"/>
<parameter name="Version" value="10"/>
<parameter name="Row_format" value="Dynamic"/>
<parameter name="Rows" value="7"/>
@@ -85,7 +85,7 @@
<table name="RBAC_SYSTEMS">
<vendor type="mysql">
<parameter name="Name" value="RBAC_SYSTEMS"/>
<parameter name="Engine" value="MyISAM"/>
<parameter name="Engine" value="InnoDB"/>
<parameter name="Version" value="10"/>
<parameter name="Row_format" value="Dynamic"/>
<parameter name="Rows" value="2"/>
@@ -112,7 +112,7 @@
<table name="RBAC_USERS">
<vendor type="mysql">
<parameter name="Name" value="RBAC_USERS"/>
<parameter name="Engine" value="MyISAM"/>
<parameter name="Engine" value="InnoDB"/>
<parameter name="Version" value="10"/>
<parameter name="Row_format" value="Dynamic"/>
<parameter name="Rows" value="11"/>
@@ -148,7 +148,7 @@
<table name="RBAC_USERS_ROLES">
<vendor type="mysql">
<parameter name="Name" value="RBAC_USERS_ROLES"/>
<parameter name="Engine" value="MyISAM"/>
<parameter name="Engine" value="InnoDB"/>
<parameter name="Version" value="10"/>
<parameter name="Row_format" value="Dynamic"/>
<parameter name="Rows" value="11"/>
@@ -172,7 +172,7 @@
<table name="RBAC_AUTHENTICATION_SOURCE">
<vendor type="mysql">
<parameter name="Name" value="AUTHENTICATION_SOURCE"/>
<parameter name="Engine" value="MyISAM"/>
<parameter name="Engine" value="InnoDB"/>
<parameter name="Version" value="10"/>
<parameter name="Row_format" value="Dynamic"/>
<parameter name="Rows" value="88"/>

View File

@@ -19,7 +19,7 @@ CREATE TABLE `RBAC_PERMISSIONS`
`PER_STATUS` INTEGER default 1 NOT NULL,
`PER_SYSTEM` VARCHAR(32) default '00000000000000000000000000000002' NOT NULL,
PRIMARY KEY (`PER_UID`)
)ENGINE=MyISAM DEFAULT CHARSET='utf8' COMMENT='Permissions';
)ENGINE=InnoDB DEFAULT CHARSET='utf8' COMMENT='Permissions';
#-----------------------------------------------------------------------------
#-- ROLES
#-----------------------------------------------------------------------------
@@ -37,7 +37,7 @@ CREATE TABLE `RBAC_ROLES`
`ROL_UPDATE_DATE` DATETIME,
`ROL_STATUS` INTEGER default 1 NOT NULL,
PRIMARY KEY (`ROL_UID`)
)ENGINE=MyISAM DEFAULT CHARSET='utf8' COMMENT='Roles';
)ENGINE=InnoDB DEFAULT CHARSET='utf8' COMMENT='Roles';
#-----------------------------------------------------------------------------
#-- ROLES_PERMISSIONS
#-----------------------------------------------------------------------------
@@ -50,7 +50,7 @@ CREATE TABLE `RBAC_ROLES_PERMISSIONS`
`ROL_UID` VARCHAR(32) default '' NOT NULL,
`PER_UID` VARCHAR(32) default '' NOT NULL,
PRIMARY KEY (`ROL_UID`,`PER_UID`)
)ENGINE=MyISAM DEFAULT CHARSET='utf8' COMMENT='Permissions of the roles';
)ENGINE=InnoDB DEFAULT CHARSET='utf8' COMMENT='Permissions of the roles';
#-----------------------------------------------------------------------------
#-- SYSTEMS
#-----------------------------------------------------------------------------
@@ -66,7 +66,7 @@ CREATE TABLE `RBAC_SYSTEMS`
`SYS_UPDATE_DATE` DATETIME,
`SYS_STATUS` INTEGER default 0 NOT NULL,
PRIMARY KEY (`SYS_UID`)
)ENGINE=MyISAM DEFAULT CHARSET='utf8' COMMENT='Systems';
)ENGINE=InnoDB DEFAULT CHARSET='utf8' COMMENT='Systems';
#-----------------------------------------------------------------------------
#-- USERS
#-----------------------------------------------------------------------------
@@ -91,7 +91,7 @@ CREATE TABLE `RBAC_USERS`
`USR_AUTH_USER_DN` VARCHAR(255) default '' NOT NULL,
`USR_AUTH_SUPERVISOR_DN` VARCHAR(255) default '' NOT NULL,
PRIMARY KEY (`USR_UID`)
)ENGINE=MyISAM DEFAULT CHARSET='utf8' COMMENT='Users';
)ENGINE=InnoDB DEFAULT CHARSET='utf8' COMMENT='Users';
#-----------------------------------------------------------------------------
#-- USERS_ROLES
#-----------------------------------------------------------------------------
@@ -104,7 +104,7 @@ CREATE TABLE `RBAC_USERS_ROLES`
`USR_UID` VARCHAR(32) default '' NOT NULL,
`ROL_UID` VARCHAR(32) default '' NOT NULL,
PRIMARY KEY (`USR_UID`,`ROL_UID`)
)ENGINE=MyISAM DEFAULT CHARSET='utf8' COMMENT='Roles of the users';
)ENGINE=InnoDB DEFAULT CHARSET='utf8' COMMENT='Roles of the users';
#-----------------------------------------------------------------------------
#-- AUTHENTICATION_SOURCE
#-----------------------------------------------------------------------------
@@ -129,6 +129,6 @@ CREATE TABLE `RBAC_AUTHENTICATION_SOURCE`
`AUTH_SOURCE_OBJECT_CLASSES` VARCHAR(255) default '' NOT NULL,
`AUTH_SOURCE_DATA` MEDIUMTEXT,
PRIMARY KEY (`AUTH_SOURCE_UID`)
)ENGINE=MyISAM DEFAULT CHARSET='utf8';
)ENGINE=InnoDB DEFAULT CHARSET='utf8';
# This restores the fkey checks, after having unset them earlier
SET FOREIGN_KEY_CHECKS = 1;

View File

@@ -115,6 +115,14 @@ class Groups
$oGrp->setGrpUid($GrpUid);
$oGrp->setUsrUid($UsrUid);
$oGrp->Save();
$oGrpwf = new Groupwf();
$grpName = $oGrpwf->loadByGroupUid($GrpUid);
$oUsr = new Users();
$usrName = $oUsr->load($UsrUid);
G::auditLog("AssignUsersToGroup", "Assign user ". $usrName['USR_USERNAME'] ." (".$UsrUid.") to group ".$grpName['CON_VALUE']." (".$GrpUid.") ");
}
} catch (exception $oError) {
throw ($oError);

View File

@@ -0,0 +1,89 @@
<?php
class featuresDetail
{
public $featureName;
public $description = null;
public $enabled = false;
public $workspaces = null;
/**
* This function is the constructor of the featuresDetail class
*
* @param string $featureName
* @param string $name
* @param string $description
* @return void
*/
public function __construct ($featureName, $description = '')
{
$this->featureName = $featureName;
$this->description = $description;
}
}
class PMLicensedFeatures
{
private $featuresDetails = array ();
private $features = array ();
private static $instancefeature = null;
/**
* This function is the constructor of the PMLicensedFeatures class
* param
*
* @return void
*/
public function __construct ()
{
$criteria = new Criteria();
$criteria->addAscendingOrderByColumn(AddonsManagerPeer::ADDON_ID);
$criteria->add(AddonsManagerPeer::ADDON_TYPE, 'feature', Criteria::EQUAL);
$addons = AddonsManagerPeer::doSelect($criteria);
foreach ($addons as $addon) {
$this->features[] = $addon->getAddonId();
$detail = new featuresDetail($addon->getAddonNick(), $addon->getAddonDescription());
$this->featuresDetails[$addon->getAddonId()] = $detail;
}
}
/**
* This function is instancing to this class
* param
*
* @return object
*/
public static function getSingleton ()
{
if (self::$instancefeature == null) {
self::$instancefeature = new PMLicensedFeatures();
}
return self::$instancefeature;
}
public function verifyfeature ($featureName)
{
$licenseManager = &pmLicenseManager::getSingleton();
$_SESSION['__sw__'] = true;
$padl = new padl();
$enable = in_array($padl->_decrypt($featureName), $licenseManager->features);
$this->featuresDetails[$padl->_decrypt($featureName)]->enabled = $enable;
return $enable;
}
public static function loadSingleton($file)
{
self::$instancefeature = unserialize(file_get_contents($file));
if (! is_object(self::$instancefeature) || get_class(self::$instancefeature) != "PMLicensedFeatures") {
throw new Exception("Can't load main PMLicensedFeatures object.");
}
return self::$instancefeature;
}
}

View File

@@ -53,6 +53,9 @@ class pmLicenseManager
);
$this->result = $results['RESULT'];
$this->features = array();
$this->licensedfeatures = array();
$this->licensedfeaturesList = array();
if (in_array($this->result, $validStatus)) {
$this->serial="3ptta7Xko2prrptrZnSd356aqmPXvMrayNPFj6CLdaR1pWtrW6qPw9jV0OHjxrDGu8LVxtmSm9nP5kR23HRpdZWccpeui+bKkK<6B>DoqCt2Kqgpq6Vg37s";
$info['FIRST_NAME'] = $results['DATA']['FIRST_NAME'];
@@ -64,7 +67,9 @@ class pmLicenseManager
$this->plan = isset($results ['DATA']['PLAN'])?$results ['DATA']['PLAN']:"";
$this->id = $results ['ID'];
$this->expireIn = $this->getExpireIn ();
$this->features = $this->result!='TMINUS'?isset($results ['DATA']['CUSTOMER_PLUGIN'])?$results ['DATA']['CUSTOMER_PLUGIN']:$this->getActiveFeatures():array();
$this->features = $this->result!='TMINUS'?isset($results ['DATA']['CUSTOMER_PLUGIN'])? $results ['DATA']['CUSTOMER_PLUGIN'] : $this->getActiveFeatures() : array();
$this->licensedfeatures = $this->result!='TMINUS'?isset($results ['DATA']['CUSTOMER_LICENSED_FEATURES'])? $results ['DATA']['CUSTOMER_LICENSED_FEATURES'] : array() : array();
$this->licensedfeaturesList = isset($results ['DATA']['LICENSED_FEATURES_LIST'])? $results ['DATA']['LICENSED_FEATURES_LIST'] : null;
$this->status = $this->getCurrentLicenseStatus ();
if (isset ( $results ['LIC'] )) {
@@ -352,7 +357,9 @@ class pmLicenseManager
public function installLicense($path, $redirect = true)
{
$application = new license_application ( $path, false, true, false, true, true );
$results = $application->validate ( false, false, "", "", "80", true );
//if the result is ok then it is saved into DB
$res = $results ['RESULT'];
if (( $res != 'OK') && ($res != 'EXPIRED' ) && ($res != 'TMINUS') ) {
@@ -496,6 +503,9 @@ class pmLicenseManager
public function getActiveFeatures()
{
if (file_exists ( PATH_PLUGINS . 'enterprise/data/default' )) {
return array();
}
return unserialize(G::decrypt($this->serial, file_get_contents(PATH_PLUGINS . 'enterprise/data/default')));
}
}

View File

@@ -39,6 +39,7 @@ class serverConf
private $_aProperties = array();
private $_aHeartbeatConfig = array();
private $_aWSapces = array();
private $_auditLogConfig = array();
private $aWSinfo = array();
private $pluginsA = array();
private $errors = array();
@@ -465,6 +466,52 @@ class serverConf
}
}
/**
* With this is possible to save a property that will be saved in the properties
* array of this class.
*
* @param string $propertyName
* @param string $propertyValue
* @param string $workspace
*/
public function setAuditLogProperty($propertyName, $propertyValue, $workspace)
{
$this->_auditLogConfig[$workspace][$propertyName] = $propertyValue;
$this->saveSingleton();
}
/**
* To unset a defined property.
* If it doesn't exist then it does nothing.
*
* @param string $propertyName
* @param string $workspace
* @return void
*/
public function unsetAuditLogProperty($propertyName, $workspace)
{
if (isset($this->_auditLogConfig[$workspace][$propertyName])) {
unset($this->_auditLogConfig[$workspace][$propertyName]);
}
$this->saveSingleton();
}
/**
* Returns the value of a defined property.
* If it doesn't exist then returns null
*
* @param string $propertyName
* @return string/null
*/
public function getAuditLogProperty($propertyName, $workspace)
{
if (isset($this->_auditLogConfig[$workspace][$propertyName])) {
return $this->_auditLogConfig[$workspace][$propertyName];
} else {
return null;
}
}
public function isRtl($lang = SYS_LANG)
{
$lang = substr($lang, 0, 2);

View File

@@ -1506,6 +1506,13 @@ class workspaceTools
$versionOld = ( isset($version[0])) ? $version[0] : '';
CLI::logging(CLI::info("$versionOld < $versionPresent") . "\n");
$start = microtime(true);
CLI::logging("> Verify enterprise old...\n");
$this->verifyEnterprise($workSpace);
$stop = microtime(true);
$final = $stop - $start;
CLI::logging("<*> Verify took $final seconds.\n");
if ( $versionOld < $versionPresent || strpos($versionPresent, "Branch")) {
$start = microtime(true);
CLI::logging("> Updating database...\n");

View File

@@ -200,6 +200,8 @@ class AdditionalTables extends BaseAdditionalTables
'APP_UID' => '',
'SHD_DATE' => date('Y-m-d H:i:s')));
*/
G::auditLog("CreatePMTable", $aData['ADD_TAB_NAME']);
return $aData['ADD_TAB_UID'];
} else {
$sMessage = '';
@@ -226,6 +228,7 @@ class AdditionalTables extends BaseAdditionalTables
$oConnection->begin();
$iResult = $oAdditionalTables->save();
$oConnection->commit();
G::auditLog("UpdatePMTable", $aData['ADD_TAB_NAME']." (".$aData['ADD_TAB_UID'].") ");
} else {
$sMessage = '';
$aValidationFailures = $oAdditionalTables->getValidationFailures();

File diff suppressed because it is too large Load Diff

View File

@@ -253,7 +253,11 @@ class CalendarDefinition extends BaseCalendarDefinition
if (! (is_object( $tr ) && get_class( $tr ) == 'CalendarDefinition')) {
$tr = new CalendarDefinition();
$tr->setCalendarCreateDate( 'now' );
G::auditLog("CreateCalendar", $aData['CALENDAR_NAME']);
} else {
G::auditLog("UpdateCalendar", $aData['CALENDAR_NAME']." (".$CalendarUid.") ");
}
$tr->setCalendarUid( $CalendarUid );
$tr->setCalendarName( $CalendarName );
$tr->setCalendarUpdateDate( 'now' );
@@ -315,6 +319,8 @@ class CalendarDefinition extends BaseCalendarDefinition
if ($tr->validate()) {
// we save it, since we get no validation errors, or do whatever else you like.
$res = $tr->save();
$deletedCalendar = $tr->getCalendarName();
G::auditLog("DeleteCalendar", $deletedCalendar." (".$CalendarUid.") ");
} else {
// Something went wrong. We can now get the validationFailures and handle them.
$msg = '';

View File

@@ -342,7 +342,7 @@ class Content extends BaseContent
`CON_LANG` VARCHAR(10) default '' NOT NULL,
`CON_VALUE` MEDIUMTEXT NOT NULL,
CONSTRAINT CONTENT_BACKUP_PK PRIMARY KEY (CON_CATEGORY,CON_PARENT,CON_ID,CON_LANG)
)Engine=MyISAM DEFAULT CHARSET='utf8' COMMENT='Table for add content';" );
)Engine=InnoDB DEFAULT CHARSET='utf8' COMMENT='Table for add content';" );
$oStatement->executeQuery();
$sql = " SELECT DISTINCT CON_LANG

View File

@@ -57,8 +57,10 @@ class DashletInstance extends BaseDashletInstance
$data['DAS_INS_UID'] = G::generateUniqueID();
$data['DAS_INS_CREATE_DATE'] = date('Y-m-d H:i:s');
$dashletInstance = new DashletInstance();
$msg = 'CreateDashletInstance';
} else {
$dashletInstance = DashletInstancePeer::retrieveByPK($data['DAS_INS_UID']);
$msg = 'UpdateDashletInstance';
}
$data['DAS_INS_UPDATE_DATE'] = date('Y-m-d H:i:s');
$dashletInstance->fromArray($data, BasePeer::TYPE_FIELDNAME);
@@ -66,6 +68,10 @@ class DashletInstance extends BaseDashletInstance
$connection->begin();
$result = $dashletInstance->save();
$connection->commit();
$dashletData = $this->load($data['DAS_INS_UID']);
G::auditLog($msg, $dashletData['DAS_INS_TITLE']." (".$dashletData['DAS_INS_UID'].") ");
return $data['DAS_INS_UID'];
} else {
$message = '';
@@ -88,8 +94,11 @@ class DashletInstance extends BaseDashletInstance
$dashletInstance = DashletInstancePeer::retrieveByPK($dasInsUid);
if (!is_null($dashletInstance)) {
$connection->begin();
$dashletData = $this->load($dasInsUid);
$result = $dashletInstance->delete();
$connection->commit();
G::auditLog("DeleteDashletInstance", $dashletData['DAS_INS_TITLE']." (".$dasInsUid.") ");
return $result;
} else {
throw new Exception('Error trying to delete: The row "' . $dasInsUid. '" does not exist.');

View File

@@ -61,6 +61,12 @@ class Department extends BaseDepartment
$this->setDepUid( G::generateUniqueID() );
}
if (isset( $aData['DEP_PARENT'] ) && ($aData['DEP_PARENT'] =='')) {
$msgLog = 'Departament';
} else {
$msgLog = 'SubDepartament';
}
if (isset( $aData['DEP_PARENT'] )) {
$this->setDepParent( $aData['DEP_PARENT'] );
} else {
@@ -108,6 +114,9 @@ class Department extends BaseDepartment
$res = $this->save();
$con->commit();
G::auditLog("Create ".$msgLog, $aData['DEP_TITLE']);
return $this->getDepUid();
} else {
$msg = '';
@@ -277,8 +286,11 @@ class Department extends BaseDepartment
$oPro = DepartmentPeer::retrieveByPK( $ProUid );
if (! is_null( $oPro )) {
$dptoTitle = $this->Load($oPro->getDepUid());
Content::removeContent( 'DEPO_TITLE', '', $oPro->getDepUid() );
Content::removeContent( 'DEPO_DESCRIPTION', '', $oPro->getDepUid() );
G::auditLog("DeleteDepartament", $dptoTitle['DEPO_TITLE']." (".$oPro->getDepUid().") ");
return $oPro->delete();
} else {
throw (new Exception( "The row '$ProUid' in table Group doesn't exist!" ));
@@ -320,10 +332,11 @@ class Department extends BaseDepartment
}
public function updateDepartmentManager ($depId)
{
{
$managerId = '';
$depParent = '';
$oDept = DepartmentPeer::retrieveByPk( $depId );
if (is_object( $oDept ) && get_class( $oDept ) == 'Department') {
$managerId = $oDept->getDepManager();
$depParent = $oDept->getDepParent();
@@ -353,7 +366,12 @@ class Department extends BaseDepartment
}
$oUser->save();
}
if ($managerId) {
$user = $oUser->loadDetailed ($managerId);
$dptoTitle = $oDept->Load($depId);
G::auditLog("AssignManagerToDepartament", "Assign Manager ".$user['USR_USERNAME']." (".$managerId.") to ".$dptoTitle['DEPO_TITLE']." (".$depId.") ");
}
// get children departments to update the reportsTo of these children
$childrenCriteria = new Criteria( 'workflow' );
$childrenCriteria->add( DepartmentPeer::DEP_PARENT, $depId );
@@ -378,9 +396,13 @@ class Department extends BaseDepartment
try {
//update the field in user table
$oUser = UsersPeer::retrieveByPk( $userId );
$user = $oUser->loadDetailed ($userId);
$dptoTitle = $this->Load($depId);
if (is_object( $oUser ) && get_class( $oUser ) == 'Users') {
$oUser->setDepUid( $depId );
$oUser->save();
G::auditLog("AssignUsersToDepartament", "Assign user ".$user['USR_USERNAME']." (".$userId.") to departament ".$dptoTitle['DEPO_TITLE']." (".$depId.") ");
}
//if the user is a manager update Department Table
@@ -549,11 +571,16 @@ class Department extends BaseDepartment
);
try {
$oUser = UsersPeer::retrieveByPk( $UsrUid );
$user = $oUser->loadDetailed ($UsrUid);
$dptoTitle = $this->Load($DepUid);
if (is_object( $oUser ) && get_class( $oUser ) == 'Users') {
//$oDepto = new Users();
$oUser->setDepUid( '' );
$oUser->setUsrReportsTo( '' );
$oUser->save();
G::auditLog("RemoveUsersFromDepartament", "Remove user ".$user['USR_USERNAME']."( ".$UsrUid.") from departament ".$dptoTitle['DEPO_TITLE']." (".$DepUid.") ");
}
} catch (exception $oError) {
throw ($oError);

View File

@@ -91,6 +91,15 @@ class GroupUser extends BaseGroupUser
$oConnection->begin();
$iResult = $oGroupUser->delete();
$oConnection->commit();
$oGrpwf = new Groupwf();
$grpName = $oGrpwf->loadByGroupUid($sGrpUid);
$oUsr = new Users();
$usrName = $oUsr->load($sUserUid);
G::auditLog("AssignUsersToGroup", "Remove user ". $usrName['USR_USERNAME'] ." (".$sUserUid.") from group ".$grpName['CON_VALUE']." (".$sGrpUid.") ");
return $iResult;
} else {
throw (new Exception( 'This row doesn\'t exist!' ));

View File

@@ -272,6 +272,26 @@ class Groupwf extends BaseGroupwf
return $c;
}
public function loadByGroupUid ($UidGroup)
{
$c = new Criteria( 'workflow' );
$del = DBAdapter::getStringDelimiter();
$c->clearSelectColumns();
$c->addSelectColumn( ContentPeer::CON_VALUE );
$c->add( ContentPeer::CON_CATEGORY, 'GRP_TITLE' );
$c->add( ContentPeer::CON_ID, $UidGroup );
$c->add( ContentPeer::CON_LANG, SYS_LANG );
$dataset = ContentPeer::doSelectRS( $c );
$dataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$dataset->next();
$row = $dataset->getRow();
return $row;
}
public function getAll ($start = null, $limit = null, $search = null)
{
$totalCount = 0;

View File

@@ -301,6 +301,8 @@ class Language extends BaseLanguage
$results->headers = $POHeaders;
$results->errMsg = $errorMsg;
G::auditLog("UploadLanguage", $languageID);
return $results;
} catch (Exception $oError) {
throw ($oError);
@@ -549,6 +551,7 @@ class Language extends BaseLanguage
}
} //end foreach
}
G::auditLog("ExportLanguage", $_GET['LOCALE']);
G::streamFile( $sPOFile, true );
}
public function updateLanguagePlugin ($plugin, $idLanguage)

View File

@@ -55,6 +55,22 @@ class ProcessCategory extends BaseProcessCategory
return $aRow;
}
public function loadByCategoryId($sCategoryUid)
{
$c = new Criteria('workflow');
$del = DBAdapter::getStringDelimiter();
$c->clearSelectColumns();
$c->addSelectColumn( ProcessCategoryPeer::CATEGORY_NAME);
$c->add(ProcessCategoryPeer::CATEGORY_UID, $sCategoryUid);
$dataset = ProcessCategoryPeer::doSelectRS($c);
$dataset->setFetchmode ( ResultSet::FETCHMODE_ASSOC );
$dataset->next();
$aRow = $dataset->getRow();
return $aRow['CATEGORY_NAME'];
}
public function exists ($catUid)
{
$oProCat = ProcessCategoryPeer::retrieveByPk( $catUid );

View File

@@ -454,6 +454,7 @@ class Translation extends BaseTranslation
if (file_exists( PATH_CORE . PATH_SEP . 'content' . PATH_SEP . 'translations' . PATH_SEP . 'processmaker' . $locale . '.po' )) {
G::rm_dir( PATH_CORE . PATH_SEP . 'content' . PATH_SEP . 'translations' . PATH_SEP . 'processmaker' . $locale . '.po' );
}
G::auditLog("DeleteLanguage", $locale);
}
}

View File

@@ -121,6 +121,12 @@ class adminProxy extends HttpProxyController
$this->restart = $restart;
$this->url = "/sys" . SYS_SYS . "/" . (($sysConf["default_lang"] != "")? $sysConf["default_lang"] : ((defined("SYS_LANG") && SYS_LANG != "")? SYS_LANG : "en")) . "/" . $sysConf["default_skin"] . $urlPart;
$this->message = 'Saved Successfully';
if($httpData->proxy_host != '' || $httpData->proxy_port != '' || $httpData->proxy_user != '') {
$msg = " Host -> ".$httpData->proxy_host." Port -> ".$httpData->proxy_port." User -> ".$httpData->proxy_user;
}
G::auditLog("UploadSystemSettings", "Time Zone -> ".$httpData->time_zone." Memory Limit -> ".$httpData->memory_limit." Cookie lifetime -> ".$httpData->max_life_time." Default Skin -> ".$httpData->default_skin." Default Language -> ". $httpData->default_lang. $msg);
}
public function uxUserUpdate($httpData)
@@ -732,6 +738,7 @@ class adminProxy extends HttpProxyController
);
$this->success='true';
$this->msg='Saved';
G::auditLog("UpdateEmailSettings", "EnableEmailNotifications->".$aFields['MESS_ENABLED']." EmailEngine->".$aFields['MESS_ENGINE']." Server->".$aFields['MESS_SERVER']." Port->".$aFields['MESS_PORT']." RequireAuthentication->".$aFields['MESS_RAUTH']." FromMail->".$aFields['MESS_ACCOUNT']." FromName->".$aFields['MESS_FROM_NAME']." Use Secure Connection->".$aFields['SMTPSecure']);
} else {
$oConfiguration->create(
array(
@@ -745,6 +752,7 @@ class adminProxy extends HttpProxyController
);
$this->success='true';
$this->msg='Saved';
G::auditLog("CreateEmailSettings", "EnableEmailNotifications->".$aFields['MESS_ENABLED']." EmailEngine->".$aFields['MESS_ENGINE']." Server->".$aFields['MESS_SERVER']." Port->".$aFields['MESS_PORT']." RequireAuthentication->".$aFields['MESS_RAUTH']." FromMail->".$aFields['MESS_ACCOUNT']." FromName->".$aFields['MESS_FROM_NAME']." Use Secure Connection->".$aFields['SMTPSecure']);
}
} catch (Exception $e) {
$this->success= false;
@@ -1048,6 +1056,7 @@ class adminProxy extends HttpProxyController
try {
list($imageWidth, $imageHeight, $imageType) = @getimagesize($dir . '/' . 'tmp' . $fileName);
G::resizeImage($dir . '/tmp' . $fileName, $imageWidth, 49, $dir . '/' . $fileName);
G::auditLog("UploadLogo", $fileName);
} catch (Exception $e) {
$error = $e->getMessage();
}
@@ -1064,8 +1073,7 @@ class adminProxy extends HttpProxyController
}
} elseif ($_FILES['img']['type'] != '') {
$failed = "1";
}
}
echo '{success: true, failed: ' . $failed . ', uploaded: ' . $uploaded . ', type: "' . $_FILES['img']['type'] . '"}';
exit();
}
@@ -1130,6 +1138,7 @@ class adminProxy extends HttpProxyController
if (file_exists($dir . '/tmp' . $imgname)) {
unlink ($dir . '/tmp' . $imgname);
}
G::auditLog("DeleteLogo", $imgname);
} else {
echo '{success: false}';
exit();
@@ -1182,6 +1191,8 @@ class adminProxy extends HttpProxyController
$oConf->saveConfig('USER_LOGO_REPLACEMENT', '', '', '');
G::SendTemporalMessage('ID_REPLACED_LOGO', 'tmp-info', 'labels');
G::auditLog("ReplaceLogo", $snameLogo);
break;
case 'restoreLogo':
$snameLogo = $_GET['NAMELOGO'];
@@ -1194,8 +1205,8 @@ class adminProxy extends HttpProxyController
$oConf->aConfig = $aConf;
$oConf->saveConfig('USER_LOGO_REPLACEMENT', '', '', '');
G::SendTemporalMessage('ID_REPLACED_LOGO', 'tmp-info', 'labels');
G::auditLog("RestoreLogo", "Restore Original Logo");
break;
}
} catch (Exception $oException) {

View File

@@ -44,11 +44,12 @@ class Main extends Controller
// license notification
$expireInLabel = '';
if (class_exists( 'pmLicenseManager' )) {
$pmLicenseManager = &pmLicenseManager::getSingleton();
$expireIn = $pmLicenseManager->getExpireIn();
$expireInLabel = $pmLicenseManager->getExpireInLabel();
}
require_once ("classes" . PATH_SEP . "class.pmLicenseManager.php");
$pmLicenseManager = &pmLicenseManager::getSingleton();
$expireIn = $pmLicenseManager->getExpireIn();
$expireInLabel = $pmLicenseManager->getExpireInLabel();
$this->setVar( 'licenseNotification', $expireInLabel );
// setting variables on javascript env.

Some files were not shown because too many files have changed in this diff Show More