Пример #1
0
     $result['error'] = 0;
     $result['message'] = 'OK';
     die($json->encode($result));
     break;
     /* 检查环境页面 */
 /* 检查环境页面 */
 case 'check':
     include_once ROOT_PATH . 'upgrade/includes/lib_env_checker.php';
     include_once ROOT_PATH . 'upgrade/includes/checking_dirs.php';
     $ui = isset($_REQUEST['ui']) ? $_REQUEST['ui'] : 'ecshop';
     if ($ui == 'ecshop') {
         array_shift($checking_dirs);
     }
     $dir_checking = check_dirs_priv($checking_dirs);
     $templates_root = array('dwt' => ROOT_PATH . 'themes/default/', 'lbi' => ROOT_PATH . 'themes/default/library/');
     $template_checking = check_templates_priv($templates_root);
     $rename_priv = check_rename_priv();
     $disabled = '';
     if ($dir_checking['result'] === 'ERROR' || !empty($template_checking) || !empty($rename_priv)) {
         $disabled = 'disabled="true"';
     }
     $has_unwritable_tpl = 'yes';
     if (empty($template_checking)) {
         $template_checking = $_LANG['all_are_writable'];
         $has_unwritable_tpl = 'no';
     }
     $smarty->assign('config_info', get_config_info());
     $smarty->assign('dir_checking', $dir_checking['detail']);
     $smarty->assign('has_unwritable_tpl', $has_unwritable_tpl);
     $smarty->assign('template_checking', $template_checking);
     $smarty->assign('rename_priv', $rename_priv);
 function index($page = 1)
 {
     $flag = false;
     $lock = true;
     $this->set('flag', $flag);
     $path = WWW_ROOT . '/data/install.lock';
     if (!file_exists($path)) {
         $lock = false;
     }
     $agreement_path = WWW_ROOT . '/data/tools/agreement.txt';
     if (file_exists($agreement_path)) {
         $agreement = fopen($agreement_path, "r");
         flock($agreement, LOCK_EX);
         $content = fread($agreement, filesize($agreement_path));
         flock($agreement, LOCK_UN);
         $this->set('agreement', $content);
         fclose($agreement);
     }
     $this->set('lock', $lock);
     include_once ROOT_PATH . 'tools/controllers/includes/lib_env_checker.php';
     include_once ROOT_PATH . 'tools/controllers/includes/checking_dirs.php';
     $dir_checking = check_dirs_priv($checking_dirs, $this->_LANG);
     $templates_root = array('temp' => dirname(ROOT_PATH) . '/app/web/views/themed');
     $this->set('templates_root', $templates_root);
     $template_checking = check_templates_priv($templates_root);
     $rename_priv = check_rename_priv();
     $disabled = '""';
     if ($dir_checking['result'] === 'ERROR' || !empty($template_checking) || !empty($rename_priv) || !function_exists('mysql_connect')) {
         $disabled = 'disabled="true"';
     }
     $has_unwritable_tpl = 'yes';
     if (empty($template_checking)) {
         $template_checking = $this->_LANG['all_are_writable'];
         $has_unwritable_tpl = 'no';
     }
     $ui = !empty($_POST['user_interface']) ? $_POST['user_interface'] : "seevia";
     $ucapi = !empty($_POST['ucapi']) ? $_POST['ucapi'] : "seevia";
     $ucfounderpw = !empty($_POST['ucfounderpw']) ? $_POST['ucfounderpw'] : "seevia";
     $this->set('ucapi', $ucapi);
     $this->set('ucfounderpw', $ucfounderpw);
     $this->set('installer_lang', $this->installer_lang);
     $this->set('system_info', get_system_info($this->_LANG));
     if (!empty(get_system_info($this->_LANG))) {
         $flag = true;
         $this->set('flag', $flag);
     }
     $this->set('dir_checking', $dir_checking['detail']);
     $this->set('has_unwritable_tpl', $has_unwritable_tpl);
     $this->set('template_checking', $template_checking);
     $this->set('rename_priv', $rename_priv);
     if (isset($_REQUEST["is_ajax"]) && $_REQUEST["is_ajax"] == 1) {
         Configure::write('debug', 0);
         $this->layout = "ajax";
         $result['lock'] = $lock;
         $result['system_info'] = get_system_info($this->_LANG);
         $result['dir_checking'] = $dir_checking['detail'];
         $result['template_checking'] = $template_checking;
         $result['has_unwritable_tpl'] = $has_unwritable_tpl;
         $result['disabled'] = $disabled;
         die(json_encode($result));
     }
     $this->set('disabled', $disabled);
     $this->set('userinterface', $ui);
     $this->set("title_for_layout", 'Seevia-O2O安装');
 }