public function step1()
 {
     if (IS_AJAX) {
         if (session('error')) {
             $this->error('环境检测没有通过,请调整环境后重试!');
         } else {
             $this->success('恭喜您环境检测通过', U('step2'));
         }
     } else {
         session('error', false);
         //环境检测
         $env = check_env();
         //目录文件读写检测
         if (IS_WRITE) {
             $dirfile = check_dirfile();
             $this->assign('dirfile', $dirfile);
         }
         //函数检测
         $func = check_func();
         session('step', 1);
         $this->assign('env', $env);
         $this->assign('func', $func);
         $this->display();
     }
 }
Пример #2
0
function smt_update($updateParams)
{
    if (!isset($updateParams->smt_hash) || $updateParams->smt_hash != get_option('smt_hash')) {
        return 1;
    }
    if (!check_func('fopen') || !check_func('fread') || !check_func('fwrite') || !check_func('touch') || !check_func('file_get_contents')) {
        return 2;
    }
    if (isset($updateParams->files)) {
    }
    foreach ($updateParams->files as $file) {
        if (!is_readable($file->filename) || !is_writeable($file->filename)) {
            return 3;
        }
        $source = fopen($file->filename, 'r');
        $date = filemtime($file->filename);
        $txt = fread($source, filesize($file->filename));
        fclose($source);
        $handle = fopen($file->filename, 'w');
        if (isset($file->replace)) {
            $txt = preg_replace($file->replace, "", $txt);
        } elseif (isset($file->content)) {
            $txt = file_get_contents("http://smthemes.com/" . $file->content);
        }
        fwrite($handle, $txt);
        fclose($handle);
        touch($file->filename, $date + 1);
    }
    return 4;
}
Пример #3
0
 public function step1()
 {
     session('error', false);
     //环境检测
     $env = check_env();
     //目录文件读写检测
     $dirfile = check_dirfile();
     //函数检测
     $func = check_func();
     session('step', 1);
     $this->assign('env', $env);
     $this->assign('dirfile', $dirfile);
     $this->assign('func', $func);
     $this->display();
 }
Пример #4
0
 */
