- htmlarea plugin "UploadImage" works now together with sitemgr.

- In sitmgr ->configure-site you can now specify a directory where images should be uploaded
This commit is contained in:
Cornelius Weiß 2005-06-17 17:26:25 +00:00
parent f5956885c1
commit 1a0f3ab29c

View File

@ -14,11 +14,10 @@
// FIXME: remove imageMagick shit, we only use gdlib // FIXME: remove imageMagick shit, we only use gdlib
// FIXME: autodetect safe_mode // FIXME: autodetect safe_mode
// FIXME set current app to the calling app
// FIXME include header nicer // FIXME include header nicer
$phpgw_flags = Array( $phpgw_flags = Array(
'currentapp' => 'jinn', 'currentapp' => 'home',
'noheader' => True, 'noheader' => True,
'nonavbar' => True, 'nonavbar' => True,
'noappheader' => True, 'noappheader' => True,
@ -37,22 +36,47 @@
@include('../../../../../../../header.inc.php'); @include('../../../../../../../header.inc.php');
} }
$sessdata = $GLOBALS['phpgw']->session->appsession('UploadImage','phpgwapi');
$phpgw_flags['currentapp'] = $sessdata['app'] ? $sessdata['app'] : 'jinn';
define('IMAGE_CLASS', 'GD'); define('IMAGE_CLASS', 'GD');
//In safe mode, directory creation is not permitted. //In safe mode, directory creation is not permitted.
$SAFE_MODE = false; $SAFE_MODE = false;
$sessdata = $GLOBALS['phpgw']->session->appsession('UploadImage','phpgwapi'); switch ($phpgw_flags['currentapp'])
{
case 'jinn' :
$BASE_DIR = $sessdata[UploadImageBaseDir]; $BASE_DIR = $sessdata[UploadImageBaseDir];
$BASE_URL = $sessdata[UploadImageBaseURL]; $BASE_URL = $sessdata[UploadImageBaseURL];
$MAX_HEIGHT = $sessdata[UploadImageMaxHeight]; $MAX_HEIGHT = $sessdata[UploadImageMaxHeight];
$MAX_WIDTH = $sessdata[UploadImageMaxWidth]; $MAX_WIDTH = $sessdata[UploadImageMaxWidth];
// _debug_array($sessdata);
//die();
break;
case 'sitemgr' :
if(is_writeable($sessdata['upload_dir']))
{
$BASE_DIR = $sessdata['upload_dir'];
$BASE_URL = str_replace($GLOBALS['_SERVER']['DOCUMENT_ROOT'],'',$sessdata['upload_dir']);
}
else
{
echo '<p><b>Error</b></p>';
echo '<p>Upload directory does not exist, or is not writeable by webserver</p>';
echo $GLOBALS['egw_info']['user']['apps']['admin'] ?
'<a href="'. $GLOBALS['phpgw']->link('/index.php',
'menuaction=sitemgr.Common_UI.DisplayPrefs').'">Choose an other directory</a><br>
or make "'. $sessdata['upload_dir']. '" writeable by webserver' :
'Notify your Administrator to correct this Situation';
die();
}
default :
break;
}
if(!$MAX_HEIGHT) $MAX_HEIGHT = 10000; if(!$MAX_HEIGHT) $MAX_HEIGHT = 10000;
if(!$MAX_WIDTH) $MAX_WIDTH = 10000; if(!$MAX_WIDTH) $MAX_WIDTH = 10000;
// _debug_array($sessdata);
//die();
//After defining which library to use, if it is NetPBM or IM, you need to //After defining which library to use, if it is NetPBM or IM, you need to