示例#1
0
define("COMMON_PATH", OVOVCMS_ROOT . "/common");
define("TPL_PATH", OVOVCMS_ROOT . "/templates/html");
define("INCLUDE_FUNCPATH", OVOVCMS_ROOT . "/include/function");
define("INCLUDE_CLASSPATH", OVOVCMS_ROOT . "/include/classlib");
header("Content-type:text/html; Charset=utf-8");
require_once INCLUDE_FUNCPATH . "/function.common.php";
require_once CONFIG_PATH . "/web.config.php";
require_once CONFIG_PATH . "/database.config.php";
//set_magic_quotes_runtime(0);
// 检测魔术引号有无开启,如果没开启,把GET,POST,COOKIE手动转义.
if (!get_magic_quotes_gpc()) {
    $_GET = addslash($_GET);
    $_POST = addslash($_POST);
    $_COOKIE = addslash($_COOKIE);
}
CheckInstall();
//检查是否安装
CheckSwitch();
//检查网站开关
require_once INCLUDE_CLASSPATH . "/mysql.class.php";
$Db = new Db();
include_once OVOVCMS_ROOT . "/include/inc/unsql.php";
require_once OVOVCMS_ROOT . "/smarty/libs/Smarty.class.php";
$smarty = new Smarty();
require_once INCLUDE_FUNCPATH . "/myLib.php";
$smarty->template_dir = OVOVCMS_ROOT . '/templates/ovov_web';
//这个放置模版文件
$smarty->compile_dir = OVOVCMS_ROOT . '/smarty/templates_web/';
//以下三个文件内容为空
$smarty->config_dir = OVOVCMS_ROOT . '/smarty/configs/';
$smarty->cache_dir = OVOVCMS_ROOT . '/smarty/cache/';
示例#2
0
<?php

if (posix_getuid() != 0) {
    die("Cannot be used in web server mode\n\n");
}
include_once dirname(__FILE__) . '/ressources/class.templates.inc';
include_once dirname(__FILE__) . '/ressources/class.ini.inc';
include_once dirname(__FILE__) . '/ressources/class.mysql.inc';
include_once dirname(__FILE__) . '/framework/class.unix.inc';
include_once dirname(__FILE__) . '/framework/frame.class.inc';
include_once dirname(__FILE__) . '/ressources/class.system.network.inc';
include_once dirname(__FILE__) . '/ressources/class.postfix-multi.inc';
include_once dirname(__FILE__) . '/ressources/class.main_cf.inc';
include_once dirname(__FILE__) . '/ressources/class.assp-multi.inc';
if ($argv[1] == '--org') {
    CheckInstall($argv[2]);
    $ass = new assp_multi($argv[2]);
    $ass->WriteConf();
    echo "Starting......: " . date("H:i:s") . " ASSP writing configuration done\n";
    if (!$ass->running) {
        $instance = str_replace(" ", "-", $ass->ou);
        @chdir("/usr/share/assp-{$instance}");
        @chmod("/usr/share/assp-{$instance}/assp.pl", 0777);
        @shell_exec("/usr/share/assp-{$instance}/assp.pl &");
    }
}
function CheckInstall($ou)
{
    $instance = str_replace(" ", "-", $ou);
    $root = "/usr/share/assp-{$instance}";
    @mkdir("{$root}", 0755, true);