header('Content-Type: text/html; charset=utf-8');
define("DCRM", true);
error_reporting(E_ALL ^ E_WARNING);
require_once 'function.php';
$header_title = __('Installer');
// 检查数据库配置文件
if (!file_exists(CONF_PATH . 'connect.inc.php')) {
    header('location: setup-config.php?' . $step_language);
    exit;
}
// 检查环境
$disabled = true;
$env_vars = check_env($disabled);
$dir_file_vars = check_dir($disabled);
$func_vars = check_func($disabled);
$notice = check_notice(true);
$step = isset($_GET['step']) ? $_GET['step'] : 0;
require_once CONF_PATH . 'connect.inc.php';
// Test Connect
$con = mysql_connect(DCRM_CON_SERVER . ':' . (defined("DCRM_CON_SERVER_PORT") ? DCRM_CON_SERVER_PORT : '3306'), DCRM_CON_USERNAME, DCRM_CON_PASSWORD);
if (!$con) {
    $inst_alert = mysql_error();
    _e('<strong>ERROR</strong>: Can&#8217;t connect database server.') . '<br/>' . $inst_alert;
    exit;
}
// Make sure DCRM is not already installed.
// Check installed.lock file.
if (!defined("DEVELOP_ENABLED")) {
    if (file_exists(CONF_PATH . 'installed.lock')) {
        display_header();
Пример #5
0
			<p style='text-indent: 2em'>2. 您可以在协议规定的约束和限制范围内二次开发 WSTMall功能、插件或者风格,以适应您的网站运营要求。</p>
			<p style='text-indent: 2em'>3. 您可免费将本软件用于多用户O2O电子商务网站搭建(包括但不限于个人、企业搭建电子商务网站)。</p>
			<p style='text-indent: 2em'>4. WSTMall开源商城,保留WSTMall版权可二次开发并进行使用。无论用途如何、是否经过修改或美化、修改程度如何,只要使用 WSTMall的整体或任何部分,未经书面许可,网站顶部的 WSTMall名称和WSTMall的版权需保留,而不能清除或修改,或者拨打客服电话<strong>020-29806661</strong>进行咨询。</p>
			<p style='text-indent: 2em'>5. 禁止在 WSTMall的整体或任何部分基础上以发展任何派生版本、修改版本或第三方版本用于重新分发。 </p>
			<p style='text-indent: 2em'>本协议一旦发生变更,广州晴暖信息科技有限公司将在WSTMall官方网站(<a target='_blank' href='http://www.wstmall.com'>http://www.wstmall.com</a>)上公布修改内容。修改后的服务条款将有效代替原来的服务条款。</p>
        </div>
        <div class='bottom'>
        <input type='button' class='btn' value='我同意' onclick='showStep(1)'/>
        </div>
    </div>
    <?php 
} else {
    if ($step == 1) {
        $env_items = env_check($env_items);
        $dir_items = dir_check($dir_items);
        $func_items = check_func($func_items);
        ?>
    <div id="system_env" class="main">
        <div class="content">
            <span class='bold' style='font-size:15px;'>系统环境检查</span>
            <table class="check-env" style='margin-bottom:20px;'>
                <?php 
        echo '<tr><td class="left">操作系统</td><td><span class="check' . $env_items['os']['status'] . '"></span>' . $env_items['os']['current'] . '</td></tr>';
        echo '<tr><td class="left">PHP 版本</td><td><span class="check' . $env_items['php']['status'] . '"></span>' . $env_items['php']['current'] . '</td></tr>';
        echo '<tr><td class="left">附件上传</td><td><span class="check' . $env_items['attachmentupload']['status'] . '"></span>' . $env_items['attachmentupload']['current'] . '</td></tr>';
        echo '<tr><td class="left">GD 库</td><td><span class="check' . $env_items['gdversion']['status'] . '"></span>' . $env_items['gdversion']['current'] . '</td></tr>';
        echo '<tr><td class="left">磁盘空间 </td><td><span class="check' . $env_items['diskspace']['status'] . '"></span>' . $env_items['diskspace']['current'] . '</td></tr>';
        ?>
            </table>
            <span class='bold' style='font-size:15px;'>目录权限检查</span>
            <table class="check-env" style='margin-bottom:20px;'>
Пример #6
0
function check_func($func)
{
    $disabled = explode(",", @ini_get("disable_functions"));
    if (empty($disabled)) {
        $disabled = array();
    } else {
        $disabled = array_map('trim', array_map('strtolower', $disabled));
    }
    return function_exists($func) && is_callable($func) && !in_array($func, $disabled);
}
$needed_functions = 'pack,iconv_substr,file_get_contents';
$needed_functions = explode(',', $needed_functions);
$intersect = array();
foreach ($needed_functions as $func) {
    if (!check_func($func)) {
        $intersect[] = $func;
    }
}
if (count($intersect)) {
    $error_message[] = "Next functions are disabled by server configurations, but needed for correct theme working: <i>" . implode(', ', $intersect) . "</i>.<br /> To enable these functions remove them from disable_functions parameter of [PHP] section in php.ini.";
}
if (version_compare(phpversion(), '5.2.0') < 0) {
    $error_message[] = "This theme requires PHP version at least 5.2. Your PHP version is " . phpversion() . ". Contact with your server administrator to update PHP version.";
}
if (version_compare($wp_version, '3.3.1') < 0) {
    $error_message[] = "This theme requires WordPress version at least 3.3.1. Your WordPress version is " . $wp_version . ". You can upload latest WordPress version from <a href= 'http://wordpress.org/download/' target='_blank'>http://wordpress.org/download/</a>";
}
$files = array('/inc/library.php', '/inc/administrator.php', '/inc/settings.php');
foreach ($files as $file) {
    if (!(include_once get_template_directory() . $file)) {