Beispiel #1
0
 /**
  * 遍历出指定目录下的所有目录
  * @author	肖飞
  * @param	string	$ddir	指定目录
  * @param	bool	$loop	是否遍历下级目录
  * @param	bool	$path	返回是否带目录结构
  * @return  void
  */
 static function mapTreeDirs($ddir, $loop = true, $path = true)
 {
     global $arrTreeDirs;
     $handle = opendir($ddir);
     while ($file = readdir($handle)) {
         //echo "$ddir"."/"."$file\n"."</br>";
         $bdir = $ddir . "/" . $file;
         if (filetype($bdir) == 'dir') {
             if ($file != '.' && $file != '..') {
                 if ($path) {
                     $arrTreeDirs[] = $bdir;
                 } else {
                     $arrTreeDirs[] = $file;
                 }
             }
         }
         if ($loop) {
             if ($file != '.' && $file != '..' && filetype($bdir) == 'dir') {
                 //是否还有下级目录
                 check::mapTreeDirs($bdir, $loop, $path);
             }
         }
     }
     closedir($handle);
 }
Beispiel #2
0
 * @copyright	(c) 2006 by bizeway.com
 * @version		$Id$
 * @package		ArthurXF
 * @subpackage	admin
 */
require_once '../config/config.inc.php';
require_once '../checklogin.php';
$objWebInit = new ArthurXF();
//smarty参数
$objWebInit->arrGSmarty = $arrGSmarty;
//访问权限检查
if (!$objWebInit->checkPopedomG($_SESSION['user_id'], 'r', 'siteset')) {
    check::AlertExit('对不起,您没有读权限', -1);
}
$arrTreeDirs = array();
check::mapTreeDirs('../../templates', false, false);
if ($_SERVER["REQUEST_METHOD"] == "POST") {
    if (!$objWebInit->checkPopedomG($_SESSION['user_id'], 'w', 'siteset')) {
        check::AlertExit('对不起,您没有写权限', -1);
    }
    $arrTemp = array();
    $arrTemp['cache_url'] = $arrGWeb['cache_url'];
    $arrTemp['cache_dir'] = $arrGSmarty['cache_dir'];
    $arrTemp['compile_dir'] = $arrGSmarty['compile_dir'];
    unset($_POST['okgo']);
    unset($arrGWeb);
    $strFilename = '../../data/webconfig.inc.php';
    include $strFilename;
    foreach ($arrGWeb as $k => $v) {
        foreach ($_POST as $k1 => $v1) {
            if ($k == $k1) {
Beispiel #3
0
         if (!($handle = fopen($strFilename, 'w'))) {
             check::AlertExit("错误:不能打开文件 {$strFilename} !", -1);
         }
         // 将$somecontent写入到我们打开的文件中。
         if (fwrite($handle, $somecontent) === FALSE) {
             check::AlertExit("错误:不能写入到文件 {$strFilename} !", -1);
         }
         fclose($handle);
     } else {
         check::AlertExit("错误:文件 {$strFilename} 不可写!", -1);
     }
 } elseif (empty($arrGPdoDB['db_name']) || empty($arrGPdoDB['db_user'])) {
     check::AlertExit("错误:数据库名和数据库用户名必须填写!", -1);
 }
 $arrTreeDirs = array();
 check::mapTreeDirs('../', false, false);
 $arrModuleDirs = array();
 foreach ($arrTreeDirs as $k => $v) {
     if (in_array($v, array('useradmin', 'uploadfile', 'templates', 'plug-in', 'html', 'data', 'config', 'compile', 'cache', substr(__WEBADMIN_ROOT, 1), 'install'))) {
         continue;
     }
     if (!is_dir('../' . $v . '/config')) {
         continue;
     }
     if (in_array($v, array('wap', 'user', 'rss', 'links', 'guest', 'archives'))) {
         $arrModuleDirs[$k]['state'] = 2;
     } else {
         $arrModuleDirs[$k]['state'] = 0;
     }
     $arrModuleDirs[$k]['id'] = $v;
     @(include '../' . $v . '/config/var.inc.php');
Beispiel #4
0
     $arrGWeb['WEB_ROOT_pre'] = $virtual_path;
     $somecontent = '<?php' . "\n" . '$arrGWeb = ' . var_export($arrGWeb, true) . ';' . "\n" . '$arrGMeta = ' . var_export($arrGMeta, true) . ';' . "\n" . '?>';
     // 首先我们要确定文件存在并且可写。
     if (!($handle = fopen($strFilename, 'w'))) {
         check::AlertExit("错误:不能打开文件 {$strFilename} !", -1);
     }
     // 将$somecontent写入到我们打开的文件中。
     if (fwrite($handle, $somecontent) === FALSE) {
         check::AlertExit("错误:不能写入到文件 {$strFilename} !", -1);
     }
     fclose($handle);
 } elseif (empty($arrGPdoDB['db_name']) || empty($arrGPdoDB['db_user'])) {
     check::AlertExit("错误:数据库名和数据库用户名必须填写!", -1);
 }
 $arrTreeDirs = array();
 check::mapTreeDirs('..' . $ver_path, false, false);
 $arrModuleDirs = array();
 foreach ($arrTreeDirs as $k => $v) {
     if (in_array($v, array('en', 'useradmin', 'uploadfile', 'templates', 'plug-in', 'html', 'data', 'config', 'compile', 'cache', substr(__WEBADMIN_ROOT, 1), 'install'))) {
         continue;
     }
     if (!is_dir('../' . $v . '/config')) {
         continue;
     }
     if (in_array($v, array('wap', 'user', 'rss', 'sitemap', 'links', 'guest', 'archives', 'keywords'))) {
         $arrModuleDirs[$k]['state'] = 2;
     } else {
         $arrModuleDirs[$k]['state'] = 0;
     }
     $arrModuleDirs[$k]['id'] = $v;
     @(include '..' . $ver_path . '/' . $v . '/config/var.inc.php');