{"id":120,"date":"2009-06-17T07:51:43","date_gmt":"2009-06-16T23:51:43","guid":{"rendered":"http:\/\/j178.mtgbb.com\/222"},"modified":"2011-02-28T20:13:59","modified_gmt":"2011-02-28T12:13:59","slug":"mantis-ad%e8%88%87db%e5%af%86%e7%a2%bc%e9%9b%99%e9%87%8d%e8%aa%8d%e8%ad%89","status":"publish","type":"post","link":"https:\/\/j178.mtgbb.com\/?p=120","title":{"rendered":"mantis AD\u8207DB\u5bc6\u78bc\u96d9\u91cd\u8a8d\u8b49"},"content":{"rendered":"<p>\u6709\u5169\u500b AD \u7684\u60c5\u6cc1\u4e0b\uff0c\u5206\u5225\u53bb\u5169\u53f0\u4e0d\u540c\u7684 LDAP \u4e3b\u6a5f\u8b80\u53d6\u8cc7\u6599<\/p>\n<p>\u591a\u6b64\u4e00\u8209\u7684\u884c\u70ba\uff0c\u6c92\u4e8b\u5225\u9019\u9ebc\u641e<\/p>\n<p>====AD\u8207DB\u5bc6\u78bc\u96d9\u91cd\u8a8d\u8b49====<\/p>\n<pre lang=\"php\" line=\"1\">\r\n\u4fee\u6539\u6a94\u6848 core\/authentication_api.php \u5982\u4e0b:\r\n\u5728  function auth_does_password_match \u88e1\r\n\u5c07\r\n  if ( LDAP == $t_configured_login_method ) {\r\n\u81f3\r\n                       return true;\r\n                     }\r\n               }\r\n      \r\n\u6539\u4ee5\u4ee5\u4e0b\u7a0b\u5f0f\u78bc\u53d6\u4ee3\r\n      $t_password         = user_get_field( $p_user_id, 'password' );\r\n      $t_login_methods   = Array(MD5, CRYPT, PLAIN);\r\n      foreach ( $t_login_methods as $t_login_method ) {\r\n \r\n         # pass the stored password in as the salt\r\n         if ( auth_process_plain_password( $p_test_password, $t_password, $t_login_method ) == $t_password ) {\r\n            # Check for migration to another login method and test whether the password was encrypted\r\n            # with our previously insecure implemention of the CRYPT method\r\n            if ( ( $t_login_method != $t_configured_login_method ) ||\r\n               ( ( CRYPT == $t_configured_login_method ) && substr( $t_password, 0, 2 ) == substr( $p_test_password, 0, 2 ) ) ) {\r\n               user_set_password( $p_user_id, $p_test_password, true );\r\n            }\r\n \r\n            return true;\r\n         }\r\n      }\r\n \r\n      if ( LDAP == $t_configured_login_method ) {\r\n         return ldap_authenticate( $p_user_id, $p_test_password );\r\n      }\r\n\u5728 function auth_process_plain_password \u88e1\r\n\u5728 case MD5: \u524d\u65b0\u589e\u4e00\u884c\u7a0b\u5f0f\u78bc\u5982\u4e0b\r\n       case LDAP:\r\n\u5728 mantis \u76ee\u9304\u5e95\u4e0b\u65b0\u589e custom_functions_inc.php\uff0c\u8b93\u4f7f\u7528\u8005\u53ef\u4ee5\u4fee\u6539\u81ea\u5df1\u7684\u5bc6\u78bc\r\n\u5167\u5bb9\u5982\u4e0b\r\n <?php\r\n function custom_function_override_auth_can_change_password() {\r\n   return true;\r\n }\r\n ?>\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u6709\u5169\u500b AD \u7684\u60c5\u6cc1\u4e0b\uff0c\u5206\u5225\u53bb\u5169\u53f0\u4e0d\u540c\u7684 LDAP \u4e3b\u6a5f\u8b80\u53d6\u8cc7\u6599 \u591a\u6b64\u4e00\u8209\u7684\u884c\u70ba\uff0c\u6c92\u4e8b\u5225\u9019\u9ebc\u641e ====AD\u8207 &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14],"tags":[56],"class_list":["post-120","post","type-post","status-publish","format-standard","hentry","category-php","tag-php"],"_links":{"self":[{"href":"https:\/\/j178.mtgbb.com\/index.php?rest_route=\/wp\/v2\/posts\/120","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/j178.mtgbb.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/j178.mtgbb.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/j178.mtgbb.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/j178.mtgbb.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=120"}],"version-history":[{"count":0,"href":"https:\/\/j178.mtgbb.com\/index.php?rest_route=\/wp\/v2\/posts\/120\/revisions"}],"wp:attachment":[{"href":"https:\/\/j178.mtgbb.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=120"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/j178.mtgbb.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=120"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/j178.mtgbb.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=120"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}