Merge pull request #800 from Jennydmz/master

CODE STYLE, workflow/engine/methods/setup/ PART 3 (final)
This commit is contained in:
ferOnti
2012-10-17 15:24:05 -07:00
76 changed files with 6886 additions and 7022 deletions

View File

@@ -1,13 +1,10 @@
function abc(panel, txt) {
/* commonDialog ( '', 'saved' , 'saved', {}, '' ) ;
setTimeout ( leimnud.closure({instance:myDialog,method:function(panel){
myDialog.remove();
panel.tabLastSelected=false;
panel.tabSelected=1;
panel.makeTab();
},args:panel}) , 1000 );
/*
* commonDialog ( '', 'saved' , 'saved', {}, '' ) ; setTimeout (
* leimnud.closure({instance:myDialog,method:function(panel){
*
* myDialog.remove(); panel.tabLastSelected=false; panel.tabSelected=1;
* panel.makeTab(); },args:panel}) , 1000 );
*/
var img = document.getElementById('workPeriodGraph');
img.src = 'workPeriodGraph?b=' + Math.random();
@@ -17,57 +14,71 @@ function abc( panel, txt ) {
return false;
}
function showHideFilterForm( divName)
{
function showHideFilterForm(divName) {
if (document.getElementById(divName).style.display === 'none')
document.getElementById(divName).style.display = '';
else
document.getElementById(divName).style.display = 'none';
}
function newHoliday(ev) {
var coor = leimnud.dom.mouse(ev);
var myPanel = new leimnud.module.panel();
myPanel.options = {
size:{w:500,h:200},
position:{x:coor.x-200,y:coor.y},
size : {
w : 500,
h : 200
},
position : {
x : coor.x - 200,
y : coor.y
},
title : "New Holiday",
theme : "panel",
control : {
close : true,
drag : true
},
fx: { modal:true }
fx : {
modal : true
}
};
myPanel.make();
var r = new leimnud.module.rpc.xmlhttp({url:"holidayNew.php"});
r.callback=leimnud.closure({Function:function(rpc){
var r = new leimnud.module.rpc.xmlhttp({
url : "holidayNew.php"
});
r.callback = leimnud.closure({
Function : function(rpc) {
myPanel.addContent(rpc.xmlhttp.responseText);
},args:r})
},
args : r
})
r.make();
}
function deleteHoliday(uid) {
url = "setupAjax.php?action=deleteHoliday&uid=" + uid;
var r = new leimnud.module.rpc.xmlhttp({url: url });
r.callback=leimnud.closure({Function:function(rpc){
var r = new leimnud.module.rpc.xmlhttp({
url : url
});
r.callback = leimnud.closure({
Function : function(rpc) {
// myPanel.addContent(rpc.xmlhttp.responseText);
myPanel = setupPanel.panels.control;
myPanel.tabLastSelected = false;
myPanel.tabSelected = 0;
myPanel.makeTab();
},args:r})
},
args : r
})
r.make();
// myPanel.clearContent();
// myPanel.addContent ( uid );
}

View File

@@ -20,33 +20,28 @@
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
/**
* New Admin User interface
*
* @author Erik A. O. <erik@colosa.com, aortiz.erik@gmail.com>
* @date Apr 5th, 2010
*/
if (($RBAC_Response=$RBAC->userCanAccess("PM_SETUP"))!=1) return $RBAC_Response;
if (($RBAC_Response = $RBAC->userCanAccess( "PM_SETUP" )) != 1)
return $RBAC_Response;
$G_MAIN_MENU = "processmaker";
$G_ID_MENU_SELECTED = "SETUP";
$G_PUBLISH = new Publisher;
$G_PUBLISH = new Publisher();
global $G_TMP_MENU;
$oMenu = new Menu();
$oMenu->load( 'setup' );
$toolItems = Array ();
foreach ($oMenu->Options as $i => $option) {
$toolItems[] = Array(
'id' => $oMenu->Id[$i],
'link' => ($oMenu->Options[$i]!='')? $oMenu->Options[$i]: '#',
'onclick' => ($oMenu->JS[$i]!='')? $oMenu->JS[$i]: '',
'label' => $oMenu->Labels[$i],
'icon' => ($oMenu->Icons[$i]!='')? $oMenu->Icons[$i]: 'icon-pmlogo.png',
'target'=> ($oMenu->JS[$i]!='')? '': 'admToolsContent'
$toolItems[] = Array ('id' => $oMenu->Id[$i],'link' => ($oMenu->Options[$i] != '') ? $oMenu->Options[$i] : '#','onclick' => ($oMenu->JS[$i] != '') ? $oMenu->JS[$i] : '','label' => $oMenu->Labels[$i],'icon' => ($oMenu->Icons[$i] != '') ? $oMenu->Icons[$i] : 'icon-pmlogo.png','target' => ($oMenu->JS[$i] != '') ? '' : 'admToolsContent'
);
}
@@ -68,7 +63,6 @@ if( isset($_GET['newSite']) ){
$template->assign( 'displayNewSiteTool', 'none' );
}
foreach ($toolItems as $item) {
$template->newBlock( 'tool_options' );
foreach ($item as $propertyName => $propertyValue)
@@ -85,3 +79,4 @@ if(isset($_GET['module'])){
</script>
";
}

View File

@@ -20,15 +20,15 @@
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
if (($RBAC_Response=$RBAC->userCanAccess("PM_SETUP"))!=1) return $RBAC_Response;
if (($RBAC_Response = $RBAC->userCanAccess( "PM_SETUP" )) != 1)
return $RBAC_Response;
//$oSMTPJSON = new Services_JSON();
//$oSMTPData = $oSMTPJSON->decode(stripslashes($_POST['data']));
//$sOutput = '';
G::LoadClass( 'setup' );
$oSMTPSetup = new Setup(new DBConnection);
$oSMTPSetup = new Setup( new DBConnection() );
$action = strtolower( $_GET['action'] );
$data = $_GET;
@@ -38,4 +38,4 @@ if (($RBAC_Response=$RBAC->userCanAccess("PM_SETUP"))!=1) return $RBAC_Response;
if ($method == $action)
$oSMTPSetup->{$action}( $_GET );
}
?>

View File

@@ -20,13 +20,14 @@
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
// if (($RBAC_Response = $RBAC->userCanAccess("PM_CASES"))!=1) return $RBAC_Response;
$idDecode64 = base64_decode( $_GET['id'] );
$idExploded = explode( '/', $idDecode64 );
if ( $idExploded[0] == '' ) array_shift($idExploded);
if ($idExploded[0] == '')
array_shift( $idExploded );
if ($idExploded[0] == 'plugin') {
//Get the Plugin Folder, always the first element
$pluginFolder = $idExploded[1];
@@ -34,7 +35,7 @@
if (file_exists( $pluginFilename )) {
G::streamFile( $pluginFilename );
}
die;
die();
}
$ainfoSite = explode( "/", $_SERVER["REQUEST_URI"] );
@@ -46,13 +47,10 @@
$dir = PATH_DATA . "sites" . PATH_SEP . str_replace( "sys", "", $ainfoSite[1] ) . PATH_SEP . "files/logos";
$imagen = $dir . PATH_SEP . $idDecode64;
if (is_file($imagen))
{
if (is_file( $imagen )) {
showLogo( $imagen );
}
else {
} else {
$newDir = PATH_DATA . "sites" . PATH_SEP . str_replace( "sys", "", $ainfoSite[1] ) . PATH_SEP . "files/logos";
$dir = PATH_HOME . "public_html/files/logos";
@@ -66,24 +64,25 @@
$dir .= PATH_SEP . $idDecode64;
copy( $dir, $newDir );
showLogo( $newDir );
die;
die();
}
function showLogo($imagen){
function showLogo ($imagen)
{
$info = @getimagesize( $imagen );
$fp = fopen( $imagen, "rb" );
if ($info && $fp) {
header( "Content-type: {$info['mime']}" );
fpassthru( $fp );
exit;
exit();
} else {
throw new Exception( "Image format not valid" );
}
}
function cpyMoreLogos($dir,$newDir){
function cpyMoreLogos ($dir, $newDir)
{
if (file_exists( $dir )) {
if ($handle = opendir( $dir )) {
while (false !== ($file = readdir( $handle ))) {
@@ -91,14 +90,14 @@
$extention = explode( ".", $file );
$aImageProp = getimagesize( $dir . '/' . $file, $info );
$sfileExtention = strtoupper( $extention[count( $extention ) - 1] );
if( in_array($sfileExtention, array('JPG','JPEG','PNG','GIF') ) ) {
if (in_array( $sfileExtention, array ('JPG','JPEG','PNG','GIF'
) )) {
$dir1 = $dir . PATH_SEP . $file;
$dir2 = $newDir . PATH_SEP . $file;
//print $dir1 ." *** ".$dir2."<br><br>";
copy( $dir1, $dir2 );
}
}
}
@@ -107,10 +106,10 @@
}
}
die;
die();
?>
<script>
</script>

View File

@@ -14,7 +14,8 @@ if (!function_exists($_REQUEST ['action'])) {
print G::json_encode( $res );
die();
}
$restrictedFunctions=array('copy_skin_folder','addTarFolder');
$restrictedFunctions = array ('copy_skin_folder','addTarFolder'
);
if (in_array( $_REQUEST['action'], $restrictedFunctions )) {
$res['success'] = false;
$res['error'] = $res['message'] = 'The requested action does not exist *';
@@ -22,7 +23,6 @@ if (in_array($_REQUEST ['action'],$restrictedFunctions)) {
die();
}
$functionName = $_REQUEST['action'];
$functionParams = isset( $_REQUEST['params'] ) ? $_REQUEST['params'] : array ();
@@ -48,8 +48,7 @@ function skinList()
$skinList = System::getSkingList();
$wildcard = '';
if(isset($_REQUEST['activeskin']))
{
if (isset( $_REQUEST['activeskin'] )) {
$wildcard = '@';
}
foreach ($skinList['skins'] as $key => $value) {
@@ -61,8 +60,7 @@ function skinList()
$value['SKIN_AUTHOR'] = $wildcard . $value['SKIN_AUTHOR'];
$value['SKIN_CREATEDATE'] = $wildcard . $value['SKIN_CREATEDATE'];
$value['SKIN_MODIFIEDDATE'] = $wildcard . $value['SKIN_MODIFIEDDATE'];
}
else{
} else {
$value['SKIN_STATUS'] = G::LoadTranslation( 'ID_INACTIVE' );
}
$skinListArray['skins'][] = $value;
@@ -89,6 +87,7 @@ function newSkin($baseSkin='classic')
//Should validate skin folder name here
//if....
$skinName = $_REQUEST['skinName'];
$skinFolder = $_REQUEST['skinFolder'];
$skinDescription = isset( $_REQUEST['skinDescription'] ) ? $_REQUEST['skinDescription'] : '';
@@ -105,19 +104,20 @@ function newSkin($baseSkin='classic')
switch ($skinBase) {
//Validate skin base
case 'uxmodern':
copy_skin_folder(G::ExpandPath("skinEngine") . 'uxmodern' . PATH_SEP, PATH_CUSTOM_SKINS .
$skinFolder,array("config.xml"));
copy_skin_folder( G::ExpandPath( "skinEngine" ) . 'uxmodern' . PATH_SEP, PATH_CUSTOM_SKINS . $skinFolder, array ("config.xml"
) );
$pathBase = G::ExpandPath( "skinEngine" ) . 'base' . PATH_SEP;
break;
case 'classic':
//Special Copy of this dir + xmlreplace
copy_skin_folder(G::ExpandPath("skinEngine") . 'base' . PATH_SEP, PATH_CUSTOM_SKINS .
$skinFolder,array("config.xml","baseCss"));
copy_skin_folder( G::ExpandPath( "skinEngine" ) . 'base' . PATH_SEP, PATH_CUSTOM_SKINS . $skinFolder, array ("config.xml","baseCss"
) );
$pathBase = G::ExpandPath( "skinEngine" ) . 'base' . PATH_SEP;
break;
default:
//Commmon copy/paste of a folder + xmlrepalce
copy_skin_folder(PATH_CUSTOM_SKINS . $skinBase, PATH_CUSTOM_SKINS . $skinFolder,array("config.xml"));
copy_skin_folder( PATH_CUSTOM_SKINS . $skinBase, PATH_CUSTOM_SKINS . $skinFolder, array ("config.xml"
) );
$pathBase = PATH_CUSTOM_SKINS . $skinBase;
break;
}
@@ -126,18 +126,12 @@ function newSkin($baseSkin='classic')
$configFileOriginal = $pathBase . PATH_SEP . 'config.xml';
$configFileFinal = PATH_CUSTOM_SKINS . $skinFolder . PATH_SEP . 'config.xml';
$xmlConfiguration = file_get_contents( $configFileOriginal );
$xmlConfiguration = preg_replace('/(<id>)(.+?)(<\/id>)/i', '<id>' . G::generateUniqueID() .
'</id><!-- $2 -->', $xmlConfiguration);
$xmlConfiguration = preg_replace("/(<name>)(.+?)(<\/name>)/i", "<name>" . $skinName .
"</name><!-- $2 -->", $xmlConfiguration);
$xmlConfiguration = preg_replace("/(<description>)(.+?)(<\/description>)/i", "<description>" .
$skinDescription . "</description><!-- $2 -->", $xmlConfiguration);
$xmlConfiguration = preg_replace("/(<author>)(.+?)(<\/author>)/i", "<author>" . $skinAuthor .
"</author><!-- $2 -->", $xmlConfiguration);
$xmlConfiguration = preg_replace("/(<createDate>)(.+?)(<\/createDate>)/i", "<createDate>" .
date("Y-m-d H:i:s") . "</createDate><!-- $2 -->", $xmlConfiguration);
$xmlConfiguration = preg_replace("/(<modifiedDate>)(.+?)(<\/modifiedDate>)/i", "<modifiedDate>" .
date("Y-m-d H:i:s") . "</modifiedDate><!-- $2 -->", $xmlConfiguration);
$xmlConfiguration = preg_replace( '/(<id>)(.+?)(<\/id>)/i', '<id>' . G::generateUniqueID() . '</id><!-- $2 -->', $xmlConfiguration );
$xmlConfiguration = preg_replace( "/(<name>)(.+?)(<\/name>)/i", "<name>" . $skinName . "</name><!-- $2 -->", $xmlConfiguration );
$xmlConfiguration = preg_replace( "/(<description>)(.+?)(<\/description>)/i", "<description>" . $skinDescription . "</description><!-- $2 -->", $xmlConfiguration );
$xmlConfiguration = preg_replace( "/(<author>)(.+?)(<\/author>)/i", "<author>" . $skinAuthor . "</author><!-- $2 -->", $xmlConfiguration );
$xmlConfiguration = preg_replace( "/(<createDate>)(.+?)(<\/createDate>)/i", "<createDate>" . date( "Y-m-d H:i:s" ) . "</createDate><!-- $2 -->", $xmlConfiguration );
$xmlConfiguration = preg_replace( "/(<modifiedDate>)(.+?)(<\/modifiedDate>)/i", "<modifiedDate>" . date( "Y-m-d H:i:s" ) . "</modifiedDate><!-- $2 -->", $xmlConfiguration );
file_put_contents( $configFileFinal, $xmlConfiguration );
$response['success'] = true;
@@ -188,7 +182,8 @@ function importSkin()
//$errors[$i]='uploadfile';
}
$fileInfo = pathinfo( $items );
$validType = array('tar', 'gz');
$validType = array ('tar','gz'
);
if (! in_array( $fileInfo['extension'], $validType )) {
throw (new Exception( G::LoadTranslation( 'ID_FILE_UPLOAD_INCORRECT_EXTENSION' ) ));
@@ -288,6 +283,7 @@ function exportSkin($skinToExport="")
print_r( G::json_encode( $response ) );
}
}
function deleteSkin ()
{
try {
@@ -311,6 +307,7 @@ function deleteSkin()
print_r( G::json_encode( $response ) );
}
}
function streamSkin ()
{
$skinTar = $_REQUEST['file'];
@@ -343,7 +340,8 @@ function addTarFolder($tar, $pathBase, $pluginHome)
function copy_skin_folder ($path, $dest, $exclude = array())
{
$defaultExcluded=array(".","..");
$defaultExcluded = array (".",".."
);
$excludedItems = array_merge( $defaultExcluded, $exclude );
if (is_dir( $path )) {
@mkdir( $dest );

View File

@@ -1,4 +1,5 @@
<?php
/**
* skinsExport.php
*
@@ -20,16 +21,17 @@
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
function copyFile ( $input, $output ) {
function copyFile ($input, $output)
{
$content = file_get_contents( $input );
$filename = $output . PATH_SEP . basename( $input );
return file_put_contents( $filename, $content );
}
function savePluginFile ( $tplName, $fileName, $fields ) {
function savePluginFile ($tplName, $fileName, $fields)
{
$pluginTpl = PATH_GULLIVER_HOME . 'bin' . PATH_SEP . 'tasks' . PATH_SEP . 'templates' . PATH_SEP . $tplName . '.tpl';
$template = new TemplatePower( $pluginTpl );
$template->prepare();
@@ -53,9 +55,11 @@
return $iSize;
}
function addTarFolder ( $tar, $pathBase,$pluginHome ) {
function addTarFolder ($tar, $pathBase, $pluginHome)
{
$aux = explode( PATH_SEP, $pathBase );
if ( $aux[count($aux) -2 ] == '.svn' ) return;
if ($aux[count( $aux ) - 2] == '.svn')
return;
if ($handle = opendir( $pathBase )) {
while (false !== ($file = readdir( $handle ))) {
@@ -72,8 +76,8 @@
}
}
function packPlugin ( $pluginName, $version ) {
function packPlugin ($pluginName, $version)
{
$pathBase = PATH_DATA . 'skins' . PATH_SEP . $pluginName . PATH_SEP;
$pathHome = PATH_DATA . 'skins' . PATH_SEP . $pluginName;
@@ -103,17 +107,16 @@
}
global $RBAC;
switch ($RBAC->userCanAccess('PM_SETUP'))
{
switch ($RBAC->userCanAccess( 'PM_SETUP' )) {
case - 2:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
G::header( 'location: ../login/login' );
die;
die();
break;
case - 1:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' );
die;
die();
break;
}
@@ -161,12 +164,12 @@ switch ($RBAC->userCanAccess('PM_SETUP'))
copyFile( PATH_HTML . 'skins' . PATH_SEP . $id . PATH_SEP . 'iepngfix.htc', $pathPublic );
copyFile( PATH_HTML . 'skins' . PATH_SEP . $id . PATH_SEP . 'style.css', $pathPublic );
$aFiles = array ();
if ($handle = opendir( $pathImages )) {
while (false !== ($file = readdir( $handle ))) {
if (substr( $file, 0, 1 ) != '.') {
if ( isset($aFiles[ $file ]) ) $aFiles[$file] = 0;
if (isset( $aFiles[$file] ))
$aFiles[$file] = 0;
copyFile( $pathImages . $file, $pathPublic . 'images' . PATH_SEP );
}
@@ -176,9 +179,9 @@ switch ($RBAC->userCanAccess('PM_SETUP'))
$fileTar = packPlugin( $id, $oConf->version );
$bDownload = true;
G::streamFile( $fileTar, $bDownload, basename( $fileTar ) );
@G::rm_dir( $pathHome );
@unlink( $fileTar );

View File

@@ -20,13 +20,12 @@
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* 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' );
//G::header('location: ../login/login');
die;
die();
}
$G_MAIN_MENU = 'processmaker';
@@ -34,7 +33,7 @@ $G_SUB_MENU = 'setup';
$G_ID_MENU_SELECTED = 'SETUP';
$G_ID_SUB_MENU_SELECTED = 'CALENDAR';
$G_PUBLISH = new Publisher;
$G_PUBLISH = new Publisher();
G::LoadClass( 'configuration' );
$c = new Configurations();
@@ -50,33 +49,32 @@ $oHeadPublisher->assign('SYS_SKIN', SYS_SKIN);
$oHeadPublisher->assign( 'FORMATS', $c->getFormats() );
G::RenderPage( 'publish', 'extJs' );
die;
die();
global $RBAC;
$access = $RBAC->userCanAccess( 'PM_SETUP' );
if ($access != 1) {
switch ($access)
{
switch ($access) {
case - 1:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' );
die;
die();
break;
case - 2:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
G::header( 'location: ../login/login' );
die;
die();
break;
default:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' );
die;
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[] = array ('id' => 'char','title' => 'char','type' => 'char','creator' => 'char','modifiedBy' => 'char','filename' => 'char','size' => 'char','mime' => 'char'
);
//***************** Skins **************************
$aFiles = array ();
@@ -86,20 +84,23 @@ if( $access != 1 ){
$filename = substr( $file, 0, strrpos( $file, '.' ) );
// list of no complete skins
$aFilterSkinsList = Array('blank', 'green', 'raw', 'tracker', 'iphone', 'green-submenu', 'extJsInitLoad', 'extJs' );
$aFilterSkinsList = Array ('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 ]) ) $aFiles[$filename] = 0;
if ( strpos($file, '.php', 1) ) $aFiles[ $filename ] += 1;
if ( strpos($file, '.html',1) ) $aFiles[ $filename ] += 2;
if (! isset( $aFiles[$filename] ))
$aFiles[$filename] = 0;
if (strpos( $file, '.php', 1 ))
$aFiles[$filename] += 1;
if (strpos( $file, '.html', 1 ))
$aFiles[$filename] += 2;
}
}
}
closedir( $handle );
//now walk in the array to get the .cnf file and display properties
foreach ($aFiles as $key => $val) {
$description = '';
@@ -113,20 +114,15 @@ if( $access != 1 ){
if (! is_object( $prop )) {
@unlink( PATH_SKINS . $key . '.cnf' );
}
if ( isset ( $prop) && isset($prop->description) ) $description = $prop->description;
if ( isset ( $prop) && isset($prop->version ) ) $version = $prop->version;
if (isset( $prop ) && isset( $prop->description ))
$description = $prop->description;
if (isset( $prop ) && isset( $prop->version ))
$version = $prop->version;
}
$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[] = array ('id' => count( $items ),'name' => $key,'filename' => $key,'description' => $description,'version' => $version,'url' => $link,'linkPackValue' => $linkPackValue
);
}
$folders['items'] = $items;
@@ -145,7 +141,7 @@ if( $access != 1 ){
$G_SUB_MENU = 'setup';
$G_ID_SUB_MENU_SELECTED = 'SKINS';
$G_PUBLISH = new Publisher;
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'setup/skinsList', $c );

View File

@@ -20,34 +20,33 @@
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
$access = $RBAC->userCanAccess( 'PM_SETUP' );
if ($access != 1) {
switch ($access)
{
switch ($access) {
case - 1:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' );
die;
die();
break;
case - 2:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
G::header( 'location: ../login/login' );
die;
die();
break;
default:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' );
die;
die();
break;
}
}
if (($RBAC_Response=$RBAC->userCanAccess("PM_SETUP"))!=1) return $RBAC_Response;
if (($RBAC_Response = $RBAC->userCanAccess( "PM_SETUP" )) != 1)
return $RBAC_Response;
$dbc = new DBConnection;
$G_PUBLISH = new Publisher;
$dbc = new DBConnection();
$G_PUBLISH = new Publisher();
$G_MAIN_MENU = 'processmaker';
$G_ID_MENU_SELECTED = 'SETUP';
$G_SUB_MENU = 'setup';

View File

@@ -1,4 +1,5 @@
<?php
/**
* skinsSave.php
*
@@ -20,11 +21,10 @@
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
function xcopy ( $pathSource, $pathTarget ) {
function xcopy ($pathSource, $pathTarget)
{
G::mk_dir( $pathTarget );
if ($handle = opendir( $pathSource )) {
while (false !== ($file = readdir( $handle ))) {
@@ -38,19 +38,17 @@
}
}
global $RBAC;
switch ($RBAC->userCanAccess('PM_SETUP'))
{
switch ($RBAC->userCanAccess( 'PM_SETUP' )) {
case - 2:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
G::header( 'location: ../login/login' );
die;
die();
break;
case - 1:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' );
die;
die();
break;
}
@@ -82,14 +80,9 @@ switch ($RBAC->userCanAccess('PM_SETUP'))
$pathImages = PATH_HTML . 'skins' . PATH_SEP . $id . PATH_SEP . 'images' . PATH_SEP;
G::mk_dir( $pathImages );
xcopy (
PATH_HTML . 'skins' . PATH_SEP . 'green' . PATH_SEP ,
PATH_HTML . 'skins' . PATH_SEP . $id . PATH_SEP
);
xcopy( PATH_HTML . 'skins' . PATH_SEP . 'green' . PATH_SEP, PATH_HTML . 'skins' . PATH_SEP . $id . PATH_SEP );
xcopy (
PATH_HTML . 'skins' . PATH_SEP . 'green' . PATH_SEP . 'images'. PATH_SEP,
PATH_HTML . 'skins' . PATH_SEP . $id . PATH_SEP . 'images'. PATH_SEP
);
xcopy( PATH_HTML . 'skins' . PATH_SEP . 'green' . PATH_SEP . 'images' . PATH_SEP, PATH_HTML . 'skins' . PATH_SEP . $id . PATH_SEP . 'images' . PATH_SEP );
G::Header( 'Location: ../../' . $id . '/setup/skinsList' );

View File

@@ -20,27 +20,25 @@
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
global $RBAC;
$access = $RBAC->userCanAccess( 'PM_SETUP_ADVANCE' );
if ($access != 1) {
switch ($access)
{
switch ($access) {
case - 1:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' );
die;
die();
break;
case - 2:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
G::header( 'location: ../login/login' );
die;
die();
break;
default:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' );
die;
die();
break;
}
}
@@ -55,8 +53,8 @@ if( $access != 1 ){
$mul = ($mul == 'M' ? 1048576 : ($mul == 'K' ? 1024 : ($mul == 'G' ? 1073741824 : 1)));
$uploadMaxSize = (int) $UPLOAD_MAX_SIZE * $mul;
if ( $postMaxSize < $uploadMaxSize ) $uploadMaxSize = $postMaxSize;
if ($postMaxSize < $uploadMaxSize)
$uploadMaxSize = $postMaxSize;
$G_MAIN_MENU = 'processmaker';
$G_SUB_MENU = 'setup';
@@ -68,7 +66,7 @@ if( $access != 1 ){
$Fields['PM_VERSION'] = System::getVersion();
$Fields['MAX_FILE_SIZE'] = $uploadMaxSize . " (" . $UPLOAD_MAX_SIZE . ") ";
$G_PUBLISH = new Publisher;
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'setup/upgrade', '', $Fields, 'upgrade_System' );
G::RenderPage( 'publishBlank', 'blank' );

View File

@@ -40,3 +40,4 @@ $aRequiredPermissions = array('PM_LOGIN',
'PM_FOLDERS_ADD_FOLDER',
'PM_FOLDERS_ADD_FILE'
);

View File

@@ -20,7 +20,6 @@
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
/**
@@ -30,17 +29,16 @@
* @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' );
die;
die();
break;
case - 1:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' );
die;
die();
break;
}
set_time_limit( 0 );
@@ -61,7 +59,7 @@ try {
$oSystem->getUpgradedFilesList();
$ver = $oSystem->upgrade();
$G_PUBLISH = new Publisher;
$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['THEMESSAGE3'] = '';
@@ -100,11 +98,11 @@ try {
G::RenderPage( 'publishBlank', 'blank' );
G::evalJScript( 'upgradeSystem(' . count( $oSystem->aWorkspaces ) . ')' );
exit( 0 );
}
catch (Exception $e) {
$G_PUBLISH = new Publisher;
} 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 );
}

View File

@@ -20,7 +20,6 @@
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
global $DB_ADAPTER;
global $DB_HOST;
@@ -30,7 +29,8 @@
set_time_limit( 0 );
$id = '';
if ( isset($_POST['id'] ) ) $id = $_POST['id'];
if (isset( $_POST['id'] ))
$id = $_POST['id'];
G::LoadClass( 'languages' );
G::LoadSystem( 'database_mysql' );
@@ -55,7 +55,6 @@
if ($aUpgradeData['sSchemaFile'] != '')
processMasterSchemaFile( $aUpgradeData['sSchemaFile'] );
//draw a gauge control indicating the progress in workspaces
$gauge = intval( (($aUpgradeData['wsQuantity'] - count( $aWorkspaces ) + 1) / $aUpgradeData['wsQuantity']) * 301 );
print "<table cellpadding=0><tr><td><img src='/images/ajax-loader.gif' border=0/></td><td>";
@@ -63,17 +62,17 @@
print "<div style='color:#FFF; height:16px; text-align:center; padding-top:3px; background-image: url(/skins/green/images/bm.jpg); background-repeat: repeat-x; width: {$gauge}px' ></div> </div>";
print "</td><td width='40%'><font color=black> Upgrading the workspace </font><b><font color=green>$workspace</font></b></td><td width=250 align=right>| $id Remaining</td></tr></table>";
file_put_contents( PATH_DATA . 'log' . PATH_SEP . "upgrade.data.bin", serialize( $aUpgradeData ) );
}
else {
} else {
print "<table cellpadding=0><tr><td>&nbsp;&nbsp;&nbsp;&nbsp;</td><td>";
print "<div style='border-style:solid;border-width:1px; border-color: #A1C868; width:300px; height:19px;' >";
print "<div style='color:#FFF; height:16px; text-align:center; padding-top:3px; background-image: url(/skins/green/images/bm.jpg); background-repeat: repeat-x; width: 301px' ></div> </div>";
print "</td><td> Finished! All workspaces were upgraded successfully.</td></tr></table>";
}
die;
die();
function getDatabaseCredentials ( $dbFile ) {
function getDatabaseCredentials ($dbFile)
{
$sContent = file_get_contents( $dbFile );
$sContent = str_replace( '<?php', '', $sContent );
$sContent = str_replace( '<?', '', $sContent );
@@ -85,7 +84,8 @@ function getDatabaseCredentials ( $dbFile ) {
return $sContent;
}
function processMasterSchemaFile ( $sSchemaFile ) {
function processMasterSchemaFile ($sSchemaFile)
{
global $DB_ADAPTER;
global $DB_HOST;
global $DB_USER;
@@ -96,8 +96,7 @@ function processMasterSchemaFile ( $sSchemaFile ) {
//convert newSchema to array
if (isset( $aUpgradeData['aNewSchema'] )) {
$aNewSchema = $aUpgradeData['aNewSchema'];
}
else {
} else {
$aNewSchema = schemaToArray( $sSchemaFile );
$aUpgradeData['aNewSchema'] = $aNewSchema;
}
@@ -157,8 +156,8 @@ function processMasterSchemaFile ( $sSchemaFile ) {
$oDataBase->close();
}
function processSchemaFile( ) {
function processSchemaFile ()
{
global $DB_ADAPTER;
global $DB_HOST;
global $DB_USER;
@@ -173,7 +172,7 @@ function processSchemaFile( ) {
if (! $oDataBase->isConnected()) {
$oDataBase->logQuery( 'Does not exist an available connection!' );
return NULL;
return null;
}
$oDataBase->iFetchType = MYSQL_NUM;
@@ -181,7 +180,7 @@ function processSchemaFile( ) {
} catch (Exception $e) {
$oDataBase->logQuery( $e->getmessage() );
return NULL;
return null;
}
//going thru all tables in current WF_ database
@@ -217,12 +216,14 @@ function processSchemaFile( ) {
$oDataBase->iFetchType = MYSQL_NUM; //this line is neccesary because the next fetch needs to be with MYSQL_NUM
}
//finally return the array with old schema obtained from the Database
if ( count($aOldSchema) == 0 ) $aOldSchema = null;
if (count( $aOldSchema ) == 0)
$aOldSchema = null;
return $aOldSchema;
}
//process the schema file in the patch file, and obtain an array
function schemaToArray($sSchemaFile) {
function schemaToArray ($sSchemaFile)
{
try {
$aSchema = array ();
$oXml = new DomDocument();
@@ -249,7 +250,8 @@ function schemaToArray($sSchemaFile) {
$aPrimaryKeys[] = $oColumn->getAttribute( 'name' );
}
if ( in_array ( $parameterName, array('Field','Type','Null','Default') ) ) {
if (in_array( $parameterName, array ('Field','Type','Null','Default'
) )) {
$aSchema[$sTableName][$sColumName][$parameterName] = $oParameter->getAttribute( 'value' );
}
}
@@ -269,13 +271,13 @@ function schemaToArray($sSchemaFile) {
}
}
return $aSchema;
}
catch (Exception $oError) {
} catch (Exception $oError) {
throw $oError;
}
}
function obtainChanges($aOldSchema, $aNewSchema) {
function obtainChanges ($aOldSchema, $aNewSchema)
{
//$aChanges = array('tablesToDelete' => array(), 'tablesToAdd' => array(), 'tablesToAlter' => array());
//Tables to delete, but this is disabled
//foreach ($aOldSchema as $sTableName => $aColumns) {
@@ -286,19 +288,21 @@ function obtainChanges($aOldSchema, $aNewSchema) {
// }
//}
$aChanges = array('tablesToAdd' => array(), 'tablesToAlter' => array(), 'tablesWithNewIndex' => array(), 'tablesToAlterIndex'=> array());
$aChanges = array ('tablesToAdd' => array (),'tablesToAlter' => array (),'tablesWithNewIndex' => array (),'tablesToAlterIndex' => array ()
);
//new tables to create and alter
foreach ($aNewSchema as $sTableName => $aColumns) {
if (! isset( $aOldSchema[$sTableName] )) {
$aChanges['tablesToAdd'][$sTableName] = $aColumns;
}
else {
} else {
//drop old columns
foreach ($aOldSchema[$sTableName] as $sColumName => $aParameters) {
if (! isset( $aNewSchema[$sTableName][$sColumName] )) {
if (! isset( $aChanges['tablesToAlter'][$sTableName] )) {
$aChanges['tablesToAlter'][$sTableName] = array('DROP' => array(), 'ADD' => array(), 'CHANGE' => array());
$aChanges['tablesToAlter'][$sTableName] = array ('DROP' => array (),'ADD' => array (),'CHANGE' => array ()
);
}
$aChanges['tablesToAlter'][$sTableName]['DROP'][$sColumName] = $sColumName;
}
@@ -310,18 +314,21 @@ function obtainChanges($aOldSchema, $aNewSchema) {
if ($sColumName != 'INDEXES') {
if (! isset( $aOldSchema[$sTableName][$sColumName] )) { //this column doesnt exist in oldschema
if (! isset( $aChanges['tablesToAlter'][$sTableName] )) {
$aChanges['tablesToAlter'][$sTableName] = array('DROP' => array(), 'ADD' => array(), 'CHANGE' => array());
$aChanges['tablesToAlter'][$sTableName] = array ('DROP' => array (),'ADD' => array (),'CHANGE' => array ()
);
}
$aChanges['tablesToAlter'][$sTableName]['ADD'][$sColumName] = $aParameters;
}
else { //the column exists
} else { //the column exists
$newField = $aNewSchema[$sTableName][$sColumName];
$oldField = $aOldSchema[$sTableName][$sColumName];
//both are null, no change is required
if ( !isset($newField['Default']) && !isset($oldField['Default'])) $changeDefaultAttr = false;
if (! isset( $newField['Default'] ) && ! isset( $oldField['Default'] ))
$changeDefaultAttr = false;
//one of them is null, change IS required
if ( !isset($newField['Default']) && isset($oldField['Default']) && $oldField['Default']!= '') $changeDefaultAttr = true;
if ( isset($newField['Default']) && !isset($oldField['Default'])) $changeDefaultAttr = true;
if (! isset( $newField['Default'] ) && isset( $oldField['Default'] ) && $oldField['Default'] != '')
$changeDefaultAttr = true;
if (isset( $newField['Default'] ) && ! isset( $oldField['Default'] ))
$changeDefaultAttr = true;
//both are defined and they are different.
if (isset( $newField['Default'] ) && isset( $oldField['Default'] )) {
if ($newField['Default'] != $oldField['Default'])
@@ -331,11 +338,13 @@ function obtainChanges($aOldSchema, $aNewSchema) {
}
//special cases
// BLOB and TEXT columns cannot have DEFAULT values. http://dev.mysql.com/doc/refman/5.0/en/blob.html
if ( in_array(strtolower($newField['Type']), array('text','mediumtext') ) )
if (in_array( strtolower( $newField['Type'] ), array ('text','mediumtext'
) ))
$changeDefaultAttr = false;
//#1067 - Invalid default value for datetime field
if ( in_array($newField['Type'], array('datetime')) && isset($newField['Default']) && $newField['Default']== '' )
if (in_array( $newField['Type'], array ('datetime'
) ) && isset( $newField['Default'] ) && $newField['Default'] == '')
$changeDefaultAttr = false;
//#1067 - Invalid default value for int field
@@ -343,12 +352,10 @@ function obtainChanges($aOldSchema, $aNewSchema) {
$changeDefaultAttr = false;
//if any difference exists, then insert the difference in aChanges
if ( $newField['Field'] != $oldField['Field'] ||
$newField['Type'] != $oldField['Type'] ||
$newField['Null'] != $oldField['Null'] ||
$changeDefaultAttr ) {
if ($newField['Field'] != $oldField['Field'] || $newField['Type'] != $oldField['Type'] || $newField['Null'] != $oldField['Null'] || $changeDefaultAttr) {
if (! isset( $aChanges['tablesToAlter'][$sTableName] )) {
$aChanges['tablesToAlter'][$sTableName] = array('DROP' => array(), 'ADD' => array(), 'CHANGE' => array());
$aChanges['tablesToAlter'][$sTableName] = array ('DROP' => array (),'ADD' => array (),'CHANGE' => array ()
);
}
$aChanges['tablesToAlter'][$sTableName]['CHANGE'][$sColumName]['Field'] = $newField['Field'];
$aChanges['tablesToAlter'][$sTableName]['CHANGE'][$sColumName]['Type'] = $newField['Type'];
@@ -363,6 +370,7 @@ function obtainChanges($aOldSchema, $aNewSchema) {
} //only columns, no the indexes column
} //foreach $aColumns
//now check the indexes of table
if (isset( $aNewSchema[$sTableName]['INDEXES'] )) {
foreach ($aNewSchema[$sTableName]['INDEXES'] as $indexName => $indexFields) {
@@ -371,8 +379,7 @@ function obtainChanges($aOldSchema, $aNewSchema) {
$aChanges['tablesWithNewIndex'][$sTableName] = array ();
}
$aChanges['tablesWithNewIndex'][$sTableName][$indexName] = $indexFields;
}
else {
} else {
if ($aOldSchema[$sTableName]['INDEXES'][$indexName] != $indexFields) {
if (! isset( $aChanges['tablesToAlterIndex'][$sTableName] )) {
$aChanges['tablesToAlterIndex'][$sTableName] = array ();

View File

@@ -20,7 +20,6 @@
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
global $RBAC;
@@ -28,7 +27,7 @@
if ($RBAC->userCanAccess( 'PM_SETUP' ) != 1 && $RBAC->userCanAccess( 'PM_SETUP_ADVANCE' ) != 1) {
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
die;
die();
}
//calculating the max upload file size;
@@ -42,7 +41,8 @@
$mul = ($mul == 'M' ? 1048576 : ($mul == 'K' ? 1024 : ($mul == 'G' ? 1073741824 : 1)));
$uploadMaxSize = (int) $UPLOAD_MAX_SIZE * $mul;
if ( $postMaxSize < $uploadMaxSize ) $uploadMaxSize = $postMaxSize;
if ($postMaxSize < $uploadMaxSize)
$uploadMaxSize = $postMaxSize;
$Fields['MAX_FILE_SIZE'] = $uploadMaxSize . " (" . $UPLOAD_MAX_SIZE . ") ";
$G_MAIN_MENU = 'processmaker';
@@ -50,7 +50,7 @@
$G_ID_MENU_SELECTED = 'SETUP';
$G_ID_SUB_MENU_SELECTED = 'LOGO';
$G_PUBLISH = new Publisher;
$G_PUBLISH = new Publisher();
$oHeadPublisher = & headPublisher::getSingleton();
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'setup/uplogo', '', $Fields );
@@ -100,3 +100,4 @@
window.location = 'uplogo';
}
</script>

View File

@@ -20,13 +20,12 @@
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
if ($RBAC->userCanAccess( 'PM_SETUP' ) != 1 && $RBAC->userCanAccess( 'PM_FACTORY' ) != 1) {
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
//G::header('location: ../login/login');
die;
die();
}
$G_MAIN_MENU = 'processmaker';
@@ -34,14 +33,13 @@ if($RBAC->userCanAccess('PM_SETUP') != 1 && $RBAC->userCanAccess('PM_FACTORY') !
$G_ID_MENU_SELECTED = 'SETUP';
//$G_ID_SUB_MENU_SELECTED = 'WEBSERVICES';
if (! extension_loaded( 'soap' )) {
$G_PUBLISH = new Publisher;
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'setup/wsMessage' );
G::RenderPage( "publish" );
}
else
{
$G_PUBLISH = new Publisher;
} else {
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'view', 'setup/webServicesTree' );
$G_PUBLISH->AddContent( 'smarty', 'groups/groups_usersList', '', '', array () );
@@ -51,7 +49,6 @@ if($RBAC->userCanAccess('PM_SETUP') != 1 && $RBAC->userCanAccess('PM_FACTORY') !
$link_Edit = G::encryptlink( 'webServicesSetup' );
$link_List = G::encryptlink( 'webServicesList' );
?>
<script>
document.body.style.backgroundColor="#fff";

View File

@@ -20,15 +20,15 @@
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
ini_set( "soap.wsdl_cache_enabled", "0" ); // enabling WSDL cache
G::LoadClass( 'ArrayPeer' );
if ($RBAC->userCanAccess( 'PM_SETUP' ) != 1 && $RBAC->userCanAccess( 'PM_FACTORY' ) != 1) {
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
//G::header('location: ../login/login');
die;
die();
}
G::LoadInclude( 'ajax' );
@@ -53,7 +53,6 @@ switch ($_POST ['action']) {
G::RenderPage( 'publish', 'raw' );
}
break;
case 'showDetails':
G::LoadClass( 'groups' );
@@ -77,9 +76,12 @@ switch ($_POST ['action']) {
$aFields['WS_WORKSPACE'] = substr( $aAux[1], 3 );
}
$rows [] = array ('uid' => 'char', 'name' => 'char', 'age' => 'integer', 'balance' => 'float' );
$rows [] = array ('uid' => 'http', 'name' => 'http' );
$rows [] = array ('uid' => 'https', 'name' => 'https' );
$rows[] = array ('uid' => 'char','name' => 'char','age' => 'integer','balance' => 'float'
);
$rows[] = array ('uid' => 'http','name' => 'http'
);
$rows[] = array ('uid' => 'https','name' => 'https'
);
global $_DBArray;
$_DBArray = (isset( $_SESSION['_DBArray'] ) ? $_SESSION['_DBArray'] : '');
@@ -112,7 +114,6 @@ switch ($_POST ['action']) {
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'setup/webServicesDetails', '', $aFields, 'webServicesSetupSave' );
G::RenderPage( "publish", "raw" );
break;
case 'showUploadFilesForm':
global $G_PUBLISH;
@@ -129,7 +130,8 @@ switch ($_POST ['action']) {
G::RenderPage( 'publish', 'blank' );
}
break;
}try {
}
try {
global $G_PUBLISH;
if (isset( $_POST['form']['ACTION'] )) {
$frm = $_POST['form'];
@@ -165,8 +167,10 @@ switch ($_POST ['action']) {
case "Login":
$user = $frm["USER_ID"];
$pass = $frm["PASSWORD"];
$params = array ('userid' => $user, 'password' => $pass );
$result = $client->__SoapCall ( 'login', array ($params ) );
$params = array ('userid' => $user,'password' => $pass
);
$result = $client->__SoapCall( 'login', array ($params
) );
$_SESSION['WS_SESSION_ID'] = '';
if ($result->status_code == 0) {
$_SESSION['WS_SESSION_ID'] = $result->message;
@@ -181,13 +185,16 @@ switch ($_POST ['action']) {
break;
case "ProcessList":
$sessionId = $frm["SESSION_ID"];
$params = array ('sessionId' => $sessionId );
$params = array ('sessionId' => $sessionId
);
$wsResponse = $client->__SoapCall ( 'ProcessList', array ($params ) );
$wsResponse = $client->__SoapCall( 'ProcessList', array ($params
) );
$result = G::PMWSCompositeResponse( $wsResponse, 'processes' );
$G_PUBLISH = new Publisher();
$rows [] = array ('guid' => 'char', 'name' => 'char' );
$rows[] = array ('guid' => 'char','name' => 'char'
);
if (is_array( $result )) {
foreach ($result as $key => $item) {
@@ -212,7 +219,8 @@ switch ($_POST ['action']) {
$name = $item->name;
}
$rows [] = array ('guid' => $guid, 'name' => $name );
$rows[] = array ('guid' => $guid,'name' => $name
);
}
global $_DBArray;
$_DBArray = (isset( $_SESSION['_DBArray'] ) ? $_SESSION['_DBArray'] : '');
@@ -235,13 +243,16 @@ switch ($_POST ['action']) {
break;
case "RoleList":
$sessionId = $frm["SESSION_ID"];
$params = array ('sessionId' => $sessionId );
$wsResponse = $client->__SoapCall ( 'RoleList', array ($params ) );
$params = array ('sessionId' => $sessionId
);
$wsResponse = $client->__SoapCall( 'RoleList', array ($params
) );
$result = G::PMWSCompositeResponse( $wsResponse, 'roles' );
$G_PUBLISH = new Publisher();
$rows [] = array ('guid' => 'char', 'name' => 'char');
$rows[] = array ('guid' => 'char','name' => 'char'
);
if (is_array( $result )) {
foreach ($result as $key => $item) {
@@ -266,7 +277,8 @@ switch ($_POST ['action']) {
$name = $item->name;
}
$rows [] = array ('guid' => $guid, 'name' => $name );
$rows[] = array ('guid' => $guid,'name' => $name
);
}
global $_DBArray;
$_DBArray = (isset( $_SESSION['_DBArray'] ) ? $_SESSION['_DBArray'] : '');
@@ -288,15 +300,17 @@ switch ($_POST ['action']) {
G::RenderPage( 'publish', 'raw' );
break;
case "GroupList":
$sessionId = $frm["SESSION_ID"];
$params = array ('sessionId' => $sessionId );
$wsResponse = $client->__SoapCall ( 'GroupList', array ($params ) );
$params = array ('sessionId' => $sessionId
);
$wsResponse = $client->__SoapCall( 'GroupList', array ($params
) );
$result = G::PMWSCompositeResponse( $wsResponse, 'groups' );
$G_PUBLISH = new Publisher();
$rows [] = array ('guid' => 'char', 'name' => 'char' );
$rows[] = array ('guid' => 'char','name' => 'char'
);
if (is_array( $result )) {
foreach ($result as $key => $item) {
if (isset( $item->item ))
@@ -320,7 +334,8 @@ switch ($_POST ['action']) {
$name = $item->name;
}
$rows [] = array ('guid' => $guid, 'name' => $name );
$rows[] = array ('guid' => $guid,'name' => $name
);
}
global $_DBArray;
$_DBArray = (isset( $_SESSION['_DBArray'] ) ? $_SESSION['_DBArray'] : '');
@@ -342,14 +357,16 @@ switch ($_POST ['action']) {
G::RenderPage( 'publish', 'raw' );
break;
case "CaseList":
$sessionId = $frm["SESSION_ID"];
$params = array ('sessionId' => $sessionId );
$wsResponse = $client->__SoapCall ( 'CaseList', array ($params ) );
$params = array ('sessionId' => $sessionId
);
$wsResponse = $client->__SoapCall( 'CaseList', array ($params
) );
$G_PUBLISH = new Publisher();
$rows [] = array ('guid' => 'char', 'name' => 'char', 'status' => 'char', 'delIndex' => 'char' );
$rows[] = array ('guid' => 'char','name' => 'char','status' => 'char','delIndex' => 'char'
);
$result = G::PMWSCompositeResponse( $wsResponse, 'cases' );
@@ -388,7 +405,8 @@ switch ($_POST ['action']) {
$delIndex = $item->delIndex;
}
$rows [] = array ('guid' => $guid, 'name' => $name, 'status' => $status, 'delIndex' => $delIndex );
$rows[] = array ('guid' => $guid,'name' => $name,'status' => $status,'delIndex' => $delIndex
);
}
@@ -413,17 +431,17 @@ switch ($_POST ['action']) {
G::RenderPage( 'publish', 'raw' );
break;
case "UnassignedCaseList":
$sessionId = $frm["SESSION_ID"];
$params = array ('sessionId' => $sessionId );
$params = array ('sessionId' => $sessionId
);
$wsResponse = $client->__SoapCall ( 'UnassignedCaseList', array ($params ));
$wsResponse = $client->__SoapCall( 'UnassignedCaseList', array ($params
) );
$G_PUBLISH = new Publisher();
$rows [] = array ('guid' => 'char', 'name' => 'char', 'delIndex' => 'char' );
$rows[] = array ('guid' => 'char','name' => 'char','delIndex' => 'char'
);
$result = G::PMWSCompositeResponse( $wsResponse, 'cases' );
if (is_array( $result )) {
@@ -454,7 +472,8 @@ switch ($_POST ['action']) {
if (isset( $item->delIndex ))
$delIndex = $item->delIndex;
}
$rows [] = array ('guid' => $guid, 'name' => $name, 'delIndex' => $delIndex );
$rows[] = array ('guid' => $guid,'name' => $name,'delIndex' => $delIndex
);
}
global $_DBArray;
@@ -467,8 +486,7 @@ switch ($_POST ['action']) {
$c->setDBArrayTable( 'case' );
$G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'setup/wsrUnassignedCaseList', $c );
}
else if( is_object($result) ){
} else if (is_object( $result )) {
$_SESSION['WS_SESSION_ID'] = '';
$fields['status_code'] = $result->status_code;
$fields['message'] = $result->message;
@@ -478,15 +496,17 @@ switch ($_POST ['action']) {
G::RenderPage( 'publish', 'raw' );
break;
case "UserList":
$sessionId = $frm["SESSION_ID"];
$params = array ('sessionId' => $sessionId );
$wsResponse = $client->__SoapCall ( 'UserList', array ($params ) );
$params = array ('sessionId' => $sessionId
);
$wsResponse = $client->__SoapCall( 'UserList', array ($params
) );
$result = G::PMWSCompositeResponse( $wsResponse, 'users' );
$G_PUBLISH = new Publisher();
$rows [] = array ('guid' => 'char', 'name' => 'char' );
$rows[] = array ('guid' => 'char','name' => 'char'
);
if (is_array( $result )) {
foreach ($result as $key => $item) {
@@ -511,10 +531,10 @@ switch ($_POST ['action']) {
$name = $item->name;
}
$rows [] = array ('guid' => $guid, 'name' => $name );
$rows[] = array ('guid' => $guid,'name' => $name
);
}
global $_DBArray;
$_DBArray = (isset( $_SESSION['_DBArray'] ) ? $_SESSION['_DBArray'] : '');
$_DBArray['user'] = $rows;
@@ -535,7 +555,6 @@ switch ($_POST ['action']) {
}
G::RenderPage( 'publish', 'raw' );
break;
case "SendMessage":
require_once ('classes/model/Application.php');
$sessionId = $frm["SESSION_ID"];
@@ -558,15 +577,10 @@ switch ($_POST ['action']) {
$messageBody = "message for case: " . $caseNumber . "<br>" . $message;
file_put_contents( $templateFile, $messageBody );
$params = array ( 'sessionId' => $sessionId,
'caseId' => $caseId,
'from' => $from,
'to' => $to,
'cc' => $cc,
'bcc' => $bcc,
'subject' => $subject,
'template' => 'tempTemplate.hml' );
$result = $client->__SoapCall ( 'sendMessage', array ($params ) );
$params = array ('sessionId' => $sessionId,'caseId' => $caseId,'from' => $from,'to' => $to,'cc' => $cc,'bcc' => $bcc,'subject' => $subject,'template' => 'tempTemplate.hml'
);
$result = $client->__SoapCall( 'sendMessage', array ($params
) );
$G_PUBLISH = new Publisher();
$fields['status_code'] = $result->status_code;
$fields['message'] = $result->message;
@@ -579,7 +593,6 @@ switch ($_POST ['action']) {
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'setup/wsShowResult', null, $fields );
G::RenderPage( 'publish', 'raw' );
break;
case "SendVariables":
$sessionId = $frm["SESSION_ID"];
$caseId = $frm["CASE_ID"];
@@ -594,8 +607,10 @@ switch ($_POST ['action']) {
$o->value = $frm["VALUE2"];
array_push( $variables, $o );
$params = array ('sessionId' => $sessionId, 'caseId' => $caseId, 'variables' => $variables );
$result = $client->__SoapCall ( 'SendVariables', array ($params ) );
$params = array ('sessionId' => $sessionId,'caseId' => $caseId,'variables' => $variables
);
$result = $client->__SoapCall( 'SendVariables', array ($params
) );
$G_PUBLISH = new Publisher();
$fields['status_code'] = $result->status_code;
$fields['message'] = $result->message;
@@ -608,14 +623,15 @@ switch ($_POST ['action']) {
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'setup/wsShowResult', null, $fields );
G::RenderPage( 'publish', 'raw' );
break;
case "DerivateCase":
$sessionId = $frm["SESSION_ID"];
$caseId = $frm["CASE_ID"];
$delIndex = $frm["DEL_INDEX"];
$params = array ('sessionId' => $sessionId, 'caseId' => $caseId, 'delIndex' => $delIndex );
$result = $client->__SoapCall ( 'RouteCase', array ($params ) );
$params = array ('sessionId' => $sessionId,'caseId' => $caseId,'delIndex' => $delIndex
);
$result = $client->__SoapCall( 'RouteCase', array ($params
) );
$G_PUBLISH = new Publisher();
$fields['status_code'] = $result->status_code;
$fields['message'] = $result->message;
@@ -628,7 +644,6 @@ switch ($_POST ['action']) {
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'setup/wsShowResult', null, $fields );
G::RenderPage( 'publish', 'raw' );
break;
case "ReassignCase":
$sessionId = $frm["SESSION_ID"];
$caseId = $frm["CASE_ID"];
@@ -636,8 +651,10 @@ switch ($_POST ['action']) {
$userIdSource = $frm['USERIDSOURCE'];
$userIdTarget = $frm['USERIDTARGET'];
$params = array ('sessionId' => $sessionId, 'caseId' => $caseId, 'delIndex' => $delIndex, 'userIdSource' => $userIdSource, 'userIdTarget' => $userIdTarget );
$result = $client->__SoapCall ( 'reassignCase', array ($params ) );
$params = array ('sessionId' => $sessionId,'caseId' => $caseId,'delIndex' => $delIndex,'userIdSource' => $userIdSource,'userIdTarget' => $userIdTarget
);
$result = $client->__SoapCall( 'reassignCase', array ($params
) );
$G_PUBLISH = new Publisher();
$fields['status_code'] = $result->status_code;
@@ -650,9 +667,7 @@ switch ($_POST ['action']) {
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'setup/wsShowResult', null, $fields );
G::RenderPage( 'publish', 'raw' );
break;
case "NewCaseImpersonate":
$sessionId = $frm["SESSION_ID"];
$processId = $frm["PROCESS_ID"];
@@ -664,8 +679,10 @@ switch ($_POST ['action']) {
$o->value = $aRow['VALUE'];
array_push( $variables, $o );
}
$params = array ('sessionId' => $sessionId, 'processId' => $processId, 'userId' => $userId, 'variables' => $variables );
$result = $client->__SoapCall ( 'NewCaseImpersonate', array ($params ) );
$params = array ('sessionId' => $sessionId,'processId' => $processId,'userId' => $userId,'variables' => $variables
);
$result = $client->__SoapCall( 'NewCaseImpersonate', array ($params
) );
$G_PUBLISH = new Publisher();
$fields['status_code'] = $result->status_code;
$fields['message'] = $result->message;
@@ -678,7 +695,6 @@ switch ($_POST ['action']) {
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'setup/wsShowResult', null, $fields );
G::RenderPage( 'publish', 'raw' );
break;
case "NewCase":
$sessionId = $frm["SESSION_ID"];
$processId = $frm["PROCESS_ID"];
@@ -691,8 +707,10 @@ switch ($_POST ['action']) {
$o->value = $aRow['VALUE'];
array_push( $variables, $o );
}
$params = array ('sessionId' => $sessionId, 'processId' => $processId, 'taskId' => $taskId, 'variables' => $variables );
$result = $client->__SoapCall ( 'NewCase', array ($params ) );
$params = array ('sessionId' => $sessionId,'processId' => $processId,'taskId' => $taskId,'variables' => $variables
);
$result = $client->__SoapCall( 'NewCase', array ($params
) );
$G_PUBLISH = new Publisher();
@@ -710,13 +728,14 @@ switch ($_POST ['action']) {
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'setup/wsShowResult', null, $fields );
G::RenderPage( 'publish', 'raw' );
break;
case "AssignUserToGroup":
$sessionId = $frm["SESSION_ID"];
$userId = $frm["USER_ID"];
$groupId = $frm["GROUP_ID"];
$params = array ('sessionId' => $sessionId, 'userId' => $userId, 'groupId' => $groupId );
$result = $client->__SoapCall ( 'AssignUserToGroup', array ($params ) );
$params = array ('sessionId' => $sessionId,'userId' => $userId,'groupId' => $groupId
);
$result = $client->__SoapCall( 'AssignUserToGroup', array ($params
) );
$G_PUBLISH = new Publisher();
$fields['status_code'] = $result->status_code;
$fields['message'] = $result->message;
@@ -729,7 +748,6 @@ switch ($_POST ['action']) {
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'setup/wsShowResult', null, $fields );
G::RenderPage( 'publish', 'raw' );
break;
case "CreateUser":
$sessionId = $frm["SESSION_ID"];
$userId = $frm["USER_ID"];
@@ -739,8 +757,10 @@ switch ($_POST ['action']) {
$role = $frm["ROLE"];
$password = $frm["PASSWORD"];
$params = array ('sessionId' => $sessionId, 'userId' => $userId, 'firstname' => $firstname, 'lastname' => $lastname, 'email' => $email, 'role' => $role, 'password' => $password );
$result = $client->__SoapCall ( 'CreateUser', array ($params ) );
$params = array ('sessionId' => $sessionId,'userId' => $userId,'firstname' => $firstname,'lastname' => $lastname,'email' => $email,'role' => $role,'password' => $password
);
$result = $client->__SoapCall( 'CreateUser', array ($params
) );
$G_PUBLISH = new Publisher();
$fields['status_code'] = $result->status_code;
$fields['message'] = $result->message;
@@ -753,15 +773,17 @@ switch ($_POST ['action']) {
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'setup/wsShowResult', null, $fields );
G::RenderPage( 'publish', 'raw' );
break;
case "TaskList":
$sessionId = $frm["SESSION_ID"];
$params = array ('sessionId' => $sessionId );
$wsResponse = $client->__SoapCall ( 'TaskList', array ($params ) );
$params = array ('sessionId' => $sessionId
);
$wsResponse = $client->__SoapCall( 'TaskList', array ($params
) );
$result = G::PMWSCompositeResponse( $wsResponse, 'tasks' );
$G_PUBLISH = new Publisher();
$rows [] = array ('guid' => 'char', 'name' => 'char' );
$rows[] = array ('guid' => 'char','name' => 'char'
);
if (is_array( $result )) {
@@ -787,7 +809,8 @@ switch ($_POST ['action']) {
$name = $item->name;
}
$rows [] = array ('guid' => $guid, 'name' => $name );
$rows[] = array ('guid' => $guid,'name' => $name
);
}
global $_DBArray;
$_DBArray = (isset( $_SESSION['_DBArray'] ) ? $_SESSION['_DBArray'] : '');
@@ -808,16 +831,18 @@ switch ($_POST ['action']) {
}
G::RenderPage( 'publish', 'raw' );
break;
case "TriggerList":
$sessionId = $frm["SESSION_ID"];
$params = array ('sessionId' => $sessionId );
$params = array ('sessionId' => $sessionId
);
$wsResponse = $client->__SoapCall ( 'triggerList', array ($params ) );
$wsResponse = $client->__SoapCall( 'triggerList', array ($params
) );
$result = G::PMWSCompositeResponse( $wsResponse, 'triggers' );
$G_PUBLISH = new Publisher();
$rows [] = array ('guid' => 'char', 'name' => 'char', 'processId' => 'char' );
$rows[] = array ('guid' => 'char','name' => 'char','processId' => 'char'
);
if (is_array( $result )) {
foreach ($result as $key => $item) {
@@ -847,7 +872,8 @@ switch ($_POST ['action']) {
if (isset( $item->processId ))
$processId = $item->processId;
}
$rows [] = array ('guid' => $guid, 'name' => $name, 'processId' => $processId );
$rows[] = array ('guid' => $guid,'name' => $name,'processId' => $processId
);
}
global $_DBArray;
@@ -882,19 +908,21 @@ switch ($_POST ['action']) {
G::RenderPage( 'publish', 'raw' );
break;
case "InputDocumentList":
$caseId = $frm["CASE_ID"];
$sessionId = $frm["SESSION_ID"];
$params = array ('sessionId' => $sessionId, 'caseId' => $caseId );
$params = array ('sessionId' => $sessionId,'caseId' => $caseId
);
$wsResponse = $client->__SoapCall ( 'InputDocumentList', array ($params ) );
$wsResponse = $client->__SoapCall( 'InputDocumentList', array ($params
) );
//g::pr($wsResponse);
$result = G::PMWSCompositeResponse( $wsResponse, 'documents' );
$G_PUBLISH = new Publisher();
$rows [] = array ('guid' => 'char', 'name' => 'char', 'processId' => 'char' );
$rows[] = array ('guid' => 'char','name' => 'char','processId' => 'char'
);
if (is_array( $result )) {
foreach ($result as $key => $item) {
@@ -954,23 +982,26 @@ switch ($_POST ['action']) {
if (isset( $item->link ))
$link = $item->link;
}
$rows [] = array ('guid' => $guid, 'filename' => $filename, 'docId' => $docId, 'version' => $version,
'createDate' => $createDate, 'createBy' => $createBy, 'type' => $type, 'link' => $link );
$rows[] = array ('guid' => $guid,'filename' => $filename,'docId' => $docId,'version' => $version,'createDate' => $createDate,'createBy' => $createBy,'type' => $type,'link' => $link
);
}
global $_DBArray;
$_DBArray = (isset( $_SESSION['_DBArray'] ) ? $_SESSION['_DBArray'] : '');
$_DBArray['inputDocument'] = $rows;
$documentArray = array ();
$documentArray[] = array ('guid' => 'char', 'filename' => 'char' );
$documentArray[] = array ('guid' => 'char','filename' => 'char'
);
if (isset( $_DBArray['inputDocument'] ))
foreach ($_DBArray['inputDocument'] as $key => $val)
if ($key != 0 && isset( $val['filename'] ))
$documentArray[] = array ('guid' => $val['guid'], 'filename' => $val['filename'] );
$documentArray[] = array ('guid' => $val['guid'],'filename' => $val['filename']
);
if (isset( $_DBArray['outputDocument'] ))
foreach ($_DBArray['outputDocument'] as $key => $val)
if ($key != 0 && isset( $val['filename'] ))
$documentArray[] = array ('guid' => $val['guid'], 'filename' => $val['filename'] );
$documentArray[] = array ('guid' => $val['guid'],'filename' => $val['filename']
);
$_DBArray['documents'] = $documentArray;
$_DBArray['WS_TMP_CASE_UID'] = $frm["CASE_ID"];
$_SESSION['_DBArray'] = $_DBArray;
@@ -989,19 +1020,20 @@ switch ($_POST ['action']) {
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'setup/wsShowResult', null, $fields );
}
G::RenderPage( 'publish', 'raw' );
break;
case "InputDocumentProcessList":
$processId = $frm["PROCESS_ID"];
$sessionId = $frm["SESSION_ID"];
$params = array ('sessionId' => $sessionId, 'processId' => $processId );
$params = array ('sessionId' => $sessionId,'processId' => $processId
);
$wsResponse = $client->__SoapCall ( 'InputDocumentProcessList', array ($params ) );
$wsResponse = $client->__SoapCall( 'InputDocumentProcessList', array ($params
) );
$result = G::PMWSCompositeResponse( $wsResponse, 'documents' );
$G_PUBLISH = new Publisher();
$rows [] = array ('guid' => 'char', 'name' => 'char', 'description' => 'char' );
$rows[] = array ('guid' => 'char','name' => 'char','description' => 'char'
);
if (is_array( $result )) {
foreach ($result as $key => $item) {
if (isset( $item->item ))
@@ -1030,7 +1062,8 @@ switch ($_POST ['action']) {
if (isset( $item->description ))
$description = $item->description;
}
$rows [] = array ('guid' => $guid, 'name' => $name, 'description' => $description );
$rows[] = array ('guid' => $guid,'name' => $name,'description' => $description
);
}
global $_DBArray;
$_DBArray = (isset( $_SESSION['_DBArray'] ) ? $_SESSION['_DBArray'] : '');
@@ -1051,19 +1084,20 @@ switch ($_POST ['action']) {
}
G::RenderPage( 'publish', 'raw' );
break;
case "OutputDocumentList":
$caseId = $frm["CASE_ID"];
$sessionId = $frm["SESSION_ID"];
$params = array ('sessionId' => $sessionId, 'caseId' => $caseId );
$params = array ('sessionId' => $sessionId,'caseId' => $caseId
);
$wsResponse = $client->__SoapCall ( 'outputDocumentList', array ($params ) );
$wsResponse = $client->__SoapCall( 'outputDocumentList', array ($params
) );
$result = G::PMWSCompositeResponse( $wsResponse, 'documents' );
$G_PUBLISH = new Publisher();
$rows = array ();
$rows [] = array ('guid' => 'char', 'name' => 'char' );
$rows[] = array ('guid' => 'char','name' => 'char'
);
if (is_array( $result )) {
foreach ($result as $key => $item) {
@@ -1123,22 +1157,25 @@ switch ($_POST ['action']) {
if (isset( $item->link ))
$link = $item->link;
}
$rows [] = array ('guid' => $guid, 'filename' => $filename, 'docId' => $docId, 'version' => $version,
'createDate' => $createDate, 'createBy' => $createBy, 'type' => $type, 'link' => $link );
$rows[] = array ('guid' => $guid,'filename' => $filename,'docId' => $docId,'version' => $version,'createDate' => $createDate,'createBy' => $createBy,'type' => $type,'link' => $link
);
}
global $_DBArray;
$_DBArray = (isset( $_SESSION['_DBArray'] ) ? $_SESSION['_DBArray'] : '');
$_DBArray['outputDocument'] = $rows;
$documentArray = array ();
$documentArray[] = array ('guid' => 'char', 'filename' => 'char' );
$documentArray[] = array ('guid' => 'char','filename' => 'char'
);
if (isset( $_DBArray['inputDocument'] ))
foreach ($_DBArray['inputDocument'] as $key => $val)
if ($key != 0 && isset( $val['filename'] ))
$documentArray[] = array ('guid' => $val['guid'], 'filename' => $val['filename'] );
$documentArray[] = array ('guid' => $val['guid'],'filename' => $val['filename']
);
if (isset( $_DBArray['outputDocument'] ))
foreach ($_DBArray['outputDocument'] as $key => $val)
if ($key != 0 && isset( $val['filename'] ))
$documentArray[] = array ('guid' => $val['guid'], 'filename' => $val['filename'] );
$documentArray[] = array ('guid' => $val['guid'],'filename' => $val['filename']
);
$_DBArray['documents'] = $documentArray;
$_SESSION['_DBArray'] = $_DBArray;
@@ -1162,8 +1199,10 @@ case "removeUserFromGroup" :
$sessionId = $frm["SESSION_ID"];
$userId = $frm["USER_ID"];
$groupId = $frm["GROUP_ID"];
$params = array ('sessionId' => $sessionId, 'userId' => $userId, 'groupId' => $groupId );
$result = $client->__SoapCall ( 'removeUserFromGroup', array ($params ) );
$params = array ('sessionId' => $sessionId,'userId' => $userId,'groupId' => $groupId
);
$result = $client->__SoapCall( 'removeUserFromGroup', array ($params
) );
$G_PUBLISH = new Publisher();
$fields['status_code'] = $result->status_code;
$fields['message'] = $result->message;
@@ -1179,8 +1218,10 @@ case "removeUserFromGroup" :
case "RemoveDocument":
$appDocUid = $frm["APP_DOC_UID"];
$sessionId = $frm["SESSION_ID"];
$params = array ('sessionId' => $sessionId, 'appDocUid' => $appDocUid );
$result = $client->__SoapCall ( 'RemoveDocument', array ($params ) );
$params = array ('sessionId' => $sessionId,'appDocUid' => $appDocUid
);
$result = $client->__SoapCall( 'RemoveDocument', array ($params
) );
$fields['status_code'] = $result->status_code;
$fields['message'] = $result->message;
$fields['time_stamp'] = $result->timestamp;
@@ -1193,43 +1234,54 @@ case "removeUserFromGroup" :
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'setup/wsShowResult', null, $fields );
G::RenderPage( 'publish', 'raw' );
break;
case "TaskCase":
$sessionId = $frm["SESSION_ID"];
$caseId = $frm["CASE_ID"];
$params = array ('sessionId' => $sessionId, 'caseId' => $caseId );
$wsResponse = $client->__SoapCall ( 'TaskCase', array ($params ) );
$params = array ('sessionId' => $sessionId,'caseId' => $caseId
);
$wsResponse = $client->__SoapCall( 'TaskCase', array ($params
) );
$result = G::PMWSCompositeResponse( $wsResponse, 'taskCases' );
$G_PUBLISH = new Publisher();
$rows [] = array ('guid' => 'char', 'name' => 'char' );
$rows[] = array ('guid' => 'char','name' => 'char'
);
if (is_array( $result )) {
foreach ($result as $key => $item) {
if (isset( $item->item ))
foreach ($item->item as $index => $val) {
if ($val->key == 'guid')
if ($val->key == 'guid') {
$guid = $val->value;
if ($val->key == 'name')
}
if ($val->key == 'name') {
$name = $val->value;
}
}
else if (is_array( $item ))
foreach ($item as $index => $val) {
if ($val->key == 'guid')
$guid = $val->value;
if ($val->key == 'name')
}
if ($val->key == 'name') {
$name = $val->value;
}
else {
if (isset ( $item->guid ))
}
else
{
if (isset( $item->guid )) {
$guid = $item->guid;
if (isset ( $item->name ))
}
if (isset( $item->name )) {
$name = $item->name;
}
}
$rows [] = array ('guid' => $guid, 'name' => $name );
$rows[] = array ('guid' => $guid,'name' => $name
);
}
global $_DBArray;
@@ -1242,7 +1294,9 @@ case "removeUserFromGroup" :
$c->setDBArrayTable( 'taskCases' );
$c->addAscendingOrderByColumn( 'name' );
$G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'setup/wsrTaskCase', $c );
} else if ( is_object($result) ){
} else
if (is_object( $result )) {
$_SESSION['WS_SESSION_ID'] = '';
$fields['status_code'] = $result->status_code;
$fields['message'] = $result->message;
@@ -1252,8 +1306,9 @@ case "removeUserFromGroup" :
G::RenderPage( 'publish', 'raw' );
break;
case "wsSendFiles":
if (isset( $_FILES['form'] )) {
foreach ($_FILES['form']['name'] as $sFieldName => $vValue) {
if ($_FILES['form']['error'][$sFieldName] == 0) {
@@ -1268,7 +1323,6 @@ case "removeUserFromGroup" :
$_POST['form']['INPUT_DOCUMENT'] = '';
}
if (isset( $_SESSION['_DBArray']['inputDocument'] )) {
foreach ($_SESSION['_DBArray']['inputDocument'] as $inputDocument) {
if ($inputDocument['guid'] == $_POST['form']['INPUT_DOCUMENT']) {
@@ -1285,24 +1339,17 @@ case "removeUserFromGroup" :
$app_uid = $_SESSION['_DBArray']['WS_TMP_CASE_UID'];
$del_index = 1;
function sendFile($FILENAME, $USR_UID, $APP_UID, $DEL_INDEX = 1, $DOC_UID = NULL, $title = NULL, $comment = NULL) {
function sendFile ($FILENAME, $USR_UID, $APP_UID, $DEL_INDEX = 1, $DOC_UID = null, $title = null, $comment = null)
{
$defaultEndpoint = 'http://' . $_SERVER['SERVER_NAME'] . ':' . $_SERVER['SERVER_PORT'] . '/sys' . SYS_SYS . '/' . SYS_LANG . '/classic/services/upload';
$upload = isset( $_SESSION['END_POINT'] ) ? $_SESSION['END_POINT'] : $defaultEndpoint;
$DOC_UID = ($DOC_UID != NULL) ? $DOC_UID : - 1;
$DOC_UID = ($DOC_UID != null) ? $DOC_UID : - 1;
$APP_DOC_TYPE = ($DOC_UID == - 1) ? 'ATTACHED' : 'INPUT';
$title = ($title != NULL) ? $title : $FILENAME;
$comment = ($comment != NULL) ? $comment : '';
$title = ($title != null) ? $title : $FILENAME;
$comment = ($comment != null) ? $comment : '';
$params = array (
'ATTACH_FILE' => "@$FILENAME",
'APPLICATION' => $APP_UID,
'INDEX' => $DEL_INDEX,
'USR_UID' => $USR_UID,
'DOC_UID' => $DOC_UID,
'APP_DOC_TYPE' => $APP_DOC_TYPE,
'TITLE' => $title,
'COMMENT' => $comment
$params = array ('ATTACH_FILE' => "@$FILENAME",'APPLICATION' => $APP_UID,'INDEX' => $DEL_INDEX,'USR_UID' => $USR_UID,'DOC_UID' => $DOC_UID,'APP_DOC_TYPE' => $APP_DOC_TYPE,'TITLE' => $title,'COMMENT' => $comment
);
$ch = curl_init();
@@ -1331,12 +1378,15 @@ case "removeUserFromGroup" :
die();
break;
default:
print_r( $_POST );
}
}
global $_DBArray;
global $_DBArray;
} catch (Exception $e) {
$G_PUBLISH = new Publisher();
$aMessage['MESSAGE'] = $e->getMessage();

View File

@@ -20,17 +20,17 @@
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
if ($RBAC->userCanAccess( 'PM_SETUP' ) != 1 && $RBAC->userCanAccess( 'PM_FACTORY' ) != 1) {
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
//G::header('location: ../login/login');
die;
die();
}
//G::genericForceLogin( 'WF_MYINFO' , 'login/noViewPage', $urlLogin = 'login/login' );
$G_PUBLISH = new Publisher;
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'view', 'setup/webServicesTree' );
G::RenderPage( "publish-raw", "raw" );
?>

View File

@@ -20,9 +20,9 @@
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
if (($RBAC_Response=$RBAC->userCanAccess("PM_FACTORY"))!=1) return $RBAC_Response;
if (($RBAC_Response = $RBAC->userCanAccess( "PM_FACTORY" )) != 1)
return $RBAC_Response;
G::LoadClass( 'groups' );
@@ -32,12 +32,10 @@ if (($RBAC_Response=$RBAC->userCanAccess("PM_FACTORY"))!=1) return $RBAC_Respons
if (! isset( $_SESSION['END_POINT'] )) {
$aFields['WS_HOST'] = $_SERVER['HTTP_HOST'];
$aFields['WS_WORKSPACE'] = SYS_SYS;
}
else {
} else {
if (strpos( $_SESSION['END_POINT'], 'https' ) !== false) {
preg_match( '@^(?:https://)?([^/]+)@i', $_SESSION['END_POINT'], $coincidencias );
}
else {
} else {
preg_match( '@^(?:http://)?([^/]+)@i', $_SESSION['END_POINT'], $coincidencias );
}
$aAux = explode( ':', $coincidencias[1] );
@@ -48,9 +46,12 @@ if (($RBAC_Response=$RBAC->userCanAccess("PM_FACTORY"))!=1) return $RBAC_Respons
$aFields['WS_WORKSPACE'] = substr( $aAux[1], 3 );
}
$rows[] = array ( 'uid' => 'char', 'name' => 'char', 'age' => 'integer', 'balance' => 'float' );
$rows[] = array ( 'uid' => 'http', 'name' => 'http' );
$rows[] = array ( 'uid' => 'https', 'name' => 'https' );
$rows[] = array ('uid' => 'char','name' => 'char','age' => 'integer','balance' => 'float'
);
$rows[] = array ('uid' => 'http','name' => 'http'
);
$rows[] = array ('uid' => 'https','name' => 'https'
);
$_DBArray['protocol'] = $rows;
$_SESSION['_DBArray'] = $_DBArray;
@@ -60,4 +61,3 @@ $_SESSION['_DBArray'] = $_DBArray;
G::RenderPage( "publish", "raw" );
?>

View File

@@ -1,22 +1,16 @@
<?php
unset( $_SESSION['WS_SESSION_ID'] );
if($_POST['form']['WS_PROTOCOL']!='' && $_POST['form']['WS_WORKSPACE']!='')
{
if($_POST['form']['WS_PORT']!='')
{
if ($_POST['form']['WS_PROTOCOL'] != '' && $_POST['form']['WS_WORKSPACE'] != '') {
if ($_POST['form']['WS_PORT'] != '') {
$_SESSION['END_POINT'] = $_POST['form']['WS_PROTOCOL'] . '://' . $_POST['form']['WS_HOST'] . ':' . $_POST['form']['WS_PORT'] . '/sys' . $_POST['form']['WS_WORKSPACE'] . '/en/classic/services/wsdl2';
G::header( 'location: webServices?x=1' );
}
else
{ $_SESSION['END_POINT']=$_POST['form']['WS_PROTOCOL'].'://' .$_POST['form']['WS_HOST'] .'/sys' .$_POST['form']['WS_WORKSPACE'].'/en/classic/services/wsdl2';
} else {
$_SESSION['END_POINT'] = $_POST['form']['WS_PROTOCOL'] . '://' . $_POST['form']['WS_HOST'] . '/sys' . $_POST['form']['WS_WORKSPACE'] . '/en/classic/services/wsdl2';
G::header( 'location: webServices?x=1' );
}
$_SESSION['WS_WORKSPACE'] = $_POST['form']['WS_WORKSPACE'];
}
else
{
} else {
G::header( 'location: webServices?x=0' );
}
?>

View File

@@ -20,31 +20,34 @@
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
if (($RBAC_Response=$RBAC->userCanAccess("PM_SETUP"))!=1) return $RBAC_Response;
if (($RBAC_Response = $RBAC->userCanAccess( "PM_SETUP" )) != 1)
return $RBAC_Response;
G::LoadInclude( 'ajax' );
$G_ENABLE_BLANK_SKIN = true;
$ARR_WEEKDAYS[0] = array('SUNDAY', 'MONDAY', 'TUESDAY', 'WEDNESDAY', 'THURSDAY', 'FRIDAY', 'SATURDAY');
$ARR_WEEKDAYS['es'] = array("Domingo?", "Lunes?", "Martes?", "Miércoles?", "Jueves?", "Viernes?", "Sábado?");
$ARR_WEEKDAYS['en'] = array("Sunday?", "Monday?", "Tuesday?", "Wednesday?", "Thursday?", "Friday?", "Saturday?");
$ARR_WEEKDAYS['fa'] = array('یکشنبه','دوشنبه','سه شنبه','چهارشنبه','پنجشنبه ','جمعه','آدینه');
$ARR_WEEKDAYS[0] = array ('SUNDAY','MONDAY','TUESDAY','WEDNESDAY','THURSDAY','FRIDAY','SATURDAY'
);
$ARR_WEEKDAYS['es'] = array ("Domingo?","Lunes?","Martes?","Miércoles?","Jueves?","Viernes?","Sábado?"
);
$ARR_WEEKDAYS['en'] = array ("Sunday?","Monday?","Tuesday?","Wednesday?","Thursday?","Friday?","Saturday?"
);
$ARR_WEEKDAYS['fa'] = array ('یکشنبه','دوشنبه','سه شنبه','چهارشنبه','پنجشنبه ','جمعه','آدینه'
);
$dbc = new DBConnection;
$dbc = new DBConnection();
$ses = new DBSession( $dbc );
$holidays = $ses->execute( "SELECT LEX_VALUE FROM LEXICO WHERE LEX_TOPIC ='NOWORKINGDAY' " );
$config = array ();
for($id=0;$id<7;$id++)
{
for ($id = 0; $id < 7; $id ++) {
$res = $ses->execute( " SELECT * FROM LEXICO WHERE LEX_KEY = '" . $ARR_WEEKDAYS[0][$id] . "' AND LEX_TOPIC ='HOLIDAY' " );
$res = $res->read();
$config[$ARR_WEEKDAYS[0][$id]] = $res['LEX_VALUE'];
}
$G_PUBLISH = new Publisher;
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'setup/weekend', '', $config, '' );
G::RenderPage( 'publish' );
?>

View File

@@ -20,9 +20,9 @@
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
if (($RBAC_Response=$RBAC->userCanAccess("PM_SETUP"))!=1) return $RBAC_Response;
if (($RBAC_Response = $RBAC->userCanAccess( "PM_SETUP" )) != 1)
return $RBAC_Response;
G::ForceLogin( 'WF_PROCESS' );
G::LoadInclude( 'ajax' );
@@ -36,14 +36,15 @@ $G_ID_MENU_SELECTED = "SETUP";
$G_ID_SUB_MENU_SELECTED = "ENVIRONMENT";
$G_ID_THIRD_MENU_SELECTED = "WEEKEND";
$dbc = new DBConnection;
$dbc = new DBConnection();
$ses = new DBSession( $dbc );
$holidays = $ses->execute( 'SELECT LEX_VALUE FROM LEXICO WHERE LEX_TOPIC ="HOLIDAY"' );
$funcion = strtolower( get_ajax_value( 'function' ) );
$funcions = get_defined_functions();
if (in_array($funcion,$funcions['user'])) eval($funcion.'();');
if (in_array( $funcion, $funcions['user'] ))
eval( $funcion . '();' );
function setDays ()
{
@@ -54,6 +55,7 @@ function setDays()
for ($r = 1; $r < sizeof( $days ); $r ++)
setDay( $days[$r], $values[$r] );
}
function setDay ($day, $dayValue)
{
global $ses;
@@ -67,4 +69,4 @@ function setDay($day,$dayValue)
$res = $res->read();
echo ($res['LEX_VALUE'] == '1') ? 'true' : 'false';
}
?>

View File

@@ -1,13 +1,10 @@
function abc(panel, txt) {
/* commonDialog ( '', 'saved' , 'saved', {}, '' ) ;
setTimeout ( leimnud.closure({instance:myDialog,method:function(panel){
myDialog.remove();
panel.tabLastSelected=false;
panel.tabSelected=1;
panel.makeTab();
},args:panel}) , 1000 );
/*
* commonDialog ( '', 'saved' , 'saved', {}, '' ) ; setTimeout (
* leimnud.closure({instance:myDialog,method:function(panel){
*
* myDialog.remove(); panel.tabLastSelected=false; panel.tabSelected=1;
* panel.makeTab(); },args:panel}) , 1000 );
*/
var img = document.getElementById('workPeriodGraph');
img.src = 'workPeriodGraph?b=' + Math.random();
@@ -17,4 +14,3 @@ function abc( panel, txt ) {
return false;
}

View File

@@ -20,14 +20,14 @@
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
if (($RBAC_Response=$RBAC->userCanAccess("PM_SETUP"))!=1) return $RBAC_Response;
if (($RBAC_Response = $RBAC->userCanAccess( "PM_SETUP" )) != 1)
return $RBAC_Response;
$G_ENABLE_BLANK_SKIN = true;
G::LoadClass( "workPeriod" );
$dbc = new DBConnection;
$dbc = new DBConnection();
$ses = new DBSession( $dbc );
$obj = new workPeriod( $dbc );
@@ -41,9 +41,9 @@ if (($RBAC_Response=$RBAC->userCanAccess("PM_SETUP"))!=1) return $RBAC_Response;
$row['FRIDAY'] = $row['noWorkingDays'][5];
$row['SATURDAY'] = $row['noWorkingDays'][6];
$G_PUBLISH = new Publisher;
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( "image", "image", "workPeriodGraph" );
$G_PUBLISH->AddContent( "xmlform", "xmlform", "setup/workPeriod", "", $row, "workPeriodSave" );
G::RenderPage( 'publish' );
?>

View File

@@ -20,14 +20,14 @@
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
if (($RBAC_Response=$RBAC->userCanAccess("PM_SETUP"))!=1) return $RBAC_Response;
if (($RBAC_Response = $RBAC->userCanAccess( "PM_SETUP" )) != 1)
return $RBAC_Response;
Header( "Content-type: image/jpeg" );
G::LoadClass( "workPeriod" );
$dbc = new DBConnection;
$dbc = new DBConnection();
$ses = new DBSession( $dbc );
$obj = new workPeriod( $dbc );
@@ -60,8 +60,8 @@ if (($RBAC_Response=$RBAC->userCanAccess("PM_SETUP"))!=1) return $RBAC_Response;
ImageFilledRectangle( $im, 0, 0, $width - 1, $height - 1, $bgcolor );
ImageRectangle( $im, 0, 0, $width - 1, $height - 1, $black );
$x = 10; $y = 20;
$x = 10;
$y = 20;
$x1 = 78;
$x2 = $x1 + 2 * 6;
@@ -81,7 +81,8 @@ if (($RBAC_Response=$RBAC->userCanAccess("PM_SETUP"))!=1) return $RBAC_Response;
$color = $orange;
else
$color = $white;
if ( isset ( $noWorkingDays[ $day ]) && $noWorkingDays[ $day ] ) $color = $white;
if (isset( $noWorkingDays[$day] ) && $noWorkingDays[$day])
$color = $white;
ImageFillToBorder( $im, $x1 + $i * 4 + 1, $y + 1, $plomo, $color );
}
@@ -98,5 +99,6 @@ if (($RBAC_Response=$RBAC->userCanAccess("PM_SETUP"))!=1) return $RBAC_Response;
}
//ImageString($im, 2, 5, 5, $initPeriod1*6 . ", $endPeriod1, $initPeriod2, $endPeriod2 ", $black);
ImageJpeg( $im );
?>

View File

@@ -20,9 +20,9 @@
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
if (($RBAC_Response=$RBAC->userCanAccess("PM_SETUP"))!=1) return $RBAC_Response;
if (($RBAC_Response = $RBAC->userCanAccess( "PM_SETUP" )) != 1)
return $RBAC_Response;
G::LoadClass( "workPeriod" );
$frm = $_POST['form'];
@@ -39,5 +39,5 @@ if (($RBAC_Response=$RBAC->userCanAccess("PM_SETUP"))!=1) return $RBAC_Response;
$obj->Save( $frm['initPeriod1'], $frm['endPeriod1'], $frm['initPeriod2'], $frm['endPeriod2'], $noWorkingDays );
print "ok";
die;
?>
die();

View File

@@ -20,7 +20,6 @@
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
try {
global $RBAC;
@@ -28,12 +27,12 @@ try {
case - 2:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
G::header( 'location: ../login/login' );
die;
die();
break;
case - 1:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' );
die;
die();
break;
}
require_once 'classes/model/Step.php';
@@ -43,8 +42,7 @@ try {
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'steps/conditions_Edit', '', $aFields, '../steps/conditions_Save' );
G::RenderPage( 'publish-raw', 'raw' );
}
catch (Exception $oException) {
} catch (Exception $oException) {
die( $oException->getMessage() );
}
?>

View File

@@ -20,7 +20,6 @@
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
try {
global $RBAC;
@@ -28,12 +27,12 @@ try {
case - 2:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
G::header( 'location: ../login/login' );
die;
die();
break;
case - 1:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' );
die;
die();
break;
}
require_once 'classes/model/Step.php';
@@ -42,12 +41,12 @@ try {
$value = $_POST['form'];
else
$value = $_POST;
$oStep->update(array('STEP_UID' => $value['STEP_UID'], 'STEP_CONDITION' => $value['STEP_CONDITION']));
$oStep->update( array ('STEP_UID' => $value['STEP_UID'],'STEP_CONDITION' => $value['STEP_CONDITION']
) );
G::LoadClass( 'processMap' );
$oProcessMap = new ProcessMap();
$oProcessMap->getStepsCriteria( $value['TAS_UID'] );
}
catch (Exception $oException) {
} catch (Exception $oException) {
die( $oException->getMessage() );
}
?>

View File

@@ -20,21 +20,19 @@
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
try {
global $RBAC;
switch ($RBAC->userCanAccess('PM_FACTORY'))
{
switch ($RBAC->userCanAccess( 'PM_FACTORY' )) {
case - 2:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
G::header( 'location: ../login/login' );
die;
die();
break;
case - 1:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' );
die;
die();
break;
}
@@ -43,12 +41,10 @@ try {
G::LoadInclude( 'ajax' );
if (! empty( $_GET )) {
$aData = urldecode_values( $_GET );
}
else {
} else {
if (! isset( $_POST['form'] )) {
$aData = urldecode_values( $_POST );
}
else {
} else {
$aData = urldecode_values( $_POST['form'] );
}
}
@@ -59,10 +55,11 @@ try {
global $G_PUBLISH;
$G_PUBLISH = new Publisher();
if ($aData['sType'] == 'BEFORE') {
$G_PUBLISH->AddContent('propeltable', 'paged-table', 'steps/triggersBefore_List', $oProcessMap->getStepTriggersCriteria($aData['sStep'], $_SESSION['TASK'], $aData['sType']), array('STEP' => $aData['sStep']));
}
else {
$G_PUBLISH->AddContent('propeltable', 'paged-table', 'steps/triggersAfter_List', $oProcessMap->getStepTriggersCriteria($aData['sStep'], $_SESSION['TASK'], $aData['sType']), array('STEP' => $aData['sStep']));
$G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'steps/triggersBefore_List', $oProcessMap->getStepTriggersCriteria( $aData['sStep'], $_SESSION['TASK'], $aData['sType'] ), array ('STEP' => $aData['sStep']
) );
} else {
$G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'steps/triggersAfter_List', $oProcessMap->getStepTriggersCriteria( $aData['sStep'], $_SESSION['TASK'], $aData['sType'] ), array ('STEP' => $aData['sStep']
) );
}
G::RenderPage( 'publish-twocolumns', 'raw' );
break;
@@ -102,8 +99,7 @@ try {
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'steps/triggers_Assign', '', $aFields, '../steps/steps_Ajax' );
G::RenderPage( 'publish', 'raw' );
}
else {
} else {
global $G_PUBLISH;
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'steps/triggers_NoAssign', '' );
@@ -111,7 +107,8 @@ try {
}
break;
case 'assignTrigger':
$aFields = array('STEP_UID' => $aData['STEP_UID'], 'TAS_UID' => $_SESSION['TASK'], 'TRI_UID' => $aData['TRI_UID'], 'ST_TYPE' => $aData['ST_TYPE']);
$aFields = array ('STEP_UID' => $aData['STEP_UID'],'TAS_UID' => $_SESSION['TASK'],'TRI_UID' => $aData['TRI_UID'],'ST_TYPE' => $aData['ST_TYPE']
);
$oStepTrigger = new StepTrigger();
$oStepTrigger->create( $aFields );
$aFields['ST_CONDITION'] = $aData['ST_CONDITION'];
@@ -142,7 +139,8 @@ try {
break;
case 'saveTriggerCondition':
$oStepTrigger = new StepTrigger();
$oStepTrigger->update(array('STEP_UID' => $aData['STEP_UID'], 'TAS_UID' => $_SESSION['TASK'], 'TRI_UID' => $aData['TRI_UID'], 'ST_TYPE' => $aData['ST_TYPE'], 'ST_CONDITION' => $aData['ST_CONDITION']));
$oStepTrigger->update( array ('STEP_UID' => $aData['STEP_UID'],'TAS_UID' => $_SESSION['TASK'],'TRI_UID' => $aData['TRI_UID'],'ST_TYPE' => $aData['ST_TYPE'],'ST_CONDITION' => $aData['ST_CONDITION']
) );
break;
case 'upTrigger':
$aData['iPosition'] = (int) $aData['iPosition'];
@@ -159,15 +157,13 @@ try {
$oStepTrigger->reOrder( $aData['sStep'], $_SESSION['TASK'], $aData['sType'], $aData['iPosition'] );
$oStepTrigger->remove( $aData['sStep'], $_SESSION['TASK'], $aData['sTrigger'], $aData['sType'] );
break;
case 'counterTriggers':
G::LoadClass( 'processMap' );
$oProcessMap = new ProcessMap();
$oCriteria1 = $oProcessMap->getStepTriggersCriteria( $aData['sStep'], $_SESSION['TASK'], $aData['sType'] );
if ($aData['sType'] == 'BEFORE') {
$oCriteria2 = $oProcessMap->getStepTriggersCriteria( $aData['sStep'], $_SESSION['TASK'], 'AFTER' );
}
else {
} else {
$oCriteria2 = $oProcessMap->getStepTriggersCriteria( $aData['sStep'], $_SESSION['TASK'], 'BEFORE' );
}
$iCantity = StepTriggerPeer::doCount( $oCriteria1 );
@@ -175,8 +171,7 @@ try {
echo $iTotal . '|' . $iCantity;
break;
}
}
catch (Exception $oException) {
} catch (Exception $oException) {
die( $oException->getMessage() );
}
?>

View File

@@ -20,21 +20,19 @@
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
try {
global $RBAC;
switch ($RBAC->userCanAccess('PM_FACTORY'))
{
switch ($RBAC->userCanAccess( 'PM_FACTORY' )) {
case - 2:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
G::header( 'location: ../login/login' );
die;
die();
break;
case - 1:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' );
die;
die();
break;
}
require_once 'classes/model/Step.php';
@@ -44,8 +42,7 @@ try {
G::LoadClass( 'processMap' );
$oProcessMap = new ProcessMap();
$oProcessMap->getStepsCriteria( $_POST['TASK'] );
}
catch (Exception $oException) {
} catch (Exception $oException) {
die( $oException->getMessage() );
}
?>

View File

@@ -20,21 +20,19 @@
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
try {
global $RBAC;
switch ($RBAC->userCanAccess('PM_FACTORY'))
{
switch ($RBAC->userCanAccess( 'PM_FACTORY' )) {
case - 2:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
G::header( 'location: ../login/login' );
die;
die();
break;
case - 1:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' );
die;
die();
break;
}
require_once 'classes/model/Step.php';
@@ -43,8 +41,7 @@ try {
G::LoadClass( 'processMap' );
$oProcessMap = new ProcessMap();
$oProcessMap->getStepsCriteria( $_POST['TASK'] );
}
catch (Exception $oException) {
} catch (Exception $oException) {
die( $oException->getMessage() );
}
?>

View File

@@ -20,7 +20,6 @@
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
try {
global $RBAC;
@@ -28,12 +27,12 @@ try {
case - 2:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
G::header( 'location: ../login/login' );
die;
die();
break;
case - 1:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' );
die;
die();
break;
}
G::LoadClass( 'processMap' );
@@ -42,8 +41,7 @@ try {
$G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'steps/steps_availableBB', $oProcessMap->getAvailableBBCriteria( $_GET['PROCESS'], $_GET['TASK'] ), $_GET );
G::RenderPage( 'publish-raw', 'raw' );
}
catch (Exception $oException) {
} catch (Exception $oException) {
die( $oException->getMessage() );
}
?>

View File

@@ -20,7 +20,6 @@
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
try {
global $RBAC;
@@ -28,27 +27,24 @@ try {
case - 2:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
G::header( 'location: ../login/login' );
die;
die();
break;
case - 1:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' );
die;
die();
break;
}
require_once 'classes/model/Step.php';
$oStep = new Step();
$sStepUID = $oStep->create(array('PRO_UID' => $_POST['sProcess'], 'TAS_UID' => $_POST['sTask']));
$oStep->update(array('STEP_UID' => $sStepUID,
'STEP_TYPE_OBJ' => $_POST['sType'],
'STEP_UID_OBJ' => $_POST['sUID'],
'STEP_POSITION' => ($oStep->getNextPosition($_POST['sTask']) - 1),
'STEP_MODE' => (isset($_POST['sMode'])) ? $_POST['sMode'] : 'EDIT'));
$sStepUID = $oStep->create( array ('PRO_UID' => $_POST['sProcess'],'TAS_UID' => $_POST['sTask']
) );
$oStep->update( array ('STEP_UID' => $sStepUID,'STEP_TYPE_OBJ' => $_POST['sType'],'STEP_UID_OBJ' => $_POST['sUID'],'STEP_POSITION' => ($oStep->getNextPosition( $_POST['sTask'] ) - 1),'STEP_MODE' => (isset( $_POST['sMode'] )) ? $_POST['sMode'] : 'EDIT'
) );
G::LoadClass( 'processMap' );
$oProcessMap = new ProcessMap();
$oProcessMap->getStepsCriteria( $_POST['sTask'] );
}
catch (Exception $oException) {
} catch (Exception $oException) {
die( $oException->getMessage() );
}
?>

View File

@@ -20,26 +20,25 @@
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
try {
global $RBAC;
switch ($RBAC->userCanAccess('PM_FACTORY'))
{
switch ($RBAC->userCanAccess( 'PM_FACTORY' )) {
case - 2:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
G::header( 'location: ../login/login' );
die;
die();
break;
case - 1:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' );
die;
die();
break;
}
//srequire_once 'classes/model/StepTrigger.php';
G::LoadClass( 'processMap' );
$oProcessMap = new ProcessMap();
@@ -63,8 +62,7 @@ try {
$oProcessMap->removeSupervisorStep( $_POST['STEP_UID'], $_POST['PRO_UID'], 'INPUT_DOCUMENT', $_POST['INP_DOC_UID'], $_POST['STEP_POSITION'] );
break;
}
}
catch (Exception $oException) {
} catch (Exception $oException) {
die( $oException->getMessage() );
}
?>

View File

@@ -20,21 +20,19 @@
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
try {
global $RBAC;
switch ($RBAC->userCanAccess('PM_FACTORY'))
{
switch ($RBAC->userCanAccess( 'PM_FACTORY' )) {
case - 2:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
G::header( 'location: ../login/login' );
die;
die();
break;
case - 1:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' );
die;
die();
break;
}
require_once 'classes/model/Step.php';
@@ -43,8 +41,7 @@ try {
G::LoadClass( 'processMap' );
$oProcessMap = new ProcessMap();
$oProcessMap->getStepsCriteria( $_POST['TASK'] );
}
catch (Exception $oException) {
} catch (Exception $oException) {
die( $oException->getMessage() );
}
?>

View File

@@ -20,10 +20,10 @@
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
/**
*
* @author Erik Amaru Ortiz <erik@colosa.com>
* @date Jan 10th, 2010
*/
@@ -37,6 +37,7 @@ $ajax->$action($_REQUEST);
class Ajax
{
function getList ($params)
{
$search = isset( $params['search'] ) ? $params['search'] : null;
@@ -45,6 +46,7 @@ class Ajax
$result = Translation::getAll( 'en', $params['start'], $params['limit'], $search, $params['dateFrom'], $params['dateTo'] );
//$result = Translation::getAll('en', $params['start'], $params['limit'], $search);
/*foreach($result->data as $i=>$row){
$result->data[$i]['TRN_VALUE'] = substr($row['TRN_VALUE'], 0, 15) . '...';
}*/
@@ -103,7 +105,7 @@ class Ajax
{
try {
require_once ("classes/model/Translation.php");
$t = new Translation;
$t = new Translation();
$result = Translation::generateFileTranslation( 'en' );
$result['success'] = true;
@@ -115,4 +117,3 @@ class Ajax
}
}

View File

@@ -20,7 +20,6 @@
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
/*
* Created on 11-02-2008
@@ -28,31 +27,33 @@
* @author David Callizaya <davidsantos@colosa.com>
*/
G::LoadSystem( "webResource" );
class dvServices extends WebResource
{
function get_session_vars ()
{
$cur = array_keys( $_SESSION );
$res = '';
foreach($cur as $key)
{
foreach ($cur as $key) {
$res .= '* ' . $key . '<br/>';
}
return $res;
}
function get_session_xmlforms ()
{
$cur = array_keys( $_SESSION );
$res = '';
$colors=array('white','#EEFFFF');
$colori=0;$count=0;
$colors = array ('white','#EEFFFF'
);
$colori = 0;
$count = 0;
//Get xmlforms in session
foreach($cur as $key)
{
foreach ($cur as $key) {
$res .= '<div style="background-color:' . $colors[$colori] . ';">';
$xml = G::getUIDName( $key, '' );
if (strpos($xml,'.xml')!==false)
{
if (strpos( $xml, '.xml' ) !== false) {
$res .= '<i>FORM:</i> ' . $xml;
$colori = $colori ^ 1;
$count ++;
@@ -60,11 +61,9 @@ class dvServices extends WebResource
$res .= '</div>';
}
//Get pagedTable in session
foreach($cur as $key)
{
foreach ($cur as $key) {
$res .= '<div style="background-color:' . $colors[$colori] . ';">';
if (substr($key,0,11)==="pagedTable[")
{
if (substr( $key, 0, 11 ) === "pagedTable[") {
$xml = G::getUIDName( substr( $key, 11, - 1 ), '' );
$res .= '<i>TABLE:</i> ' . $xml;
$colori = $colori ^ 1;
@@ -72,7 +71,8 @@ class dvServices extends WebResource
}
$res .= '</div>';
}
return array("count"=>$count,"html"=>$res);
return array ("count" => $count,"html" => $res
);
}
}
$o = new dvServices( $_SERVER['REQUEST_URI'], $_POST );
@@ -80,4 +80,3 @@ $o=new dvServices($_SERVER['REQUEST_URI'],$_POST);
//tienda viva.
//122
?>

View File

@@ -20,10 +20,8 @@
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
unset( $_SESSION['TOOLS_VIEWTYPE'] );
$newFile = str_replace( 'index.php', 'translations.php', __FILE__ );
return $newFile;

View File

@@ -1,8 +1,8 @@
<?php
$oHeadPublisher = & headPublisher::getSingleton();
$oHeadPublisher->addExtJsScript( 'tools/main', true );
//$oHeadPublisher->assign('_ENV_CURRENT_DATE', $conf->getSystemDate(date('Y-m-d')));
G::RenderPage( 'publish', 'extJs' );

View File

@@ -20,12 +20,10 @@
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
$G_PUBLISH = new Publisher;
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'view', 'tools/methodsPermissions' );
G::RenderPage( 'publish' );
?>

View File

@@ -20,13 +20,14 @@
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
G::LoadClass( "webResource" );
define( 'GET_PERMISSION_REG_EXP', '/(G::\\s*genericForceLogin\\s*\\(\\s*[\'"])(\\w+)([\'"]\\s*,\\s*[\'"].+[\'"],.+\\)\\s*)|(\\$RBAC->userCanAccess\\s*\\(\\s*[\'"])(\\w+)([\'"]\\s*\\))/i' );
define( 'GET_PERMISSION_REG_EXP2', '/\\s*if\\s*\\(\\s*\\(\\s*\\$RBAC_Response\\s*=\\s*\\$RBAC->userCanAccess\\s*\\(\\s*[\'"]\\w+[\'"]\\s*\\)\\s*\\)\\s*!=1\\s*\\)\\s*return(?:.*)?;\\s*/i' );
class phpFile extends webResource
{
function _get_permissions ($filename)
{
$aSource = file( $filename );
@@ -36,59 +37,46 @@
$permissions = array ();
$lines = array ();
$len = preg_match_all( $regExp, $source, $matches, PREG_OFFSET_CAPTURE );
for($r=0; $r < $len; $r++)
{
for ($r = 0; $r < $len; $r ++) {
$match = $matches[0][$r][0];
$permission = ($matches[2][$r][0] != '') ? $matches[2][$r][0] : $matches[5][$r][0];
$toPrint=($matches[2][$r][0]!='') ?
(
htmlentities($matches[1][$r][0],ENT_QUOTES,'utf-8').
'<b>'.htmlentities($matches[2][$r][0],ENT_QUOTES,'utf-8').'</b>'.
htmlentities($matches[3][$r][0],ENT_QUOTES,'utf-8')
)
:
(
htmlentities($matches[4][$r][0],ENT_QUOTES,'utf-8').
'<b>'.htmlentities($matches[5][$r][0],ENT_QUOTES,'utf-8').'</b>'.
htmlentities($matches[6][$r][0],ENT_QUOTES,'utf-8')
);
$toPrint = ($matches[2][$r][0] != '') ? (htmlentities( $matches[1][$r][0], ENT_QUOTES, 'utf-8' ) . '<b>' . htmlentities( $matches[2][$r][0], ENT_QUOTES, 'utf-8' ) . '</b>' . htmlentities( $matches[3][$r][0], ENT_QUOTES, 'utf-8' )) : (htmlentities( $matches[4][$r][0], ENT_QUOTES, 'utf-8' ) . '<b>' . htmlentities( $matches[5][$r][0], ENT_QUOTES, 'utf-8' ) . '</b>' . htmlentities( $matches[6][$r][0], ENT_QUOTES, 'utf-8' ));
$row = $this->_getLine( $aSource, $matches[0][$r][1] );
if (array_search($permission,$permissions)===FALSE)
{
if (array_search( $permission, $permissions ) === false) {
$permissions[] = $permission;
$lines[] = $row;
}
//TODO: Need to htmlencode the rest of the line that is not in match. Ex. < ? php
if ($row>0) $aOutSource[$row-1]=str_replace($match,$toPrint,isset($aOutSource[$row-1])?$aOutSource[$row-1]:$aSource[$row-1]);
if ($row > 0)
$aOutSource[$row - 1] = str_replace( $match, $toPrint, isset( $aOutSource[$row - 1] ) ? $aOutSource[$row - 1] : $aSource[$row - 1] );
$aOutSource[$row] = str_replace( $match, $toPrint, isset( $aOutSource[$row] ) ? $aOutSource[$row] : $aSource[$row] );
if ($row<(sizeof($aSource)-1)) $aOutSource[$row+1]=str_replace($match,$toPrint,isset($aOutSource[$row+1])?$aOutSource[$row+1]:$aSource[$row+1]);
if ($row < (sizeof( $aSource ) - 1))
$aOutSource[$row + 1] = str_replace( $match, $toPrint, isset( $aOutSource[$row + 1] ) ? $aOutSource[$row + 1] : $aSource[$row + 1] );
}
ksort( $aOutSource );
$row0=0;$html='';
foreach($aOutSource as $row => $line)
{
if (($row-1) > $row0) $html.=$this->_printLine($row,'...');
$row0 = 0;
$html = '';
foreach ($aOutSource as $row => $line) {
if (($row - 1) > $row0)
$html .= $this->_printLine( $row, '...' );
$html .= $this->_printLine( $row + 1, $line, true, $aSource[$row], $filename . '?' . $row );
$row0 = $row;
}
return array (
($html==='')?'Dont have RBAC validation!':('<table>'.$html.'</table>'),
$permissions,
$lines
return array (($html === '') ? 'Dont have RBAC validation!' : ('<table>' . $html . '</table>'),$permissions,$lines
);
}
function get_permissions ($filename)
{
$res = $this->_get_permissions( $filename );
return $res[0];
}
function modify_line ($filename, $row, $value)
{
$aSource = file( $filename );
$line = $aSource[$row];
$nl=(strlen($line)>=2)&&(substr($line,-2,2)=="\r\n")?
"\r\n":
((strlen($line)>=1)&&(substr($line,-1,1)=="\n")?"\n":"");
$nl = (strlen( $line ) >= 2) && (substr( $line, - 2, 2 ) == "\r\n") ? "\r\n" : ((strlen( $line ) >= 1) && (substr( $line, - 1, 1 ) == "\n") ? "\n" : "");
$aSource[$row] = $value . $nl;
/*Save change*/
$fp = fopen( $filename, 'w' );
@@ -98,49 +86,34 @@
$regExp = GET_PERMISSION_REG_EXP;
$line = $aSource[$row];
$len = preg_match_all( $regExp, $line, $matches, PREG_OFFSET_CAPTURE );
for($r=0; $r < $len; $r++)
{
for ($r = 0; $r < $len; $r ++) {
$match = $matches[0][$r][0];
$toPrint=($matches[2][$r][0]!='') ?
(
htmlentities($matches[1][$r][0],ENT_QUOTES,'utf-8').
'<b>'.htmlentities($matches[2][$r][0],ENT_QUOTES,'utf-8').'</b>'.
htmlentities($matches[3][$r][0],ENT_QUOTES,'utf-8')
)
:
(
htmlentities($matches[4][$r][0],ENT_QUOTES,'utf-8').
'<b>'.htmlentities($matches[5][$r][0],ENT_QUOTES,'utf-8').'</b>'.
htmlentities($matches[6][$r][0],ENT_QUOTES,'utf-8')
);
$toPrint = ($matches[2][$r][0] != '') ? (htmlentities( $matches[1][$r][0], ENT_QUOTES, 'utf-8' ) . '<b>' . htmlentities( $matches[2][$r][0], ENT_QUOTES, 'utf-8' ) . '</b>' . htmlentities( $matches[3][$r][0], ENT_QUOTES, 'utf-8' )) : (htmlentities( $matches[4][$r][0], ENT_QUOTES, 'utf-8' ) . '<b>' . htmlentities( $matches[5][$r][0], ENT_QUOTES, 'utf-8' ) . '</b>' . htmlentities( $matches[6][$r][0], ENT_QUOTES, 'utf-8' ));
$line = str_replace( $match, $toPrint, $line );
}
return array($line,$aSource[$row]);
return array ($line,$aSource[$row]
);
}
function set_header ($filename, $value)
{
$aFields=array("_FILENAME_"=>basename( $filename ) );
$aFields = array ("_FILENAME_" => basename( $filename )
);
$value = G::replaceDataField( $value, $aFields );
$aOrigin = file( $filename );
//It suposse that allway start with <?. or <?php
$line = $aOrigin[0];
$nl=(strlen($line)>=2)&&(substr($line,-2,2)=="\r\n")?
"\r\n":
((strlen($line)>=1)&&(substr($line,-1,1)=="\n")?"\n":"");
$nl = (strlen( $line ) >= 2) && (substr( $line, - 2, 2 ) == "\r\n") ? "\r\n" : ((strlen( $line ) >= 1) && (substr( $line, - 1, 1 ) == "\n") ? "\n" : "");
$codigo = implode( '', $aOrigin );
$pattern = '/\/\*[\w\W]+\* ' . 'ProcessMaker Open Source' . '[\w\W]+?\*\//i';
if (preg_match($pattern,$codigo))
{
if (preg_match( $pattern, $codigo )) {
$codigo = preg_replace( $pattern, $value, $codigo );
}
else
{
} else {
$aSource = array ();
$aSource[0] = $aOrigin[0];
$aSource[1] = $value . $nl;
for($r=1;$r<sizeof($aOrigin);$r++)
{
for ($r = 1; $r < sizeof( $aOrigin ); $r ++) {
$aSource[] = $aOrigin[$r];
}
$codigo = implode( '', $aSource );
@@ -151,18 +124,16 @@
fclose( $fp );
return $this->get_permissions( $filename );
}
function add_permission ($filename, $value)
{
$aOrigin = file( $filename );
//It suposse that allway start with <?. or <?php
$aSource[0] = $aOrigin[0];
$line = $aOrigin[0];
$nl=(strlen($line)>=2)&&(substr($line,-2,2)=="\r\n")?
"\r\n":
((strlen($line)>=1)&&(substr($line,-1,1)=="\n")?"\n":"");
$nl = (strlen( $line ) >= 2) && (substr( $line, - 2, 2 ) == "\r\n") ? "\r\n" : ((strlen( $line ) >= 1) && (substr( $line, - 1, 1 ) == "\n") ? "\n" : "");
$aSource[1] = $value . $nl;
for($r=1;$r<sizeof($aOrigin);$r++)
{
for ($r = 1; $r < sizeof( $aOrigin ); $r ++) {
$aSource[] = $aOrigin[$r];
}
/*Save change*/
@@ -171,84 +142,68 @@
fclose( $fp );
return $this->get_permissions( $filename );
}
function _getLine (&$aSource, $pos)
{
$i = 1;
while ($pos>sizeof($aSource[$i]))
{
while ($pos > sizeof( $aSource[$i] )) {
$pos -= strlen( $aSource[$i] );
$i ++;
}
return $i - 1;
}
function _printLine ($row, $txt, $editable = false, $editValue = '', $name = '')
{
if ($editable)
{
return '<tr><td><input value="X" type="button" style="width:100%;" '.
' name="'.htmlentities($name,ENT_QUOTES,'utf-8').'"'.
' onclick="removeLine(this);"/></td>'.
'<td class="treeContent" align="right">'.$row.'</td>
<td class="treeNode"><span onclick="switchViewEdit(this,this.nextSibling);">'.
$txt.'</span>'.
'<input class="treeNode"'.
' name="'.htmlentities($name,ENT_QUOTES,'utf-8').'"'.
' style="border:none;width:100%;display:none;"'.
' onblur="switchEditView(this.previousSibling,this);"'.
' value="'.htmlentities($editValue,ENT_QUOTES,'utf-8').'"/></td></tr>';
}
else
{
return '<tr><td></td>'.
'<td class="treeContent" align="right">'.$row.'</td>'.
'<td class="treeNode">'.$txt.'</td></tr>';
if ($editable) {
return '<tr><td><input value="X" type="button" style="width:100%;" ' . ' name="' . htmlentities( $name, ENT_QUOTES, 'utf-8' ) . '"' . ' onclick="removeLine(this);"/></td>' . '<td class="treeContent" align="right">' . $row . '</td>
<td class="treeNode"><span onclick="switchViewEdit(this,this.nextSibling);">' . $txt . '</span>' . '<input class="treeNode"' . ' name="' . htmlentities( $name, ENT_QUOTES, 'utf-8' ) . '"' . ' style="border:none;width:100%;display:none;"' . ' onblur="switchEditView(this.previousSibling,this);"' . ' value="' . htmlentities( $editValue, ENT_QUOTES, 'utf-8' ) . '"/></td></tr>';
} else {
return '<tr><td></td>' . '<td class="treeContent" align="right">' . $row . '</td>' . '<td class="treeNode">' . $txt . '</td></tr>';
}
}
function set_permission ($filename, $permission)
{
list ($html, $permissions) = $this->_get_permissions( $filename );
if (array_search($permission,$permissions)===FALSE)
{
$this->add_permission
(
$filename,
'if (($RBAC_Response=$RBAC->userCanAccess("'.$permission.'"))!=1) return $RBAC_Response;'
);
if (array_search( $permission, $permissions ) === false) {
$this->add_permission( $filename, 'if (($RBAC_Response=$RBAC->userCanAccess("' . $permission . '"))!=1) return $RBAC_Response;' );
}
return $this->get_permissions( $filename );
}
function set_path_permission ($path, $permission)
{
$files = glob( $path . '*.php' );
foreach($files as $file)
{
foreach ($files as $file) {
$this->set_permission( $file, $permission );
}
}
function set_path_header ($path, $header)
{
$files = glob( $path . '*.php' );
$filesMod = array ();
foreach($files as $file)
{
foreach ($files as $file) {
$filesMod[] = $file;
$this->set_header( $file, $header );
}
$dirs = glob( $path . '*', GLOB_MARK );
foreach($dirs as $dir)
{
if (substr( $dir , -1 , 1 )=='/') $this->set_path_header($dir,$header);
foreach ($dirs as $dir) {
if (substr( $dir, - 1, 1 ) == '/')
$this->set_path_header( $dir, $header );
}
return $filesMod;
}
function remove_path_permission ($path, $permission)
{
$files = glob( $path . '*.php' );
foreach($files as $file)
{
foreach ($files as $file) {
$this->remove_permission( $file, $permission );
}
}
function remove_line ($filename, $line)
{
$aSource = file( $filename );
@@ -259,20 +214,17 @@
fclose( $fp );
return $this->get_permissions( $filename );
}
function remove_permission ($filename, $permission)
{
$aSource = file( $filename );
list ($html, $permissions, $lines) = $this->_get_permissions( $filename );
if (($row=array_search($permission,$permissions))!==FALSE)
{
if (($row = array_search( $permission, $permissions )) !== false) {
$line = $lines[$row];
if (preg_match(GET_PERMISSION_REG_EXP2,$aSource[$line]))
{
if (preg_match( GET_PERMISSION_REG_EXP2, $aSource[$line] )) {
unset( $aSource[$line] );
$msg = "Removed.";
}
else
{
} else {
$msg = "Can not be removed!";
}
}
@@ -284,4 +236,4 @@
}
}
$phpFile = new phpFile( 'methodsPermissions_Ajax', $_POST );
?>

View File

@@ -25,7 +25,6 @@
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
$G_MAIN_MENU = 'tools';
@@ -35,7 +34,7 @@
$table = "TRANSLATION";
$G_PUBLISH = new Publisher;
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'pagedtable', 'paged-table', 'tools/translationsList', '', array (), '' );
if (isset( $_SESSION['TOOLS_VIEWTYPE'] )) {
G::RenderPage( 'publishBlank', 'green-submenu' );

View File

@@ -20,14 +20,13 @@
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
$G_MAIN_MENU = 'tools';
$G_SUB_MENU = 'toolsTranslations';
$G_ID_MENU_SELECTED = 'TRANSLATION';
$G_ID_SUB_MENU_SELECTED = 'TRANSLATION_ADD';
$G_PUBLISH = new Publisher;
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'tools/translationAdd', '', null, 'translationsSave' );
if (isset( $_SESSION['TOOLS_VIEWTYPE'] ) && $_SESSION['TOOLS_VIEWTYPE'] == 'blank') {
@@ -35,4 +34,4 @@
} else {
G::RenderPage( 'publish' );
}
?>

View File

@@ -20,7 +20,6 @@
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
ini_set( 'display_errors', 'off' );
G::LoadInclude( 'ajax' );
@@ -31,35 +30,38 @@
$langLabel = get_ajax_value( 'langLabel' );
$text = get_ajax_value( 'text' );
$table = "TRANSLATION";
$dbc = new DBConnection;
$dbc = new DBConnection();
$ses = new DBSession( $dbc );
switch($function)
{
switch ($function) {
case "editLabel":
case "changeLabel":
$query = $ses->execute( "select * from $table where TRN_CATEGORY='$cat' and TRN_ID='$node' and TRN_LANG='$lang'", false );
if ($query->count()===0) {echo("Not found $cat:$node:$lang in table '$table'");return;}
if ($query->count()>1) {echo("The $cat:$node:$lang in table '$table' is not unique");return;}
if ($query->count() === 0) {
echo ("Not found $cat:$node:$lang in table '$table'");
return;
}
if ($query->count() > 1) {
echo ("The $cat:$node:$lang in table '$table' is not unique");
return;
}
$res = $query->read();
switch($function)
{
switch ($function) {
case "editLabel":
$myID = "input_" . $cat . "_" . $node . "_" . $lang;
$myID = 'aux';
echo("<input id='$myID' type='text' value='".htmlspecialchars($res['TRN_VALUE'])."' ".
ajax_event("onblur","translationsAjax.php",
'lang_'.$cat.'_'.$node.'_'.$lang,
"'function=changeLabel&cat=".urlencode($cat).
"&node=".urlencode($node).
"&lang=".urlencode($lang).
"&langLabel='+encodeURI(getElementById('$myID').value)",'')
."/>");
echo ("<input id='$myID' type='text' value='" . htmlspecialchars( $res['TRN_VALUE'] ) . "' " . ajax_event( "onblur", "translationsAjax.php", 'lang_' . $cat . '_' . $node . '_' . $lang, "'function=changeLabel&cat=" . urlencode( $cat ) . "&node=" . urlencode( $node ) . "&lang=" . urlencode( $lang ) . "&langLabel='+encodeURI(getElementById('$myID').value)", '' ) . "/>");
break;
case "changeLabel":
$update = $ses->execute( "update $table set TRN_VALUE='$langLabel' where TRN_CATEGORY='$cat' and TRN_ID='$node' and TRN_LANG='$lang'", false );
$query = $ses->execute( "select * from $table where TRN_CATEGORY='$cat' and TRN_ID='$node' and TRN_LANG='$lang'", false );
if ($query->count()===0) {echo("Not found $cat:$node:$lang in table '$table'");return;}
if ($query->count()>1) {echo("The $cat:$node:$lang in table '$table' is not unique");return;}
if ($query->count() === 0) {
echo ("Not found $cat:$node:$lang in table '$table'");
return;
}
if ($query->count() > 1) {
echo ("The $cat:$node:$lang in table '$table' is not unique");
return;
}
$res = $query->read();
echo (htmlspecialchars( $res['TRN_VALUE'] ));
break;
@@ -67,8 +69,8 @@ switch($function)
}
G::LoadClass( "translation" );
$dbc = new DBConnection;
$obj = new Translation;
$dbc = new DBConnection();
$obj = new Translation();
$obj->SetTo( $dbc );
$translation2 = $obj->generateFileTranslation();
break;
@@ -77,11 +79,9 @@ switch($function)
$template = new TemplatePower( PATH_CORE . 'templates/tools/translationsTP.html' );
$template->prepare();
$template->newBlock( "languageList" );
$template->assign("ajaxDelLang",ajax_event("onclick","translationsAjax","showSpace",
"'function=delLanguage&lang='+encodeURI(getElementById('language').value)",'hideLangBar'));
$template->assign( "ajaxDelLang", ajax_event( "onclick", "translationsAjax", "showSpace", "'function=delLanguage&lang='+encodeURI(getElementById('language').value)", 'hideLangBar' ) );
for($r=1;$r<=$query->count();$r++)
{
for ($r = 1; $r <= $query->count(); $r ++) {
$res = $query->read();
$template->newBlock( "languageItem" );
$template->assign( "langIdRadio", $res['TRN_LANG'] );
@@ -94,8 +94,7 @@ switch($function)
case "addLanguage":
case "delLanguage":
case "delField":
switch($function)
{
switch ($function) {
case "show":
$query = $ses->execute( "select * from $table ORDER BY TRN_CATEGORY ASC , TRN_ID ASC , TRN_LANG ASC ", false );
break;
@@ -103,10 +102,10 @@ switch($function)
$query = $ses->execute( "select * from $table where (TRN_CATEGORY like '%$text%') or (TRN_ID like '%$text%') or (TRN_LANG like '%$text%') or (TRN_VALUE like '%$text%') ORDER BY TRN_CATEGORY ASC , TRN_ID ASC , TRN_LANG ASC ", false );
break;
case "addField":
if (!defined('LANGUAGES')) define('LANGUAGES',SYS_LANG);
if (! defined( 'LANGUAGES' ))
define( 'LANGUAGES', SYS_LANG );
$languages = explode( ",", LANGUAGES );
foreach($languages as $lang)
{
foreach ($languages as $lang) {
//$langLabel=$cat;
/* $update=$ses->execute("insert into $table(TRN_CATEGORY , TRN_ID , TRN_LANG , TRN_VALUE )
values ('$cat','$node','$lang','$langLabel')",false);*/
@@ -121,13 +120,11 @@ switch($function)
$query1 = $ses->execute( "select * from $table where TRN_LANG='$lang'", false );
$query2 = $ses->execute( "select distinct TRN_CATEGORY, TRN_ID from $table", false );
$existe = array ();
for($r=1;$r<=$query1->count();$r++)
{
for ($r = 1; $r <= $query1->count(); $r ++) {
$res = $query1->read();
$existe[$res['TRN_CATEGORY'] . "_" . $res['TRN_ID']] = $res;
}
for($r=1;$r<=$query2->count();$r++)
{
for ($r = 1; $r <= $query2->count(); $r ++) {
$res = $query2->read();
$cat = $res['TRN_CATEGORY'];
$node = $res['TRN_ID'];
@@ -140,7 +137,8 @@ switch($function)
unset( $update );
}
unset( $existe );
unset($query1);unset($query2);
unset( $query1 );
unset( $query2 );
$query = $ses->execute( "select * from $table ORDER BY TRN_CATEGORY ASC , TRN_ID ASC , TRN_LANG ASC ", false );
break;
case "delLanguage":
@@ -157,29 +155,21 @@ switch($function)
$template->prepare();
$template->newBlock( "CONTENT" );
$template->newBlock( "table" );
$aCat="";$aNode="";
for($i=1;$i<=$query->count();$i++)
{
$aCat = "";
$aNode = "";
for ($i = 1; $i <= $query->count(); $i ++) {
$template->newBlock( "row" );
$res = $query->read();
$cat = $res['TRN_CATEGORY'];
$node = $res['TRN_ID'];
$lang = $res['TRN_LANG'];
$langLabel = $res['TRN_VALUE'];
if ($cat!=$aCat)
{
if ($cat != $aCat) {
$template->newBlock( "TDcat" );
$template->assign( "catId", $res['TRN_CATEGORY'] );
$template->assign("ajaxDelField",
ajax_event('onclick','translationsAjax','showSpace',
"'function=delField".
"&cat=".urlencode($cat).
"&node=".urlencode($node).
"&lang=".urlencode($lang)."'",''));
$template->assign( "ajaxDelField", ajax_event( 'onclick', 'translationsAjax', 'showSpace', "'function=delField" . "&cat=" . urlencode( $cat ) . "&node=" . urlencode( $node ) . "&lang=" . urlencode( $lang ) . "'", '' ) );
}
if (($cat!=$aCat) ||
($node!=$aNode))
{
if (($cat != $aCat) || ($node != $aNode)) {
$template->newBlock( "TDnode" );
$template->assign( "nodeId", $res['TRN_ID'] );
}
@@ -190,28 +180,26 @@ switch($function)
$template->assign( "nodeId", $res['TRN_ID'] );
$template->assign( "langId", $lang );
$template->assign( "langLabel", $langLabel );
$template->assign("ajaxLabel","onclick=\"if (!document.getElementById('aux'))".
ajax_init('translationsAjax.php',
'lang_'.$cat.'_'.$node.'_'.$lang,
"'function=editLabel".
"&cat=".urlencode($cat).
"&node=".urlencode($node).
"&lang=".urlencode($lang)."'",'focusInputLabel')
.'"');
$template->assign( "ajaxLabel", "onclick=\"if (!document.getElementById('aux'))" . ajax_init( 'translationsAjax.php', 'lang_' . $cat . '_' . $node . '_' . $lang, "'function=editLabel" . "&cat=" . urlencode( $cat ) . "&node=" . urlencode( $node ) . "&lang=" . urlencode( $lang ) . "'", 'focusInputLabel' ) . '"' );
}
$template->printToScreen();
break;
}
?>
<?php
function ajax_event ($event = "onclick", $page, $div, $param, $freturn = "")
{
if ($freturn==='') $freturn="''";
if ($freturn === '')
$freturn = "''";
return "$event=\"ajax_init('$page','$div',$param,$freturn)\"";
}
function ajax_init ($page, $div, $param, $freturn = "")
{
if ($freturn=='') $freturn="''";
if ($freturn == '')
$freturn = "''";
return "ajax_init('$page','$div',$param,$freturn);";
}
?>

View File

@@ -20,16 +20,15 @@
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
//to do: improve the way to pass two or more parameters in the paged-table ( link )
$aux = explode( '|', $_GET['id'] );
$category = str_replace( '"', '', $aux[0] );
$id = str_replace( '"', '', $aux[1] );
require_once ("classes/model/Translation.php");
//if exists the row in the database propel will update it, otherwise will insert.
$tr = TranslationPeer::retrieveByPK( $category, $id, 'en' );
@@ -39,5 +38,6 @@
}
// else
G::Header( 'location: translations' );
?>

View File

@@ -20,16 +20,15 @@
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
//to do: improve the way to pass two or more parameters in the paged-table ( link )
$aux = explode( '|', $_GET['id'] );
$category = str_replace( '"', '', $aux[0] );
$id = str_replace( '"', '', $aux[1] );
require_once ("classes/model/Translation.php");
//if exists the row in the database propel will update it, otherwise will insert.
$tr = TranslationPeer::retrieveByPK( $category, $id, 'en' );
@@ -38,8 +37,7 @@
$fields['trn_category'] = $tr->getTrnCategory();
$fields['trn_id'] = $tr->getTrnId();
$fields['trn_value'] = $tr->getTrnValue();
}
else
} else
$fields = array ();
$G_MAIN_MENU = 'tools';
@@ -47,14 +45,14 @@
$G_ID_MENU_SELECTED = 'TOOLS';
$G_ID_SUB_MENU_SELECTED = 'ADD_TRANSLATION';
$G_PUBLISH = new Publisher;
$dbc = new DBConnection;
$G_PUBLISH = new Publisher();
$dbc = new DBConnection();
$ses = new DBSession( $dbc );
$G_PUBLISH = new Publisher;
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'tools/translationAdd', '', $fields, 'translationsSave' );
if (isset( $_SESSION['TOOLS_VIEWTYPE'] ) && $_SESSION['TOOLS_VIEWTYPE'] == 'blank') {
G::RenderPage( 'publishBlank', 'green-submenu' );
} else {
G::RenderPage( 'publish' );
}
?>

View File

@@ -20,7 +20,6 @@
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
$form = $_POST['form'];
@@ -33,4 +32,4 @@
G::SendMessageText( $res['message'], 'error' );
}
G::Header( 'location: translations' );
?>

View File

@@ -20,12 +20,11 @@
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
require_once ("classes/model/Translation.php");
$t = new Translation;
$t = new Translation();
$fields = Translation::generateFileTranslation( 'en' );
$G_MAIN_MENU = 'tools';
@@ -33,11 +32,11 @@
$G_ID_MENU_SELECTED = 'TRANSLATION';
$G_ID_SUB_MENU_SELECTED = 'TRANSLATION_REBUILD';
$G_PUBLISH = new Publisher;
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'tools/updateTranslation', '', $fields );
if (isset( $_SESSION['TOOLS_VIEWTYPE'] ) && $_SESSION['TOOLS_VIEWTYPE'] == 'blank') {
G::RenderPage( 'publishBlank', 'green-submenu' );
} else {
G::RenderPage( 'publish' );
}
?>

View File

@@ -20,7 +20,6 @@
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
require_once (PATH_RBAC . "model/RolesPeer.php");
@@ -50,18 +49,15 @@ $oCriteria->addSelectColumn(UsersPeer::USR_DUE_DATE);
//$oCriteria->addAsColumn('USR_DELETE', $sDelimiter . G::LoadTranslation('ID_DELETE') . $sDelimiter);
//$oCriteria->addAsColumn('USR_AUTH', $sDelimiter . G::LoadTranslation('ID_AUTHENTICATION') . $sDelimiter);
//$oCriteria->addAsColumn('USR_REASSIGN', $sDelimiter . G::LoadTranslation('ID_REASSIGN_CASES') . $sDelimiter);
$oCriteria->add(UsersPeer::USR_STATUS, array('CLOSED'), Criteria::NOT_IN);
$oCriteria->add( UsersPeer::USR_STATUS, array ('CLOSED'
), Criteria::NOT_IN );
if ($filter != '') {
$cc = $oCriteria->getNewCriterion(UsersPeer::USR_USERNAME,'%'.$filter.'%',Criteria::LIKE)->addOr(
$oCriteria->getNewCriterion(UsersPeer::USR_FIRSTNAME,'%'.$filter.'%',Criteria::LIKE)->addOr(
$oCriteria->getNewCriterion(UsersPeer::USR_LASTNAME,'%'.$filter.'%',Criteria::LIKE)));
$cc = $oCriteria->getNewCriterion( UsersPeer::USR_USERNAME, '%' . $filter . '%', Criteria::LIKE )->addOr( $oCriteria->getNewCriterion( UsersPeer::USR_FIRSTNAME, '%' . $filter . '%', Criteria::LIKE )->addOr( $oCriteria->getNewCriterion( UsersPeer::USR_LASTNAME, '%' . $filter . '%', Criteria::LIKE ) ) );
$oCriteria->add( $cc );
//echo $oCriteria->toString();
}
$rs = UsersPeer::DoSelectRs( $oCriteria );
$rs->setFetchmode( ResultSet::FETCHMODE_ASSOC );
@@ -72,3 +68,4 @@ while($rs->next()){
// $rows[] = $aux;
}
echo '{users: ' . G::json_encode( $rows ) . '}';

View File

@@ -20,9 +20,7 @@
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
$newFile = str_replace( 'index.php', 'users_List.php', __FILE__ );
return $newFile;

View File

@@ -20,7 +20,6 @@
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
$G_MAIN_MENU = 'processmaker';
@@ -30,8 +29,8 @@
if (isset( $_GET['type'] )) {
$G_PUBLISH->AddContent( 'view', 'users/usersReload' );
G::RenderPage( "publishBlank", "blank" );
}
else {
} else {
$G_PUBLISH->AddContent( 'view', 'users/usersLoad' );
G::RenderPage( "publish" );
}

View File

@@ -20,13 +20,13 @@
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
if (($RBAC_Response=$RBAC->userCanAccess("PM_LOGIN"))!=1) return $RBAC_Response;
if (($RBAC_Response = $RBAC->userCanAccess( "PM_LOGIN" )) != 1)
return $RBAC_Response;
G::LoadClass( "xmlMenu" );
$form = new Form( 'myInfo/myInfoAEdit.xml', PATH_XMLFORM );
$form->action = urlencode( G::encrypt( '', URL_KEY ) );
$form->ajaxServer = urlencode( G::encrypt( SYS_URI . '/gulliver/defaultAjax', URL_KEY ) );
$template = PATH_CORE . 'templates/xmlform.html';
print $G_FORM->render( $template, $scriptCode );
?>

View File

@@ -20,7 +20,6 @@
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
try {
global $RBAC;
@@ -58,19 +57,16 @@ try {
try {
$depFields = $oDepInfo->load( $userFields['DEP_UID'] . 'xy<' );
$aFields['USR_REPORTS_TO'] .= " (" . $depFields['DEPO_TITLE'] . ")";
} catch (Exception $e) {
}
catch( Exception $e ) {
}
}
else{
} else {
$aFields['USR_REPORTS_TO'] = ' ';
}
try {
$depFields = $oDepInfo->load( $aFields['DEP_UID'] );
$aFields['USR_DEPARTMENT'] = $depFields['DEPO_TITLE'];
}
catch( Exception $e ) {
} catch (Exception $e) {
$oUser = UsersPeer::retrieveByPk( $_SESSION['USER_LOGGED'] );
$oUser->setDepUid( '' );
$oUser->save();
@@ -79,14 +75,14 @@ try {
$G_MAIN_MENU = 'processmaker';
$G_ID_MENU_SELECTED = 'MY_ACCOUNT';
$G_PUBLISH = new Publisher;
$G_PUBLISH = new Publisher();
//$RBAC->systemObj->loadByCode('PROCESSMAKER');//('PROCESSMAKER', $_SESSION['USER_LOGGED']);
#verifying if it has any preferences on the configurations table
G::loadClass( 'configuration' );
$oConf = new Configurations;
$oConf = new Configurations();
$oConf->loadConfig( $x, 'USER_PREFERENCES', '', '', $_SESSION['USER_LOGGED'], '' );
//echo $RBAC->aUserInfo['PROCESSMAKER']['ROLE']['ROL_CODE'];
@@ -109,21 +105,24 @@ try {
$aFields['PREF_DEFAULT_LANG'] = SYS_LANG;
}
//G::pr($RBAC->aUserInfo);
$rows[] = Array('id'=>'char', 'name'=>'char');
$rows[] = Array ('id' => 'char','name' => 'char'
);
foreach ($RBAC->aUserInfo['PROCESSMAKER']['PERMISSIONS'] as $permission) {
switch ($permission['PER_CODE']) {
case 'PM_USERS':
case 'PM_SETUP':
$rows[] = Array('id'=>'PM_SETUP', 'name'=>strtoupper(G::LoadTranslation('ID_SETUP')));
$rows[] = Array ('id' => 'PM_SETUP','name' => strtoupper( G::LoadTranslation( 'ID_SETUP' ) )
);
break;
case 'PM_CASES':
$rows[] = Array('id'=>'PM_CASES', 'name'=>strtoupper(G::LoadTranslation('ID_CASES')));
$rows[] = Array ('id' => 'PM_CASES','name' => strtoupper( G::LoadTranslation( 'ID_CASES' ) )
);
break;
case 'PM_FACTORY':
$rows[] = Array('id'=>'PM_FACTORY', 'name'=>strtoupper(G::LoadTranslation('ID_APPLICATIONS')));
$rows[] = Array ('id' => 'PM_FACTORY','name' => strtoupper( G::LoadTranslation( 'ID_APPLICATIONS' ) )
);
break;
}
}
@@ -132,11 +131,13 @@ try {
$oMenu = new Menu();
$oMenu->load( 'cases' );
$rowsCasesMenu[] = Array('id'=>'char', 'name'=>'char');
$rowsCasesMenu[] = Array ('id' => 'char','name' => 'char'
);
foreach ($oMenu->Id as $i => $item) {
if ($oMenu->Types[$i] != 'blockHeader') {
$rowsCasesMenu[] = Array('id'=>$item, 'name'=>$oMenu->Labels[$i]);
$rowsCasesMenu[] = Array ('id' => $item,'name' => $oMenu->Labels[$i]
);
}
}
@@ -161,8 +162,7 @@ try {
}
G::RenderPage( 'publish' );
}
catch (Exception $oException) {
} catch (Exception $oException) {
die( $oException->getMessage() );
}
?>

View File

@@ -20,21 +20,20 @@
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
try {ini_set('display_errors','1');
try {
ini_set( 'display_errors', '1' );
global $RBAC;
switch ($RBAC->userCanAccess('PM_LOGIN'))
{
switch ($RBAC->userCanAccess( 'PM_LOGIN' )) {
case - 2:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
G::header( 'location: ../login/login' );
die;
die();
break;
case - 1:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' );
die;
die();
break;
}
if (isset( $_FILES['form']['name']['USR_RESUME'] )) {
@@ -69,7 +68,9 @@ try {ini_set('display_errors','1');
$aData['USR_PASSWORD'] = $_POST['form']['USR_PASSWORD'];
require_once 'classes/model/UsersProperties.php';
$oUserProperty = new UsersProperties();
$aUserProperty = $oUserProperty->loadOrCreateIfNotExists($_POST['form']['USR_UID'], array('USR_PASSWORD_HISTORY' => serialize(array(md5($_POST['form']['USR_NEW_PASS'])))));
$aUserProperty = $oUserProperty->loadOrCreateIfNotExists( $_POST['form']['USR_UID'], array ('USR_PASSWORD_HISTORY' => serialize( array (md5( $_POST['form']['USR_NEW_PASS'] )
) )
) );
$aErrors = $oUserProperty->validatePassword( $_POST['form']['USR_NEW_PASS'], $aUserProperty['USR_LAST_UPDATE_DATE'], $aUserProperty['USR_LOGGED_NEXT_TIME'] );
if (count( $aErrors ) > 0) {
$sDescription = G::LoadTranslation( 'ID_POLICY_ALERT' ) . ':<br /><br />';
@@ -92,7 +93,7 @@ try {ini_set('display_errors','1');
$sDescription .= '<br />' . G::LoadTranslation( 'ID_PLEASE_CHANGE_PASSWORD_POLICY' );
G::SendMessageText( $sDescription, 'warning' );
G::header( 'Location: ' . $_SERVER['HTTP_REFERER'] );
die;
die();
}
$aHistory = unserialize( $aUserProperty['USR_PASSWORD_HISTORY'] );
if (! is_array( $aHistory )) {
@@ -149,25 +150,20 @@ try {ini_set('display_errors','1');
G::loadClass( 'configuration' );
$oConf = new Configurations;
$aConf = Array(
'DEFAULT_LANG'=>$def_lang,
'DEFAULT_MENU'=>$def_menu,
'DEFAULT_CASES_MENU'=>$def_cases_menu
$oConf = new Configurations();
$aConf = Array ('DEFAULT_LANG' => $def_lang,'DEFAULT_MENU' => $def_menu,'DEFAULT_CASES_MENU' => $def_cases_menu
);
/*UPDATING SESSION VARIABLES*/
$aUser = $RBAC->userObj->load( $_SESSION['USER_LOGGED'] );
$_SESSION['USR_FULLNAME'] = $aUser['USR_FIRSTNAME'] . ' ' . $aUser['USR_LASTNAME'];
$oConf->aConfig = $aConf;
$oConf->saveConfig( 'USER_PREFERENCES', '', '', $_SESSION['USER_LOGGED'] );
G::SendTemporalMessage( 'ID_CHANGES_SAVED', 'info', 'labels' );
G::header( 'location: myInfo' );
}
catch (Exception $oException) {
} catch (Exception $oException) {
die( $oException->getMessage() );
}
?>

View File

@@ -2,8 +2,7 @@
global $RBAC;
switch($_POST['action'])
{
switch ($_POST['action']) {
case 'countryList':
require_once ("classes/model/IsoCountry.php");
$c = new Criteria();
@@ -11,7 +10,8 @@ switch($_POST['action'])
$countries = IsoCountryPeer::doSelect( $c );
foreach ($countries as $rowid => $row) {
$oData[] = Array('IC_UID'=>$row->getICUid(),'IC_NAME'=>$row->getICName());
$oData[] = Array ('IC_UID' => $row->getICUid(),'IC_NAME' => $row->getICName()
);
}
print (G::json_encode( $oData )) ;
break;
@@ -26,7 +26,8 @@ switch($_POST['action'])
$oData = Array ();
foreach ($locations as $rowid => $row) {
if (($row->getISUid() != '') && ($row->getISName() != ''))
$oData[] = Array('IS_UID' => $row->getISUid(), 'IS_NAME' => $row->getISName());
$oData[] = Array ('IS_UID' => $row->getISUid(),'IS_NAME' => $row->getISName()
);
}
print (G::json_encode( $oData )) ;
break;
@@ -43,7 +44,8 @@ switch($_POST['action'])
$oData = Array ();
foreach ($locations as $rowid => $row) {
if (($row->getILUid() != '') && ($row->getILName() != ''))
$oData[] = Array('IL_UID' => $row->getILUid(), 'IL_NAME' => $row->getILName());
$oData[] = Array ('IL_UID' => $row->getILUid(),'IL_NAME' => $row->getILName()
);
}
print (G::json_encode( $oData )) ;
break;
@@ -55,7 +57,8 @@ switch($_POST['action'])
$oCriteria->addSelectColumn( UsersPeer::USR_FIRSTNAME );
$oCriteria->addSelectColumn( UsersPeer::USR_LASTNAME );
$oCriteria->addSelectColumn( UsersPeer::USR_EMAIL );
$oCriteria->add(UsersPeer::USR_STATUS, array('ACTIVE', 'VACATION'), Criteria::IN);
$oCriteria->add( UsersPeer::USR_STATUS, array ('ACTIVE','VACATION'
), Criteria::IN );
if (isset( $_POST['USR_UID'] )) {
$oCriteria->add( UsersPeer::USR_UID, $_POST['USR_UID'], Criteria::NOT_EQUAL );
}
@@ -63,22 +66,21 @@ switch($_POST['action'])
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
G::loadClass( 'configuration' );
$oConf = new Configurations;
$oConf = new Configurations();
$oConf->loadConfig( $obj, 'ENVIRONMENT_SETTINGS', '' );
$defaultOption = isset( $oConf->aConfig['format'] ) ? $oConf->aConfig['format'] : '';
$aUserInfo = array ();
if (isset( $_POST['addNone'] ) && $_POST['addNone'] == '1') {
$aUserInfo[] = array('USR_UID' => '', 'USER_FULLNAME' => '- ' . G::LoadTranslation('ID_NONE') . ' -');
$aUserInfo[] = array ('USR_UID' => '','USER_FULLNAME' => '- ' . G::LoadTranslation( 'ID_NONE' ) . ' -'
);
}
while ($oDataset->next()) {
$aRow1 = $oDataset->getRow();
$infoUser = G::getFormatUserList( $defaultOption, $aRow1 );
$aUserInfo[] = array(
'USR_UID' => $aRow1['USR_UID'],
'USER_FULLNAME' => $infoUser
$aUserInfo[] = array ('USR_UID' => $aRow1['USR_UID'],'USER_FULLNAME' => $infoUser
);
}
print (G::json_encode( $aUserInfo )) ;
@@ -89,10 +91,12 @@ switch($_POST['action'])
G::LoadClass( 'calendar' );
$calendar = new Calendar();
$calendarObj = $calendar->getCalendarList( true, true );
$oData[] = array('CALENDAR_UID' => '', 'CALENDAR_NAME' => '- None -');
$oData[] = array ('CALENDAR_UID' => '','CALENDAR_NAME' => '- None -'
);
foreach ($calendarObj['array'] as $rowid => $row) {
if ($rowid > 0)
$oData[] = array('CALENDAR_UID' => $row['CALENDAR_UID'], 'CALENDAR_NAME' => $row['CALENDAR_NAME']);
$oData[] = array ('CALENDAR_UID' => $row['CALENDAR_UID'],'CALENDAR_NAME' => $row['CALENDAR_NAME']
);
}
print (G::json_encode( $oData )) ;
break;
@@ -101,7 +105,8 @@ switch($_POST['action'])
$roles = new Roles();
$rolesData = $roles->getAllRoles();
foreach ($rolesData as $rowid => $row) {
$oData[] = array('ROL_UID' => $row['ROL_CODE'],'ROL_CODE' => $row['ROL_CODE']);
$oData[] = array ('ROL_UID' => $row['ROL_CODE'],'ROL_CODE' => $row['ROL_CODE']
);
}
print (G::json_encode( $oData )) ;
break;
@@ -111,8 +116,7 @@ switch($_POST['action'])
if (isset( $_POST['USR_UID'] )) {
$form['USR_UID'] = $_POST['USR_UID'];
}
else {
} else {
$form['USR_UID'] = '';
}
/*
@@ -179,12 +183,11 @@ switch($_POST['action'])
if ($_FILES['USR_PHOTO']['tmp_name'] != '') {
G::uploadFile( $_FILES['USR_PHOTO']['tmp_name'], PATH_IMAGES_ENVIRONMENT_USERS, $sUserUID . '.gif' );
}
}
else {
} else {
$result->success = false;
$result->fileError = true;
print (G::json_encode( $result )) ;
die;
die();
}
/*
if ($_FILES['USR_RESUME']['error'] != 1) {
@@ -199,8 +202,7 @@ switch($_POST['action'])
die;
}
*/
}
else {
} else {
$aData['USR_UID'] = $form['USR_UID'];
$aData['USR_USERNAME'] = $form['USR_USERNAME'];
@@ -211,7 +213,9 @@ switch($_POST['action'])
$aData['USR_PASSWORD'] = $form['USR_PASSWORD'];
require_once 'classes/model/UsersProperties.php';
$oUserProperty = new UsersProperties();
$aUserProperty = $oUserProperty->loadOrCreateIfNotExists($form['USR_UID'], array('USR_PASSWORD_HISTORY' => serialize(array(md5($form['USR_PASSWORD'])))));
$aUserProperty = $oUserProperty->loadOrCreateIfNotExists( $form['USR_UID'], array ('USR_PASSWORD_HISTORY' => serialize( array (md5( $form['USR_PASSWORD'] )
) )
) );
$memKey = 'rbacSession' . session_id();
$memcache = & PMmemcached::getSingleton( defined( 'SYS_SYS' ) ? SYS_SYS : '' );
@@ -227,7 +231,6 @@ switch($_POST['action'])
$aErrors = $oUserProperty->validatePassword( $form['USR_NEW_PASS'], $aUserProperty['USR_LAST_UPDATE_DATE'], 0 );
if (count( $aErrors ) > 0) {
$sDescription = G::LoadTranslation( 'ID_POLICY_ALERT' ) . ':,';
foreach ($aErrors as $sError) {
@@ -250,8 +253,7 @@ switch($_POST['action'])
$result->success = false;
$result->msg = $sDescription;
print (G::json_encode( $result )) ;
die;
die();
}
$aHistory = unserialize( $aUserProperty['USR_PASSWORD_HISTORY'] );
@@ -302,8 +304,7 @@ switch($_POST['action'])
}
if (isset( $form['USR_ROLE'] )) {
$RBAC->updateUser( $aData, $form['USR_ROLE'] );
}
else {
} else {
$RBAC->updateUser( $aData );
}
$aData['USR_COUNTRY'] = $form['USR_COUNTRY'];
@@ -338,12 +339,11 @@ switch($_POST['action'])
G::uploadFile( $_FILES['USR_PHOTO']['tmp_name'], PATH_IMAGES_ENVIRONMENT_USERS, $aData['USR_UID'] . '.' . $aAux[1] );
G::resizeImage( PATH_IMAGES_ENVIRONMENT_USERS . $aData['USR_UID'] . '.' . $aAux[1], 96, 96, PATH_IMAGES_ENVIRONMENT_USERS . $aData['USR_UID'] . '.gif' );
}
}
else {
} else {
$result->success = false;
$result->fileError = true;
print (G::json_encode( $result )) ;
die;
die();
}
/*
if ($_FILES['USR_RESUME']['error'] != 1) {
@@ -365,17 +365,15 @@ switch($_POST['action'])
G::loadClass( 'configuration' );
$oConf = new Configurations;
$aConf = Array(
'DEFAULT_LANG' => $def_lang,
'DEFAULT_MENU' => $def_menu,
'DEFAULT_CASES_MENU' => $def_cases_menu
$oConf = new Configurations();
$aConf = Array ('DEFAULT_LANG' => $def_lang,'DEFAULT_MENU' => $def_menu,'DEFAULT_CASES_MENU' => $def_cases_menu
);
/*UPDATING SESSION VARIABLES*/
$aUser = $RBAC->userObj->load( $_SESSION['USER_LOGGED'] );
//$_SESSION['USR_FULLNAME'] = $aUser['USR_FIRSTNAME'] . ' ' . $aUser['USR_LASTNAME'];
$oConf->aConfig = $aConf;
$oConf->saveConfig( 'USER_PREFERENCES', '', '', $_SESSION['USER_LOGGED'] );
@@ -387,7 +385,6 @@ switch($_POST['action'])
$_SESSION['USR_FULLNAME'] = $aUser['USR_FIRSTNAME'] . ' ' . $aUser['USR_LASTNAME'];
}
//Save Calendar assigment
if ((isset( $form['USR_CALENDAR'] ))) {
//Save Calendar ID for this user
@@ -419,7 +416,7 @@ switch($_POST['action'])
#verifying if it has any preferences on the configurations table
G::loadClass( 'configuration' );
$oConf = new Configurations;
$oConf = new Configurations();
$oConf->loadConfig( $x, 'USER_PREFERENCES', '', '', $_SESSION['USER_LOGGED'], '' );
$aFields['PREF_DEFAULT_MENUSELECTED'] = '';
@@ -476,7 +473,6 @@ switch($_POST['action'])
}
}
$aFields['MENUSELECTED_NAME'] = $menuSelected;
$oMenu = new Menu();
@@ -503,39 +499,44 @@ switch($_POST['action'])
print (G::json_encode( $result )) ;
break;
case 'defaultMainMenuOptionList';
case 'defaultMainMenuOptionList':
foreach ($RBAC->aUserInfo['PROCESSMAKER']['PERMISSIONS'] as $permission) {
switch ($permission['PER_CODE']) {
case 'PM_USERS':
case 'PM_SETUP':
$rows[] = Array('id'=>'PM_SETUP', 'name'=>strtoupper(G::LoadTranslation('ID_SETUP')));
$rows[] = Array ('id' => 'PM_SETUP','name' => strtoupper( G::LoadTranslation( 'ID_SETUP' ) )
);
break;
case 'PM_CASES':
$rows[] = Array('id'=>'PM_CASES', 'name'=>strtoupper(G::LoadTranslation('ID_CASES')));
$rows[] = Array ('id' => 'PM_CASES','name' => strtoupper( G::LoadTranslation( 'ID_CASES' ) )
);
break;
case 'PM_FACTORY':
$rows[] = Array('id'=>'PM_FACTORY', 'name'=>strtoupper(G::LoadTranslation('ID_APPLICATIONS')));
$rows[] = Array ('id' => 'PM_FACTORY','name' => strtoupper( G::LoadTranslation( 'ID_APPLICATIONS' ) )
);
break;
case 'PM_DASHBOARD':
$rows[] = Array('id'=>'PM_DASHBOARD', 'name'=>strtoupper(G::LoadTranslation('ID_DASHBOARD')));
$rows[] = Array ('id' => 'PM_DASHBOARD','name' => strtoupper( G::LoadTranslation( 'ID_DASHBOARD' ) )
);
break;
}
}
print (G::json_encode( $rows )) ;
break;
case 'defaultCasesMenuOptionList';
case 'defaultCasesMenuOptionList':
$oMenu = new Menu();
$oMenu->load( 'cases' );
foreach ($oMenu->Id as $i => $item) {
if ($oMenu->Types[$i] != 'blockHeader') {
$rowsCasesMenu[] = Array('id'=>$item, 'name' => $oMenu->Labels[$i]);
$rowsCasesMenu[] = Array ('id' => $item,'name' => $oMenu->Labels[$i]
);
}
}
print (G::json_encode( $rowsCasesMenu )) ;
break;
case 'testPassword';
case 'testPassword':
require_once 'classes/model/UsersProperties.php';
$oUserProperty = new UsersProperties();
@@ -588,19 +589,21 @@ switch($_POST['action'])
$aFields['DESCRIPTION'] = $span . $gif . $aFields['DESCRIPTION'];
print (G::json_encode( $aFields )) ;
break;
case 'testUsername';
case 'testUsername':
require_once 'classes/model/Users.php';
$_POST['NEW_USERNAME'] = trim( $_POST['NEW_USERNAME'] );
$USR_UID = isset( $_POST['USR_UID'] ) ? $_POST['USR_UID'] : '';
$response = array( "success" => true );
$response = array ("success" => true
);
$oCriteria = new Criteria();
$oCriteria->addSelectColumn( UsersPeer::USR_USERNAME );
$oCriteria->add( UsersPeer::USR_USERNAME, $_POST['NEW_USERNAME'] );
if ($USR_UID != '') {
$oCriteria->add(UsersPeer::USR_UID, array($_POST['USR_UID']), Criteria::NOT_IN);
$oCriteria->add( UsersPeer::USR_UID, array ($_POST['USR_UID']
), Criteria::NOT_IN );
}
$oDataset = UsersPeer::doSelectRS( $oCriteria );
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
@@ -621,7 +624,6 @@ switch($_POST['action'])
$response['exists'] = false;
}
$span = '<span style="color: ' . $color . '; font: 9px tahoma,arial,helvetica,sans-serif;">';
$gif = '<img width="13" height="13" border="0" src="' . $img . '">';
$response['descriptionText'] = $span . $gif . $text . '</span>';
@@ -629,3 +631,4 @@ switch($_POST['action'])
break;
}

View File

@@ -1,20 +1 @@
<?php
//calculating the max upload file size;
$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);
$mul = ($mul == 'M' ? 1048576 : ($mul == 'K' ? 1024 : ($mul == 'G' ? 1073741824 : 1)));
$uploadMaxSize = (int)$UPLOAD_MAX_SIZE * $mul;
if ( $postMaxSize < $uploadMaxSize ) $uploadMaxSize = $postMaxSize;
$oHeadPublisher =& headPublisher::getSingleton();
$oHeadPublisher->addExtJsScript('users/users', true ); //adding a javascript file .js
$oHeadPublisher->assign('USR_UID', $_GET['USR_UID']);
$oHeadPublisher->assign('MODE', $_GET['MODE']);
$oHeadPublisher->assign('MAX_FILES_SIZE', ' (' . $UPLOAD_MAX_SIZE . ') ');
G::RenderPage('publish', 'extJs');
<?php

View File

@@ -21,7 +21,6 @@
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
if (($RBAC_Response = $RBAC->userCanAccess( "PM_LOGIN" )) != 1) {
return $RBAC_Response;
@@ -34,17 +33,17 @@ if ($access != 1) {
case - 1:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' );
die;
die();
break;
case - 2:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
G::header( 'location: ../login/login' );
die;
die();
break;
default:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' );
die;
die();
break;
}
}
@@ -53,7 +52,7 @@ $G_SUB_MENU = 'users';
$G_ID_MENU_SELECTED = 'USERS';
$G_ID_SUB_MENU_SELECTED = 'USERS';
$G_PUBLISH = new Publisher;
$G_PUBLISH = new Publisher();
G::LoadClass( 'configuration' );
$c = new Configurations();

View File

@@ -23,7 +23,8 @@ $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 ) $uploadMaxSize = $postMaxSize;
if ($postMaxSize < $uploadMaxSize)
$uploadMaxSize = $postMaxSize;
$oHeadPublisher = & headPublisher::getSingleton();
$oHeadPublisher->addExtJsScript( 'users/users', true ); //adding a javascript file .js
@@ -34,3 +35,4 @@ $oHeadPublisher->assign('canEdit', $canEdit);
$oHeadPublisher->assign( 'MAX_FILES_SIZE', ' (' . $UPLOAD_MAX_SIZE . ') ' );
$oHeadPublisher->assign( 'MODE', '' );
G::RenderPage( 'publish', 'extJs' );

View File

@@ -11,7 +11,8 @@ $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 ) $uploadMaxSize = $postMaxSize;
if ($postMaxSize < $uploadMaxSize)
$uploadMaxSize = $postMaxSize;
$oHeadPublisher = & headPublisher::getSingleton();
$oHeadPublisher->addExtJsScript( 'users/users', true ); //adding a javascript file .js
@@ -19,3 +20,4 @@ $oHeadPublisher->assign('USR_UID', '');
$oHeadPublisher->assign( 'MODE', $_GET['MODE'] );
$oHeadPublisher->assign( 'MAX_FILES_SIZE', ' (' . $UPLOAD_MAX_SIZE . ') ' );
G::RenderPage( 'publish', 'extJs' );

View File

@@ -20,26 +20,23 @@
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
try {
global $RBAC;
switch ($RBAC->userCanAccess('PM_LOGIN'))
{
switch ($RBAC->userCanAccess( 'PM_LOGIN' )) {
case - 2:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
G::header( 'location: ../login/login' );
die;
die();
break;
case - 1:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' );
die;
die();
break;
}
G::LoadInclude( 'ajax' );
if (isset($_POST['form']))
{
if (isset( $_POST['form'] )) {
$_POST = $_POST['form'];
}
if (isset( $_REQUEST['function'] )) {
@@ -54,12 +51,9 @@ try {
//print_r($_POST); die;
$_POST['sOriginalUsername'] = get_ajax_value( 'sOriginalUsername' );
$_POST['sUsername'] = get_ajax_value( 'sUsername' );
if ($_POST['sOriginalUsername'] == $_POST['sUsername'])
{
if ($_POST['sOriginalUsername'] == $_POST['sUsername']) {
echo '0';
}
else
{
} else {
require_once 'classes/model/Users.php';
G::LoadClass( 'Users' );
$oUser = new Users();
@@ -70,12 +64,9 @@ try {
$aRow = $oDataset->getRow();
//print_r($aRow); die;
//if (!$aRow)
if (!is_array($aRow))
{
if (! is_array( $aRow )) {
echo '0';
}
else
{
} else {
echo '1';
}
}
@@ -120,19 +111,19 @@ try {
$oGroup = new Groups();
$oGroup->removeUserOfGroup( $_POST['GRP_UID'], $_POST['USR_UID'] );
$_GET['sUserUID'] = $_POST['USR_UID'];
$G_PUBLISH = new Publisher;
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'view', 'users/users_Tree' );
G::RenderPage( 'publish', 'raw' );
break;
case 'showUserGroupInterface':
$_GET['sUserUID'] = $_POST['sUserUID'];
$G_PUBLISH = new Publisher;
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'view', 'users/users_AssignGroup' );
G::RenderPage( 'publish', 'raw' );
break;
case 'showUserGroups':
$_GET['sUserUID'] = $_POST['sUserUID'];
$G_PUBLISH = new Publisher;
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'view', 'users/users_Tree' );
G::RenderPage( 'publish', 'raw' );
break;
@@ -203,7 +194,8 @@ try {
$oGroups->removeUserOfAllGroups( $UID );
$RBAC->changeUserStatus( $UID, 'CLOSED' );
$_GET['USR_USERNAME'] = '';
$RBAC->updateUser(array('USR_UID' => $UID, 'USR_USERNAME' => $_GET['USR_USERNAME']),'');
$RBAC->updateUser( array ('USR_UID' => $UID,'USR_USERNAME' => $_GET['USR_USERNAME']
), '' );
require_once 'classes/model/Users.php';
$oUser = new Users();
$aFields = $oUser->load( $UID );
@@ -221,8 +213,7 @@ try {
$userData['USR_STATUS'] = $_REQUEST['NEW_USR_STATUS'];
$userInstance->update( $userData );
$response->status = 'OK';
}
else {
} else {
$response->status = 'ERROR';
$response->message = 'USR_UID and NEW_USR_STATUS parameters are required.';
}
@@ -371,13 +362,11 @@ try {
$oCriteria = new Criteria( 'workflow' );
$oCriteria->addSelectColumn( 'COUNT(*) AS CNT' );
if ($filter != '') {
$cc = $oCriteria->getNewCriterion(UsersPeer::USR_USERNAME,'%'.$filter.'%',Criteria::LIKE)->addOr(
$oCriteria->getNewCriterion(UsersPeer::USR_FIRSTNAME,'%'.$filter.'%',Criteria::LIKE)->addOr(
$oCriteria->getNewCriterion(UsersPeer::USR_LASTNAME,'%'.$filter.'%',Criteria::LIKE)->addOr(
$oCriteria->getNewCriterion(UsersPeer::USR_EMAIL,'%'.$filter.'%',Criteria::LIKE))));
$cc = $oCriteria->getNewCriterion( UsersPeer::USR_USERNAME, '%' . $filter . '%', Criteria::LIKE )->addOr( $oCriteria->getNewCriterion( UsersPeer::USR_FIRSTNAME, '%' . $filter . '%', Criteria::LIKE )->addOr( $oCriteria->getNewCriterion( UsersPeer::USR_LASTNAME, '%' . $filter . '%', Criteria::LIKE )->addOr( $oCriteria->getNewCriterion( UsersPeer::USR_EMAIL, '%' . $filter . '%', Criteria::LIKE ) ) ) );
$oCriteria->add( $cc );
}
$oCriteria->add(UsersPeer::USR_STATUS, array('CLOSED'), Criteria::NOT_IN);
$oCriteria->add( UsersPeer::USR_STATUS, array ('CLOSED'
), Criteria::NOT_IN );
if ($auths != '') {
$totalRows = sizeof( $aUsers );
} else {
@@ -403,12 +392,10 @@ try {
$oCriteria->addAsColumn( 'TOTAL_CASES', 0 );
$oCriteria->addAsColumn( 'DUE_DATE_OK', 1 );
$sep = "'";
$oCriteria->add(UsersPeer::USR_STATUS, array('CLOSED'), Criteria::NOT_IN);
$oCriteria->add( UsersPeer::USR_STATUS, array ('CLOSED'
), Criteria::NOT_IN );
if ($filter != '') {
$cc = $oCriteria->getNewCriterion(UsersPeer::USR_USERNAME,'%'.$filter.'%',Criteria::LIKE)->addOr(
$oCriteria->getNewCriterion(UsersPeer::USR_FIRSTNAME,'%'.$filter.'%',Criteria::LIKE)->addOr(
$oCriteria->getNewCriterion(UsersPeer::USR_LASTNAME,'%'.$filter.'%',Criteria::LIKE)->addOr(
$oCriteria->getNewCriterion(UsersPeer::USR_EMAIL,'%'.$filter.'%',Criteria::LIKE))));
$cc = $oCriteria->getNewCriterion( UsersPeer::USR_USERNAME, '%' . $filter . '%', Criteria::LIKE )->addOr( $oCriteria->getNewCriterion( UsersPeer::USR_FIRSTNAME, '%' . $filter . '%', Criteria::LIKE )->addOr( $oCriteria->getNewCriterion( UsersPeer::USR_LASTNAME, '%' . $filter . '%', Criteria::LIKE )->addOr( $oCriteria->getNewCriterion( UsersPeer::USR_EMAIL, '%' . $filter . '%', Criteria::LIKE ) ) ) );
$oCriteria->add( $cc );
}
// $sw_add = false;
@@ -430,8 +417,7 @@ try {
if ($sort != '') {
if ($dir == 'ASC') {
$oCriteria->addAscendingOrderByColumn( $sort );
}
else {
} else {
$oCriteria->addDescendingOrderByColumn( $sort );
}
}
@@ -515,8 +501,7 @@ try {
echo '{success: true, userdata: ' . G::json_encode( $data ) . ', cases: ' . G::json_encode( $aCount ) . ', misc: ' . G::json_encode( $misc ) . '}';
break;
}
}
catch (Exception $oException) {
} catch (Exception $oException) {
die( $oException->getMessage() );
}
?>

View File

@@ -20,13 +20,12 @@
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
global $RBAC;
if ($RBAC->userCanAccess( 'PM_SETUP_ADVANCE' ) != 1) {
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' );
die;
die();
}
$G_MAIN_MENU = 'processmaker';
@@ -34,6 +33,8 @@ $G_MAIN_MENU = 'processmaker';
$G_ID_MENU_SELECTED = 'USERS';
//$G_ID_SUB_MENU_SELECTED = '-';
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'users/users_AuthSource', '', $RBAC->load( $_GET['USR_UID'] ), '../users/users_AuthSourceSave' );
G::RenderPage( 'publish', 'blank' );

View File

@@ -20,13 +20,12 @@
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
global $RBAC;
if ($RBAC->userCanAccess( 'PM_SETUP_ADVANCE' ) != 1) {
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' );
die;
die();
}
$aData = $RBAC->load( $_POST['form']['USR_UID'] );
@@ -34,8 +33,7 @@ unset($aData['USR_ROLE']);
if ($_POST['form']['UID_AUTH_SOURCE'] == 'MYSQL') {
$aData['USR_AUTH_TYPE'] = 'MYSQL';
$aData['UID_AUTH_SOURCE'] = '';
}
else {
} else {
$aFields = $RBAC->getAuthSource( $_POST['form']['UID_AUTH_SOURCE'] );
$aData['USR_AUTH_TYPE'] = $aFields['AUTH_SOURCE_PROVIDER'];
$aData['UID_AUTH_SOURCE'] = $_POST['form']['UID_AUTH_SOURCE'];
@@ -44,3 +42,4 @@ $aData['USR_AUTH_USER_DN'] = $_POST['form']['USR_AUTH_USER_DN'];
$RBAC->updateUser( $aData );
G::header( 'location: users_List' );

View File

@@ -20,27 +20,25 @@
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
try {
global $RBAC;
switch ($RBAC->userCanAccess('PM_FACTORY'))
{
switch ($RBAC->userCanAccess( 'PM_FACTORY' )) {
case - 2:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
G::header( 'location: ../login/login' );
die;
die();
break;
case - 1:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' );
die;
die();
break;
}
if ($_GET['USR_UID'] == '00000000000000000000000000000001') {
G::SendTemporalMessage( 'ID_CANNOT_CHANGE_STATUS_ADMIN_USER', 'error', 'usersLabels' );
G::header( 'location: ' . $_SERVER['HTTP_REFERER'] );
die;
die();
}
/*$RBAC->removeUser($_GET['USR_UID']);
require_once 'classes/model/Users.php';
@@ -56,8 +54,8 @@ try {
$oGroups->removeUserOfAllGroups( $_GET['USR_UID'] );
$RBAC->changeUserStatus( $_GET['USR_UID'], 'CLOSED' );
$_GET['USR_USERNAME'] = '';
$RBAC->updateUser(array('USR_UID' => $_GET['USR_UID'], 'USR_USERNAME' => $_GET['USR_USERNAME']),'');
$RBAC->updateUser( array ('USR_UID' => $_GET['USR_UID'],'USR_USERNAME' => $_GET['USR_USERNAME']
), '' );
require_once 'classes/model/Users.php';
$oUser = new Users();
@@ -66,8 +64,7 @@ try {
$aFields['USR_USERNAME'] = '';
$oUser->update( $aFields );
G::header( 'location: users_List' );
}
catch (Exception $oException) {
} catch (Exception $oException) {
die( $oException->getMessage() );
}
?>

View File

@@ -20,7 +20,6 @@
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
$USR_UID = $_GET['USR_UID'];
@@ -42,8 +41,7 @@
$array["USR_UID"] = $USR_UID;
$G_PUBLISH = new Publisher;
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'users/users_DeleteAssign', '', $array, '' );
G::RenderPage( 'publish', 'raw' );
?>

View File

@@ -20,7 +20,6 @@
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
try {
@@ -29,12 +28,12 @@ try {
case - 2:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
G::header( 'location: ../login/login' );
die;
die();
break;
case - 1:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' );
die;
die();
break;
}
@@ -46,7 +45,7 @@ try {
$G_SUB_MENU = 'users';
$G_ID_MENU_SELECTED = 'USERS';
$G_ID_SUB_MENU_SELECTED = 'USERS';
$G_PUBLISH = new Publisher;
$G_PUBLISH = new Publisher();
if ($_GET['USR_UID'] != '') {
$c = 0;
@@ -63,7 +62,8 @@ try {
list ($oCriteriaToDo, $sXMLFile) = $oCases->getConditionCasesList( 'to_do', $_GET['USR_UID'] );
list ($oCriteriaDraft, $sXMLFile) = $oCases->getConditionCasesList( 'draft', $_GET['USR_UID'] );
if(ApplicationPeer::doCount($oCriteriaToDo)==0 && ApplicationPeer::doCount($oCriteriaDraft)==0);
if (ApplicationPeer::doCount( $oCriteriaToDo ) == 0 && ApplicationPeer::doCount( $oCriteriaDraft ) == 0)
;
G::header( 'location: users_Delete?USR_UID=' . $USR_UID );
$oDataset = ApplicationPeer::doSelectRS( $oCriteriaToDo );
@@ -76,7 +76,8 @@ try {
foreach ($aKeys as $sKey) {
$oTemplatePower->assign( $sKey, $aRow[$sKey] );
}
$aUsers = array($_GET['USR_UID']);
$aUsers = array ($_GET['USR_UID']
);
$aAux1 = $oTasks->getGroupsOfTask( $aRow['TAS_UID'], 1 );
foreach ($aAux1 as $aGroup) {
$aAux2 = $oGroups->getUsersOfGroup( $aGroup['GRP_UID'] );
@@ -115,7 +116,8 @@ try {
foreach ($aKeys as $sKey) {
$oTemplatePower->assign( $sKey, $aRow[$sKey] );
}
$aUsers = array($_GET['USR_UID']);
$aUsers = array ($_GET['USR_UID']
);
$aAux1 = $oTasks->getGroupsOfTask( $aRow['TAS_UID'], 1 );
foreach ($aAux1 as $aGroup) {
$aAux2 = $oGroups->getUsersOfGroup( $aGroup['GRP_UID'] );
@@ -157,8 +159,7 @@ try {
$G_PUBLISH->AddContent( 'template', '', '', '', $oTemplatePower );
}
G::RenderPage( 'publish' );
}
catch (Exception $oException) {
} catch (Exception $oException) {
die( $oException->getMessage() );
}
?>

View File

@@ -21,7 +21,6 @@
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
try {
@@ -30,12 +29,12 @@ try {
case - 2:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
G::header( 'location: ../login/login' );
die;
die();
break;
case - 1:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' );
die;
die();
break;
}
G::LoadClass( 'case' );
@@ -43,8 +42,8 @@ try {
$aCases = array ();
$aUsers = array ();
$c = 0;
if(isset($_POST['USERS']))
{ if (is_array($_POST['USERS'])) {
if (isset( $_POST['USERS'] )) {
if (is_array( $_POST['USERS'] )) {
foreach ($_POST['USERS'] as $sKey => $sUser) {
if ($sUser != '') {
$c ++;
@@ -66,12 +65,11 @@ try {
$sText .= $aCase['TITLE'] . ' => ' . $aUser['USR_FIRSTNAME'] . ' ' . $aUser['USR_LASTNAME'] . ' (' . $aUser['USR_USERNAME'] . ')' . '<br />';
}
$G_MAIN_MENU = 'processmaker';
$G_SUB_MENU = 'users';
$G_ID_MENU_SELECTED = 'USERS';
$G_ID_SUB_MENU_SELECTED = 'USERS';
$G_PUBLISH = new Publisher;
$G_PUBLISH = new Publisher();
$aMessage['USR_UID'] = $_POST['USR_UID'];
@@ -83,8 +81,7 @@ try {
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'users/users_ReassignShowInfo', '', $aMessage );
G::RenderPage( 'publish' );
}
catch (Exception $oException) {
} catch (Exception $oException) {
die( $oException->getMessage() );
}
?>

View File

@@ -20,7 +20,6 @@
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
try {
global $RBAC;
@@ -53,7 +52,7 @@ try {
$G_ID_MENU_SELECTED = 'USERS';
$G_ID_SUB_MENU_SELECTED = 'USERS';
$G_PUBLISH = new Publisher;
$G_PUBLISH = new Publisher();
//getting the user and department
$oDepInfo = new Department();
@@ -65,19 +64,16 @@ try {
try {
$depFields = $oDepInfo->load( $userFields['DEP_UID'] );
$aFields['USR_REPORTS_TO'] .= " (" . $depFields['DEPO_TITLE'] . ")";
} catch (Exception $e) {
}
catch( Exception $e ) {
}
}
else{
} else {
$aFields['USR_REPORTS_TO'] = ' ';
}
try {
$depFields = $oDepInfo->load( $aFields['DEP_UID'] );
$aFields['USR_DEPARTMENT'] = $depFields['DEPO_TITLE'];
}
catch( Exception $e ) {
} catch (Exception $e) {
$oUser = UsersPeer::retrieveByPk( $_GET['USR_UID'] );
$oUser->setDepUid( '' );
$oUser->save();
@@ -110,20 +106,19 @@ try {
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
///////////////////////
G::loadClass( 'configuration' );
$oConf = new Configurations;
$oConf = new Configurations();
$oConf->loadConfig( $obj, 'ENVIRONMENT_SETTINGS', '' );
$defaultOption = isset( $oConf->aConfig['format'] ) ? $oConf->aConfig['format'] : '';
$aUserInfo = array ();
$aUserInfo[] = array('USR_UID' => 'char','USER_FULLNAME' => 'char');
$aUserInfo[] = array ('USR_UID' => 'char','USER_FULLNAME' => 'char'
);
while ($oDataset->next()) {
$aRow1 = $oDataset->getRow();
$infoUser = G::getFormatUserList( $defaultOption, $aRow1 );
$aUserInfo[]=array(
'USR_UID' => $aRow1['USR_UID'],
'USER_FULLNAME' => $infoUser
$aUserInfo[] = array ('USR_UID' => $aRow1['USR_UID'],'USER_FULLNAME' => $infoUser
);
}
@@ -138,25 +133,23 @@ try {
$mul = ($mul == 'M' ? 1048576 : ($mul == 'K' ? 1024 : ($mul == 'G' ? 1073741824 : 1)));
$uploadMaxSize = (int) $UPLOAD_MAX_SIZE * $mul;
if ( $postMaxSize < $uploadMaxSize ) $uploadMaxSize = $postMaxSize;
if ($postMaxSize < $uploadMaxSize)
$uploadMaxSize = $postMaxSize;
$aFields['MAX_FILES_SIZE'] = " (" . $UPLOAD_MAX_SIZE . ") ";
global $_DBArray;
$_DBArray['aUserInfo'] = $aUserInfo;
$_SESSION['_DBArray'] = $_DBArray;
if ($_GET['USR_AUTH_SOURCE'] == 'ProcessMaker (MYSQL)') {
//always show this form users_EditRT.xml.
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'users/users_EditRT.xml', '', $aFields, 'users_Save?USR_UID=' . $_SESSION['CURRENT_USER'] );
}
else {
} else {
//for users ldap always show this form users_EditLDAP.xml.
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'users/users_EditLDAP.xml', '', $aFields, 'users_Save?USR_UID=' . $_SESSION['CURRENT_USER'] );
}
G::RenderPage( 'publish', 'blank' );
}
catch (Exception $oException) {
} catch (Exception $oException) {
die( $oException->getMessage() );
}
?>

View File

@@ -20,11 +20,11 @@
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
/**
* @Description This is a callback for the View of all groups from a determinated user
* ription This is a callback for the View of all groups from a determinated user
*
* @author Erik Amaru Ortiz <erik@colosa.com>
* @Date 24/04/2008
* @LastModification none
@@ -35,21 +35,19 @@ try {
case - 2:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
G::header( 'location: ../login/login' );
die;
die();
break;
case - 1:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' );
die;
die();
break;
}
$G_PUBLISH = new Publisher;
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'view', 'users/users_Tree' );
G::RenderPage( 'publish', 'raw' );
}
catch (exception $oException) {
} catch (exception $oException) {
die( $oException->getMessage() );
}
?>

View File

@@ -20,29 +20,28 @@
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
if (($RBAC_Response=$RBAC->userCanAccess("PM_LOGIN"))!=1) return $RBAC_Response;
if (($RBAC_Response = $RBAC->userCanAccess( "PM_LOGIN" )) != 1)
return $RBAC_Response;
global $RBAC;
$access = $RBAC->userCanAccess( 'PM_USERS' );
if ($access != 1) {
switch ($access)
{
switch ($access) {
case - 1:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' );
die;
die();
break;
case - 2:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
G::header( 'location: ../login/login' );
die;
die();
break;
default:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' );
die;
die();
break;
}
}
@@ -52,7 +51,7 @@ $G_SUB_MENU = 'users';
$G_ID_MENU_SELECTED = 'USERS';
$G_ID_SUB_MENU_SELECTED = 'USERS';
$G_PUBLISH = new Publisher;
$G_PUBLISH = new Publisher();
G::LoadClass( 'configuration' );
$c = new Configurations();
@@ -66,3 +65,4 @@ $oHeadPublisher->assign('CONFIG', $Config);
$oHeadPublisher->assign( 'FORMATS', $c->getFormats() );
G::RenderPage( 'publish', 'extJs' );

View File

@@ -20,7 +20,6 @@
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
try {
global $RBAC;
@@ -50,7 +49,8 @@ try {
$mul = ($mul == 'M' ? 1048576 : ($mul == 'K' ? 1024 : ($mul == 'G' ? 1073741824 : 1)));
$uploadMaxSize = (int) $UPLOAD_MAX_SIZE * $mul;
if ( $postMaxSize < $uploadMaxSize ) $uploadMaxSize = $postMaxSize;
if ($postMaxSize < $uploadMaxSize)
$uploadMaxSize = $postMaxSize;
$aFields['MAX_FILES_SIZE'] = " (" . $UPLOAD_MAX_SIZE . ") ";
//Load Calendar options and falue for this user
@@ -64,6 +64,7 @@ try {
// $G_MAIN_MENU = 'processmaker';
// $G_ID_MENU_SELECTED = 'USERS';
$G_MAIN_MENU = 'processmaker';
$G_SUB_MENU = 'users';
$G_ID_MENU_SELECTED = 'USERS';
@@ -84,20 +85,19 @@ try {
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
///////////////////////
G::loadClass( 'configuration' );
$oConf = new Configurations;
$oConf = new Configurations();
$oConf->loadConfig( $obj, 'ENVIRONMENT_SETTINGS', '' );
$defaultOption = isset( $oConf->aConfig['format'] ) ? $oConf->aConfig['format'] : '';
$aUserInfo = array ();
$aUserInfo[] = array('USR_UID' => 'char','USER_FULLNAME' => 'char');
$aUserInfo[] = array ('USR_UID' => 'char','USER_FULLNAME' => 'char'
);
while ($oDataset->next()) {
$aRow1 = $oDataset->getRow();
$infoUser = G::getFormatUserList( $defaultOption, $aRow1 );
$aUserInfo[]=array(
'USR_UID' => $aRow1['USR_UID'],
'USER_FULLNAME' => $infoUser
$aUserInfo[] = array ('USR_UID' => $aRow1['USR_UID'],'USER_FULLNAME' => $infoUser
);
}
//print_r($aUserInfo);
@@ -106,12 +106,12 @@ try {
$_SESSION['_DBArray'] = $_DBArray;
/////////////////////////////
//var_dump($aFields);
$G_PUBLISH = new Publisher;
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'users/users_New.xml', '', $aFields, 'users_Save' );
G::RenderPage( 'publish', 'blank' );
}
catch (Exception $oException) {
} catch (Exception $oException) {
die( $oException->getMessage() );
}
?>

View File

@@ -20,7 +20,6 @@
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
try {
G::LoadClass( 'case' );
@@ -42,8 +41,7 @@ try {
}
}
}
}
catch (Exception $oException) {
} catch (Exception $oException) {
die( $oException->getMessage() );
}
?>

View File

@@ -20,7 +20,6 @@
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
try {
global $G_PUBLISH;
@@ -28,7 +27,8 @@ try {
$_GET['iStep'] = (int) $_GET['iStep'];
switch ($_GET['iStep']) {
case 1:
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'users/users_ReassignSelectType', '', array('USR_UID' => $_GET['USR_UID']), '');
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'users/users_ReassignSelectType', '', array ('USR_UID' => $_GET['USR_UID']
), '' );
break;
case 2:
switch ($_POST['TYPE']) {
@@ -56,7 +56,8 @@ try {
$oCriteria->addAsColumn( 'USR_COMPLETENAME', $usr_completename_col );
$oCriteria->add( UsersPeer::USR_UID, $_POST['USR_UID'], Criteria::NOT_EQUAL );
$oCriteria->add(UsersPeer::USR_STATUS, array('CLOSED'), Criteria::NOT_IN);
$oCriteria->add( UsersPeer::USR_STATUS, array ('CLOSED'
), Criteria::NOT_IN );
$oDataset = UsersPeer::doSelectRS( $oCriteria );
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$oDataset->next();
@@ -66,10 +67,8 @@ try {
$oDataset->next();
}
$aProcesses = array ();
$aProcesses[] = array('CHECKBOX' => 'char',
'PROCESS' => 'char',
'CANTITY' => 'char',
'USERS' => 'char');
$aProcesses[] = array ('CHECKBOX' => 'char','PROCESS' => 'char','CANTITY' => 'char','USERS' => 'char'
);
$del = DBAdapter::getStringDelimiter();
require_once 'classes/model/AppDelegation.php';
$oCriteria = new Criteria( 'workflow' );
@@ -77,9 +76,12 @@ try {
$oCriteria->addSelectColumn( 'COUNT(' . AppDelegationPeer::PRO_UID . ') AS CANTITY' );
$oCriteria->addAsColumn( 'PRO_TITLE', ContentPeer::CON_VALUE );
$aConditions = array ();
$aConditions[] = array(AppDelegationPeer::PRO_UID, ContentPeer::CON_ID);
$aConditions[] = array(ContentPeer::CON_CATEGORY, $del . 'PRO_TITLE' . $del);
$aConditions[] = array(ContentPeer::CON_LANG, $del . SYS_LANG . $del);
$aConditions[] = array (AppDelegationPeer::PRO_UID,ContentPeer::CON_ID
);
$aConditions[] = array (ContentPeer::CON_CATEGORY,$del . 'PRO_TITLE' . $del
);
$aConditions[] = array (ContentPeer::CON_LANG,$del . SYS_LANG . $del
);
$oCriteria->addJoinMC( $aConditions, Criteria::LEFT_JOIN );
$oCriteria->add( AppDelegationPeer::USR_UID, $_POST['USR_UID'] );
$oCriteria->add( AppDelegationPeer::DEL_FINISH_DATE, null, Criteria::ISNULL );
@@ -94,10 +96,8 @@ try {
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
$aProcesses[] = array('CHECKBOX' => '<input type="checkbox" name="PROCESS[' . $aRow['PRO_UID'] . ']" id="PROCESS[' . $aRow['PRO_UID'] . ']" />',
'PROCESS' => $aRow['PRO_TITLE'],
'CANTITY' => $aRow['CANTITY'],
'USERS' => '<select name="USER[' . $aRow['PRO_UID'] . ']" id="USER[' . $aRow['PRO_UID'] . ']">' . $sUsers . '</select>');
$aProcesses[] = array ('CHECKBOX' => '<input type="checkbox" name="PROCESS[' . $aRow['PRO_UID'] . ']" id="PROCESS[' . $aRow['PRO_UID'] . ']" />','PROCESS' => $aRow['PRO_TITLE'],'CANTITY' => $aRow['CANTITY'],'USERS' => '<select name="USER[' . $aRow['PRO_UID'] . ']" id="USER[' . $aRow['PRO_UID'] . ']">' . $sUsers . '</select>'
);
$oDataset->next();
}
global $_DBArray;
@@ -112,8 +112,7 @@ try {
break;
}
G::RenderPage( 'publish', 'raw' );
}
catch (Exception $oException) {
} catch (Exception $oException) {
die( $oException->getMessage() );
}
?>

View File

@@ -20,23 +20,20 @@
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
try {
global $RBAC;
switch ($RBAC->userCanAccess('PM_FACTORY'))
{
switch ($RBAC->userCanAccess( 'PM_FACTORY' )) {
case - 2:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
G::header( 'location: ../login/login' );
die;
die();
break;
case - 1:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' );
die;
die();
break;
}
if (empty( $_POST ) || ! isset( $_POST['form'] )) {
@@ -50,16 +47,14 @@ try {
if (isset( $_GET['USR_UID'] )) {
$form['USR_UID'] = $_GET['USR_UID'];
}
else {
} else {
$form['USR_UID'] = '';
}
if (isset( $_FILES['form']['name']['USR_RESUME'] )) {
if ($_FILES['form']['tmp_name']['USR_RESUME'] != '') {
$form['USR_RESUME'] = $_FILES['form']['name']['USR_RESUME'];
}
else {
} else {
$form['USR_RESUME'] = '';
}
}
@@ -109,7 +104,6 @@ try {
$aData['USR_ROLE'] = $form['USR_ROLE'];
$aData['USR_REPLACED_BY'] = $form['USR_REPLACED_BY'];
require_once 'classes/model/Users.php';
$oUser = new Users();
$oUser->create( $aData );
@@ -117,20 +111,17 @@ try {
if ($_FILES['form']['tmp_name']['USR_PHOTO'] != '') {
G::uploadFile( $_FILES['form']['tmp_name']['USR_PHOTO'], PATH_IMAGES_ENVIRONMENT_USERS, $sUserUID . '.gif' );
}
}
else {
} else {
G::SendTemporalMessage( 'ID_FILE_TOO_BIG', 'error' );
}
if ($_FILES['form']['error']['USR_RESUME'] != 1) {
if ($_FILES['form']['tmp_name']['USR_RESUME'] != '') {
G::uploadFile( $_FILES['form']['tmp_name']['USR_RESUME'], PATH_IMAGES_ENVIRONMENT_FILES . $sUserUID . '/', $_FILES['form']['name']['USR_RESUME'] );
}
}
else {
} else {
G::SendTemporalMessage( 'ID_FILE_TOO_BIG', 'error' );
}
}
else {
} else {
$aData['USR_UID'] = $form['USR_UID'];
$aData['USR_USERNAME'] = $form['USR_USERNAME'];
@@ -139,7 +130,9 @@ try {
$aData['USR_PASSWORD'] = $form['USR_PASSWORD'];
require_once 'classes/model/UsersProperties.php';
$oUserProperty = new UsersProperties();
$aUserProperty = $oUserProperty->loadOrCreateIfNotExists($form['USR_UID'], array('USR_PASSWORD_HISTORY' => serialize(array(md5($form['USR_PASSWORD'])))));
$aUserProperty = $oUserProperty->loadOrCreateIfNotExists( $form['USR_UID'], array ('USR_PASSWORD_HISTORY' => serialize( array (md5( $form['USR_PASSWORD'] )
) )
) );
$RBAC->loadUserRolePermission( 'PROCESSMAKER', $_SESSION['USER_LOGGED'] );
if ($RBAC->aUserInfo['PROCESSMAKER']['ROLE']['ROL_CODE'] == 'PROCESSMAKER_ADMIN') {
@@ -170,7 +163,7 @@ try {
$sDescription .= '<br />' . G::LoadTranslation( 'ID_PLEASE_CHANGE_PASSWORD_POLICY' );
G::SendMessageText( $sDescription, 'warning' );
G::header( 'Location: ' . $_SERVER['HTTP_REFERER'] );
die;
die();
}
$aHistory = unserialize( $aUserProperty['USR_PASSWORD_HISTORY'] );
if (! is_array( $aHistory )) {
@@ -181,7 +174,8 @@ try {
}
if (PPP_PASSWORD_HISTORY > 0) {
//it's looking a password igual into aHistory array that was send for post in md5 way
$c=0;$sw=1;
$c = 0;
$sw = 1;
while (count( $aHistory ) >= 1 && count( $aHistory ) > $c && $sw) {
if (strcmp( trim( $aHistory[$c] ), trim( $form['USR_PASSWORD'] ) ) == 0) {
$sw = 0;
@@ -194,7 +188,7 @@ try {
$sDescription .= '<br />' . G::LoadTranslation( 'ID_PLEASE_CHANGE_PASSWORD_POLICY' ) . '';
G::SendMessageText( $sDescription, 'warning' );
G::header( 'Location: ' . $_SERVER['HTTP_REFERER'] );
die;
die();
}
//
if (count( $aHistory ) >= PPP_PASSWORD_HISTORY) {
@@ -218,8 +212,7 @@ try {
}
if (isset( $form['USR_ROLE'] )) {
$RBAC->updateUser( $aData, $form['USR_ROLE'] );
}
else {
} else {
$RBAC->updateUser( $aData );
}
$aData['USR_COUNTRY'] = $form['USR_COUNTRY'];
@@ -247,11 +240,7 @@ try {
require_once 'classes/model/Users.php';
$oUser = new Users();
$oUser->update( $aData );
$aExtensions = array ( "AIS", "BMP", "BW", "CDR", "CDT", "CGM", "CMX", "CPT", "DCX", "DIB",
"EMF", "GBR", "GIF", "GIH", "ICO", "IFF", "ILBM", "JFIF", "JIF", "JPE",
"JPEG", "JPG", "KDC", "LBM", "MAC", "PAT", "PCD", "PCT", "PCX", "PIC",
"PICT", "PNG", "PNTG", "PIX", "PSD", "PSP", "QTI", "QTIF", "RGB", "RGBA",
"RIF", "RLE", "SGI", "TGA", "TIF", "TIFF", "WMF", "XCF"
$aExtensions = array ("AIS","BMP","BW","CDR","CDT","CGM","CMX","CPT","DCX","DIB","EMF","GBR","GIF","GIH","ICO","IFF","ILBM","JFIF","JIF","JPE","JPEG","JPG","KDC","LBM","MAC","PAT","PCD","PCT","PCX","PIC","PICT","PNG","PNTG","PIX","PSD","PSP","QTI","QTIF","RGB","RGBA","RIF","RLE","SGI","TGA","TIF","TIFF","WMF","XCF"
);
$sPhotoFile = $_FILES['form']['name']['USR_PHOTO'];
@@ -266,16 +255,14 @@ try {
G::uploadFile( $_FILES['form']['tmp_name']['USR_PHOTO'], PATH_IMAGES_ENVIRONMENT_USERS, $aData['USR_UID'] . '.' . $aAux[1] );
G::resizeImage( PATH_IMAGES_ENVIRONMENT_USERS . $aData['USR_UID'] . '.' . $aAux[1], 96, 96, PATH_IMAGES_ENVIRONMENT_USERS . $aData['USR_UID'] . '.gif' );
}
}
else {
} else {
G::SendTemporalMessage( 'ID_FILE_TOO_BIG', 'error' );
}
if ($_FILES['form']['error']['USR_RESUME'] != 1) {
if ($_FILES['form']['tmp_name']['USR_RESUME'] != '') {
G::uploadFile( $_FILES['form']['tmp_name']['USR_RESUME'], PATH_IMAGES_ENVIRONMENT_FILES . $aData['USR_UID'] . '/', $_FILES['form']['name']['USR_RESUME'] );
}
}
else {
} else {
G::SendTemporalMessage( 'ID_FILE_TOO_BIG', 'error' );
}
}
@@ -286,7 +273,6 @@ try {
$_SESSION['USR_FULLNAME'] = $aUser['USR_FIRSTNAME'] . ' ' . $aUser['USR_LASTNAME'];
}
//Save Calendar assigment
if ((isset( $form['USR_CALENDAR'] ))) {
//Save Calendar ID for this user
@@ -296,8 +282,7 @@ try {
}
G::header( 'location: users_List' );
}
catch (Exception $e) {
} catch (Exception $e) {
$G_MAIN_MENU = 'processmaker';
$G_SUB_MENU = 'users';
$G_ID_MENU_SELECTED = 'USERS';
@@ -305,7 +290,8 @@ catch (Exception $e) {
$aMessage = array ();
$aMessage['MESSAGE'] = $e->getMessage();
$G_PUBLISH = new Publisher;
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
G::RenderPage( 'publish', 'blank' );
}

View File

@@ -20,21 +20,19 @@
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
try {
global $RBAC;
switch ($RBAC->userCanAccess('PM_FACTORY'))
{
switch ($RBAC->userCanAccess( 'PM_FACTORY' )) {
case - 2:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
G::header( 'location: ../login/login' );
die;
die();
break;
case - 1:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' );
die;
die();
break;
}
// deprecated the class XmlForm_Field_Image is currently part of the class.xmlform.php package
@@ -59,23 +57,19 @@ try {
$aFields['RANDOM'] = rand();
$G_MAIN_MENU = 'processmaker';
$G_ID_MENU_SELECTED = 'USERS';
$G_PUBLISH = new Publisher;
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'users/users_View.xml', '', $aFields );
krumo( $_SESSION );
if($_GET['USR_UID']=='00000000000000000000000000000001')
{ //$G_PUBLISH->AddContent('xmlform', 'xmlform', 'users/users_ViewAdmin.xml', '', $aFields);
if ($_GET['USR_UID'] == '00000000000000000000000000000001') { //$G_PUBLISH->AddContent('xmlform', 'xmlform', 'users/users_ViewAdmin.xml', '', $aFields);
// administrator due date must have a longer range
$aFields['END_DATE'] = date( 'Y-m-d', mktime( 0, 0, 0, date( 'm' ), date( 'd' ), date( 'Y' ) + 10 ) );
krumo( "asdasd" );
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'users/users_EditAdmin.xml', 'display:none', $aFields, 'users_Save?USR_UID=' . $_SESSION['CURRENT_USER'] );
}
else
{
} else {
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'users/users_Edit.xml', 'display:none', $aFields, 'users_Save?USR_UID=' . $_SESSION['CURRENT_USER'] );
}
G::RenderPage( 'publish' );
}
catch (Exception $oException) {
} catch (Exception $oException) {
die( $oException->getMessage() );
}
?>

View File

@@ -20,23 +20,22 @@
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
if (($RBAC_Response=$RBAC->userCanAccess("PM_LOGIN"))!=1) return $RBAC_Response;
if (($RBAC_Response = $RBAC->userCanAccess( "PM_LOGIN" )) != 1)
return $RBAC_Response;
$direction = PATH_IMAGES_ENVIRONMENT_USERS . $uid = (isset( $_SESSION['CURRENT_USER'] ) ? $_SESSION['CURRENT_USER'] : $_SESSION['USER_LOGGED']) . ".gif";
// header('Pragma: ');
// header('Cache-Control: cache');
if (!file_exists($direction))
{
if (! file_exists( $direction )) {
$direction = PATH_HOME . 'public_html/images/user.gif';
}
G::sendHeaders( $direction );
DumpHeaders( $direction );
/*
* This function is verified to work with Netscape and the *very latest*
* version of IE. I don't know if it works with Opera, but it should now.
@@ -46,20 +45,18 @@ function DumpHeaders($filename)
global $root_path;
if (!$filename) return;
if (! $filename)
return;
$HTTP_USER_AGENT = $_SERVER['HTTP_USER_AGENT'];
$isIE = 0;
if (strstr($HTTP_USER_AGENT, 'compatible; MSIE ') !== false &&
strstr($HTTP_USER_AGENT, 'Opera') === false) {
if (strstr( $HTTP_USER_AGENT, 'compatible; MSIE ' ) !== false && strstr( $HTTP_USER_AGENT, 'Opera' ) === false) {
$isIE = 1;
}
if (strstr($HTTP_USER_AGENT, 'compatible; MSIE 6') !== false &&
strstr($HTTP_USER_AGENT, 'Opera') === false) {
if (strstr( $HTTP_USER_AGENT, 'compatible; MSIE 6' ) !== false && strstr( $HTTP_USER_AGENT, 'Opera' ) === false) {
$isIE6 = 1;
}
@@ -68,13 +65,16 @@ function DumpHeaders($filename)
$downloadName = $aux[count( $aux ) - 1];
// $downloadName = $filename;
//$downloadName = ereg_replace('[^-a-zA-Z0-9\.]', '_', $filename);
if ($isIE && ! isset( $isIE6 )) {
// http://support.microsoft.com/support/kb/articles/Q182/3/15.asp
// Do not have quotes around filename, but that applied to
// "attachment"... does it apply to inline too?
// This combination seems to work mostly. IE 5.5 SP 1 has
// known issues (see the Microsoft Knowledge Base)
header( "Content-Disposition: inline; filename=$downloadName" );
@@ -85,8 +85,7 @@ function DumpHeaders($filename)
//header("Content-Type: $type0/$type1; name=\"$downloadName\"");
//header("Content-Type: application/x-msdownload; name=\"$downloadName\"");
//header("Content-Type: application/octet-stream; name=\"$downloadName\"");
}
else {
} else {
header( "Content-Disposition: attachment; filename=\"$downloadName\"" );
header( "Content-Type: application/octet-stream; name=\"$downloadName\"" );
}
@@ -95,6 +94,5 @@ function DumpHeaders($filename)
readfile( $filename );
}
//G::header2( "location: /files/" .$_SESSION['ENVIRONMENT']. "/" .$appid, $filename);
?>

View File

@@ -20,23 +20,22 @@
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
if (($RBAC_Response=$RBAC->userCanAccess("PM_LOGIN"))!=1) return $RBAC_Response;
if (($RBAC_Response = $RBAC->userCanAccess( "PM_LOGIN" )) != 1)
return $RBAC_Response;
$direction = PATH_IMAGES_ENVIRONMENT_USERS . $_REQUEST['pUID'] . ".gif";
// header('Pragma: ');
// header('Cache-Control: cache');
if (!file_exists($direction))
{
if (! file_exists( $direction )) {
$direction = PATH_HOME . 'public_html/images/user.gif';
}
G::sendHeaders( $direction );
DumpHeaders( $direction );
/*
* This function is verified to work with Netscape and the *very latest*
* version of IE. I don't know if it works with Opera, but it should now.
@@ -46,20 +45,18 @@ function DumpHeaders($filename)
global $root_path;
if (!$filename) return;
if (! $filename)
return;
$HTTP_USER_AGENT = $_SERVER['HTTP_USER_AGENT'];
$isIE = 0;
if (strstr($HTTP_USER_AGENT, 'compatible; MSIE ') !== false &&
strstr($HTTP_USER_AGENT, 'Opera') === false) {
if (strstr( $HTTP_USER_AGENT, 'compatible; MSIE ' ) !== false && strstr( $HTTP_USER_AGENT, 'Opera' ) === false) {
$isIE = 1;
}
if (strstr($HTTP_USER_AGENT, 'compatible; MSIE 6') !== false &&
strstr($HTTP_USER_AGENT, 'Opera') === false) {
if (strstr( $HTTP_USER_AGENT, 'compatible; MSIE 6' ) !== false && strstr( $HTTP_USER_AGENT, 'Opera' ) === false) {
$isIE6 = 1;
}
@@ -67,12 +64,12 @@ function DumpHeaders($filename)
$aux = explode( '_', $aux );
$downloadName = $aux[count( $aux ) - 1];
if ($isIE && ! isset( $isIE6 )) {
// http://support.microsoft.com/support/kb/articles/Q182/3/15.asp
// Do not have quotes around filename, but that applied to
// "attachment"... does it apply to inline too?
// This combination seems to work mostly. IE 5.5 SP 1 has
// known issues (see the Microsoft Knowledge Base)
header( "Content-Disposition: inline; filename=$downloadName" );
@@ -83,8 +80,7 @@ function DumpHeaders($filename)
//header("Content-Type: $type0/$type1; name=\"$downloadName\"");
//header("Content-Type: application/x-msdownload; name=\"$downloadName\"");
//header("Content-Type: application/octet-stream; name=\"$downloadName\"");
}
else {
} else {
header( "Content-Disposition: attachment; filename=\"$downloadName\"" );
header( "Content-Type: application/octet-stream; name=\"$downloadName\"" );
}
@@ -93,6 +89,5 @@ function DumpHeaders($filename)
readfile( $filename );
}
//G::header2( "location: /files/" .$_SESSION['ENVIRONMENT']. "/" .$appid, $filename);
?>

View File

@@ -20,16 +20,17 @@
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
if (($RBAC_Response=$RBAC->userCanAccess("PM_LOGIN"))!=1) return $RBAC_Response;
if (($RBAC_Response = $RBAC->userCanAccess( "PM_LOGIN" )) != 1)
return $RBAC_Response;
G::LoadClass( "user" );
$uid = (isset( $_SESSION['CURRENT_USER'] ) ? $_SESSION['CURRENT_USER'] : $_SESSION['USER_LOGGED']);
require_once 'classes/model/Users.php';
$oUser = new Users();
$form = $oUser->load( $uid );
if (!isset($form['USR_RESUME']) || $form['USR_RESUME']==='') die(G::LoadTranslation('ID_WITHOUT_RESUME'));
if (! isset( $form['USR_RESUME'] ) || $form['USR_RESUME'] === '')
die( G::LoadTranslation( 'ID_WITHOUT_RESUME' ) );
$direction = PATH_IMAGES_ENVIRONMENT_FILES . $uid . "/" . $form['USR_RESUME'];
if (! file_exists( $direction )) {
die( 'The file "' . $direction . '"doesn\'t exist in the server!' );
@@ -38,11 +39,11 @@ if (!file_exists($direction)) {
header( 'Pragma: ' );
header( 'Cache-Control: cache' );
G::sendHeaders( $direction );
readfile( $direction );
//DumpHeaders($direction);
/*
* This function is verified to work with Netscape and the *very latest*
* version of IE. I don't know if it works with Opera, but it should now.
@@ -52,20 +53,18 @@ function DumpHeaders($filename)
global $root_path;
if (!$filename) return;
if (! $filename)
return;
$HTTP_USER_AGENT = $_SERVER['HTTP_USER_AGENT'];
$isIE = 0;
if (strstr($HTTP_USER_AGENT, 'compatible; MSIE ') !== false &&
strstr($HTTP_USER_AGENT, 'Opera') === false) {
if (strstr( $HTTP_USER_AGENT, 'compatible; MSIE ' ) !== false && strstr( $HTTP_USER_AGENT, 'Opera' ) === false) {
$isIE = 1;
}
if (strstr($HTTP_USER_AGENT, 'compatible; MSIE 6') !== false &&
strstr($HTTP_USER_AGENT, 'Opera') === false) {
if (strstr( $HTTP_USER_AGENT, 'compatible; MSIE 6' ) !== false && strstr( $HTTP_USER_AGENT, 'Opera' ) === false) {
$isIE6 = 1;
}
@@ -76,13 +75,16 @@ function DumpHeaders($filename)
$downloadName = $aux[count( $aux ) - 1];
// $downloadName = $filename;
//$downloadName = ereg_replace('[^-a-zA-Z0-9\.]', '_', $filename);
if ($isIE && ! isset( $isIE6 )) {
// http://support.microsoft.com/support/kb/articles/Q182/3/15.asp
// Do not have quotes around filename, but that applied to
// "attachment"... does it apply to inline too?
// This combination seems to work mostly. IE 5.5 SP 1 has
// known issues (see the Microsoft Knowledge Base)
header( "Content-Disposition: inline; filename=$downloadName" );
@@ -93,8 +95,7 @@ function DumpHeaders($filename)
//header("Content-Type: $type0/$type1; name=\"$downloadName\"");
//header("Content-Type: application/x-msdownload; name=\"$downloadName\"");
//header("Content-Type: application/octet-stream; name=\"$downloadName\"");
}
else {
} else {
header( "Content-Disposition: attachment; filename=\"$downloadName\"" );
header( "Content-Type: application/octet-stream; name=\"$downloadName\"" );
}
@@ -103,6 +104,5 @@ function DumpHeaders($filename)
readfile( $filename );
}
//G::header2( "location: /files/" .$_SESSION['ENVIRONMENT']. "/" .$appid, $filename);
?>