<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>MyBlog_笑著流淚II &#187; PHP</title>
	<atom:link href="http://blog.havenlin.org/archives/category/%e6%8a%80%e8%a1%93%e6%96%87%e4%bb%b6/php/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.havenlin.org</link>
	<description>歡迎使用非Internet Explorer瀏覽器，欣賞這裡的一切資訊！！</description>
	<lastBuildDate>Sat, 09 Jan 2010 09:21:47 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>PHP-LDAP_Search Lists Active Directory® Account  How To</title>
		<link>http://blog.havenlin.org/archives/2252</link>
		<comments>http://blog.havenlin.org/archives/2252#comments</comments>
		<pubDate>Fri, 24 Jul 2009 08:06:04 +0000</pubDate>
		<dc:creator>白目研究生</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[技術文件]]></category>

		<guid isPermaLink="false">http://blog.havenlin.org/?p=2252</guid>
		<description><![CDATA[看完新增AD Account後，就是把全部的使用者怎麼全部列表出來了~
References:
http://www.php.net/manual/en/function.ldap-search.php
Source Code : Download

這邊可以注意的是~
如果不管AD端預設值的話~
會在這程式開始執行的時候發現這個(Warning: ldap_search(): Partial search results returned: Sizelimit exceeded.)提醒
看一下ldap_search傳回來的資料不多不少剛好一千~
這數值真的很令人在意啊~XDD

所以測了一下ldap_search的sizelimit參數~
發現~可能問題出在~AD Server那一端~
微軟也很貼心(?)的設定了1000 Default Value~
所以學長就這樣子操作了~(KeyWord : Ntdsutil.exe &#8211; Active Directory 目錄服務維護公用程式)

看一下HELP可以做些什麼設定~
不過現在的重點會放在LDAP Policies

這是還沒建立Connections的錯誤
所以Show Values不知道要Show什麼資料

所以，想辦法連線到AD端

然後就可以用(Set %s to %s)來修改一些數據

修改的話~應該不難~
以Set %s1 to %s2的例子而言
%s1 = Argument Name
%s2 = Set Argument Value
所以大概是Set MaxPageSize to 35000、Set MaxTempTableSize to 35000後
就會看到下面的結果了~

整理一下檢視/變更原則設定的步驟 :
啟動 Ntdsutil.exe
按一下 [開始]，然後按一下 [執行]。
在 [開啟] 文字方塊中，輸入 [ntdsutil]，然後按 [ENTER]。任何時候，若要檢視說明，請在命令提示字元下輸入 ?。
檢視原則設定
在 Ntdsutil.exe 命令提示字元下，輸入 LDAP policies，然後按 [...]]]></description>
		<wfw:commentRss>http://blog.havenlin.org/archives/2252/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP-LDAP_ADD Add Active Directory® Account How To</title>
		<link>http://blog.havenlin.org/archives/2239</link>
		<comments>http://blog.havenlin.org/archives/2239#comments</comments>
		<pubDate>Fri, 24 Jul 2009 02:11:04 +0000</pubDate>
		<dc:creator>白目研究生</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[技術文件]]></category>

		<guid isPermaLink="false">http://blog.havenlin.org/?p=2239</guid>
		<description><![CDATA[看完刪除AD Account後，就是新增使用者的部分
References:
http://www.php.net/manual/en/function.ldap-add.php
Source Code : Download

可以注意的是有關於密碼這個attribute分成了兩個~
userPassword與unicodePwd
可以辨別出的差異在這裡提出了說明:
userpassword is only accepted for auth, and unicodepwd is not readable by ldap.
以圖例來舉證的話~
下圖是用LDAP ADMIN新增cn_test的密碼呈現的結果，(SHA1)

如果硬要使用Create Unicode Password的方式
把密碼塞給userPassword這個attribute的話
會只看到一個字元
也就是
$newPassword = &#8220;\&#8221;&#8221; . $pwdtxt . &#8220;\&#8221;";
上面標註的那個字元

還有~
看不見任何unicodePwd attribute的結果~
不過可以確定的是~
在這個case，就算沒有可視的unicodePwd
還是可以進行密碼的驗證~

]]></description>
		<wfw:commentRss>http://blog.havenlin.org/archives/2239/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP-LDAP_DELETE Delete Active Directory® Account How To</title>
		<link>http://blog.havenlin.org/archives/2232</link>
		<comments>http://blog.havenlin.org/archives/2232#comments</comments>
		<pubDate>Thu, 23 Jul 2009 14:06:08 +0000</pubDate>
		<dc:creator>白目研究生</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[技術文件]]></category>

		<guid isPermaLink="false">http://blog.havenlin.org/?p=2232</guid>
		<description><![CDATA[有長輩開需求就終於可以寫文件了~XDD
頭一次建立Active Directory®約等同於Lightweight Directory Access Protocol的概念
這次要用PHP對AD跟LDAP兩端處理一些資料
目的讓兩端的的記錄能同步
所以這幾天的文件會紀錄
PHP for LDAP一些用法(sample/example)
ldap_search、ldap_add、ldap_delete的用法
所以這篇文章就先ldap_delete了~
Reference:
http://www.php.net/manual/en/function.ldap-delete.php
Test Target:
End operation -Linux vivaldi 2.6.18-6-686
Server-side &#8211; Windows 2003 Server AD
Source Code : Download

&#8211;
聽說LDAP/AD系統整合管理相當夯~XDD
&#8211;
]]></description>
		<wfw:commentRss>http://blog.havenlin.org/archives/2232/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>PHP-看Wordpress每次都會忘記的地方</title>
		<link>http://blog.havenlin.org/archives/480</link>
		<comments>http://blog.havenlin.org/archives/480#comments</comments>
		<pubDate>Fri, 01 Feb 2008 06:50:51 +0000</pubDate>
		<dc:creator>白目研究生</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[技術文件]]></category>

		<guid isPermaLink="false">http://blog.havenlin.org/index.php/archives/480</guid>
		<description><![CDATA[http://codex.wordpress.org/Category:Functions
相當好用
可是每次都會忘記
特此NOTE
再快的方式就是cat ~/wp-includes/*.php &#124; more
這樣子最快
XDD
]]></description>
		<wfw:commentRss>http://blog.havenlin.org/archives/480/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP-SOAPCLIENT How To</title>
		<link>http://blog.havenlin.org/archives/354</link>
		<comments>http://blog.havenlin.org/archives/354#comments</comments>
		<pubDate>Mon, 03 Dec 2007 11:33:05 +0000</pubDate>
		<dc:creator>白目研究生</dc:creator>
				<category><![CDATA[C#.NET]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[技術文件]]></category>

		<guid isPermaLink="false">http://blog.havenlin.org/index.php/archives/354</guid>
		<description><![CDATA[又是Program
整理一些下一個Project的前置作業
如何使用PHP叫用Web Services
用了SOAPCLIENT的Object
測試環境：
Web Service Server：IIS 5
Web Services：dotNET Web Service Project
Web Server：appserv-win32-2.5.8
PHP Compiler：PHP Version 5.2.0
寫了兩個dotNET的WebMethod測試

[WebMethod]
public int Sum(int a, int b)
{
return a + b;
}
[WebMethod]
public string str(string str)
{
return &#8220;123123123123123&#8243;;
}
接著是PHP部分

&#60;?
$client = new SOAPClient(&#8216;http://127.0.0.1/get/Service.asmx?WSDL&#8217;);
$temp = $client-&#62;str(&#8220;&#8221;);
echo $temp-&#62;strResult;//可以這樣子把叫用的結果印出
//如果需要傳參數運算的話
$Client = new SoapClient(&#8220;http://127.0.0.1/get/Service.asmx?WSDL&#8220;);
$params-&#62;a = 2;
$params-&#62;b = 3;
$objectresult = $client-&#62;sum($params);
$simpleresult = $objectresult-&#62;SumResult;

//針對傳輸資料細節可以用print_r把資料dump出來
print_r ($simpleresult);
$client-&#62;Encrypt(array(&#8220;id&#8221;=&#62;$ID,&#8221;pwd&#8221;=&#62;$PWD)) //或者把參數用ARRAY傳呼叫
//目前測試了三個型態的WebMethod，如果回傳值為DataSet的話可以用下面方式dump 資料，有階層性的概念
$smldata = $regetdata -&#62; GetDataResult; //接收資料
echo $tmp -&#62; NewDataSet -&#62; tbltmp[0] [...]]]></description>
		<wfw:commentRss>http://blog.havenlin.org/archives/354/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Use MySql內建預設的Function On PHP How To</title>
		<link>http://blog.havenlin.org/archives/161</link>
		<comments>http://blog.havenlin.org/archives/161#comments</comments>
		<pubDate>Fri, 21 Sep 2007 09:44:20 +0000</pubDate>
		<dc:creator>白目研究生</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[技術文件]]></category>

		<guid isPermaLink="false">http://blog.havenlin.org/wordpress/index.php/archives/161</guid>
		<description><![CDATA[這篇文章的主題主要在於如何使用PHP 對MySql的預設函數對IO的資料作以下處理
MD5
官方API的用法是：string md5 ( string str [, bool raw_output] )
所以我只要這樣子用
&#60;?php echo md5(&#8220;md5 string here&#8221;)?&#62;
ENCODE
&#60;?php
　$enc = mysql_query(&#8220;SELECT ENCODE(&#8216;testing&#8217;,&#8221;)&#8221;);
　$str_enc = mysql_fetch_array($enc);
　$val_enc = $str_enc[0];
　echo $val_enc;
?&#62;
DECODE
&#60;?php
　$dec = mysql_query(&#8220;SELECT DECODE(&#8216;&#8221;.$val_enc.&#8221;&#8216;,&#8221;)&#8221;);
　$str_dec = mysql_fetch_array($dec);
　$val_dec = $str_dec[0];
　echo $val_dec;
?&#62;
]]></description>
		<wfw:commentRss>http://blog.havenlin.org/archives/161/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wordpress user online plugin Install How To</title>
		<link>http://blog.havenlin.org/archives/156</link>
		<comments>http://blog.havenlin.org/archives/156#comments</comments>
		<pubDate>Sat, 15 Sep 2007 04:02:15 +0000</pubDate>
		<dc:creator>白目研究生</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[技術文件]]></category>

		<guid isPermaLink="false">http://blog.havenlin.org/wordpress/index.php/archives/156</guid>
		<description><![CDATA[該PLUGIN作者的BLOG跟相關PLUGIN文章連結
下載：https://freebsd.stu.edu.tw/~heaven/useronline.rar
把檔案解壓縮至*/wp-content/plugin後
在後台管理WP-UserOnline、WP-UserOnline Widget的這兩個外掛啟用後，在佈景主題下把WP-UserOnline Widget拉到可以Display的地方，
這個外掛會自己開始計算在線觀賞BLOG人數 的功能
而，在後台的管理首頁的第二個功能也會多了一個 WP-UserOnline的功能，能即時的看到在線瀏覽的詳細相關資料，如以下資料列。

There are a total of 2 Users online now: 1 Member, 0 Guests and 1 Bot.
Most users ever online were 3, on September 14, 2007 @ 6:27 pm
1 Member Online Now
#1 &#8211; admin (210.71.11.169) on September 15, 2007 @ 12:01 pm
MyBlog_笑著流淚II [url] [referral]
1 Bot Online Now
#1 &#8211; Google Bot (66.249.70.198) on [...]]]></description>
		<wfw:commentRss>http://blog.havenlin.org/archives/156/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wordpress Tag Cloud plugin Install How To</title>
		<link>http://blog.havenlin.org/archives/153</link>
		<comments>http://blog.havenlin.org/archives/153#comments</comments>
		<pubDate>Wed, 12 Sep 2007 15:50:35 +0000</pubDate>
		<dc:creator>白目研究生</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[技術文件]]></category>

		<guid isPermaLink="false">http://blog.havenlin.org/wordpress/?p=153</guid>
		<description><![CDATA[Demo：請在http://blog.havenlin.org/wordpress/看右邊sidebar
請將simple-tagging.rar、simpletagging-widget.rar這兩個外掛的檔案下載，並解壓縮至Blog的plugins目錄下，並在後台管理介面Active這兩個外掛的功能。
啟用後會在後台的功能列表上看到Tags的選項，在Tags底下可以設定相關的設定選項。
接著在外觀的Widgets把Simple Tagging Tag Cloud選擇要呈現在那個位置。
然後回首頁觀察應該就可以看到相關Tags Cloud會提示，尚未有相關的Tags被建立。
這個時候可以在後台管理介面的Tags底下的Manage Tags手動新增，也可以在POST新文章時的下一行輸入KeyWord Tags它會自己被建立，並連結相關Tags的文章。
可以觀察到，預設的Tags Cloud排列方式是以，一個Tag斷行一次。
透過編排 Style.css 的方法可以修改為橫向排列，並依據常用的關鍵字做字體大小的變更。不過前提是要目前套用的佈景主題有支援才可以這樣子使用。
到後台的編輯佈景主題，修改Style.css的檔案，在文件內文的最下面添加下面內容
ul#tagcloud { padding:0; margin:0; text-align:center;
list-style:none; }
ul#tagcloud li { display:inline; font-size:100%; color:#ccc;
background: none; padding: 0;}
ul#tagcloud li a, ul#tagcloud li a:link { text-decoration:none; }
ul#tagcloud li a:hover { text-decoration:underline; }
ul#tagcloud li.t1 a { color:#797979; font-size: 120%; }
ul#tagcloud li.t2 a { color:#6d6d6d; font-size: 160%; }
ul#tagcloud li.t3 a { color:#616161; font-size: [...]]]></description>
		<wfw:commentRss>http://blog.havenlin.org/archives/153/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>怎麼辦，Wordpress的首頁不是我要的怎麼辦？</title>
		<link>http://blog.havenlin.org/archives/152</link>
		<comments>http://blog.havenlin.org/archives/152#comments</comments>
		<pubDate>Tue, 11 Sep 2007 17:11:10 +0000</pubDate>
		<dc:creator>白目研究生</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[技術文件]]></category>

		<guid isPermaLink="false">http://blog.havenlin.org/wordpress/?p=152</guid>
		<description><![CDATA[UseCase：
Cymer今天的需求是，把舊有的WORDPRESS的首頁改掉。
正規的首頁通常會停留在，最後發表的那篇文章上。
而Cymer的需求則是要呈現分類&#8221;最新消息&#8221;搜尋出來的文章。
Solution：
修正首頁指向目錄，可以在Wordpress下的目錄建立.htaccess做Redirect，參考以下範例語法修改
Redirect /wordpress http://What do u want to Redirect path
或者，直接修改index.php，在這邊你會發現到，直接修改Wordpress的index.php只會不停的轉向首頁跟目的頁的切換
根本不符合需求的情況下，這是不可行的。
但是，你可以修改你套用的外觀模組
只要是外觀模組都會有一支主要模版(Template)屬於index.php的頁面，則可以透過後台的佈景主題編輯器修改編輯該檔案即可。
PHP轉址語法：
&#60;?php header(&#8216;location: http://google.com&#8217;);?&#62;
KeyWord：Wordpress, theme, htaccess, Redirect
]]></description>
		<wfw:commentRss>http://blog.havenlin.org/archives/152/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[warn] module dav_module is already loaded, skipping Solution How To</title>
		<link>http://blog.havenlin.org/archives/137</link>
		<comments>http://blog.havenlin.org/archives/137#comments</comments>
		<pubDate>Tue, 28 Aug 2007 15:25:38 +0000</pubDate>
		<dc:creator>白目研究生</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://210.71.11.169/wordpress/?p=137</guid>
		<description><![CDATA[今天整理了一台機器
操作流程以下：
因為沒有LDAP也沒有PHP5的其他模組
也就是我要/usr/ports/net/php5-ldap裝支援LDAP的元件
結果因為版本不一樣
restart apache不能，會看到如標題般的錯誤
有人說google的說法是把dav_module註解掉重開
其實原因不然
而是PHP5相關套件的版本不一
解決辦法，強制portupgrade PHP5的相關套件
#portupgrade -f &#8216;php5*&#8217;
之後再重開即可。
關鍵字： dav_module、php5-ldap、portupgrade 
]]></description>
		<wfw:commentRss>http://blog.havenlin.org/archives/137/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
