BUG 0000 Some Fixes like unversioning index.html, cleaning up of sysGeneric
This commit is contained in:
@@ -2066,7 +2066,7 @@ function run_workspace_backup($task, $args) {
|
||||
|
||||
//new db restore rotines, by Erik <erik@colosa.com> on May 17th, 2010
|
||||
//set the temporal directory for all tables into wf, rb, and rp databases
|
||||
$tmpDir = G::getSysTemDir() . PATH_SEP . 'pmDbBackup' . PATH_SEP;
|
||||
$tmpDir = G::sys_get_temp_dir() . PATH_SEP . 'pmDbBackup' . PATH_SEP;
|
||||
//create the db maintenance temporal dir
|
||||
G::mk_dir($tmpDir);
|
||||
|
||||
|
||||
@@ -914,6 +914,12 @@ class G
|
||||
*/
|
||||
function parseURI($uri, $config = array())
|
||||
{
|
||||
//*** process the $_POST with magic_quotes enabled
|
||||
// The magic_quotes_gpc feature has been DEPRECATED as of PHP 5.3.0.
|
||||
if (get_magic_quotes_gpc() === 1) {
|
||||
$_POST = G::strip_slashes($_POST);
|
||||
}
|
||||
|
||||
$aRequestUri = explode('/', $uri );
|
||||
|
||||
if ( substr ( $aRequestUri[1], 0, 3 ) == 'sys' ) {
|
||||
@@ -992,6 +998,42 @@ class G
|
||||
}
|
||||
}
|
||||
|
||||
function strip_slashes($vVar) {
|
||||
if (is_array($vVar)) {
|
||||
foreach($vVar as $sKey => $vValue) {
|
||||
if (is_array($vValue)) {
|
||||
G::strip_slashes($vVar[$sKey]);
|
||||
}
|
||||
else {
|
||||
$vVar[$sKey] = stripslashes($vVar[$sKey]);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
$vVar = stripslashes($vVar);
|
||||
}
|
||||
|
||||
return $vVar;
|
||||
}
|
||||
|
||||
/**
|
||||
* function to calculate the time used to render a page
|
||||
*/
|
||||
function logTimeByPage()
|
||||
{
|
||||
if (!defined(PATH_DATA)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$serverAddr = $_SERVER['SERVER_ADDR'];
|
||||
global $startingTime;
|
||||
$endTime = microtime(true);
|
||||
$time = $endTime - $startingTime;
|
||||
$fpt= fopen ( PATH_DATA . 'log/time.log', 'a' );
|
||||
fwrite( $fpt, sprintf ( "%s.%03d %15s %s %5.3f %s\n", date('Y-m-d H:i:s'), $time, getenv('REMOTE_ADDR'), substr($serverAddr,-4), $time, $_SERVER['REQUEST_URI'] ));
|
||||
fclose( $fpt);
|
||||
}
|
||||
|
||||
/**
|
||||
* streaming a big JS file with small js files
|
||||
*
|
||||
@@ -3138,7 +3180,7 @@ $output = $outputHeader.$output;
|
||||
* Get the temporal directory path on differents O.S. i.e. /temp -> linux, C:/Temp -> win
|
||||
* @author <erik@colosa.com>
|
||||
*/
|
||||
function getSysTemDir() {
|
||||
function sys_get_temp_dir() {
|
||||
if ( !function_exists('sys_get_temp_dir') ){
|
||||
// Based on http://www.phpit.net/
|
||||
// article/creating-zip-tar-archives-dynamically-php/2/
|
||||
@@ -4922,6 +4964,56 @@ function getDirectorySize($path,$maxmtime=0)
|
||||
file_put_contents($file, $content);
|
||||
}
|
||||
|
||||
function verifyWriteAccess($resources)
|
||||
{
|
||||
$noWritable = array();
|
||||
foreach ($resources as $i => $resource) {
|
||||
if (!is_writable($resource)) {
|
||||
$noWritable[] = $resource;
|
||||
}
|
||||
}
|
||||
|
||||
if (count($noWritable) > 0) {
|
||||
$e = new Exception("Write access not allowed for ProcessMaker resources");
|
||||
$e->files = $noWritable;
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
function renderTemplate($template, $data=array())
|
||||
{
|
||||
if (!defined('PATH_THIRDPARTY')) {
|
||||
throw new Exception('System constant (PATH_THIRDPARTY) is not defined!');
|
||||
}
|
||||
|
||||
require_once PATH_THIRDPARTY . 'smarty/libs/Smarty.class.php';
|
||||
|
||||
$smarty = new Smarty();
|
||||
$smarty->compile_dir = G::sys_get_temp_dir();
|
||||
$smarty->cache_dir = G::sys_get_temp_dir();
|
||||
$smarty->config_dir = PATH_THIRDPARTY . 'smarty/configs';
|
||||
|
||||
$smarty->template_dir = PATH_TEMPLATE;
|
||||
$smarty->force_compile = true;
|
||||
|
||||
foreach ($data as $key => $value) {
|
||||
$smarty->assign($key, $value);
|
||||
}
|
||||
|
||||
$smarty->display("$template.tpl");
|
||||
}
|
||||
|
||||
function parseTemplate($template, $data=array())
|
||||
{
|
||||
$content = '';
|
||||
|
||||
ob_start();
|
||||
G::renderTemplate($template, $data);
|
||||
$content = ob_get_contents();
|
||||
ob_get_clean();
|
||||
|
||||
return $content;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
82
gulliver/templates/write_access_denied.exception.tpl
Normal file
82
gulliver/templates/write_access_denied.exception.tpl
Normal file
@@ -0,0 +1,82 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<meta name="robots" content="noindex,nofollow" />
|
||||
<title>Whoops, looks like something went wrong.</title>
|
||||
<style>
|
||||
{literal}
|
||||
/* Copyright (c) 2010, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.com/yui/license.html */
|
||||
html{color:#000;background:#FFF;}body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td{margin:0;padding:0;}table{border-collapse:collapse;border-spacing:0;}fieldset,img{border:0;}address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}li{list-style:none;}caption,th{text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}q:before,q:after{content:'';}abbr,acronym{border:0;font-variant:normal;}sup{vertical-align:text-top;}sub{vertical-align:text-bottom;}input,textarea,select{font-family:inherit;font-size:inherit;font-weight:inherit;}input,textarea,select{*font-size:100%;}legend{color:#000;}
|
||||
|
||||
html { background: #eee; padding: 10px }
|
||||
body { font: 11px Verdana, Arial, sans-serif; color: #333 }
|
||||
img { border: 0; }
|
||||
.clear { clear:both; height:0; font-size:0; line-height:0; }
|
||||
.clear_fix:after { display:block; height:0; clear:both; visibility:hidden; }
|
||||
.clear_fix { display:inline-block; }
|
||||
* html .clear_fix { height:1%; }
|
||||
.clear_fix { display:block; }
|
||||
#content { width:970px; margin:0 auto; }
|
||||
.exceptionreset, .exceptionreset .block { margin: auto }
|
||||
.exceptionreset abbr { border-bottom: 1px dotted #000; cursor: help; }
|
||||
.exceptionreset p { font-size:14px; line-height:20px; color:#868686; padding-bottom:20px }
|
||||
.exceptionreset strong { font-weight:bold; }
|
||||
.exceptionreset a { color:#6c6159; }
|
||||
.exceptionreset a img { border:none; }
|
||||
.exceptionreset a:hover { text-decoration:underline; }
|
||||
.exceptionreset em { font-style:italic; }
|
||||
.exceptionreset h1, .exceptionreset h2 { font: 20px Georgia, "Times New Roman", Times, serif }
|
||||
.exceptionreset h2 span { background-color: #fff; color: #333; padding: 6px; float: left; margin-right: 10px; }
|
||||
.exceptionreset .traces li { font-size:12px; padding: 2px 4px; list-style-type:decimal; margin-left:20px; }
|
||||
.exceptionreset .block { background-color:#FFFFFF; padding:10px 28px; margin-bottom:20px;
|
||||
-webkit-border-bottom-right-radius: 16px;
|
||||
-webkit-border-bottom-left-radius: 16px;
|
||||
-moz-border-radius-bottomright: 16px;
|
||||
-moz-border-radius-bottomleft: 16px;
|
||||
border-bottom-right-radius: 16px;
|
||||
border-bottom-left-radius: 16px;
|
||||
border-bottom:1px solid #ccc;
|
||||
border-right:1px solid #ccc;
|
||||
border-left:1px solid #ccc;
|
||||
}
|
||||
.exceptionreset .block_exception { background-color:#ddd; color: #333; padding:20px;
|
||||
-webkit-border-top-left-radius: 16px;
|
||||
-webkit-border-top-right-radius: 16px;
|
||||
-moz-border-radius-topleft: 16px;
|
||||
-moz-border-radius-topright: 16px;
|
||||
border-top-left-radius: 16px;
|
||||
border-top-right-radius: 16px;
|
||||
border-top:1px solid #ccc;
|
||||
border-right:1px solid #ccc;
|
||||
border-left:1px solid #ccc;
|
||||
}
|
||||
.exceptionreset li a { background:none; color:#868686; text-decoration:none; }
|
||||
.exceptionreset li a:hover { background:none; color:#313131; text-decoration:underline; }
|
||||
.exceptionreset ol { padding: 10px 0; }
|
||||
.exceptionreset h1 { background-color:#FFFFFF; padding: 15px 28px; margin-bottom: 20px;
|
||||
-webkit-border-radius: 10px;
|
||||
-moz-border-radius: 10px;
|
||||
border-radius: 10px;
|
||||
border: 1px solid #ccc;
|
||||
}
|
||||
{/literal}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="content" class="exceptionreset">
|
||||
<h1>ProcessMaker Start, looks like something went wrong.</h1>
|
||||
<div class="block_exception clear_fix"><h2>
|
||||
<abbr title="RuntimeException">RuntimeException</abbr>:
|
||||
Unable to write on ProcessMaker directories, change permissions to run properly.</h2>
|
||||
</div>
|
||||
<div class="block">
|
||||
<ol class="traces list_exception">
|
||||
{foreach from=$files item=file}
|
||||
<li>at <abbr title="{$file}">{$file}</abbr> .... <font color="red">not writable.</font></li>
|
||||
{/foreach}
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -142,7 +142,7 @@ class Sessions {
|
||||
*/
|
||||
public function registerGlobal($name, $value)
|
||||
{
|
||||
$this->tmpfile = G::getSysTemDir() . PATH_SEP . "pm-rg-{$this->sessionId}";
|
||||
$this->tmpfile = G::sys_get_temp_dir() . PATH_SEP . "pm-rg-{$this->sessionId}";
|
||||
|
||||
if($this->sessionId == NULL){
|
||||
throw new Exception('session id was not set.');
|
||||
@@ -180,7 +180,7 @@ class Sessions {
|
||||
*/
|
||||
public function getGlobal($name)
|
||||
{
|
||||
$this->tmpfile = G::getSysTemDir() . PATH_SEP . "pm-rg-{$this->sessionId}";
|
||||
$this->tmpfile = G::sys_get_temp_dir() . PATH_SEP . "pm-rg-{$this->sessionId}";
|
||||
|
||||
if($this->sessionId == NULL){
|
||||
throw new Exception('session id was not set.');
|
||||
@@ -217,7 +217,7 @@ class Sessions {
|
||||
*/
|
||||
public function getGlobals()
|
||||
{
|
||||
$this->tmpfile = G::getSysTemDir() . PATH_SEP . "pm-rg-{$this->sessionId}";
|
||||
$this->tmpfile = G::sys_get_temp_dir() . PATH_SEP . "pm-rg-{$this->sessionId}";
|
||||
|
||||
if($this->sessionId == NULL){
|
||||
throw new Exception('session id was not set.');
|
||||
@@ -250,7 +250,7 @@ class Sessions {
|
||||
if($this->sessionId == NULL){
|
||||
throw new Exception('session id was not set.');
|
||||
}
|
||||
$this->tmpfile = G::getSysTemDir() . PATH_SEP . "pm-rg-{$this->sessionId}";
|
||||
$this->tmpfile = G::sys_get_temp_dir() . PATH_SEP . "pm-rg-{$this->sessionId}";
|
||||
@unlink($this->tmpfile);
|
||||
}
|
||||
|
||||
|
||||
@@ -1240,8 +1240,8 @@ case "removeUserFromGroup" :
|
||||
if ( isset($_FILES['form']) ) {
|
||||
foreach ($_FILES['form']['name'] as $sFieldName => $vValue) {
|
||||
if ( $_FILES['form']['error'][$sFieldName] == 0 ){
|
||||
file_put_contents(G::getSysTemDir().PATH_SEP.$_FILES['form']['name'][$sFieldName], file_get_contents($_FILES['form']['tmp_name'][$sFieldName]));
|
||||
$filename = G::getSysTemDir().PATH_SEP.$_FILES['form']['name'][$sFieldName];
|
||||
file_put_contents(G::sys_get_temp_dir().PATH_SEP.$_FILES['form']['name'][$sFieldName], file_get_contents($_FILES['form']['tmp_name'][$sFieldName]));
|
||||
$filename = G::sys_get_temp_dir().PATH_SEP.$_FILES['form']['name'][$sFieldName];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,6 @@
|
||||
<title>Redirector</title>
|
||||
<meta http-equiv="PRAGMA" content="NO-CACHE" />
|
||||
<meta http-equiv="CACHE-CONTROL" content="NO-STORE" />
|
||||
<meta http-equiv="REFRESH" content="0;URL=/sys/{lang}/{skin}/login/login" />
|
||||
<meta http-equiv="REFRESH" content="0;URL=/sys/{$lang}/{$skin}/login/login" />
|
||||
</head>
|
||||
</html>
|
||||
@@ -36,8 +36,8 @@
|
||||
if ( isset($_FILES['form']) ) {
|
||||
foreach ($_FILES['form']['name'] as $sFieldName => $vValue) {
|
||||
if ( $_FILES['form']['error'][$sFieldName] == 0 ){
|
||||
file_put_contents(G::getSysTemDir().PATH_SEP.$_FILES['form']['name'][$sFieldName], file_get_contents($_FILES['form']['tmp_name'][$sFieldName]));
|
||||
$fpath = G::getSysTemDir().PATH_SEP.$_FILES['form']['name'][$sFieldName];
|
||||
file_put_contents(G::sys_get_temp_dir().PATH_SEP.$_FILES['form']['name'][$sFieldName], file_get_contents($_FILES['form']['tmp_name'][$sFieldName]));
|
||||
$fpath = G::sys_get_temp_dir().PATH_SEP.$_FILES['form']['name'][$sFieldName];
|
||||
|
||||
if( isset($_POST['INPUTS'][$sFieldName]) && $_POST['INPUTS'][$sFieldName] != '' ){ #input file type
|
||||
ws_sendFile($fpath, $USR_UID, $caseId, 1, $_POST['INPUTS'][$sFieldName]);
|
||||
|
||||
@@ -268,7 +268,7 @@
|
||||
$t->is( $methods[89] , 'pr' ,$i++. ' pr');
|
||||
$t->is( $methods[90] , 'dump' ,$i++. ' dump');
|
||||
$t->is( $methods[91] , 'stripCDATA' ,$i++. ' stripCDATA');
|
||||
$t->is( $methods[92] , 'getSysTemDir' ,$i++. ' getSysTemDir');
|
||||
$t->is( $methods[92] , 'sys_get_temp_dir' ,$i++. ' sys_get_temp_dir');
|
||||
$t->is( $methods[93] , 'PMWSCompositeResponse' ,$i++. ' PMWSCompositeResponse');
|
||||
$t->is( $methods[94] , 'emailAddress' ,$i++. ' emailAddress');
|
||||
$t->is( count( $methods ) , --$i , count( $methods ).' = '.$i.' ok');
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Redirector</title>
|
||||
<meta http-equiv="PRAGMA" content="NO-CACHE" />
|
||||
<meta http-equiv="CACHE-CONTROL" content="NO-STORE" />
|
||||
<meta http-equiv="REFRESH" content="0;URL=sys/en/classic/login/login" />
|
||||
</head>
|
||||
</html>
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user