AJAX_OPT::ajax_dbconfig PHP Method

ajax_dbconfig() public method

public ajax_dbconfig ( )
    function ajax_dbconfig()
    {
        if (!isset($this->adminLogged["admin_allow"]["opt"]["dbconfig"]) && !$this->is_super) {
            $this->obj_ajax->halt_alert("x040301");
        }
        $_arr_dbconfigSubmit = $this->mdl_opt->input_dbconfig();
        if ($_arr_dbconfigSubmit["alert"] != "ok") {
            $this->obj_ajax->halt_alert($_arr_dbconfigSubmit["alert"]);
        }
        $_arr_return = $this->mdl_opt->mdl_dbconfig();
        $_arr_targets[] = "dbconfig";
        $_str_targets = json_encode($_arr_targets);
        $_str_return = json_encode($_arr_return);
        $_arr_logData = array("log_targets" => $_str_targets, "log_target_type" => "log", "log_title" => $this->log["opt"]["edit"], "log_result" => $_str_return, "log_type" => "admin");
        $this->mdl_log->mdl_submit($_arr_logData, $this->adminLogged["admin_id"]);
        $this->obj_ajax->halt_alert($_arr_return["alert"]);
    }

Usage Example

Example #1
0
<?php

/*-----------------------------------------------------------------
!!!!警告!!!!
以下为系统文件,请勿修改
-----------------------------------------------------------------*/
//不能非法包含或直接执行
if (!defined("IN_BAIGO")) {
    exit("Access Denied");
}
include_once BG_PATH_FUNC . "init.func.php";
//管理员通用
fn_init(true, true, "Content-type: application/json", true, "ajax", true);
include_once BG_PATH_CONTROL . "admin/ajax/opt.class.php";
//载入设置 ajax 控制器
$ajax_opt = new AJAX_OPT();
//初始化设置对象
switch ($GLOBALS["act_post"]) {
    case "dbconfig":
        $ajax_opt->ajax_dbconfig();
        //数据库
        break;
    default:
        $ajax_opt->ajax_submit();
        //数据库
        break;
}