2012-04-15 56 views

回答

2

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:这是,如果你想通过自己的登录页面登录,您必须添加一个glucode线时验证用户名和密码后的登录页面:

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); 

这应该有效。

+0

感谢代码示例Ahmed。我将它添加到我的,并能够通过日志看到我成功登录,但是当我点击链接到ajaxplorer时,它仍然有我希望绕过的登录弹出窗口。任何想法我做错了什么? – 2013-01-21 17:53:17

+0

看到用户在gluecode中进行身份验证的行我记得我设置,如果条件为真绕过ajaxplorer身份验证方法。 – ahmed 2013-03-11 14:52:01

1

1)您不能在AjaxPlorer中使用带有SQL Auth方法的桥而不用大量修改代码。 2)以上示例不正确,因为您必须为“NAME”指定“remote”参数,否则它不会尝试创建桥。

这是如何处理工作......

你告诉AjaXplorer通过指定“名称” =>“远程”为“AUTH_DRIVER”设置的桥梁。 然后,AjaXplorer通过AjaXplorer CMS插件与您的CMS链接,并在users.ser(串行文件)中写入用户(如果它们不存在)。 在这一点上,AjaXplorer根本没有尝试查看任何数据库。 数据库完全绕过天气,您指定“SQL_DRIVER”=> $ SQL_Settings或不。 它将引用数据库的唯一方式是如果“NAME”=>'sql'表示“AUTH_DRIVER”设置。 但是,如果你使用'sql',你将无法拥有桥接功能。

我个人认为这是一个巨大的bug和一个主要的烦恼。

我希望这会消除所有的困惑。