示例#1
0
if (isset($_POST['savebasic'])) {
    $sp_search = array('\\\\"', "\\\\'", "'");
    $sp_replace = array('&', '"', ''');
    $siteurl = $_POST['data']['setting']['site_url'];
    if (!empty($siteurl) && substr($siteurl, -1, 1) != '/') {
        $siteurl .= "/";
    }
    $_POST['data']['setting']['site_url'] = $siteurl;
    if (isset($_POST['data']['multita'])) {
        $_POST['data']['setting']['site_description'] = pb_lang_merge($_POST['data']['multita']);
        if (!empty($_POST['data']['setting']['site_description'])) {
            $_POST['data']['setting']['site_description'] = str_replace($sp_search, $sp_replace, $_POST['data']['setting']['site_description']);
        }
    }
    if (!empty($_POST['data']['setting'])) {
        $updated = $setting->replace($_POST['data']['setting']);
        if ($updated) {
            $cache->writeCache("setting", "setting");
        }
    }
    if ($updated) {
        if (!empty($_POST['data']['setting']['site_url']) && !pb_strcomp($_POST['data']['setting']['site_url'], $absolute_uri)) {
            edit_config(array("absolute_uri" => $_POST['data']['setting']['site_url']));
        }
        flash("success", "setting.php?do=basic");
    } else {
        flash();
    }
}
if (isset($_POST['saveauth'])) {
    $updated = $setting->replace($_POST['data']['setting']);
示例#2
0
require PHPB2B_ROOT . './libraries/page.class.php';
require "session_cp.inc.php";
require LIB_PATH . "cache.class.php";
uses("service", "typeoption", "setting");
$page = new Pages();
$cache = new Caches();
$setting = new Settings();
$typeoption = new Typeoption();
$service = new Services();
$conditions = null;
$tpl_file = "service";
setvar("Status", $typeoption->get_cache_type("common_status"));
setvar("ServiceTypes", $typeoption->get_cache_type("service_type"));
if (isset($_POST['save_client'])) {
    if (!empty($_POST['data']['setting'])) {
        $updated = $setting->replace($_POST['data']['setting'], 1);
        if ($updated) {
            $cache->writeCache("setting", "setting");
            flash("success");
        }
    }
    flash();
}
if (isset($_POST['save']) && !empty($_POST['data']['service'])) {
    $vals = array();
    $vals = $_POST['data']['service'];
    $vals['modified'] = $time_stamp;
    $result = $service->save($vals, "update", $_POST['id']);
    if (!empty($vals['revert_content'])) {
        $datas = array("actor" => $adminer_info['last_name'], "action" => L("feed_revert", "tpl"), "do" => L("feed_problem", "tpl"), "subject" => '<a href="index.php?do=service&action=detail&id=' . $_POST['id'] . '">' . $vals['title'] . '</a>');
        $sql = "INSERT INTO {$tb_prefix}feeds (type_id,type,member_id,username,data,created,modified,revert_date) VALUE ('1','service'," . $current_adminer_id . ",'" . $adminer_info['last_name'] . "','" . serialize($datas) . "'," . $time_stamp . "," . $time_stamp . "," . $time_stamp . ")";
示例#3
0
require LIB_PATH . "file.class.php";
uses("setting");
$setting_controller = new Setting();
$setting = new Settings();
$cache = new Caches();
$file = new Files();
$conditions = null;
$tpl_file = "language";
if (isset($_POST['action'])) {
    $vals = $datas = array();
    foreach ($_POST['data']['item'] as $key => $val) {
        $_POST['data']['language'][$val]['img'] = str_replace(array("../", "../../"), "", $_POST['data']['language'][$val]['img']);
        $vals[$val] = $_POST['data']['language'][$val];
    }
    $datas['languages'] = serialize($vals);
    $setting->replace($datas);
    if (isset($_POST['update_dot'])) {
        foreach ($vals as $lang => $lang_var) {
            pb_configmake($lang, false);
            $cache->lang_dirname = $lang;
            $cache->cacheAll();
        }
    } else {
        pb_configmake($app_lang, false);
        $cache->updateLanguages();
    }
    flash("success");
}
$result = $file->getFolders("../languages/");
$items = array();
$installed_languages = array();
示例#4
0
 *      @version $Revision: 2075 $
 */
require "../libraries/common.inc.php";
session_start();
require PHPB2B_ROOT . './libraries/func.sql.php';
require "session_cp.inc.php";
$system_info = array();
uses("setting", "adminnote");
$setting = new Settings();
$adminnote = new Adminnotes();
if (isset($_GET['do'])) {
    $do = trim($_GET['do']);
    if ($do == "set_update_alert") {
        $vals['update_alert_type'] = intval($_GET['type']);
        $vals['update_alert_lasttime'] = $time_stamp;
        $setting->replace($vals, 1);
        die(L("action_successfully"));
    }
}
$serverinfo = PHP_VERSION;
$serverinfo .= @ini_get('safe_mode') ? ' Safe Mode' : NULL;
$dbversion = $pdb->GetOne("SELECT VERSION()");
$system_info['PhpVersion'] = $serverinfo;
$system_info["MysqlVersion"] = $dbversion;
$when_to_backup = $_PB_CACHE['setting']['backup_type'];
$system_info["LastBackupTime"] = $_PB_CACHE['setting']['last_backup'];
$system_info['InstallDate'] = df(file_exists(DATA_PATH . 'install.lock') ? filemtime(DATA_PATH . 'install.lock') : $pdb->GetOne("SELECT valued FROM {$tb_prefix}settings WHERE variable='install_dateline'"));
$system_info['last_login'] = !empty($adminer_info['last_login']) ? date("Y-m-d H:i", $adminer_info['last_login']) : L("your_first_login", "tpl");
$system_info['last_ip'] = $adminer_info['last_ip'];
$system_info['safe_mode'] = (bool) ini_get('safe_mode') ? L("correct", "tpl") : L("deny", "tpl");
$system_info['safe_mode_gid'] = (bool) ini_get('safe_mode_gid') ? L("correct", "tpl") : L("deny", "tpl");
示例#5
0
if (isset($_GET['do'])) {
    $do = trim($_GET['do']);
    if (!empty($_GET['id'])) {
        $id = intval($_GET['id']);
    }
    if ($do == "uninstall" && !empty($id)) {
        $templet->del($id);
    }
    if ($do == "install" && !empty($_GET['entry'])) {
        $entry = trim($_GET['entry']);
        $templet_controller->install($entry);
        flash("tpl_installed_ok", "templet.php?type=" . $_GET['type']);
    }
    if ($do == "setup" && !empty($_GET['name']) && $pdb->GetRow("SELECT * FROM {$tb_prefix}templets WHERE id=" . $id)) {
        $the_theme = trim($_GET['name']);
        $setting->replace(array("theme" => $the_theme));
        $result = $cache->writeCache("setting", "setting");
        if ($result) {
            $templet->exchangeDefault($id);
            flash("success", "templet.php?type=system");
        } else {
            flash();
        }
    }
    if ($do == "edit") {
        if (!empty($id)) {
            setvar("item", $templet->read("*", $id));
        }
        $user_types = array();
        foreach ($_PB_CACHE['membergroup'] as $key => $val) {
            $user_types[$key] = $val['name'];
示例#6
0
    if ($type == "user") {
        //description for styles column 20120920
        $vals['description'] = serialize($_POST['data']['skins']);
    }
    if (!empty($id)) {
        $result = $templet->save($vals, "update", $id);
        if (isset($_POST['data']['templet']['is_default']) && $_POST['data']['templet']['is_default'] == 1) {
            $pdb->Execute("UPDATE {$tb_prefix}templets SET is_default='0' WHERE type='" . $type . "'");
            $pdb->Execute("UPDATE {$tb_prefix}templets SET is_default='1' WHERE id='" . $_POST['id'] . "'");
        }
    } else {
        $result = $templet->save($vals);
    }
    if (!empty($_POST['data']['site_style'])) {
        $the_style = trim($_POST['data']['site_style']);
        $setting->replace(array("site_style" => $the_style));
        $site_theme_styles = $templet_controller->getStyle();
        $setting->replace(array("site_theme_styles" => serialize($site_theme_styles)));
        //		$setting->replace(array("site_theme_styles"=>serialize($_POST['data']['site_theme_styles'])));
        $result = $cache->writeCache("setting", "setting");
    }
    if (!$result) {
        flash();
    } else {
        flash("success", "templet.php?type=" . $_POST['type']);
    }
}
if (isset($_GET['do'])) {
    $do = trim($_GET['do']);
    if (!empty($_GET['id'])) {
        $id = intval($_GET['id']);