Esempio n. 1
0
function config_file_form($p_array = null)
{
    $os = is_unix();
    if ($p_array == null) {
        /* default value */
        $ctmp = $os == 1 ? '/tmp' : 'c:/tmp';
        $cpath = $os == 1 ? '/usr/bin' : 'c:/noalyss/postgresql/bin';
        $cuser = '******';
        $cpasswd = 'dany';
        $cport = 5432;
        $cdomain = '';
        $clocale = 1;
        $multi = 1;
        $cdbname = "database_noalyss";
    } else {
        extract($p_array);
    }
    $ictmp = new IText('ctmp', $ctmp);
    $ictmp->size = 25;
    $iclocale = new ISelect('clocale');
    $iclocale->value = array(array("value" => 1, "label" => "Activé"), array("value" => 0, "label" => "Désactivé"));
    $iclocale->selected = 1;
    $icpath = new IText("cpath", $cpath);
    $icpath->size = 30;
    $icuser = new IText('cuser', $cuser);
    $icpasswd = new IText('cpasswd', $cpasswd);
    $icport = new IText("cport", $cport);
    /*
     * For version MONO
     */
    $smulti = new ICheckBox('multi');
    $smulti->javascript = ' onchange="show_dbname(this)" ';
    $icdbname = new IText('cdbname');
    require 'template_config_form.php';
}
Esempio n. 2
0
/**
 * 模版缓存清空函数设置
 * @author HumingXu E-mail:huming17@126.com
 */
function build_cache_template()
{
    global $_G;
    $cache_template = SITE_ROOT . './data/template/*.tpl.php';
    //删除目录内所有模板缓存文件
    $is_unix = is_unix();
    if ($is_unix == 1 && function_exists('shell_exec')) {
        $cmd = 'rm -f ' . $cache_template;
        shell_exec($cmd);
    } else {
        //递归删除所有.php 文件
        array_map("unlink", glob($cache_template));
    }
}
Esempio n. 3
0
     }
     echo '{
         "statusCode":"200",
         "message":"' . $return_message . '",
         "navTabId":"",
         "rel":"",
         "callbackType":"forward",
         "forwardUrl":"admin.php?mod=backup&action=index",
         "confirmMsg":""
     }';
     break;
 case "backup_restore":
     $backup_id = isset($_REQUEST['backup_id']) ? $_REQUEST['backup_id'] : '';
     if ($backup_id) {
         //DEBUG 删除目录
         $is_unix = is_unix();
         if ($is_unix == 1 && function_exists('shell_exec')) {
             $backup_path = SITE_ROOT . './data/backup/backup.' . $backup_id;
             $tmp_array = directoryToArray($backup_path, false, false, true);
             //DEBUG 导入数据库
             sort($tmp_array);
             $sql_backup_file = $www_backup_file = '';
             $issqlfile = strpos($tmp_array[0], "sql");
             if ($issqlfile) {
                 $sql_backup_file = $tmp_array[0];
                 $www_backup_file = $tmp_array[1];
             } else {
                 $sql_backup_file = $tmp_array[1];
                 $www_backup_file = $tmp_array[0];
             }
             $sqlfile_path = $sql_backup_file;