Esempio n. 1
0
function recoveryDatabase()
{
    $backupDir = '';
    $backupFilePath = '';
    $content = '';
    $s = '';
    $splStr = '';
    $tableName = '';
    handlePower('恢复数据库');
    $backupDir = $GLOBALS['adminDir'] . '/Data/BackUpDateBases/';
    $backupFilePath = $backupDir . '/' . @$_REQUEST['databaseName'];
    if (CheckFile($backupFilePath) == false) {
        eerr('数据库文件不存在', $backupFilePath);
    }
    $content = GetFText($backupFilePath);
    $splStr = aspSplit($content, '===============================' . vbCrlf());
    foreach ($splStr as $key => $s) {
        $tableName = newGetStrCut($s, 'table');
        if ($tableName != '') {
            connexecute('delete from ' . $GLOBALS['db_PREFIX'] . $tableName);
            aspEcho($tableName, importTXTData($s, $tableName, '添加'));
        }
    }
    aspEcho('恢复数据库完成', '');
}
Esempio n. 2
0
function XY_Include($action)
{
    $templateFilePath = '';
    $Block = '';
    $startStr = '';
    $endStr = '';
    $content = '';
    $templateFilePath = lCase(RParam($action, 'File'));
    $Block = lCase(RParam($action, 'Block'));
    $findstr = '';
    $replaceStr = '';
    //查找字符,替换字符
    $findstr = moduleFindContent($action, 'findstr');
    //先找块
    $replaceStr = moduleFindContent($action, 'replacestr');
    //先找块
    $templateFilePath = handleFileUrl($templateFilePath);
    //处理文件路径
    if (CheckFile($templateFilePath) == false) {
        $templateFilePath = $GLOBALS['webTemplate'] . $templateFilePath;
    }
    $content = getFText($templateFilePath);
    if ($Block != '') {
        $startStr = '<!--#' . $Block . ' start#-->';
        $endStr = '<!--#' . $Block . ' end#-->';
        if (inStr($content, $startStr) > 0 && inStr($content, $endStr) > 0) {
            $content = StrCut($content, $startStr, $endStr, 2);
        }
    }
    //替换读出来的内容
    if ($findstr != '') {
        $content = replace($content, $findstr, $replaceStr);
    }
    $XY_Include = $content;
    return @$XY_Include;
}
Esempio n. 3
0
function handleConfigFile($ConfigPath)
{
    $c = '';
    if (CheckFile($ConfigPath) == false) {
        $c = '#Help帮助# start' . vbCrlf() . '默认帮助内容' . vbCrlf() . '#Help帮助# end';
        createFile($ConfigPath, $c);
    }
}
Esempio n. 4
0
function readArticleInfoStyleSource($id)
{
    $filePath = '';
    $filePath = getWebImages() . '\\文章信息展示样式\\' . $id;
    if (CheckFile($filePath) == false) {
        $filePath = $GLOBALS['webTemplate'] . '\\Resources\\' . $id;
    }
    $readArticleInfoStyleSource = readTemplateFileSource($filePath, $id);
    return @$readArticleInfoStyleSource;
}
Esempio n. 5
0
function getTemplateContent($templateFileName)
{
    loadWebConfig();
    //读模板
    $templateFile = '';
    $customTemplateFile = '';
    $c = '';
    $customTemplateFile = ROOT_PATH . 'template/' . $GLOBALS['db_PREFIX'] . '/' . $templateFileName;
    //为手机端
    if (CheckMobile() == true || @$_REQUEST['m'] == 'mobile') {
        $templateFile = ROOT_PATH . '/Template/mobile/' . $templateFileName;
    }
    //判断手机端文件是否存在20160330
    if (CheckFile($templateFile) == false) {
        if (CheckFile($customTemplateFile) == true) {
            $templateFile = $customTemplateFile;
        } else {
            $templateFile = ROOT_PATH . $templateFileName;
        }
    }
    $c = getFText($templateFile);
    $c = replaceLableContent($c);
    $getTemplateContent = $c;
    return @$getTemplateContent;
}
Esempio n. 6
0
function makeHtmlWebToZip($webDir)
{
    $content = '';
    $splStr = '';
    $filePath = '';
    $c = '';
    $fileArray = '';
    $fileName = '';
    $fileType = '';
    $isTrue = '';
    $webFolderName = '';
    $cleanFileList = '';
    $splStr = aspSplit($webDir, '/');
    $webFolderName = $splStr[2];
    //call eerr(webFolderName,webDir)
    $content = getFileFolderList($webDir, true, '全部', '', '全部文件夹', '', '');
    $splStr = aspSplit($content, vbCrlf());
    foreach ($splStr as $key => $filePath) {
        if (CheckFolder($filePath) == false) {
            $fileArray = handleFilePathArray($filePath);
            $fileName = lCase($fileArray[2]);
            $fileType = lCase($fileArray[4]);
            $fileName = remoteNumber($fileName);
            $isTrue = true;
            if (inStr('|' . $cleanFileList . '|', '|' . $fileName . '|') > 0 && $fileType == 'html') {
                $isTrue = false;
            }
            if ($isTrue == true) {
                //call echo(fileType,fileName)
                if ($c != '') {
                    $c = $c . '|';
                }
                $c = $c . replace($filePath, HandlePath('/'), '');
                $cleanFileList = $cleanFileList . $fileName . '|';
            }
        }
    }
    Rw($c);
    $c = $c . '|||||';
    createFileGBK('htmlweb/1.txt', $c);
    aspEcho('<hr>cccccccccccc', $c);
    //先判断这个文件存在20160309
    if (CheckFile('/myZIP.php') == true) {
        aspEcho('', XMLPost(getHost() . '/myZIP.php?webFolderName=' . $webFolderName, 'content=' . escape($c)));
    }
}
Esempio n. 7
0
function PrepareListFile($listFile)
{
    // check if specified file exists locally and if not, fetch the remote location first
    $listFileLocal = realpath($listFile);
    if (CheckFile($listFileLocal)) {
        // if list file exists on the local system, use it right away
        return $listFileLocal;
    } else {
        $localTarget = XDWCTEMP . md5($listFile) . '.txt';
        if (CheckFile($localTarget) && time() - filemtime($localTarget) < LISTFILECACHEPERIOD) {
            // cache hit: cached list file exists locally and is still valid
            return $localTarget;
        } else {
            return FetchRemoteListFile($listFile, $localTarget);
        }
    }
}
Esempio n. 8
0
function scanUrl($httpUrl, $toTitle, $codeset)
{
    $splStr = '';
    $i = '';
    $s = '';
    $content = '';
    $PubAHrefList = '';
    $PubATitleList = '';
    $splUrl = '';
    $spltitle = '';
    $title = '';
    $url = '';
    $htmlDir = '';
    $htmlFilePath = '';
    $nOK = '';
    $dataArray = '';
    $webState = '';
    $u = '';
    $iniDir = '';
    $iniFilePath = '';
    $websize = '';
    $nSetTime = '';
    $startTime = '';
    $openSpeed = '';
    $isLocal = '';
    $isThrough = '';
    $htmlDir = '/../网站UrlScan/' . setFileName(getWebSite($httpUrl));
    CreateDirFolder($htmlDir);
    $htmlFilePath = $htmlDir . '/' . setFileName($httpUrl) . '.html';
    $iniDir = $htmlDir . '/conifg';
    CreateFolder($iniDir);
    $iniFilePath = $iniDir . '/' . setFileName($httpUrl) . '.txt';
    //httpurl="http://maiside.net/"
    $webState = 0;
    $nSetTime = 1;
    $openSpeed = 0;
    if (CheckFile($htmlFilePath) == false) {
        $startTime = now();
        aspEcho('codeset', $codeset);
        $dataArray = handleXmlGet($httpUrl, $codeset);
        $content = $dataArray[0];
        $content = toGB2312Char($content);
        //给PHP用,转成gb2312字符
        $webState = $dataArray[1];
        $openSpeed = dateDiff('s', $startTime, now());
        //content=gethttpurl(httpurl,codeset)
        //call createfile(htmlFilePath,content)
        WriteToFile($htmlFilePath, $content, $codeset);
        createFile($iniFilePath, $webState . vbCrlf() . $openSpeed);
        $nSetTime = 3;
        $isLocal = 0;
    } else {
        //content=getftext(htmlFilePath)
        $content = reaFile($htmlFilePath, $codeset);
        $content = toGB2312Char($content);
        //给PHP用,转成gb2312字符
        $splStr = aspSplit(getFText($iniFilePath), vbCrlf());
        $webState = CInt($splStr[0]);
        $openSpeed = CInt($splStr[0]);
        $isLocal = 1;
    }
    $websize = getFSize($htmlFilePath);
    if ($websize == '') {
        $websize = 0;
    }
    aspEcho('isLocal', $isLocal);
    $rsObj = $GLOBALS['conn']->query('select * from ' . $GLOBALS['db_PREFIX'] . 'weburlscan where httpurl=\'' . $httpUrl . '\'');
    if (@mysql_num_rows($rsObj) == 0) {
        $rs = mysql_fetch_array($rsObj);
        connexecute('insert into ' . $GLOBALS['db_PREFIX'] . 'weburlscan(httpurl,title,charset) values(\'' . $httpUrl . '\',\'' . $toTitle . '\',\'' . $codeset . '\')');
    }
    connexecute('update ' . $GLOBALS['db_PREFIX'] . 'weburlscan  set webstate=' . $webState . ',websize=' . $websize . ',openspeed=' . $openSpeed . ',charset=\'' . $codeset . '\'  where httpurl=\'' . $httpUrl . '\'');
    //strLen(content)  不用这个,不精准
    $s = getContentAHref('', $content, $PubAHrefList, $PubATitleList);
    $s = handleScanUrlList($httpUrl, $s);
    //call echo("httpurl",httpurl)
    //call echo("s",s)
    //call echo("PubATitleList",PubATitleList)
    $nOK = 0;
    $splUrl = aspSplit($PubAHrefList, vbCrlf());
    $spltitle = aspSplit($PubATitleList, vbCrlf());
    for ($i = 1; $i <= uBound($splUrl); $i++) {
        $title = $spltitle[$i];
        $url = $splUrl[$i];
        //去掉#号后台的字符20160506
        if (inStr($url, '#') > 0) {
            $url = mid($url, 1, inStr($url, '#') - 1);
        }
        if ($url == '') {
            if ($title != '') {
                aspEcho('网址为空', $title);
            }
        } else {
            $url = handleScanUrlList($httpUrl, $url);
            $url = handleWithWebSiteList($httpUrl, $url);
            if ($url != '') {
                $rsObj = $GLOBALS['conn']->query('select * from ' . $GLOBALS['db_PREFIX'] . 'weburlscan where httpurl=\'' . $url . '\'');
                if (@mysql_num_rows($rsObj) == 0) {
                    $rs = mysql_fetch_array($rsObj);
                    $u = lCase($url);
                    if (inStr($u, 'tools/downfile.asp') > 0 || inStr($u, '/url.asp?') > 0 || inStr($u, '/aspweb.asp?') > 0 || inStr($u, '/phpweb.php?') > 0 || $u == 'http://www.maiside.net/qq/' || inStr($u, 'mailto:') > 0 || inStr($u, 'tel:') > 0 || inStr($u, '.html?replytocom') > 0) {
                        //.html?replytocom  王通网站
                        $isThrough = 0;
                    } else {
                        $isThrough = 1;
                        //不用true 因为写入数据会有问题
                    }
                    connexecute('insert into ' . $GLOBALS['db_PREFIX'] . 'weburlscan(tohttpurl,totitle,httpurl,title,isthrough,charset) values(\'' . $httpUrl . '\',\'' . $toTitle . '\',\'' . $url . '\',\'' . left($title, 255) . '\',' . $isThrough . ',\'' . $codeset . '\')');
                    $nOK = $nOK + 1;
                    aspEcho($i, $url);
                } else {
                    aspEcho($title, $url);
                }
            }
        }
    }
    $scanUrl = $nSetTime;
    return @$scanUrl;
}
Esempio n. 9
0
function addEditFile($dir, $fileName)
{
    $filePath = '';
    $promptMsg = '';
    if (right(lCase($fileName), 5) != '.html' && @$_SESSION['adminusername'] != 'ASPPHPCMS') {
        $fileName = $fileName . '.html';
    }
    $filePath = $dir . '/' . $fileName;
    if (CheckFile($filePath) == false) {
        handlePower('添加模板文件');
        //管理权限处理
    } else {
        handlePower('修改模板文件');
        //管理权限处理
    }
    //保存内容
    if (@$_REQUEST['issave'] == 'true') {
        createFile($filePath, @$_REQUEST['content']);
        $promptMsg = '保存成功';
    }
    ?>
    <form name="form1" method="post" action="?act=addEditFile&issave=true">
    <table width="99%" border="0" cellspacing="0" cellpadding="0" class="tableline">
    <tr>
    <td height="30">目录<?php 
    echo $dir;
    ?>
<br>
    <input name="dir" type="hidden" id="dir" value="<?php 
    echo $dir;
    ?>
" /></td>
    </tr>
    <tr>
    <td>文件名称
    <input name="fileName" type="text" id="fileName" value="<?php 
    echo $fileName;
    ?>
" size="40">&nbsp;<input type="submit" name="button" id="button" value=" 保存 " /><?php 
    echo $promptMsg;
    ?>
    <br>
    <textarea name="content" style="width:99%;height:480px;"id="content"><?php 
    Rw(getFText($filePath));
    ?>
</textarea></td>
    </tr>
    </table>
    </form>
    <?php 
}
Esempio n. 10
0
{
    $File3Name = basename($_SERVER['SCRIPT_NAME']);
    if ($File3Name == $FileName || $File3Name == "/" . $FileName) {
        require 'index.php';
        exit;
    }
    return null;
}
function CheckFiles($FileName)
{
    $File3Name = basename($_SERVER['SCRIPT_NAME']);
    if ($File3Name == $FileName || $File3Name == "/" . $FileName) {
        return true;
    }
}
CheckFile("functions.php");
require $SettDir['misc'] . "compression.php";
if ($Settings['sqltype'] == "mysql") {
    if (!in_array("ini_set", $disfunc)) {
        @ini_set("mysql.default_host", $Settings['sqlhost']);
        @ini_set("mysql.default_user", $Settings['sqluser']);
        @ini_set("mysql.default_password", $Settings['sqlpass']);
    }
    require $SettDir['sql'] . "mysql.php";
}
if ($Settings['sqltype'] == "mysqli") {
    if (!in_array("ini_set", $disfunc)) {
        @ini_set("mysqli.default_host", $Settings['sqlhost']);
        @ini_set("mysqli.default_user", $Settings['sqluser']);
        @ini_set("mysqli.default_pw", $Settings['sqlpass']);
    }