<?php
function CombinePaths( $sBasePath, $sFolder )
{
return RemoveFromEnd( $sBasePath, '/' ) . '/' . RemoveFromStart( $sFolder, '/' ) ;
}
function GetResourceTypePath( $resourceType, $sCommand )
{
global $Config ;
if ( $sCommand == "QuickUpload")
return $Config['QuickUploadPath'][$resourceType] ;
else
return $Config['FileTypesPath'][$resourceType] ;
}
function GetResourceTypeDirectory( $resourceType, $sCommand )
{
global $Config ;
if ( $sCommand == "QuickUpload")
{
if ( strlen( $Config['QuickUploadAbsolutePath'][$resourceType] ) > 0 )
return $Config['QuickUploadAbsolutePath'][$resourceType] ;
// Map the "UserFiles" path to a local directory.
return Server_MapPath( $Config['QuickUploadPath'][$resourceType] ) ;
}
else
{
if ( strlen( $Config['FileTypesAbsolutePath'][$resourceType] ) > 0 )
return $Config['FileTypesAbsolutePath'][$resourceType] ;
// Map the "UserFiles" path to a local directory.
return Server_MapPath( $Config['FileTypesPath'][$resourceType] ) ;
}
}
function GetUrlFromPath( $resourceType, $folderPath, $sCommand )
{
return CombinePaths( GetResourceTypePath( $resourceType, $sCommand ), $folderPath ) ;
}
function RemoveExtension( $fileName )
{
return substr( $fileName, 0, strrpos( $fileName, '.' ) ) ;
}
function ServerMapFolder( $resourceType, $folderPath, $sCommand )
{
// Get the resource type directory.
$sResourceTypePath = GetResourceTypeDirectory( $resourceType, $sCommand ) ;
// Ensure that the directory exists.
$sErrorMsg = CreateServerFolder( $sResourceTypePath ) ;
if ( $sErrorMsg != '' )
SendError( 1, "Error creating folder \"{$sResourceTypePath}\" ({$sErrorMsg})" ) ;
// Return the resource type directory combined with the required path.
return CombinePaths( $sResourceTypePath , $folderPath ) ;
}
function GetParentFolder( $folderPath )
{
$sPattern = "-[/\\\\][^/\\\\]+[/\\\\]?$-" ;
return preg_replace( $sPattern, '', $folderPath ) ;
}
function CreateServerFolder( $folderPath, $lastFolder = null )
{
global $Config ;
$sParent = GetParentFolder( $folderPath ) ;
// Ensure the folder path has no double-slashes, or mkdir may fail on certain platforms
while ( strpos($folderPath, '//') !== false )
{
$folderPath = str_replace( '//', '/', $folderPath ) ;
}
// Check if the parent exists, or create it.
if ( !empty($sParent) && !file_exists( $sParent ) )
{
//prevents agains infinite loop when we can't create root folder
if ( !is_null( $lastFolder ) && $lastFolder === $sParent) {
return "Can't create $folderPath directory" ;
}
$sErrorMsg = CreateServerFolder( $sParent, $folderPath ) ;
if ( $sErrorMsg != '' )
return $sErrorMsg ;
}
if ( !file_exists( $folderPath ) )
{
// Turn off all error reporting.
error_reporting( 0 ) ;
$php_errormsg = '' ;
// Enable error tracking to catch the error.
ini_set( 'track_errors', '1' ) ;
if ( isset( $Config['ChmodOnFolderCreate'] ) && !$Config['ChmodOnFolderCreate'] )
{
mkdir( $folderPath ) ;
}
else
{
$permissions = 0777 ;
if ( isset( $Config['ChmodOnFolderCreate'] ) )
{
$permissions = $Config['ChmodOnFolderCreate'] ;
}
// To create the folder with 0777 permissions, we need to set umask to zero.
$oldumask = umask(0) ;
mkdir( $folderPath, $permissions ) ;
umask( $oldumask ) ;
}
$sErrorMsg = $php_errormsg ;
// Restore the configurations.
ini_restore( 'track_errors' ) ;
ini_restore( 'error_reporting' ) ;
return $sErrorMsg ;
}
else
return '' ;
}
function GetRootPath()
{
if (!isset($_SERVER)) {
global $_SERVER;
}
$sRealPath = realpath( './' ) ;
// #2124 ensure that no slash is at the end
$sRealPath = rtrim($sRealPath,"\\/");
$sSelfPath = $_SERVER['PHP_SELF'] ;
$sSelfPath = substr( $sSelfPath, 0, strrpos( $sSelfPath, '/' ) ) ;
$sSelfPath = str_replace( '/', DIRECTORY_SEPARATOR, $sSelfPath ) ;
$position = strpos( $sRealPath, $sSelfPath ) ;
// This can check only that this script isn't run from a virtual dir
// But it avoids the problems that arise if it isn't checked
if ( $position === false || $position <> strlen( $sRealPath ) - strlen( $sSelfPath ) )
SendError( 1, 'Sorry, can\'t map "UserFilesPath" to a physical path. You must set the "UserFilesAbsolutePath" value in "editor/filemanager/connectors/php/config.php".' ) ;
return substr( $sRealPath, 0, $position ) ;
}
// Emulate the asp Server.mapPath function.
// given an url path return the physical directory that it corresponds to
function Server_MapPath( $path )
{
// This function is available only for Apache
if ( function_exists( 'apache_lookup_uri' ) )
{
$info = apache_lookup_uri( $path ) ;
return $info->filename . $info->path_info ;
}
// This isn't correct but for the moment there's no other solution
// If this script is under a virtual directory or symlink it will detect the problem and stop
return GetRootPath() . $path ;
}
function IsAllowedExt( $sExtension, $resourceType )
{
global $Config ;
// Get the allowed and denied extensions arrays.
$arAllowed = $Config['AllowedExtensions'][$resourceType] ;
$arDenied = $Config['DeniedExtensions'][$resourceType] ;
if ( count($arAllowed) > 0 && !in_array( $sExtension, $arAllowed ) )
return false ;
if ( count($arDenied) > 0 && in_array( $sExtension, $arDenied ) )
return false ;
return true ;
}
function IsAllowedType( $resourceType )
{
global $Config ;
if ( !in_array( $resourceType, $Config['ConfigAllowedTypes'] ) )
return false ;
return true ;
}
function IsAllowedCommand( $sCommand )
{
global $Config ;
if ( !in_array( $sCommand, $Config['ConfigAllowedCommands'] ) )
return false ;
return true ;
}
function GetCurrentFolder()
{
if (!isset($_GET)) {
global $_GET;
}
$sCurrentFolder = isset( $_GET['CurrentFolder'] ) ? $_GET['CurrentFolder'] : '/' ;
// Check the current folder syntax (must begin and start with a slash).
if ( !preg_match( '|/$|', $sCurrentFolder ) )
$sCurrentFolder .= '/' ;
if ( strpos( $sCurrentFolder, '/' ) !== 0 )
$sCurrentFolder = '/' . $sCurrentFolder ;
// Ensure the folder path has no double-slashes
while ( strpos ($sCurrentFolder, '//') !== false ) {
$sCurrentFolder = str_replace ('//', '/', $sCurrentFolder) ;
}
// Check for invalid folder paths (..)
if ( strpos( $sCurrentFolder, '..' ) || strpos( $sCurrentFolder, "\\" ))
SendError( 102, '' ) ;
if ( preg_match(",(/\.)|[[:cntrl:]]|(//)|(\\\\)|([\:\*\?\"\<\>\|]),", $sCurrentFolder))
SendError( 102, '' ) ;
return $sCurrentFolder ;
}
// Do a cleanup of the folder name to avoid possible problems
function SanitizeFolderName( $sNewFolderName )
{
$sNewFolderName = stripslashes( $sNewFolderName ) ;
// Remove . \ / | : ? * " < >
$sNewFolderName = preg_replace( '/\\.|\\\\|\\/|\\||\\:|\\?|\\*|"|<|>|[[:cntrl:]]/', '_', $sNewFolderName ) ;
return $sNewFolderName ;
}
//Do a cleanup of the file name to avoid possible problems
// function SanitizeFileName( $sNewFileName )
// {
// global $Config ;
//
// $sNewFileName = stripslashes( $sNewFileName ) ;
//
// // Replace dots in the name with underscores (only one dot can be there... security issue).
// if ( $Config['ForceSingleExtension'] )
// $sNewFileName = preg_replace( '/\\.(?![^.]*$)/', '_', $sNewFileName ) ;
//
// // Remove \ / | : ? * " < >
// $sNewFileName = preg_replace( '/\\\\|\\/|\\||\\:|\\?|\\*|"|<|>|[[:cntrl:]]/', '_', $sNewFileName ) ;
//
// return $sNewFileName ;
// }
function SanitizeFileName( $sNewFileName )
{
global $Config ;
$sNewFileName = stripslashes( $sNewFileName ) ;
// Replace dots in the name with underscores (only one dot can be there... security issue).
if ( $Config['ForceSingleExtension'] )
$sNewFileName = preg_replace( '/\\.(?![^.]*$)/', '_', $sNewFi
没有合适的资源?快使用搜索试试~ 我知道了~
PHP+access企业网站管理系统
共278个文件
gif:123个
html:53个
js:31个
4星 · 超过85%的资源 需积分: 9 38 下载量 55 浏览量
2012-02-06
17:43:40
上传
评论
收藏 898KB RAR 举报
温馨提示
系统是PHP+ACCESS 方便那些买不起MYSQL空间的人 同时我个人认为,企业网站 用PHP+ACCESS就够了 不用太浪费资源 而且PHP+ACCESS性能也不会太差,对企业网站来说执行速度也可以 !
资源推荐
资源详情
资源评论
收起资源包目录
PHP+access企业网站管理系统 (278个子文件)
spellchecker.cfm 5KB
fck_editor.css 8KB
fck_dialog.css 6KB
insertCode.css 4KB
lvtao.css 3KB
fck_internal.css 3KB
scayt_dialog.css 2KB
fck_showtableborders_gecko.css 2KB
fck_editorarea.css 2KB
browser.css 2KB
spellerStyle.css 890B
fck_dialog_common.css 881B
Thumbs.db 149KB
Thumbs.db 12KB
Thumbs.db 11KB
Thumbs.db 8KB
25.gif 39KB
8.gif 28KB
12.gif 25KB
9.gif 25KB
14.gif 23KB
15.gif 21KB
7.gif 20KB
24.gif 20KB
6.gif 19KB
21.gif 19KB
27.gif 18KB
19.gif 18KB
16.gif 17KB
22.gif 17KB
4.gif 16KB
18.gif 15KB
20.gif 14KB
11.gif 14KB
30.gif 13KB
5.gif 12KB
23.gif 11KB
28.gif 9KB
26.gif 9KB
29.gif 7KB
2.gif 6KB
10.gif 6KB
13.gif 6KB
3.gif 5KB
fck_strip.gif 5KB
17.gif 4KB
1.gif 4KB
logo.gif 2KB
fck_plugin.gif 2KB
html.gif 1KB
htm.gif 1KB
rdp.gif 1KB
spellchecker_net.gif 1KB
ai.gif 1KB
bmp.gif 1KB
sprites.gif 959B
fla.gif 946B
logo_fredck.gif 920B
toolbar.buttonbg.gif 829B
swf.gif 725B
swt.gif 724B
bmp.gif 709B
gif.gif 704B
html.gif 621B
htm.gif 621B
rdp.gif 606B
fck_flashlogo.gif 599B
pdf.gif 567B
png.gif 464B
jpg.gif 463B
avi.gif 454B
mp3.gif 454B
template3.gif 422B
xml.gif 408B
ai.gif 403B
swt.gif 388B
swf.gif 388B
fla.gif 382B
template1.gif 375B
zip.gif 368B
template2.gif 333B
Folder32.gif 281B
vsd.gif 277B
mdb.gif 274B
js.gif 274B
xls.gif 271B
FolderOpened32.gif 264B
doc.gif 260B
dll.gif 258B
ppt.gif 254B
avi.gif 249B
mp3.gif 249B
zip.gif 235B
xml.gif 231B
pdf.gif 230B
cs.gif 224B
txt.gif 213B
button_bg.gif 212B
anchor.gif 184B
fck_anchor.gif 184B
共 278 条
- 1
- 2
- 3
时光机器001
- 粉丝: 0
- 资源: 6
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
前往页