2009-03-21
Debian
- dbconfig-common - common framework for packaging database applications
- 如果 deb 套件會使用到 SQL 資料庫的話,可以相依這個套件,然後透過 dbconfig-common 來做資料庫的設定。
- 參考打包範例 webcalendar
Web Service
- [備忘] Apache 要啟用 .htaccess 的話,必須在設定中加上
AllowOverride ALL
- [備忘] 有些網頁還是維持 Big5 的字集,如果做轉換不方便的話,可以在 Apache 設定檔中,針對該目錄加入
AddDefaultCharset Big5
Active Directory / LDAP / PHP
function ldap_auth($adhost, $port, $uid_field, $basedn, $binddn, $passwd, $userid, $userpasswd) {
global $msg, $db, $default_prefix, $default_prefix_id ;
$ds = @ldap_connect($adhost, $port) ; // must be a valid LDAP server!
if ($ds) {
$r = @ldap_bind($ds, $binddn, $passwd);
if(!$r){ alert_err("binding failed !!"); }
// Search usrname entry
$sr = @ldap_search($ds, $basedn, "(".$uid_field."=".$userid.")");
$user_arr = @ldap_get_entries($ds, $sr) ;
//echo print_r($user_arr) ; exit ;
if ($user_arr["count"] == "1") {
$user_binddn = $user_arr[0]["dn"] ;
$ub = @ldap_bind($ds, $user_binddn, $userpasswd) ;
if(!$ub) { alert_err($msg["ad_passwd_err"]); }
} else { alert_err($msg["ad_search_err"]) ; }
ldap_close($ds);
return true ;
} else {
alert_err("Unable to connect to LDAP server") ;
}