<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" version="2.0">

<channel>
	<title>Luca's forge</title>
	
	<link>http://lucasforge.bmeme.com</link>
	<description>Experiments from the land of open source</description>
	<lastBuildDate>Wed, 19 Oct 2011 10:29:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/lucasforge" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="lucasforge" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>[Drupal7] How display block programmatically</title>
		<link>http://lucasforge.bmeme.com/2011/10/drupal7-how-display-block-programmatically/</link>
		<comments>http://lucasforge.bmeme.com/2011/10/drupal7-how-display-block-programmatically/#comments</comments>
		<pubDate>Wed, 19 Oct 2011 10:29:20 +0000</pubDate>
		<dc:creator>Luca Corbo</dc:creator>
				<category><![CDATA[drupal]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://lucasforge.2bopen.org/?p=139</guid>
		<description><![CDATA[If you want to display a block in your template: $block = block_load(&#60;code&#62;$module, $delta&#60;/code&#62;); print render(_block_get_renderable_array( _block_render_blocks( array($block) ))); where: $module Name of the module that implements the block to load. $delta Unique ID of the block within the context of $module. Pass NULL to return an empty block object for $module. Reference links: block_load [...]]]></description>
			<content:encoded><![CDATA[<p>If you want to display a block in your template:</p>
<pre class="brush: php">
$block = block_load(&lt;code&gt;$module, $delta&lt;/code&gt;);
print render(_block_get_renderable_array( _block_render_blocks( array($block) )));
</pre>
<p>where:</p>
<p>$module Name of the module that implements the block to load.</p>
<p>$delta Unique ID of the block within the context of $module. Pass NULL to return an empty block object for $module.</p>
<p>Reference links:</p>
<ul>
<li><a title="block_load API" href="http://api.drupal.org/api/drupal/modules--block--block.module/function/block_load/7" target="_blank">block_load API</a></li>
<li><a title="Drupal.org comment" href="http://api.drupal.org/api/drupal/includes--module.inc/function/module_invoke/7#comment-15884" target="_blank">Drupal.org comment</a></li>
</ul>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://lucasforge.bmeme.com/2011/10/drupal7-how-display-block-programmatically/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How enable the PHP Tidy extension for MAMP</title>
		<link>http://lucasforge.bmeme.com/2010/07/how-enable-the-php-tidy-extension-for-mamp/</link>
		<comments>http://lucasforge.bmeme.com/2010/07/how-enable-the-php-tidy-extension-for-mamp/#comments</comments>
		<pubDate>Tue, 20 Jul 2010 15:21:14 +0000</pubDate>
		<dc:creator>Luca Corbo</dc:creator>
				<category><![CDATA[mac]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[mamp]]></category>
		<category><![CDATA[tidy]]></category>

		<guid isPermaLink="false">http://lucasforge.2bopen.org/?p=126</guid>
		<description><![CDATA[Download the PHP source in according with your environment: $ php -v PHP 5.2.11 (cli) (built: Dec 12 2009 13:19:08) Extract in a temporary folder $ cd ~ &#38;&#38; tar zxvf php-5.2.11.tar.gz &#38;&#38; cd php-5.2.11 Patch the ext/iconv/iconv.c file remove the lib on #define iconv libiconv so that the code reads like this: #ifdef HAVE_LIBICONV [...]]]></description>
			<content:encoded><![CDATA[<ol>
<li>Download the PHP source in according with your environment:
<pre>$ php -v
PHP 5.2.11 (cli) (built: Dec 12 2009 13:19:08)
</pre>
</li>
<li>Extract in a temporary folder
<pre>$ cd ~ &amp;&amp; tar zxvf php-5.2.11.tar.gz &amp;&amp; cd php-5.2.11
</pre>
</li>
<li>Patch the <code><em>ext/iconv/iconv.c</em> file </code>remove the <em><code>lib</code></em> on <em><code>#define iconv libiconv</code></em> so that the code reads like this:
<pre><code>#ifdef HAVE_LIBICONV
#define iconv iconv
#endif</code></pre>
</li>
<li>Patch the ext/tidy/tidy.c file moving the line 34: #include &#8220;tidy.h&#8221; to line 24 of tidy.c so that the code reads like this:
<pre>#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include "tidy.h"
#include "php.h"
#include "php_tidy.h"

#if HAVE_TIDY

#include "php_ini.h"
</pre>
</li>
<li>Instruct the system to build universal binaries, that will work on both 32 and 64 bit systems by entering the following commands in the terminal console:
<pre>$ MACOSX_DEPLOYMENT_TARGET=10.6
$ CFLAGS="-arch i386 -arch x86_64 -g -Os -pipe -no-cpp-precomp"
$ CCFLAGS="-arch i386 -arch x86_64 -g -Os -pipe"CXXFLAGS="-arch i386 -arch x86_64 -g -Os -pipe"
$ LDFLAGS="-arch i386 -arch x86_64 -bind_at_load"
$ export CFLAGS CXXFLAGS LDFLAGS CCFLAGS MACOSX_DEPLOYMENT_TARGET</pre>
</li>
<li>Configure &amp; make
<pre>$ LIBS=-lresolv ./configure --with-tidy=shared &amp;&amp; make</pre>
</li>
<li>Copy the module in MAMP
<pre>$ cp ./modules/tidy.so /Applications/MAMP/bin/php5/lib/php/extensions/no-debug-non-zts-20060613/</pre>
</li>
<li>Enable the module in the /Applications/MAMP/conf/php5/php.ini adding the following line in the extension section:
<pre>extension=tidy.so</pre>
</li>
<li>Restart the webserver</li>
<li>Check with php_info() if the tidy extension is loaded correctly <img src='http://lucasforge.bmeme.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </li>
</ol>
<p>Reference Links:</p>
<ul>
<li><a title="Installing PHP 5.2.10 on OS X 10.6 Snow Leopard" href="http://www.firewing1.com/node/31">Installing PHP 5.2.10 on OS X 10.6 Snow Leopard</a></li>
<li><a title="How to compile PHP with '--enable-zip' on Mac OS-X SnowLeopard (10.6)" href="http://symphony-cms.com/discuss/thread/35577/#position-14">How to compile PHP with &#8216;&#8211;enable-zip&#8217; on Mac OS-X SnowLeopard (10.6)</a></li>
<li><a href="http://forum.mamp.info/viewtopic.php?f=4&amp;t=6569">http://forum.mamp.info/viewtopic.php?f=4&amp;t=6569</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://lucasforge.bmeme.com/2010/07/how-enable-the-php-tidy-extension-for-mamp/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Drupal 6: how create a node with CCK fields programmatically</title>
		<link>http://lucasforge.bmeme.com/2010/06/drupal-6-create-a-node-with-cck-fields-programmatically/</link>
		<comments>http://lucasforge.bmeme.com/2010/06/drupal-6-create-a-node-with-cck-fields-programmatically/#comments</comments>
		<pubDate>Mon, 28 Jun 2010 15:19:04 +0000</pubDate>
		<dc:creator>Luca Corbo</dc:creator>
				<category><![CDATA[drupal]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://lucasforge.2bopen.org/?p=119</guid>
		<description><![CDATA[&#60;?php require_once &#039;./includes/bootstrap.inc&#039;; drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); module_load_include(&#039;inc&#039;, &#039;node&#039;, &#039;node.pages&#039;); $node = new stdClass(); //Set up default values, if required. node_object_prepare($node); //Specify the content type $node-&#62;type = &#039;profile&#039;; //Specify an author for the node $node-&#62;uid = 1; //Add the title $node-&#62;title = &#039;Test&#039;; //Add the CCK fields data $node-&#62;field_name[0][&#039;value&#039;] = &#039;Name&#039;; $node-&#62;field_surname[0][&#039;value&#039;] = &#039;Surname&#039;; //Save the node object [...]]]></description>
			<content:encoded><![CDATA[<pre class="brush: php">
&lt;?php 

require_once &#039;./includes/bootstrap.inc&#039;;
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
module_load_include(&#039;inc&#039;, &#039;node&#039;, &#039;node.pages&#039;);

$node = new stdClass();

//Set up default values, if required.
node_object_prepare($node);

//Specify the content type
$node-&gt;type = &#039;profile&#039;;

//Specify an author for the node
$node-&gt;uid = 1;

//Add the title
$node-&gt;title = &#039;Test&#039;;

//Add the CCK fields data
$node-&gt;field_name[0][&#039;value&#039;] = &#039;Name&#039;;
$node-&gt;field_surname[0][&#039;value&#039;] = &#039;Surname&#039;;

//Save the node object into the database.
node_save($node);

//Debug the created node
print &#039;&lt;pre&gt;&#039;;
print_($node);
print &#039;&lt;/pre&gt;&#039;;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://lucasforge.bmeme.com/2010/06/drupal-6-create-a-node-with-cck-fields-programmatically/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Installing JBoss eap 4.3 on Red Hat 5.3</title>
		<link>http://lucasforge.bmeme.com/2009/12/installing-jboss-eap-4-3-on-red-hat-5-3/</link>
		<comments>http://lucasforge.bmeme.com/2009/12/installing-jboss-eap-4-3-on-red-hat-5-3/#comments</comments>
		<pubDate>Tue, 15 Dec 2009 15:37:42 +0000</pubDate>
		<dc:creator>Luca Corbo</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://lucasforge.2bopen.org/?p=104</guid>
		<description><![CDATA[Requirements JDK 1.5 or 1.6 Installer Jboss eap 4.3 or higher Installation Create jboss user ~# adduser jboss &#038;&#038; passwd jboss Update ~/.bashrc #JAVA Settings export JAVA_HOME=/usr/java/latest export PATH=$JAVA_HOME/bin:$PATH #JBOSS Settings export JBOSS_HOME=/home/jboss/EnterprisePlatform-4.3.0.GA_CP07/jboss-as export JAVAPTH=$JAVA_HOME/bin export JBOSS_CONF=default export JBOSS_HOST="0.0.0.0" Install JBoss eap ~$ java -jar enterprise-installer-4.3.0.GA_CP07.jar Follow the graphic installer and complete the installation. Set [...]]]></description>
			<content:encoded><![CDATA[<h2>Requirements</h2>
<ul>
<li>JDK 1.5 or 1.6</li>
<li>Installer Jboss eap 4.3 or higher</li>
</ul>
<h2>Installation</h2>
<h3>Create jboss user</h3>
<p><code><br />
~# adduser jboss &#038;&#038; passwd jboss<br />
</code></p>
<h3>Update ~/.bashrc</h3>
<p><code><br />
#JAVA Settings<br />
export JAVA_HOME=/usr/java/latest<br />
export PATH=$JAVA_HOME/bin:$PATH</p>
<p>#JBOSS Settings<br />
export JBOSS_HOME=/home/jboss/EnterprisePlatform-4.3.0.GA_CP07/jboss-as<br />
export JAVAPTH=$JAVA_HOME/bin<br />
export JBOSS_CONF=default<br />
export JBOSS_HOST="0.0.0.0"<br />
</code></p>
<h3>Install JBoss eap</h3>
<p><code><br />
~$ java -jar enterprise-installer-4.3.0.GA_CP07.jar<br />
</code><br />
Follow the graphic installer and complete the installation.</p>
<h2>Set up as service</h2>
<p>As root:<br />
<code><br />
ln -s /home/jboss/EnterprisePlatform-4.3.0.GA_CP07/jboss-as/bin/jboss_init_redhat.sh jboss<br />
ln -s /etc/rc.d/init.d/jboss /etc/rc3.d/S84jboss<br />
ln -s /etc/rc.d/init.d/jboss /etc/rc5.d/S84jboss<br />
ln -s /etc/rc.d/init.d/jboss /etc/rc4.d/S84jboss<br />
ln -s /etc/rc.d/init.d/jboss /etc/rc6.d/K15jboss<br />
ln -s /etc/rc.d/init.d/jboss /etc/rc0.d/K15jboss<br />
ln -s /etc/rc.d/init.d/jboss /etc/rc1.d/K15jboss<br />
ln -s /etc/rc.d/init.d/jboss /etc/rc2.d/K15jboss<br />
</code></p>
<p>Edit the $JBOSS_HOME/bin/jboss_init_redhat.sh to allow loading the user profile:<br />
<code><br />
#Add this line before any script content<br />
. /home/jboss/.bashrc<br />
</code></p>
<h2>Test</h2>
<p>As root:<br />
<code><br />
~# service jboss start<br />
</code></p>
<p>Now JBoss should be available at:</p>
<p>http://YOUR_ADDRESS:8080</p>
]]></content:encoded>
			<wfw:commentRss>http://lucasforge.bmeme.com/2009/12/installing-jboss-eap-4-3-on-red-hat-5-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Telecom Italia is using Ortro</title>
		<link>http://lucasforge.bmeme.com/2009/11/telecom-italia-is-using-ortro/</link>
		<comments>http://lucasforge.bmeme.com/2009/11/telecom-italia-is-using-ortro/#comments</comments>
		<pubDate>Sun, 22 Nov 2009 19:07:39 +0000</pubDate>
		<dc:creator>Luca Corbo</dc:creator>
				<category><![CDATA[ortro]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[telecomitalia]]></category>

		<guid isPermaLink="false">http://lucasforge.2bopen.org/?p=97</guid>
		<description><![CDATA[I’ m happy to announce Ortro is also used in Telecom Italia now. An older version of Ortro (updated to the latest version right in these days) was already used in such departments of Telecom Italia as an experimental software for application monitoring. But in the last time I had a confirm Ortro is, as [...]]]></description>
			<content:encoded><![CDATA[<p>I’ m happy to announce <a href="http://www.ortro.net">Ortro</a> is also used in Telecom Italia now.</p>
<p>An older version of Ortro (updated to the latest version right in these days) was already used in such departments of  Telecom Italia as an experimental software for application monitoring. </p>
<p>But in the last time I had a confirm Ortro is, as I like to define it, mainly a “<a href="http://en.wikipedia.org/wiki/Framework">Framework</a>” helping you to solve the daily problems encountered in monitoring and job activities. </p>
<p>Some months ago some people in Telecom Italia asked me if <a href="http://www.ortro.net">Ortro</a> could be used as a valid alternative to a commercial product specialized in secure file transfer activity.</p>
<p>So I‘ve realized a proof of concept keeping in mind the <a href="http://en.wikipedia.org/w/index.php?title=80-20_rule">80-20 rule</a> and after a second phase of security, performance and functional tests Ortro was result to be a valid choice to replace the commercial product.</p>
<p>At writing time some real pilot projects was identified for an “on the job” final test.</p>
<p>The results of these activities are the actual version of Ortro (<a href="http://dev.ortro.net/news/show/8">1.3.4</a>) and the <a href="http://dev.ortro.net/wiki/ortro/PluginFileAdvancedFileTranfer">advanced file transfer plugin</a>.</p>
<p>Following these positive results Telecom Italia asked me to verify if Ortro could be also used as an alternative to some commercial enterprise scheduler software Telecom is using. </p>
<p>So another challenge is started&#8230;</p>
<p>Stay tuned&#8230; the 1.4 is around the corner <img src='http://lucasforge.bmeme.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://lucasforge.bmeme.com/2009/11/telecom-italia-is-using-ortro/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ortro 1.3.4 released!</title>
		<link>http://lucasforge.bmeme.com/2009/10/ortro-1-3-4-released/</link>
		<comments>http://lucasforge.bmeme.com/2009/10/ortro-1-3-4-released/#comments</comments>
		<pubDate>Tue, 13 Oct 2009 12:30:16 +0000</pubDate>
		<dc:creator>Luca Corbo</dc:creator>
				<category><![CDATA[ortro]]></category>

		<guid isPermaLink="false">http://lucasforge.2bopen.org/?p=93</guid>
		<description><![CDATA[This version includes some enhancements, fixes, plugins and very important security fixes. We recommend everyone update immediately. Help and comments are always welcome, see http://www.ortro.net for full changelog and details. Ortro 1.3.4 and the plugins may be downloaded as usual from: http://www.ortro.net/download]]></description>
			<content:encoded><![CDATA[<p>This version includes some enhancements, fixes, plugins and very important security fixes.<br />
We recommend everyone update immediately.</p>
<p>Help and comments are always welcome, see <a href="http://www.ortro.net">http://www.ortro.net</a> for full changelog and details.</p>
<p>Ortro 1.3.4 and the plugins may be downloaded as usual from:<br />
<a href="http://www.ortro.net">http://www.ortro.net/download</a></p>
]]></content:encoded>
			<wfw:commentRss>http://lucasforge.bmeme.com/2009/10/ortro-1-3-4-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Caching dynamic contents using Nginx as reverse proxy cache server</title>
		<link>http://lucasforge.bmeme.com/2009/09/caching-dynamic-content-using-nginx/</link>
		<comments>http://lucasforge.bmeme.com/2009/09/caching-dynamic-content-using-nginx/#comments</comments>
		<pubDate>Mon, 21 Sep 2009 12:26:04 +0000</pubDate>
		<dc:creator>Luca Corbo</dc:creator>
				<category><![CDATA[Linux/Unix]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[dynamic]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[reverse proxy]]></category>
		<category><![CDATA[static]]></category>

		<guid isPermaLink="false">http://lucasforge.2bopen.org/?p=83</guid>
		<description><![CDATA[If you need a static version of your dynamic web application maybe you may interested to configure Nginx as reverse proxy cache so it can cache also dynamic contents (pages with ? in the URI).

Well, if this is your scenario, let's go to configure Nginx.]]></description>
			<content:encoded><![CDATA[<p>If you need a static version of your dynamic web application maybe you may interested to configure Nginx as reverse proxy cache so it can cache also dynamic contents (pages with ? in the URI).</p>
<p>Well, if this is your scenario, let&#8217;s go to configure Nginx.</p>
<p><strong>Requirements</strong><br />
- Nginx up, running and listening on 80 port<br />
- A web server, like Apache, listening on 8080 port </p>
<pre class="brush: shell">
server {
listen       80;
server_name  www.example.com;

access_log  /var/log/nginx/host.access.log  main;
set $prefix  prefix_;

# proxy module defaults
proxy_store_access   user:rw  group:rw  all:r;
proxy_set_header  X-Real-IP  $remote_addr;
proxy_set_header  Host       $host;

# Main location
location / {

root /tmp/nginx/;
index index.html index.htm index.php index.php.html index.php.html;

# Use this if you don&#039;t cache a context (dont_cache_path) , send all requests through the proxy
location ~ ^/dont_cache_path {
  proxy_pass http://localhost:8080;
}

# if the request uri was a directory, store the index page name
if ($request_uri ~ /$) {
  set $store_extra ${request_uri}index;
}

# set the location the proxy will store the data to. Add the index page
# name if the uri was a directory (nginx can&#039;t normally store these)
proxy_store /tmp/nginx/${prefix}${query_string}${store_extra}.html;

# go through the proxy if there is no cache
if (!-f /tmp/nginx/${prefix}${query_string}${store_extra}.html) {
  proxy_pass http://localhost:8080;
}

# workaround. headers module doesn&#039;t take into account proxy response
# headers. It overwrites the proxy Cache-Control header, causing
# private/no-cache/no-store to be wiped, so only set if not using proxy
if (-f /tmp/nginx/${request_uri}${store_extra}.html) {
  expires 0;
}

# handle static files directly. Set their expiry time to max, so they&#039;ll
# always use the browser cache after first request
location ~* (css|js|png|jpe?g|gif|ico|swf)$ {
  root /var/www/html/;
  expires max;
}
error_page 404 = /${prefix}${query_string}${store_extra}.html;
}
}
</pre>
<p>Restart Nginx and enjoy with your static web site <img src='http://lucasforge.bmeme.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Reference Links:<br />
- <a href="http://wiki.nginx.org/Main">Nginx wiki</a><br />
- <a href="http://mark.ossdl.de/2009/07/nginx-to-create-static-files-from-dynamic-content/">how to use nginx to create static files from dynamic content</a><br />
- <a href="http://www.webtatic.com/blog/2008/04/page-level-caching-with-nginx/">Page-level caching with Nginx</a></p>
]]></content:encoded>
			<wfw:commentRss>http://lucasforge.bmeme.com/2009/09/caching-dynamic-content-using-nginx/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Ortro – Scp Transfer plugin v1.0.3 released</title>
		<link>http://lucasforge.bmeme.com/2009/07/ortro-%e2%80%93-scp-transfer-plugin-v1-0-3-released/</link>
		<comments>http://lucasforge.bmeme.com/2009/07/ortro-%e2%80%93-scp-transfer-plugin-v1-0-3-released/#comments</comments>
		<pubDate>Thu, 30 Jul 2009 16:53:50 +0000</pubDate>
		<dc:creator>Luca Corbo</dc:creator>
				<category><![CDATA[ortro]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[scp]]></category>

		<guid isPermaLink="false">http://lucasforge.2bopen.org/?p=77</guid>
		<description><![CDATA[The Scp Transfer plugin allows Ortro to transfer files between remote hosts in a secure way. This release add the capability to use compression during transfer and enable the recursive copy of files and folders. Download and enjoy]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://dev.ortro.net/wiki/ortro/PluginFileScpTransfer">Scp Transfer</a> plugin allows <a href="http://www.ortro.net">Ortro</a> to transfer files between remote hosts in a secure way.</p>
<p>This release add the capability to use compression during transfer and enable the recursive copy of files and folders. <a href="http://dev.ortro.net/attachments/download/48/file_scp-1.0.3.tar.gz"><br />
Download</a> and enjoy <img src='http://lucasforge.bmeme.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://lucasforge.bmeme.com/2009/07/ortro-%e2%80%93-scp-transfer-plugin-v1-0-3-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ortro – Scp Transfer plugin v1.0.2 released</title>
		<link>http://lucasforge.bmeme.com/2009/07/ortro-scp-transfer-plugin-v1-0-2-released/</link>
		<comments>http://lucasforge.bmeme.com/2009/07/ortro-scp-transfer-plugin-v1-0-2-released/#comments</comments>
		<pubDate>Fri, 24 Jul 2009 13:18:13 +0000</pubDate>
		<dc:creator>Luca Corbo</dc:creator>
				<category><![CDATA[ortro]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[release]]></category>
		<category><![CDATA[scp]]></category>

		<guid isPermaLink="false">http://lucasforge.2bopen.org/?p=74</guid>
		<description><![CDATA[The Scp Transfer plugin allows Ortro to transfer files between remote hosts in a secure way. This release add the capability to filter the copy using whitelist or blacklist based on the host:path string and the saving of transfer time. Download and enjoy]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://dev.ortro.net/wiki/ortro/PluginFileScpTransfer">Scp Transfer</a> plugin allows <a href="http://www.ortro.net">Ortro</a> to transfer files between remote hosts in a secure way.</p>
<p>This release add the capability to filter the copy using whitelist or blacklist based on the host:path string and the saving of transfer time. <a href="http://dev.ortro.net/attachments/download/47/file_scp-1.0.2.tar.gz"><br />
Download</a> and enjoy <img src='http://lucasforge.bmeme.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://lucasforge.bmeme.com/2009/07/ortro-scp-transfer-plugin-v1-0-2-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Pear::Auth as Zend_Auth adapter</title>
		<link>http://lucasforge.bmeme.com/2009/07/using-pear-auth-as-zend-auth-adapter/</link>
		<comments>http://lucasforge.bmeme.com/2009/07/using-pear-auth-as-zend-auth-adapter/#comments</comments>
		<pubDate>Wed, 15 Jul 2009 13:57:04 +0000</pubDate>
		<dc:creator>Luca Corbo</dc:creator>
				<category><![CDATA[pear]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[zend]]></category>
		<category><![CDATA[authentication]]></category>

		<guid isPermaLink="false">http://lucasforge.2bopen.org/?p=63</guid>
		<description><![CDATA[If you use both Pear and Zend framework you may want to extend the <a href="http://framework.zend.com/manual/en/zend.auth.html">Zend_Auth</a> adapters to use all the containers shipped with the <a href="http://pear.php.net/package/Auth">Pear::Auth</a> package.

Let's go to create the class implements the Zend_Auth_Adapter_Interface starting from the Zend_Auth_Adapter_Ldap class.]]></description>
			<content:encoded><![CDATA[<p>If you use both Pear and Zend framework you may want to extend the <a href="http://framework.zend.com/manual/en/zend.auth.html">Zend_Auth</a> adapters to use all the containers shipped with the <a href="http://pear.php.net/package/Auth">Pear::Auth</a> package.</p>
<p>Let&#8217;s go to create the class implements the Zend_Auth_Adapter_Interface starting from the Zend_Auth_Adapter_Ldap class.</p>
<p><strong>My_Zend_Auth_Adapter_PearAuth</strong></p>
<pre class="brush: php">
class My_Zend_Auth_Adapter_PearAuth implements Zend_Auth_Adapter_Interface
{

/**
* The array of arrays of Pear::Auth options passed to the constructor.
*
* @var array
*/
protected $_options = null;

/**
* The username of the account being authenticated.
*
* @var string
*/
protected $_username = null;

/**
* The password of the account being authenticated.
*
* @var string
*/
protected $_password = null;

/**
* The Pear::Auth container.
*
* @var string
*/
protected $_container = null;

protected $_logger = null;

/**
* Constructor
*
* @param  string $container The Pear::Auth container to use
* @param  array  $options  An array of arrays of Pear::Auth options
* @param  string $username The username of the account being authenticated
* @param  string $password The password of the account being authenticated
* @return void
*/
public function __construct($container, array $options = array(), $username = null, $password = null)
{
$this-&gt;setOptions($options);
if ($username !== null) {
$this-&gt;setUsername($username);
}
if ($password !== null) {
$this-&gt;setPassword($password);
}
$this-&gt;_container = $container;
}

public function setLogger($logger)
{
$this-&gt;_logger = $logger;
}

/**
* Returns the array of arrays of Pear::Auth options.
*
* @return array|null
*/
public function getOptions()
{
return $this-&gt;_options;
}

/**
* Sets the array of arrays of Pear::Auth options to be used by
* this adapter.
*
* @param  array $options The array of arrays of of Pear::Auth options
* @return My_Zend_Auth_Adapter_PearAuth Provides a fluent interface
*/
public function setOptions($options)
{
$this-&gt;_options = is_array($options) ? $options : array();
return $this;
}

/**
* Returns the username of the account being authenticated, or
* NULL if none is set.
*
* @return string|null
*/
public function getUsername()
{
return $this-&gt;_username;
}

/**
* Sets the username for binding
*
* @param  string $username The username for binding
* @return My_Zend_Auth_Adapter_PearAuth Provides a fluent interface
*/
public function setUsername($username)
{
$this-&gt;_username = (string) $username;
return $this;
}

/**
* Returns the password of the account being authenticated, or
* NULL if none is set.
*
* @return string|null
*/
public function getPassword()
{
return $this-&gt;_password;
}

/**
* Sets the password for the account
*
* @param  string $password The password of the account being authenticated
* @return My_Zend_Auth_Adapter_PearAuth Provides a fluent interface
*/
public function setPassword($password)
{
$this-&gt;_password = (string) $password;
return $this;
}

/**
* Authenticate the user
*
* @throws Zend_Auth_Adapter_Exception
* @return Zend_Auth_Result
*/
public function authenticate()
{
require_once &#039;Pear/Auth.php&#039;;

$messages = array();
$messages[0] = &#039;&#039;; // reserved
$messages[1] = &#039;&#039;; // reserved

$username = $this-&gt;_username;
$password = $this-&gt;_password;

if (!$username) {
$code = Zend_Auth_Result::FAILURE_IDENTITY_NOT_FOUND;
$messages[0] = &#039;A username is required&#039;;
return new Zend_Auth_Result($code, &#039;&#039;, $messages);
}
if (!$password) {
/* A password is required because some servers will
* treat an empty password as an anonymous bind.
*/
$code = Zend_Auth_Result::FAILURE_CREDENTIAL_INVALID;
$messages[0] = &#039;A password is required&#039;;
return new Zend_Auth_Result($code, &#039;&#039;, $messages);
}

//Override $_POST variables required by Auth pear package.
$_POST[&#039;username&#039;] = $username;
$_POST[&#039;password&#039;] = $password;

$_auth = new Auth($this-&gt;_container, $this-&gt;_options, &#039;&#039;, false);

//Enable logging
if (isset ($this-&gt;_options[&#039;enableLogging&#039;]) &amp;amp;&amp;amp; $this-&gt;_options[&#039;enableLogging&#039;] &amp;amp;&amp;amp;
!is_null($this-&gt;_logger)) {
$_auth-&gt;logger = $this-&gt;_logger;
}

$_auth-&gt;start();

if ($_auth-&gt;getAuth()) {
//Destroy Pear::Auth session to avoid unespected behaviour
$_auth-&gt;logout();
$messages[] = &quot;$username authentication successful&quot;;
return new Zend_Auth_Result(Zend_Auth_Result::SUCCESS, $username, $messages);
}

$messages[] = &quot;$username authentication failed.&quot;;
return new Zend_Auth_Result(Zend_Auth_Result::FAILURE, $username, $messages);
}
}
</pre>
<p>and now let&#8217;s go to use it, for example in our controller</p>
<pre class="brush: php">
....
$auth = Zend_Auth::getInstance();
$config = new Zend_Config_Xml(&#039;APPLICATION_HOME/configs/auth_ldap.xml&#039;, &#039;production&#039;);
$options = $config-&gt;ldap-&gt;toArray();
$authAdapter = new Zend_Auth_Adapter_PearAuth(&#039;LDAP&#039;, $options, $username, $password);
$result = $auth-&gt;authenticate($authAdapter);
if(!is_null($result) &amp;amp;&amp;amp; $result-&gt;isValid()) {
$authorized = true;
}
....
</pre>
<p>In the example above I&#8217;ve used the LDAP container but this should be valid for all supported containers by Pear::Auth.</p>
<p>Hope this helps <img src='http://lucasforge.bmeme.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://lucasforge.bmeme.com/2009/07/using-pear-auth-as-zend-auth-adapter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

