Subversion Repositories Applications.papyrus

Compare Revisions

Ignore whitespace Rev 435 → Rev 436

/trunk/api/fckeditor/editor/filemanager/browser/default/connectors/php/config.php
22,7 → 22,10
$Config['Enabled'] = true;
 
// Path to user files relative to the document root.
$Config['UserFilesPath'] = '/UserFiles/' ;
// Without end slash
$Config['UserFilesPath'] = '/UserFiles';
$Config['BaseDir'] = '/home/david/workspace/papyrus';
$Config['UrlPrefix'] = '/~david/papyrus';
 
$Config['AllowedExtensions']['File'] = array() ;
$Config['DeniedExtensions']['File'] = array('php','php3','php5','phtml','asp','aspx','ascx','jsp','cfm','cfc','pl','bat','exe','dll','reg','cgi') ;
/trunk/api/fckeditor/editor/filemanager/browser/default/connectors/php/io.php
19,11 → 19,12
function GetUrlFromPath( $resourceType, $folderPath )
{
if ( $resourceType == '' )
return RemoveFromEnd( $GLOBALS["UserFilesPath"], '/' ) . $folderPath ;
return RemoveFromEnd( $GLOBALS['UrlPrefix'].$GLOBALS["UserFilesPath"], '/' ) . $folderPath ;
else
return $GLOBALS["UserFilesPath"] . $resourceType . $folderPath ;
return $GLOBALS['UrlPrefix'].$GLOBALS["UserFilesPath"] . $resourceType . $folderPath ;
}
 
 
function RemoveExtension( $fileName )
{
return substr( $fileName, 0, strrpos( $fileName, '.' ) ) ;
/trunk/api/fckeditor/editor/filemanager/browser/default/connectors/php/connector.php
38,10 → 38,29
if ( ! ereg( '/$', $GLOBALS["UserFilesPath"] ) )
$GLOBALS["UserFilesPath"] .= '/' ;
 
$GLOBALS["BaseDir"] = '';
if ( isset( $Config['BaseDir'] ) )
$GLOBALS["BaseDir"] = $Config['BaseDir'] ;
else if ( isset( $_GET['BaseDir'] ) )
$GLOBALS["BaseDir"] = $_GET['BaseDir'] ;
else
$GLOBALS["BaseDir"] = '' ;
 
$GLOBALS["UrlPrefix"] = '';
if ( isset( $Config['UrlPrefix'] ) )
$GLOBALS["UrlPrefix"] = $Config['UrlPrefix'] ;
else if ( isset( $_GET['UrlPrefix'] ) )
$GLOBALS["UrlPrefix"] = $_GET['UrlPrefix'] ;
else
$GLOBALS["UrlPrefix"] = '' ;
 
 
// Map the "UserFiles" path to a local directory.
//$GLOBALS["UserFilesDirectory"] = GetRootPath() . str_replace( '/', '\\', $GLOBALS["UserFilesPath"] ) ;
$GLOBALS["UserFilesDirectory"] = GetRootPath() . $GLOBALS["UserFilesPath"] ;
//$GLOBALS["UserFilesDirectory"] = GetRootPath() . $GLOBALS["UserFilesPath"] ;
$GLOBALS['UserFilesDirectory'] = $GLOBALS['BaseDir'].$GLOBALS['UserFilesPath'] ;
 
 
DoResponse() ;
 
function DoResponse()
/trunk/api/fckeditor/editor/filemanager/upload/php/config.php
22,8 → 22,13
$Config['Enabled'] = true ;
 
// Path to uploaded files relative to the document root.
$Config['UserFilesPath'] = '/UserFiles/' ;
//$Config['UserFilesPath'] = '/UserFiles/' ;
 
$Config['UserFilesPath'] = '/UserFiles';
$Config['BaseDir'] = '/home/david/workspace/papyrus';
$Config['UrlPrefix'] = '/~david/papyrus';
 
 
$Config['AllowedExtensions']['File'] = array() ;
$Config['DeniedExtensions']['File'] = array('php','php3','php5','phtml','asp','aspx','ascx','jsp','cfm','cfc','pl','bat','exe','dll','reg','cgi') ;
 
/trunk/api/fckeditor/editor/filemanager/upload/php/util.php
28,9 → 28,8
$sSelfPath = $_SERVER['PHP_SELF'] ;
$sSelfPath = substr( $sSelfPath, 0, strrpos( $sSelfPath, '/' ) ) ;
 
//return substr( $sRealPath, 0, strlen( $sRealPath ) - strlen( $sSelfPath ) ) ;
return substr( $sRealPath, 0, strlen( $sRealPath ) - strlen( $sSelfPath ) ) ;
return "/home/david/workspace/papyrus";
}
 
 
/trunk/api/fckeditor/editor/filemanager/upload/php/upload.php
63,10 → 63,8
$iCounter = 0 ;
 
// The the target directory.
$sServerDir = GetRootPath() . $Config["UserFilesPath"] ;
print "|";
print $sServerDir;
print "|";
//$sServerDir = GetRootPath() . $Config["UserFilesPath"] ;
$sServerDir = $Config['BaseDir'].$Config["UserFilesPath"].'/';
 
while ( true )
{
91,8 → 89,8
umask( $oldumask ) ;
}
$sFileUrl = $Config["UserFilesPath"] . $sFileName ;
 
$sFileUrl = $Config["UrlPrefix"].$Config["UserFilesPath"]."/". $sFileName ;
break ;
}
}