修改ecshop2.7.0后台路径

2009-09-29 11:08 来源:www.chinab4c.com 作者:ecshop专家

      ecshop已经发展到2.7了。ecshop2.7不象其他版本,文件路径和文件调用机智都发生了变化,为了更好的处理ecshop后台路径,增加站的安全性.下面将总结,如何修改ecshop后台路径.

quotation.php
include_once(ROOT_PATH . 'user/includes/lib_main.php');

includes/lib_main.php
include_once(ROOT_PATH . 'user/includes/lib_template.php');

includes/lib_common.php
get_brands(){
include_once(ROOT_PATH . 'user/includes/lib_template.php');
}

 

data/config
$admin_dir = "user";

 

admin/picture_batch.php
include_once(ROOT_PATH . '/user/includes/lib_goods.php');


admin/index.php
 require_once(ROOT_PATH . 'user/includes/lib_goods.php');


admin/goods.php
require_once(ROOT_PATH . '/user/includes/lib_goods.php');

admin/filecheck.php

 checkfiles('user/', '\.php|\.htm|\.js|\.css|\xml');


admin/database.php
require_once(ROOT_PATH . 'user/includes/cls_sql_dump.php');


admin/check_file_priv.php
$dir[]                     = 'user';
$dir_subdir['temp'][] = 'temp/compiled/user';

$tpl_dirs[] = 'temp/compiled/user';


admin/includes/init.php
define('ROOT_PATH', str_replace('user/includes/init.php', '', str_replace('\\', '/', __FILE__)));
require(ROOT_PATH . 'user/includes/lib_main.php');
require(ROOT_PATH . 'user/includes/cls_exchange.php');
if (!file_exists('../temp/compiled/user'))
{
    @mkdir('../temp/compiled/user', 0777);
    @chmod('../temp/compiled/user', 0777);
}
$smarty->template_dir  = ROOT_PATH . 'user/templates';
$smarty->compile_dir   = ROOT_PATH . 'temp/compiled/user';

 

 $admin_path = preg_replace('/:\d+/', '', $ecs->url()) . 'user';

 


api/client/includes/lib_api.php
require_once(ROOT_PATH.'user/includes/lib_main.php');
 require_once(ROOT_PATH . 'user/includes/cls_exchange.php');
 require_once(ROOT_PATH . 'user/includes/lib_goods.php');

includes/cls_ecshop.php
 function url()
    {
        $curr = strpos(PHP_SELF, 'user/') !== false ?
                preg_replace('/(.*)(user)(\/?)(.)*/i', '\1', dirname(PHP_SELF)) :
                dirname(PHP_SELF);

        $root = str_replace('\\', '/', $curr);

        if (substr($root, -1) != '/')
        {
            $root .= '/';
        }

        return $this->get_domain() . $root;
    }
 

 

  来源:中国B4C电子商务