2012-04-15 77 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和一個主要的煩惱。

我希望這會消除所有的困惑。