@@ -384,7 +384,6 @@ if ($action === 'is_need_check_code') { | |||||
$mdir = MyDate($cfg_addon_savetype, $nowtme); | $mdir = MyDate($cfg_addon_savetype, $nowtme); | ||||
if (!is_dir($cfg_basedir.$activepath."/$mdir")) { | if (!is_dir($cfg_basedir.$activepath."/$mdir")) { | ||||
MkdirAll($cfg_basedir.$activepath."/$mdir", $cfg_dir_purview); | MkdirAll($cfg_basedir.$activepath."/$mdir", $cfg_dir_purview); | ||||
CloseFtp(); | |||||
} | } | ||||
$cuserLogin = new userLogin(); | $cuserLogin = new userLogin(); | ||||
$iseditor = isset($iseditor)? intval($iseditor) : 0; | $iseditor = isset($iseditor)? intval($iseditor) : 0; | ||||
@@ -42,7 +42,6 @@ if (!in_array($imgfile_type, $sparr)) { | |||||
$mdir = MyDate($cfg_addon_savetype, $nowtme); | $mdir = MyDate($cfg_addon_savetype, $nowtme); | ||||
if (!is_dir($cfg_basedir.$activepath."/$mdir")) { | if (!is_dir($cfg_basedir.$activepath."/$mdir")) { | ||||
MkdirAll($cfg_basedir.$activepath."/$mdir", $cfg_dir_purview); | MkdirAll($cfg_basedir.$activepath."/$mdir", $cfg_dir_purview); | ||||
CloseFtp(); | |||||
} | } | ||||
$iseditor = isset($iseditor)? intval($iseditor) : 0; | $iseditor = isset($iseditor)? intval($iseditor) : 0; | ||||
$filename_name = $cuserLogin->getUserID().'-'.dd2char(MyDate("ymdHis", $nowtme).mt_rand(100, 999)); | $filename_name = $cuserLogin->getUserID().'-'.dd2char(MyDate("ymdHis", $nowtme).mt_rand(100, 999)); | ||||
@@ -37,7 +37,6 @@ if ($activepath == $cfg_soft_dir) { | |||||
$activepath = $activepath.'/'.$newdir; | $activepath = $activepath.'/'.$newdir; | ||||
if (!is_dir($cfg_basedir.$activepath)) { | if (!is_dir($cfg_basedir.$activepath)) { | ||||
MkdirAll($cfg_basedir.$activepath, $cfg_dir_purview); | MkdirAll($cfg_basedir.$activepath, $cfg_dir_purview); | ||||
CloseFtp(); | |||||
} | } | ||||
} | } | ||||
//文件名前为手工指定,后者自动处理 | //文件名前为手工指定,后者自动处理 | ||||
@@ -48,7 +48,6 @@ class FileManagement | |||||
$dirname = $this->baseDir.$this->activeDir."/".$dirname; | $dirname = $this->baseDir.$this->activeDir."/".$dirname; | ||||
if (is_writable($this->baseDir.$this->activeDir)) { | if (is_writable($this->baseDir.$this->activeDir)) { | ||||
MkdirAll($dirname, $GLOBALS['cfg_dir_purview']); | MkdirAll($dirname, $GLOBALS['cfg_dir_purview']); | ||||
CloseFtp(); | |||||
ShowMsg("成功创建一个新目录", "file_manage_main.php?activepath=".$this->activeDir."/".$newdir); | ShowMsg("成功创建一个新目录", "file_manage_main.php?activepath=".$this->activeDir."/".$newdir); | ||||
return 1; | return 1; | ||||
} else { | } else { | ||||
@@ -79,7 +78,6 @@ class FileManagement | |||||
copy($oldfile, $truepath."/$mfile"); | copy($oldfile, $truepath."/$mfile"); | ||||
} else { | } else { | ||||
MkdirAll($truepath, $GLOBALS['cfg_dir_purview']); | MkdirAll($truepath, $GLOBALS['cfg_dir_purview']); | ||||
CloseFtp(); | |||||
copy($oldfile, $truepath."/$mfile"); | copy($oldfile, $truepath."/$mfile"); | ||||
} | } | ||||
unlink($oldfile); | unlink($oldfile); | ||||
@@ -23,7 +23,6 @@ if ($dopost == "add") { | |||||
$imgurl = $cfg_medias_dir."/flink"; | $imgurl = $cfg_medias_dir."/flink"; | ||||
if (!is_dir($cfg_basedir.$imgurl)) { | if (!is_dir($cfg_basedir.$imgurl)) { | ||||
MkdirAll($cfg_basedir.$imgurl, $cfg_dir_purview); | MkdirAll($cfg_basedir.$imgurl, $cfg_dir_purview); | ||||
CloseFtp(); | |||||
} | } | ||||
$imgurl = $imgurl."/".$filename; | $imgurl = $imgurl."/".$filename; | ||||
$mime = get_mime_type($logoimg); | $mime = get_mime_type($logoimg); | ||||
@@ -152,7 +152,6 @@ function GetFieldValue($dvalue, $dtype, $aid = 0, $job = 'add', $addvar = '') | |||||
$fp = fopen($GLOBALS['cfg_basedir'].$addvar, "w"); | $fp = fopen($GLOBALS['cfg_basedir'].$addvar, "w"); | ||||
fwrite($fp, stripslashes($dvalue)); | fwrite($fp, stripslashes($dvalue)); | ||||
fclose($fp); | fclose($fp); | ||||
CloseFtp(); | |||||
return $addvar; | return $addvar; | ||||
} else { | } else { | ||||
$ipath = $GLOBALS['cfg_cmspath']."/data/textdata"; | $ipath = $GLOBALS['cfg_cmspath']."/data/textdata"; | ||||
@@ -168,7 +167,6 @@ function GetFieldValue($dvalue, $dtype, $aid = 0, $job = 'add', $addvar = '') | |||||
$fp = fopen($GLOBALS['cfg_basedir'].$filename, "w"); | $fp = fopen($GLOBALS['cfg_basedir'].$filename, "w"); | ||||
fwrite($fp, stripslashes($dvalue)); | fwrite($fp, stripslashes($dvalue)); | ||||
fclose($fp); | fclose($fp); | ||||
CloseFtp(); | |||||
return $filename; | return $filename; | ||||
} | } | ||||
} else if ($dtype == "img") { | } else if ($dtype == "img") { | ||||
@@ -41,7 +41,6 @@ function GetCurContentAlbum($body, $rfurl, &$firstdd) | |||||
$imgPath = $cfg_basedir.$imgUrl; | $imgPath = $cfg_basedir.$imgUrl; | ||||
if (!is_dir($imgPath.'/')) { | if (!is_dir($imgPath.'/')) { | ||||
MkdirAll($imgPath, $GLOBALS['cfg_dir_purview']); | MkdirAll($imgPath, $GLOBALS['cfg_dir_purview']); | ||||
CloseFtp(); | |||||
} | } | ||||
$milliSecond = 'co'.dd2char(MyDate('ymdHis', time())); | $milliSecond = 'co'.dd2char(MyDate('ymdHis', time())); | ||||
foreach ($img_array as $key => $value) { | foreach ($img_array as $key => $value) { | ||||
@@ -104,7 +103,6 @@ function GetCurContent($body) | |||||
$imgPath = $cfg_basedir.$imgUrl; | $imgPath = $cfg_basedir.$imgUrl; | ||||
if (!is_dir($imgPath.'/')) { | if (!is_dir($imgPath.'/')) { | ||||
MkdirAll($imgPath, $GLOBALS['cfg_dir_purview']); | MkdirAll($imgPath, $GLOBALS['cfg_dir_purview']); | ||||
CloseFtp(); | |||||
} | } | ||||
$milliSecond = MyDate('His', time()); | $milliSecond = MyDate('His', time()); | ||||
foreach ($img_array as $key => $value) { | foreach ($img_array as $key => $value) { | ||||
@@ -50,7 +50,6 @@ if ($dopost == "upload") { | |||||
$filename = $savePath."/".$filename; | $filename = $savePath."/".$filename; | ||||
if (!is_dir($cfg_basedir.$savePath)) { | if (!is_dir($cfg_basedir.$savePath)) { | ||||
MkdirAll($cfg_basedir.$savePath, 777); | MkdirAll($cfg_basedir.$savePath, 777); | ||||
CloseFtp(); | |||||
} | } | ||||
if (preg_match('#\.(php|pl|cgi|asp|aspx|jsp|php5|php4|php3|shtm|shtml)$#i', trim($newname))) { | if (preg_match('#\.(php|pl|cgi|asp|aspx|jsp|php5|php4|php3|shtm|shtml)$#i', trim($newname))) { | ||||
ShowMsg("文件扩展名已被系统禁止", "javascript:;"); | ShowMsg("文件扩展名已被系统禁止", "javascript:;"); | ||||
@@ -109,7 +109,6 @@ else if ($dopost == 'save') { | |||||
$oldfile_path = preg_replace("#".$oldfiles[count($oldfiles) - 1]."$#", "", $oldfile); | $oldfile_path = preg_replace("#".$oldfiles[count($oldfiles) - 1]."$#", "", $oldfile); | ||||
if (!is_dir($cfg_basedir.$oldfile_path)) { | if (!is_dir($cfg_basedir.$oldfile_path)) { | ||||
MkdirAll($cfg_basedir.$oldfile_path, 777); | MkdirAll($cfg_basedir.$oldfile_path, 777); | ||||
CloseFtp(); | |||||
} | } | ||||
$mime = get_mime_type($upfile); | $mime = get_mime_type($upfile); | ||||
if (preg_match("#^unknow#", $mime)) { | if (preg_match("#^unknow#", $mime)) { | ||||
@@ -21,7 +21,6 @@ if (empty($dopost)) { | |||||
$tmpdir = DEDEDATA.'/uploadtmp'; | $tmpdir = DEDEDATA.'/uploadtmp'; | ||||
if (!is_dir($tmpdir)) { | if (!is_dir($tmpdir)) { | ||||
MkdirAll($tmpdir, $cfg_dir_purview); | MkdirAll($tmpdir, $cfg_dir_purview); | ||||
CloseFtp(); | |||||
if (!is_dir($tmpdir)) { | if (!is_dir($tmpdir)) { | ||||
echo "ERROR: Create {$tmpdir} dir Error! "; | echo "ERROR: Create {$tmpdir} dir Error! "; | ||||
exit(0); | exit(0); | ||||
@@ -75,7 +74,6 @@ if (empty($dopost)) { | |||||
$filedir = $cfg_image_dir.'/'.MyDate($cfg_addon_savetype, time()); | $filedir = $cfg_image_dir.'/'.MyDate($cfg_addon_savetype, time()); | ||||
if (!is_dir(DEDEROOT.$filedir)) { | if (!is_dir(DEDEROOT.$filedir)) { | ||||
MkdirAll($cfg_basedir.$filedir, $cfg_dir_purview); | MkdirAll($cfg_basedir.$filedir, $cfg_dir_purview); | ||||
CloseFtp(); | |||||
} | } | ||||
$filename = $cuserLogin->getUserID().'-'.dd2char(MyDate('ymdHis', time())); | $filename = $cuserLogin->getUserID().'-'.dd2char(MyDate('ymdHis', time())); | ||||
if (file_exists($cfg_basedir.$filedir.'/'.$filename.$sname)) { | if (file_exists($cfg_basedir.$filedir.'/'.$filename.$sname)) { | ||||
@@ -29,7 +29,6 @@ if ($dopost == 'bak') { | |||||
} | } | ||||
if (!is_dir($bkdir)) { | if (!is_dir($bkdir)) { | ||||
MkdirAll($bkdir, $cfg_dir_purview); | MkdirAll($bkdir, $cfg_dir_purview); | ||||
CloseFtp(); | |||||
} | } | ||||
//初始化使用到的变量 | //初始化使用到的变量 | ||||
$tables = explode(',', $tablearr); | $tables = explode(',', $tablearr); | ||||
@@ -31,12 +31,6 @@ $cfg_arcsptitle = 'N'; | |||||
$cfg_arcautosp = 'N'; | $cfg_arcautosp = 'N'; | ||||
$cfg_arcautosp_size = 5; | $cfg_arcautosp_size = 5; | ||||
$cfg_auot_description = 250; | $cfg_auot_description = 250; | ||||
$cfg_ftp_host = ''; | |||||
$cfg_ftp_port = ''; | |||||
$cfg_ftp_user = ''; | |||||
$cfg_ftp_pwd = ''; | |||||
$cfg_ftp_root = '/'; | |||||
$cfg_ftp_mkdir = 'N'; | |||||
$cfg_feedback_ck = 'Y'; | $cfg_feedback_ck = 'Y'; | ||||
$cfg_list_son = 'Y'; | $cfg_list_son = 'Y'; | ||||
$cfg_mb_open = 'N'; | $cfg_mb_open = 'N'; | ||||
@@ -3962,12 +3962,6 @@ INSERT INTO `#@__sysconfig` VALUES ('1','cfg_basehost','站点网址','1','strin | |||||
('32','cfg_arcautosp','是否开启长文档自动分页','6','bool','N'), | ('32','cfg_arcautosp','是否开启长文档自动分页','6','bool','N'), | ||||
('33','cfg_arcautosp_size','文档自动分页大小','6','number','5'), | ('33','cfg_arcautosp_size','文档自动分页大小','6','number','5'), | ||||
('34','cfg_auot_description','自动摘要长度(0-255,0表示不启用)','7','number','255'), | ('34','cfg_auot_description','自动摘要长度(0-255,0表示不启用)','7','number','255'), | ||||
('35','cfg_ftp_host','FTP主机','2','string',''), | |||||
('36','cfg_ftp_port','FTP端口','2','number',''), | |||||
('37','cfg_ftp_user','FTP用户名','2','string',''), | |||||
('38','cfg_ftp_pwd','FTP密码','2','string',''), | |||||
('39','cfg_ftp_root','网站根在FTP中的目录','2','string','/'), | |||||
('40','cfg_ftp_mkdir','是否强制用FTP创建目录','2','bool','N'), | |||||
('41','cfg_list_son','是否包含上级列表子类文档','6','bool','Y'), | ('41','cfg_list_son','是否包含上级列表子类文档','6','bool','Y'), | ||||
('42','cfg_mb_open','是否开启会员功能','4','bool','N'), | ('42','cfg_mb_open','是否开启会员功能','4','bool','N'), | ||||
('43','cfg_mb_album','是否开启会员图集功能','4','bool','Y'), | ('43','cfg_mb_album','是否开启会员图集功能','4','bool','Y'), | ||||
@@ -128,4 +128,11 @@ ALTER TABLE `#@__arctype` ADD COLUMN `apienabled` tinyint UNSIGNED NULL DEFAULT | |||||
ALTER TABLE `#@__member` ADD COLUMN `pmid` INT(8) UNSIGNED NULL DEFAULT 0 AFTER `user_money`; | ALTER TABLE `#@__member` ADD COLUMN `pmid` INT(8) UNSIGNED NULL DEFAULT 0 AFTER `user_money`; | ||||
-- 6.2.11 | -- 6.2.11 | ||||
UPDATE `#@__channeltype` SET `useraddcon` = 'soft_add.php', `usermancon` = 'content_list.php', `usereditcon` = 'soft_edit.php' WHERE `id` = 3 | |||||
UPDATE `#@__channeltype` SET `useraddcon` = 'soft_add.php', `usermancon` = 'content_list.php', `usereditcon` = 'soft_edit.php' WHERE `id` = 3; | |||||
DELETE FROM `#@__sysconfig` WHERE `varname` = 'cfg_ftp_mkdir'; | |||||
DELETE FROM `#@__sysconfig` WHERE `varname` = 'cfg_ftp_host'; | |||||
DELETE FROM `#@__sysconfig` WHERE `varname` = 'cfg_ftp_port'; | |||||
DELETE FROM `#@__sysconfig` WHERE `varname` = 'cfg_ftp_user'; | |||||
DELETE FROM `#@__sysconfig` WHERE `varname` = 'cfg_ftp_pwd'; | |||||
DELETE FROM `#@__sysconfig` WHERE `varname` = 'cfg_ftp_root'; | |||||
DELETE FROM `#@__sysconfig` WHERE `varname` = 'cfg_ftp_mkdir'; |
@@ -106,10 +106,6 @@ if (!isset($needFilter)) { | |||||
} | } | ||||
$registerGlobals = @ini_get("register_globals"); | $registerGlobals = @ini_get("register_globals"); | ||||
$isUrlOpen = @ini_get("allow_url_fopen"); | $isUrlOpen = @ini_get("allow_url_fopen"); | ||||
$isSafeMode = @ini_get("safe_mode"); | |||||
if (preg_match('/windows/i', @getenv('OS'))) { | |||||
$isSafeMode = false; | |||||
} | |||||
//系统配置参数 | //系统配置参数 | ||||
if (!file_exists(DEDEDATA."/config.cache.inc.php")) { | if (!file_exists(DEDEDATA."/config.cache.inc.php")) { | ||||
die('DedeBIZ初始化失败,确保系统正确被安装'); | die('DedeBIZ初始化失败,确保系统正确被安装'); | ||||
@@ -202,11 +198,7 @@ $cfg_soft_devteam = 'DedeBIZ'; | |||||
$art_shortname = $cfg_df_ext = '.html'; | $art_shortname = $cfg_df_ext = '.html'; | ||||
$cfg_df_namerule = '{typedir}/{aid}'.$cfg_df_ext; | $cfg_df_namerule = '{typedir}/{aid}'.$cfg_df_ext; | ||||
//新建目录的权限,如果您使用别的属性,本程不保证程序能顺利在Linux或Unix系统运行 | //新建目录的权限,如果您使用别的属性,本程不保证程序能顺利在Linux或Unix系统运行 | ||||
if (isset($cfg_ftp_mkdir) && $cfg_ftp_mkdir == 'Y') { | |||||
$cfg_dir_purview = '0755'; | |||||
} else { | |||||
$cfg_dir_purview = 0755; | |||||
} | |||||
$cfg_dir_purview = 0755; | |||||
//会员是否使用精简模式 | //会员是否使用精简模式 | ||||
$cfg_mb_lit = 'N'; | $cfg_mb_lit = 'N'; | ||||
//特殊全局变量 | //特殊全局变量 | ||||
@@ -218,7 +218,6 @@ function GetFieldValue($dvalue, $dtype, $aid = 0, $job = 'add', $addvar = '', $a | |||||
$fp = fopen($cfg_basedir.$filename, "w"); | $fp = fopen($cfg_basedir.$filename, "w"); | ||||
fwrite($fp, stripslashes($dvalue)); | fwrite($fp, stripslashes($dvalue)); | ||||
fclose($fp); | fclose($fp); | ||||
CloseFtp(); | |||||
return $filename; | return $filename; | ||||
} else if ($dtype == 'img' || $dtype == 'imgfile') { | } else if ($dtype == 'img' || $dtype == 'imgfile') { | ||||
return addslashes($dvalue); | return addslashes($dvalue); | ||||
@@ -395,8 +395,8 @@ function FormatScript($atme) | |||||
* 给属性默认值 | * 给属性默认值 | ||||
* | * | ||||
* @param array $atts 属性 | * @param array $atts 属性 | ||||
* @param array $attlist 属性列表 | |||||
* @return string | |||||
* @param string $attlist 属性列表 | |||||
* @return void | |||||
*/ | */ | ||||
function FillAttsDefault(&$atts, $attlist) | function FillAttsDefault(&$atts, $attlist) | ||||
{ | { | ||||
@@ -9,81 +9,7 @@ if (!defined('DEDEINC')) exit ('dedebiz'); | |||||
* @license GNU GPL v2 (https://www.dedebiz.com/license) | * @license GNU GPL v2 (https://www.dedebiz.com/license) | ||||
* @link https://www.dedebiz.com | * @link https://www.dedebiz.com | ||||
*/ | */ | ||||
$g_ftpLink = false; | |||||
/** | |||||
* 使用FTP方法创建文件夹目录 | |||||
* | |||||
* @param string $truepath 真实目标地址 | |||||
* @param string $mmode 创建模式 | |||||
* @param string $isMkdir 是否创建目录 | |||||
* @return bool | |||||
*/ | |||||
if (!function_exists('FtpMkdir')) { | |||||
function FtpMkdir($truepath, $mmode, $isMkdir = true) | |||||
{ | |||||
global $cfg_basedir, $cfg_ftp_root, $g_ftpLink; | |||||
OpenFtp(); | |||||
$ftproot = preg_replace('/'.$cfg_ftp_root.'$/', '', $cfg_basedir); | |||||
$mdir = preg_replace('/^'.$ftproot.'/', '', $truepath); | |||||
if ($isMkdir) { | |||||
ftp_mkdir($g_ftpLink, $mdir); | |||||
} | |||||
return ftp_site($g_ftpLink, "chmod $mmode $mdir"); | |||||
} | |||||
} | |||||
/** | |||||
* 改变目录模式 | |||||
* | |||||
* @param string $truepath 真实地址 | |||||
* @param string $mmode 模式 | |||||
* @return bool | |||||
*/ | |||||
if (!function_exists('FtpChmod')) { | |||||
function FtpChmod($truepath, $mmode) | |||||
{ | |||||
return FtpMkdir($truepath, $mmode, false); | |||||
} | |||||
} | |||||
/** | |||||
* 打开FTP链接,打开之前确保已经设置好了FTP相关的配置信息 | |||||
* | |||||
* @return void | |||||
*/ | |||||
if (!function_exists('OpenFtp')) { | |||||
function OpenFtp() | |||||
{ | |||||
global $cfg_basedir, $cfg_ftp_host, $cfg_ftp_port, $cfg_ftp_user, $cfg_ftp_pwd, $cfg_ftp_root, $g_ftpLink; | |||||
if (!$g_ftpLink) { | |||||
if ($cfg_ftp_host == '') { | |||||
echo "由于您的站点的PHP配置存在限制,程序尝试用FTP进行目录操作,您必须在后台指定FTP相关的变量"; | |||||
exit(); | |||||
} | |||||
$g_ftpLink = ftp_connect($cfg_ftp_host, $cfg_ftp_port); | |||||
if (!$g_ftpLink) { | |||||
echo "连接FTP失败"; | |||||
exit(); | |||||
} | |||||
if (!ftp_login($g_ftpLink, $cfg_ftp_user, $cfg_ftp_pwd)) { | |||||
echo "登录FTP失败"; | |||||
exit(); | |||||
} | |||||
} | |||||
} | |||||
} | |||||
/** | |||||
* 关闭FTP链接 | |||||
* | |||||
* @return void | |||||
*/ | |||||
if (!function_exists('CloseFtp')) { | |||||
function CloseFtp() | |||||
{ | |||||
global $g_ftpLink; | |||||
if ($g_ftpLink) { | |||||
@ftp_quit($g_ftpLink); | |||||
} | |||||
} | |||||
} | |||||
/** | /** | ||||
* 创建所有目录 | * 创建所有目录 | ||||
* | * | ||||
@@ -94,17 +20,12 @@ if (!function_exists('CloseFtp')) { | |||||
if (!function_exists('MkdirAll')) { | if (!function_exists('MkdirAll')) { | ||||
function MkdirAll($truepath, $mmode) | function MkdirAll($truepath, $mmode) | ||||
{ | { | ||||
global $cfg_ftp_mkdir, $isSafeMode, $cfg_dir_purview; | |||||
if ($isSafeMode || $cfg_ftp_mkdir == 'Y') { | |||||
return FtpMkdir($truepath, $mmode); | |||||
if (!file_exists($truepath)) { | |||||
mkdir($truepath, $mmode); | |||||
chmod($truepath, $mmode); | |||||
return true; | |||||
} else { | } else { | ||||
if (!file_exists($truepath)) { | |||||
mkdir($truepath, $cfg_dir_purview); | |||||
chmod($truepath, $cfg_dir_purview); | |||||
return true; | |||||
} else { | |||||
return true; | |||||
} | |||||
return true; | |||||
} | } | ||||
} | } | ||||
} | } | ||||
@@ -119,12 +40,7 @@ if (!function_exists('MkdirAll')) { | |||||
if (!function_exists('ChmodAll')) { | if (!function_exists('ChmodAll')) { | ||||
function ChmodAll($truepath, $mmode) | function ChmodAll($truepath, $mmode) | ||||
{ | { | ||||
global $cfg_ftp_mkdir, $isSafeMode; | |||||
if ($isSafeMode || $cfg_ftp_mkdir == 'Y') { | |||||
return FtpChmod($truepath, $mmode); | |||||
} else { | |||||
return chmod($truepath, '0'.$mmode); | |||||
} | |||||
return chmod($truepath, '0'.$mmode); | |||||
} | } | ||||
} | } | ||||
/** | /** | ||||
@@ -59,7 +59,6 @@ if (!function_exists('AdminUpload')) { | |||||
} | } | ||||
if (!is_dir(DEDEROOT.$filedir)) { | if (!is_dir(DEDEROOT.$filedir)) { | ||||
MkdirAll($cfg_basedir.$filedir, $cfg_dir_purview); | MkdirAll($cfg_basedir.$filedir, $cfg_dir_purview); | ||||
CloseFtp(); | |||||
} | } | ||||
$filename = $cuserLogin->getUserID().'-'.dd2char(MyDate('ymdHis', time())).$rnddd; | $filename = $cuserLogin->getUserID().'-'.dd2char(MyDate('ymdHis', time())).$rnddd; | ||||
if ($ftype == 'imagelit') $filename .= '-L'; | if ($ftype == 'imagelit') $filename .= '-L'; | ||||
@@ -99,7 +98,6 @@ if (!function_exists('MemberUploads')) { | |||||
if (empty($userid)) $userid = 0; | if (empty($userid)) $userid = 0; | ||||
if (!is_dir($cfg_basedir.$cfg_user_dir."/$userid")) { | if (!is_dir($cfg_basedir.$cfg_user_dir."/$userid")) { | ||||
MkdirAll($cfg_basedir.$cfg_user_dir."/$userid", $cfg_dir_purview); | MkdirAll($cfg_basedir.$cfg_user_dir."/$userid", $cfg_dir_purview); | ||||
CloseFtp(); | |||||
} | } | ||||
//有上传文件 | //有上传文件 | ||||
$allAllowType = str_replace('||', '|', $cfg_imgtype.'|'.$cfg_mediatype.'|'.$cfg_mb_addontype); | $allAllowType = str_replace('||', '|', $cfg_imgtype.'|'.$cfg_mediatype.'|'.$cfg_mb_addontype); | ||||
@@ -82,7 +82,7 @@ function SpGetPinyin($str, $ishead = 0, $isclose = 1) | |||||
*/ | */ | ||||
function SpCreateDir($spath) | function SpCreateDir($spath) | ||||
{ | { | ||||
global $cfg_dir_purview, $cfg_basedir, $cfg_ftp_mkdir, $isSafeMode; | |||||
global $cfg_dir_purview, $cfg_basedir; | |||||
if ($spath == '') { | if ($spath == '') { | ||||
return true; | return true; | ||||
} | } | ||||
@@ -105,12 +105,10 @@ function SpCreateDir($spath) | |||||
} | } | ||||
if (!$isok) { | if (!$isok) { | ||||
echo "创建或修改目录<span class='text-primary'>".$truepath."</span>失败"; | echo "创建或修改目录<span class='text-primary'>".$truepath."</span>失败"; | ||||
CloseFtp(); | |||||
return false; | return false; | ||||
} | } | ||||
} | } | ||||
} | } | ||||
CloseFtp(); | |||||
return true; | return true; | ||||
} | } | ||||
function jsScript($js) | function jsScript($js) | ||||
@@ -157,7 +157,6 @@ if ($action === 'is_need_check_code') { | |||||
} | } | ||||
if (!is_dir($cfg_basedir.$cfg_user_dir."/{$cfg_ml->M_ID}")) { | if (!is_dir($cfg_basedir.$cfg_user_dir."/{$cfg_ml->M_ID}")) { | ||||
MkdirAll($cfg_basedir.$cfg_user_dir."/{$cfg_ml->M_ID}", $cfg_dir_purview); | MkdirAll($cfg_basedir.$cfg_user_dir."/{$cfg_ml->M_ID}", $cfg_dir_purview); | ||||
CloseFtp(); | |||||
} | } | ||||
//头像特殊处理 | //头像特殊处理 | ||||
$fsize = filesize($ff["tmp_name"]); | $fsize = filesize($ff["tmp_name"]); | ||||
@@ -35,7 +35,6 @@ function GetCurContentAlbum($body, $rfurl, &$firstdd) | |||||
$imgPath = $cfg_basedir.$imgUrl; | $imgPath = $cfg_basedir.$imgUrl; | ||||
if (!is_dir($imgPath."/")) { | if (!is_dir($imgPath."/")) { | ||||
MkdirAll($imgPath, $GLOBALS['cfg_dir_purview']); | MkdirAll($imgPath, $GLOBALS['cfg_dir_purview']); | ||||
CloseFtp(); | |||||
} | } | ||||
$milliSecond = MyDate("ymdHis", time()); | $milliSecond = MyDate("ymdHis", time()); | ||||
foreach ($img_array as $key => $value) { | foreach ($img_array as $key => $value) { | ||||
@@ -303,7 +302,6 @@ function GetCurContent(&$body) | |||||
$imgPath = $cfg_basedir.$imgUrl; | $imgPath = $cfg_basedir.$imgUrl; | ||||
if (!is_dir($imgPath."/")) { | if (!is_dir($imgPath."/")) { | ||||
MkdirAll($imgPath, $GLOBALS['cfg_dir_purview']); | MkdirAll($imgPath, $GLOBALS['cfg_dir_purview']); | ||||
CloseFtp(); | |||||
} | } | ||||
$milliSecond = MyDate("ymdHis", time()); | $milliSecond = MyDate("ymdHis", time()); | ||||
foreach ($img_array as $key => $value) { | foreach ($img_array as $key => $value) { | ||||