AjaXplorer 连接到数据库

标签 ajax linux authentication pydio

我发现了 AjaXplorer,我想知道是否有关于如何加强数据库之间链接的分步指南我已阅读文件 http://ajaxplorer.info/documentation/developer-documentation/chapter-external-bridge/ 但还是觉得太详细了

有没有一步一步ajax链接数据库的?

最佳答案

1:将bootstrap_plugins.php中的auth驱动和conf驱动替换成下面的:

    "CONF_DRIVER" => array(
        "NAME"      => "sql",
        "OPTIONS"   => array(
            "SQL_DRIVER"    => array(
                "driver"    => "mysql",
                "host"      => "db_server",
                "database"  => "db_name",
                "user"      => "db_username",
                "password"  => "db_password",
            ),
            )
),    

"AUTH_DRIVER" => array(
            "NAME"          => "sql",
            //"NAME" => "remote",
            "OPTIONS"       => array(
            "SLAVE_MODE"  => true,  
                "SQL_DRIVER"    => array(
                                        "driver"    => "mysql",
                                        "host"      => "db_server",
                                        "database"  => "db_name",
                                        "user"      => "db_username",
                                        "password"  => "db_password"
                                            ),

                "LOGIN_URL" => "../login.php",  // The URL to redirect to if a non-logged user tries to access AjaXplorer
                "LOGOUT_URL" => "../logout.php",  // The URL to redirect upon login out
                "SECRET" => "ahmed",// the secret key that you will pass to the glueCode when communicating with it (see below)
                "TRANSMIT_CLEAR_PASS"   => false  // Don't touch this. It's unsafe (and useless here) to transmit clear password.
                                        )
                ),

2:这是如果你想通过自己的登录页面登录,你必须在验证用户名和密码后的登录页面添加一段代码:

define("AJXP_EXEC", true);
    $glueCode = "ajaxplorer-core-4.0.4/plugins/auth.remote/glueCode.php";
    $secret = "ahmed";

    // Initialize the "parameters holder"
    global $AJXP_GLUE_GLOBALS;
    $AJXP_GLUE_GLOBALS = array();
    $AJXP_GLUE_GLOBALS["secret"] = $secret;
    $AJXP_GLUE_GLOBALS["plugInAction"] = "login";
    $AJXP_GLUE_GLOBALS["autoCreate"] = false;

    // NOTE THE md5() call on the password field.
    $AJXP_GLUE_GLOBALS["login"] = array("name" => $_POST["login"], "password" => md5($_POST["password"]));

    // NOW call glueCode!
    include($glueCode);

这应该有效。

关于AjaXplorer 连接到数据库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10165453/

相关文章:

jquery - 在asp.net mvc中使用ajax发送Json数据数组和图像文件

javascript - Spring Boot 和 AJAX 用于向下滚动时加载页面

c++ - Linux下c++中的绝对文件路径

asp.net-mvc - 用户在 Controller 中为空,但在 View 中具有值

facebook - 具有基本 http 身份验证和 Facebook 社交插件、Twitter 按钮的网站

javascript - AJAX 不会将变量传输到 PHP

javascript - 如何订购运行 ajax 的 jQuery 然后必须返回 true

ruby - ruby 脚本中的 `#!` (shebang)(hashbang) 有问题

linux - 无法启动Hadoop虚拟机

node.js - SPA 与 Deepstream.io 用于登录页面的 HTTP 身份验证