ติดตั้ง ldaphack9 กับ Mambo 4.5.3


ok ครับ

สำหรับการใช้
ldaphack กับ Mambo 4.5.3

เมื่อติดตั่งโดยการระเบิดไปแทนที่แล้วจะเกิด error ที่เว็บไซต์ template 

ตัวอย่าง error ที่เว็บไซต์
 Fatal error: Call to undefined function tr() in
 /home/mambo2/public_html/includes/frontend.html.php on line 255


 เรื่องของเรื่องคือ
 เขาเขียนโค๊ดที่อยู่ในไฟล์ "ldaphack9includesmambo.php" ไม่ครบ

 ขาดฟังค์ชั่นนี้ไป
 ในช่วงบรรทัดสุดท้ายของไฟล์

 $TR_STRS = array();
 function tr( $str )
 {
  global $TR_STRS;
  $strindex = strtolower(trim($str));
  $result = ( array_key_exists($strindex, $TR_STRS) ? $TR_STRS[$strindex]:$str );
  return $result;
 }
(ฟังค์ชั่นนี้ดูโคดเดิมได้จากไฟล์ mambo.php ก่อนที่จะระเบิดไปทับ)


ก็แก้ไข error โดยการ copy
ฟังค์ชั่นด้านบนไปแปะใว้ที่บรรทัดล้างสุดไฟล์ mambo.php

ตัวอย่าง
 .
 .
 .

 /** @global mosPlugin $_MAMBOTS */
 $_MAMBOTS = new mosMambotHandler();

 /** @global TR_STRS translation string array */
 $TR_STRS = array();


 function tr( $str )
 {
  global $TR_STRS;
  $strindex = strtolower(trim($str));
  $result = ( array_key_exists($strindex, $TR_STRS) ? $TR_STRS[$strindex] : $str );
  return $result;
 }
 ?>


 แค่นี้ก็เรียบร้อยครับที่เหลือก็ config ธรรมดาเหมือนเดิม

ผมมีตัวอย่างไฟล์ config ของ ldaphack มาให้ดูด้วย
เพื่อจะหลงลืมกัน หรือ config แล้วไม่สามารถติดต่อ ldap ได้จะได้ใช้ไฟล์นี้อ้างอิง

ไฟล์นี้จะอยู่ที่ /includes/authentication/config/
ซึ่งไฟล์นี้จะเกิดขึ้นหลังจากเราสร้าง Authentication source แล้ว

<?php
// ensure this file is being included by a parent file
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );

// this file is saved whenever the plugin instance configuration is edited.
include_once("{$mosConfig_absolute_path}/includes/authentication/plugins/ldapauthenticator.php");
return new ldapauthenticator(
Array(
   "_default_group_id" => "21",
   "_user_attributes" => "",
   "_published" => "1",
   "_name" => "ldap",
   "ldap_host" => "front.psu.ac.th",
   "ldap_port" => "389",
   "ldap_connect" => "",
   "ldap_base_dn" => "dc=cc,dc=psu",
   "ldap_users_dn" => "uid=[login],ou=staff,dc=cc,dc=psu",
   "ldap_search_string" => "",
   "ldap_use_ldapV3" => "1",
   "ldap_dont_follow_referrals" => "0",
   "ldap_negociate_tls" => "0",
   "ldap_password" => "",
));
?>
 

 

โป้ง-เขียน

คำสำคัญ (Tags): #uncategorized
หมายเลขบันทึก: 30295เขียนเมื่อ 23 พฤษภาคม 2006 09:48 น. ()แก้ไขเมื่อ 19 พฤษภาคม 2012 11:36 น. ()สัญญาอนุญาต: จำนวนที่อ่านจำนวนที่อ่าน:


ความเห็น (1)

อยากทราบว่า หลังจากที่เรา config เรียบร้อยแล้วเราจะเริ่มการให้งานกับ ldap อย่างไรคะ ในกรณีที่ลง ldaphack9 กับ mamboV4.5.5

ขอบคุณค่ะ

พบปัญหาการใช้งานกรุณาแจ้ง LINE ID @gotoknow
ClassStart
ระบบจัดการการเรียนการสอนผ่านอินเทอร์เน็ต
ทั้งเว็บทั้งแอปใช้งานฟรี
ClassStart Books
โครงการหนังสือจากคลาสสตาร์ท